Feature request : custom draw scripted component
Quote from LWT98709 on November 29, 2024, 6:48 pmHello,
Is it possible to create components drawn by a script in a "scripted component" (or other)?
I use the software for teaching in a high school. It would be nice if there was the possibility of animating components to make the simulation more visual for younger students.I tried to do some things with the components already available. The "displays" are too tedious to animate. The LEDs and the LAMP are too small.
Finally, I make animations with an external Python program after sending data through the serial port. But, the whole thing to set up is always tedious.
Thanks
Hello,
Is it possible to create components drawn by a script in a "scripted component" (or other)?
I use the software for teaching in a high school. It would be nice if there was the possibility of animating components to make the simulation more visual for younger students.
I tried to do some things with the components already available. The "displays" are too tedious to animate. The LEDs and the LAMP are too small.
Finally, I make animations with an external Python program after sending data through the serial port. But, the whole thing to set up is always tedious.
Thanks
Quote from arcachofo on November 29, 2024, 8:03 pmHi.
It is posible to do animations with scripts, for example in this video a simple bar chart done animating rectangles (at around 04:13)
https://www.youtube.com/watch?v=LBknR6y5QhoOr in this one an animated "water tank" simulating magnetic sensors:
https://www.youtube.com/watch?v=8LoZilvd1YoYou can read/write any property of any component in the circuit, including position, size, color, opacity, etc. (if the component have it)
For that the script component must be "linked" to the component you want to control.
And you need to know the internal name of the property.
Then use the function setPropStr( int link_number, string property_name, string property _value )For example to set the position of a component:
int posY = 100; valStr = "60,"+posY; component.setPropStr( 0, "Pos", valStr );
If you have some specific idea I could try to help.
Hi.
It is posible to do animations with scripts, for example in this video a simple bar chart done animating rectangles (at around 04:13)
https://www.youtube.com/watch?v=LBknR6y5Qho
Or in this one an animated "water tank" simulating magnetic sensors:
https://www.youtube.com/watch?v=8LoZilvd1Yo
You can read/write any property of any component in the circuit, including position, size, color, opacity, etc. (if the component have it)
For that the script component must be "linked" to the component you want to control.
And you need to know the internal name of the property.
Then use the function setPropStr( int link_number, string property_name, string property _value )
For example to set the position of a component:
int posY = 100;
valStr = "60,"+posY;
component.setPropStr( 0, "Pos", valStr );
If you have some specific idea I could try to help.
Quote from LWT98709 on November 30, 2024, 11:14 amThanks for the reply !
I've try a to copy the "display" design. But, I'm unable to make it work. The component appearance is not affected by the script.
Can you upload your "display", "chartscript" with an exemple ?
Thanks for the reply !
I've try a to copy the "display" design. But, I'm unable to make it work. The component appearance is not affected by the script.
Can you upload your "display", "chartscript" with an exemple ?
Quote from LWT98709 on November 30, 2024, 4:32 pmBy the way, how can I attach an upload file to a post in this forum. The "Upload Files" don't seems to work.
Edit : it works now ...
By the way, how can I attach an upload file to a post in this forum. The "Upload Files" don't seems to work.
Edit : it works now ...
Uploaded files:Quote from LWT98709 on November 30, 2024, 9:09 pmFinally get the scripted "display" work with the latest 1.1.0-SR1 Rev 2011.
Previously, I was using R2094.
Finally get the scripted "display" work with the latest 1.1.0-SR1 Rev 2011.
Previously, I was using R2094.
Quote from LWT98709 on December 1, 2024, 1:42 amOK, find the way to remove "display" : set to name="" in package file.
But, still the yellow dot. The package file is rename "display_LS.package" for logical symbol, but still the yellow dot.
OK, find the way to remove "display" : set to name="" in package file.
But, still the yellow dot. The package file is rename "display_LS.package" for logical symbol, but still the yellow dot.
Quote from KerimF on December 1, 2024, 8:39 amQuote from LWT98709 on November 30, 2024, 4:32 pmBy the way, how can I attach an upload file to a post in this forum. The "Upload Files" don't seems to work.
I usually zip a file or a folder before uploading it as *.zip.
Quote from LWT98709 on November 30, 2024, 4:32 pmBy the way, how can I attach an upload file to a post in this forum. The "Upload Files" don't seems to work.
I usually zip a file or a folder before uploading it as *.zip.
Quote from arcachofo on December 2, 2024, 9:30 amHi , sorry for the delay, I was "disconnected" this weekend.
About the yellow dot:
This indicates which component is the "active" one.
When you upload from the Editor it will send data to the component with the yellow dot.If there are more than one MCU or Script component you need to set the one you want before uploading.
Hi , sorry for the delay, I was "disconnected" this weekend.
About the yellow dot:
This indicates which component is the "active" one.
When you upload from the Editor it will send data to the component with the yellow dot.
If there are more than one MCU or Script component you need to set the one you want before uploading.