Hi,
i want to know how to get the color of each graphic object on a compressor symbol (panel)
the compressor symbol contain (rectangle, circle, icon) and each object has a different color signal.
I add the symbol in runtime with the function "addSymbol("","","Symbol/myPanel.pnl", "dpComp",.......)" but now , how to go on, if
i want to get the color (online) of each object?
thank u for your reply.
get color of each symbol on the panel (forecol, backcol)
Search
Re: get color of each symbol on the panel (forecol, backcol)
Hello,
with the function getShapes() you can get a list of shapes where an attribute has a defined value.
Why do you want to read the current color of all shapes?
What is done with the result?
Best Regards
Leopold Knipp
Senior Support Specialist
with the function getShapes() you can get a list of shapes where an attribute has a defined value.
Why do you want to read the current color of all shapes?
What is done with the result?
Best Regards
Leopold Knipp
Senior Support Specialist
Re: get color of each symbol on the panel (forecol, backcol)
hi,
thanks for u are reaction
the task is to check if the project is well done, because
two persons are working parall on one project
- one man for the panel design
- one man for the control script of all panel
now i want to check if all the panel signal color are correct and match with
the list of color signal code for this project.
thanks for u are reaction
the task is to check if the project is well done, because
two persons are working parall on one project
- one man for the panel design
- one man for the control script of all panel
now i want to check if all the panel signal color are correct and match with
the list of color signal code for this project.
Re: get color of each symbol on the panel (forecol, backcol)
Hello,
it is a bit difficult to understand what you are exactly trying to achieve. As it was said before, you can do what you strictly asked for using getShapes() and doing the necessary parsing afterwards though your approach to the problem sounds at first glance not optimal.
I understand you have someone developing some front-end panels and someone else modeling the devices and doing some other back-end things. Now you want to verify that the panel was properly developed and the colors of the objects represent the right parameters. In order to suggest a way to do this one would need a better idea of the scale of the whole thing and some more information on how you develop. Following, as an illustration I give some suggestions that depend very much on how you are doing things and the size of your project (perhaps also if you are planning to reuse this in other projects, etc.)
You say you are adding this modeled devices using the addsymbol function so you do already have a template of the device you want to reuse many times on your panels.
One first check would be to verify that the different parts of your reference panel are addressing the correct device parameters (or datapoint elements). I don't see other way to do this than someone doing it by eye, unless you want to create some small simulator, create a panel with one of this reference panels linked to your simulated device and change one by one the values while looking at the panel in run-time to check that the right parts of the panel change color.
If you have modeled a device that expect many dollar parameters (reference values) then it would be more complicated to check that all of the instances that you add to the panels are addressing the right dpes. Ideally you should just pass one dollar parameter representing the device. Other dollar parameters should represent things not related to the device. For example:
Pump1.state (boolean)
Pump1.flow (float)
Pump1.temperature (float)
If I would model a reference panel for this device I would do it in a way so that it would take only one reference value : "Pump1" and inside the reference panel I would take care of looking for the right elements to change the color of each of the parts. If you otherwise would pass the 3 of them: .state, .flow and .temperature then there is more room for errors, scaling with the complexity of the device and the number of devices in the panel. If you only pass the device name (dp) then one would just have to check that each of the devices has the right Device associated (Pump1) since we already checked the reference panel in the first step.
From your question one would deduce too that the person developing the panel added the symbols in the editor by hand rather than scripting it. Here is where the factor size/re-usability has a very important role. If this panels has many of this devices one would rather want to add this devices dynamically on the start-up of the panel according to a mapping defined by the back-end guy (again size and other factors are important here, this mapping could be in dps or in files or in a external DB). If this would be done, then one would just have to make sure that the mapping algorithm in the panel (that should be rahter small!) is correct and that the mapping in the dps, table of files is correct.
Said all this, if this is a one of a time project and you are not planning on reusing this or building any sort of framework or so, then I would just go for the approach where you pass ONLY one reference parameter to the reference panel and you display a small label for each of the devices to be sure they are connected to the right device. (you can make it as a tool-tip for example).
I hope some of this helps but if not just drop me a line!
Regards,
Bobby
it is a bit difficult to understand what you are exactly trying to achieve. As it was said before, you can do what you strictly asked for using getShapes() and doing the necessary parsing afterwards though your approach to the problem sounds at first glance not optimal.
I understand you have someone developing some front-end panels and someone else modeling the devices and doing some other back-end things. Now you want to verify that the panel was properly developed and the colors of the objects represent the right parameters. In order to suggest a way to do this one would need a better idea of the scale of the whole thing and some more information on how you develop. Following, as an illustration I give some suggestions that depend very much on how you are doing things and the size of your project (perhaps also if you are planning to reuse this in other projects, etc.)
You say you are adding this modeled devices using the addsymbol function so you do already have a template of the device you want to reuse many times on your panels.
One first check would be to verify that the different parts of your reference panel are addressing the correct device parameters (or datapoint elements). I don't see other way to do this than someone doing it by eye, unless you want to create some small simulator, create a panel with one of this reference panels linked to your simulated device and change one by one the values while looking at the panel in run-time to check that the right parts of the panel change color.
If you have modeled a device that expect many dollar parameters (reference values) then it would be more complicated to check that all of the instances that you add to the panels are addressing the right dpes. Ideally you should just pass one dollar parameter representing the device. Other dollar parameters should represent things not related to the device. For example:
Pump1.state (boolean)
Pump1.flow (float)
Pump1.temperature (float)
If I would model a reference panel for this device I would do it in a way so that it would take only one reference value : "Pump1" and inside the reference panel I would take care of looking for the right elements to change the color of each of the parts. If you otherwise would pass the 3 of them: .state, .flow and .temperature then there is more room for errors, scaling with the complexity of the device and the number of devices in the panel. If you only pass the device name (dp) then one would just have to check that each of the devices has the right Device associated (Pump1) since we already checked the reference panel in the first step.
From your question one would deduce too that the person developing the panel added the symbols in the editor by hand rather than scripting it. Here is where the factor size/re-usability has a very important role. If this panels has many of this devices one would rather want to add this devices dynamically on the start-up of the panel according to a mapping defined by the back-end guy (again size and other factors are important here, this mapping could be in dps or in files or in a external DB). If this would be done, then one would just have to make sure that the mapping algorithm in the panel (that should be rahter small!) is correct and that the mapping in the dps, table of files is correct.
Said all this, if this is a one of a time project and you are not planning on reusing this or building any sort of framework or so, then I would just go for the approach where you pass ONLY one reference parameter to the reference panel and you display a small label for each of the devices to be sure they are connected to the right device. (you can make it as a tool-tip for example).
I hope some of this helps but if not just drop me a line!
Regards,
Bobby