Support

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 modules (primitives?)

Post any examples or modules that you want to share here

Ruby modules (primitives?)

Postby pall » Sat Feb 09, 2013 5:51 pm

I believe if we can realize different modules with Ruby - like the greens - that can reuse them anywhere, anytime, would be a great advantage for everyone.
However I think that cannot be made even as the green. For that we could categorize them according to their complexity, level one, level two, level three etc. :idea:
What is your opinion?
This is a proposal. I do not know if you understand. Express myself as hell... ;)

I tried with the simplest.
Attachments
Ruby modules 01.fsm
(1.08 KiB) Downloaded 1467 times
pall
 
Posts: 31
Joined: Thu Dec 09, 2010 1:27 pm
Location: Transilvania

Re: Ruby modules (primitives?)

Postby trogluddite » Sat Feb 09, 2013 6:28 pm

Yes, I think that's a great idea.
Especially good for the GUI, because Ruby can do many good graphics and mouse things that can't be done in green. But also many other things like accessing files, text parsing, some kinds of maths etc. are more powerful in Ruby.

Regarding 'levels', I'm not sure how you would decide what level a module is - but I think you have a good point. Until now most of the Ruby stuff posted is "high level" - like a whole knob all in one code. That's not good to customise and adapt if you don't know Ruby, so taking out the small sections to use like primitives sounds very sensible - give the power of Ruby to all, even if they don't know the programming.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby modules (primitives?)

Postby pall » Sat Feb 09, 2013 7:51 pm

I understand that Ruby treats everything as objects. So a module that treats a single object, would be the level one. Modules presented by me would be the level one in this case. But if it contains a second object (eg mouseEvent) would be second level, and so.
I have said, this is just my ideas, and I do not decide how to be.

trogluddite wrote:- give the power of Ruby to all, even if they don't know the programming.
-This is the idea-
Cheers!
pall
 
Posts: 31
Joined: Thu Dec 09, 2010 1:27 pm
Location: Transilvania

Re: Ruby modules (primitives?)

Postby Nubeat7 » Sat Feb 09, 2013 9:36 pm

yes a collection of useful small primitive like ruby modules would be great, i already did a few, sadly i ve nearly no time for FS atm and i`m not on my main FS PC, but here`s a snippet i used in one of my last projects - sometimes its useful when u don`t need to take care from dividing through Zero... whit this it is zero instead of INF to prevent errors. not shure how much sense i tmakes, because you also could keep the divisor greater then Zero but in some cases maybe this is better and /or easier..

Code: Select all
def event i,v
z = @x/@y
z = 0 if @y == 0
output 0, z
end
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Ruby modules (primitives?)

Postby RJHollins » Tue Jun 04, 2013 9:20 am

More and more playing with RUBY ... still not consistent getting all ideas to work.

Sure hope some additional RUBY snippets could be shared !

The RUBY 'primitive' idea is great. Those graphics modules are great building blocks.

Thanks for posting 8-)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm


Return to User Examples

Who is online

Users browsing this forum: No registered users and 102 guests

cron