Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi
Actually when I ran the java sdk code the properties values reflect in thing ,i mean generate random values.
in Mashup values generate. But my thing i want to generate the values in Properties through Java Sdk.
Have you considered writing a random number generator function in Java which you can call in the processScanRequest() via a setProperty(), thus every time the scan is performed the function will have a random number to set in the property in the Java SDK.
int temp = <value>;
write getter and setter for temp property and in the processScanRequest() you can call this setter(). Therefore, whenever the updateSubscribedProperties(); is called the temp property should have a new value
Hope this helps.
I am writing like this
public void processScanRequest() throws Exception {
super.getProperty("CompressionRate");
super.getProperty("UniversalInput");
super.getProperty("Inputvolt");
// Be sure to call the base classes scan request
super.processScanRequest();
// Execute the code for this simulation every scan
this.scanDevice();
}
// Performs the logic for the steam sensor, occurs every scan cycle
public void scanDevice() throws Exception {
double compressionRate = 1+20*Math.random();
double universalInput = 2+20*Math.random();
double inputvolt = 1+20*Math.random();
String currentStatus = "Float";
String equipmentType = "Active";
String controllerType = "Float";
super.setProperty("CompressionRate",compressionRate);
super.setProperty("UniversalInput",universalInput);
super.setProperty("Inputvolt", inputvolt);
super.setProperty("CurrentStatus", currentStatus);
super.setProperty("EquipmentType", equipmentType);
super.setProperty("ControllerType", controllerType);
//System.out.println("@@## came to scanDevice method ");
super.updateSubscribedProperties(15000);
super.updateSubscribedEvents(60000);
}
it is ok,,can you reply me
Hi
Can you please tell me how to stop the Overlap in Mashup,I mean i have created dashboard, in dashboard the gadget overlap so i have to stop the overlap
tell me Please
Please start a new thread for this question, I don't see how this is connected to your "with out refresh button how to generate random values" question
See I Have created the Dashboard but here it is Overlapping the gadgets(Dashboard) but my requirement don't change position.How is it possiable or we can't do, Please tell me About dashboard.I saw the some videos they told They can add or remove gadgets, reposition gadgets on the page, and relocate gadgets to other tab like this.
Hi
i want don't change position, How
Can you please tell me About dashboard image
You are calling all the right functions so it should be working(not sure if it's the complete code). Is there specific reason as to why you are calling super for all the properties?
Nonetheless, where is the problem? Does that not work for you? I don't see any additional code on Events so not sure why you calling the updateSubscribedEvent() , if you only have the properties it should be sufficient to use the super.updateSubscribedProperties();