If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Ruby GraphicsPath save error?
10 posts
• Page 1 of 1
Ruby GraphicsPath save error?
Here is the thing. I want to pass a GraphicsPath form one ruby component to another but when I save the schematic I get an error "(in method 'saveState') no _dump_data is defined for Class GraphicsPath"
I believe the problem is, that the Path cannot be saved as part of inputs and outputs (which are saved and loaded by default in ruby). I do not need to save the path, but I need it to pass from one component to another. What should I do?
I believe the problem is, that the Path cannot be saved as part of inputs and outputs (which are saved and loaded by default in ruby). I do not need to save the path, but I need it to pass from one component to another. What should I do?
- Attachments
-
- pathproblem.fsm
- (321 Bytes) Downloaded 808 times
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Ruby GraphicsPath save error?
KG_is_back wrote:pass a GraphicsPath form one ruby component to another
What if you write the method inside a class like..
- Code: Select all
class GraphicsPath
def rect
return [0,0,10,10]
end
end
# then in other ruby prim...
mypath = GraphicsPath.new
mypath.rect
Would this work for you ?
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Ruby GraphicsPath save error?
billv wrote:KG_is_back wrote:pass a GraphicsPath form one ruby component to another
What if you write the method inside a class like..
- Code: Select all
class GraphicsPath
def rect
return [0,0,10,10]
end
end
# then in other ruby prim...
mypath = GraphicsPath.new
mypath.rect
Would this work for you ?
Unfortunately that would not work. The example schematic contains the path contains only one rectangle just to show the problem. The path I'm using in my original schematic contains several shapes.
But it gave me an idea oh how to fix the problem. I do not really need to save the path - I just need to prevent the error massage to show. So what if I add a dummy "_dump_data" method to graphicsPath class that simply outputs nil. That should fool the FS not to show error. And similar thing would probably be needed for loading... I'll give it a try.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Ruby GraphicsPath save error?
So its not viable/possible to just re write your
original inside the class and add all your shapes
inside new def's there....Ok....Hope you find right solution.
original inside the class and add all your shapes
inside new def's there....Ok....Hope you find right solution.
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Ruby GraphicsPath save error?
Yes!!! IT WORKS... it is something called marshal module...has functions _dump and _load to deal the saving and loading data... some classes do not have these functions defined, so they output error. I just added "dummy" versions of these methods GraphicsPath class and errors are gone
- Code: Select all
class GraphicsPath
def _dump level
end
def _load args
end
end
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Ruby GraphicsPath save error?
Great ..will take another look at Mr Marshall..interesting fix..
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Ruby GraphicsPath save error?
Ahh ... the 'Marshall' routine.
Mr NuBeat has done some extensive work on this very useful function.
I think NuBeat started to help me on this over at the SM forum. For what I needed to do, this 'Marshall' technique of saving and loading configuration data simplified the entire process and array management.
I continue to thank NuBeat for this, and all his other generous help and educating
Mr NuBeat has done some extensive work on this very useful function.
I think NuBeat started to help me on this over at the SM forum. For what I needed to do, this 'Marshall' technique of saving and loading configuration data simplified the entire process and array management.
I continue to thank NuBeat for this, and all his other generous help and educating
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: Ruby GraphicsPath save error?
RJHollins wrote:Ahh ... the 'Marshall' routine.
Mr NuBeat has done some extensive work on this very useful function.
I think NuBeat started to help me on this over at the SM forum. For what I needed to do, this 'Marshall' technique of saving and loading configuration data simplified the entire process and array management.
I continue to thank NuBeat for this, and all his other generous help and educating
ah yes I remember that... it was something about array of arrays, that the top array contains only pointers to the sub-arrays. when you create a copy of the top array and change the element in the sub-array both copy and original will be affected. We needed the mashall routine to create a hard copy to make the copy and original change values separately.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Ruby GraphicsPath save error?
One of the very handy features using the 'Marshall' routine had to do with variable sized array management. It automatically handle all those details.
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: Ruby GraphicsPath save error?
I went searching for the thread[s] both here and on SM for the 'Marshal Method' ... I couldn't find it
We were doing all kinds of testing to save/load files while dealing with some strange compatiability issue ... it was a real crazy time.
If I find the threads I'll try to post them.
We were doing all kinds of testing to save/load files while dealing with some strange compatiability issue ... it was a real crazy time.
If I find the threads I'll try to post them.
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 80 guests