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

Radio buttons under preset manager

For general discussion related FlowStone

Re: Radio buttons under preset manager

Postby billv » Thu Aug 22, 2013 7:45 am

RJHollins wrote:This is some fine work here billv

Thanks mate...long way to go yet...
Next is ruby mouse triggers and then bind it into the 'case... select' code.....
Then will be to try to fold the graphics section into this, to get it down to one code.
That's as far as i aiming to get.....Trogs trick of creating new selectors 'on the fly' is
something I'll have to 'back burner' till the next time....not enough knowledge to process it..
Is one problem though: my use of bitmap....requires afterload trigger to work...
I have hundred's of these selectors in my schematic...
this will mean hundred's of triggers on load up for no reason....will have to fix...
RJHollins wrote: CASE...SELECT to work in your last post.

Yeh, but i could have used it again in the main code to combine the 2 "if and the" sections..
Thanks again for the tip... :)
RJHollins wrote:I've noticed the use of the 'V

V=Value

Sounds like you've done the same mistake i have....not learning all i,v,t
I forgot about the "i"..now everything starting to open up and make sense....
Got very fustrating when I could'nt get simple stuff to work-because i didn't work with 'i'..
Avoid yourself the same grief....
Get stuck into the user guide mate....it's worth it....boring...but worth it..
Learn how to use your weapons before you go to war...
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Radio buttons under preset manager

Postby RJHollins » Thu Aug 22, 2013 9:10 am

Sounds like you've done the same mistake i have....not learning all i,v,t
I forgot about the "i"..now everything starting to open up and make sense....
Got very fustrating when I could'nt get simple stuff to work-because i didn't work with 'i'..
Avoid yourself the same grief....
Get stuck into the user guide mate....it's worth it....boring...but worth it..
Learn how to use your weapons before you go to war...


I remember reading your original post in that regard.

Time to heed your good advice, and for me to hit that guide again. Speaking of which ...

I recall in SM that I could get the guide from its' HELP menu. But with FS, I get connected to the FS web site to find the manuals. I already dL'd the PDF files. Is this 'The' new way ... or can this be changed to access the files on my drive ? Just curious.

Tonite I was doing some RUBY research and happened into a web page dealing with powers of the CASE...Select.
Maybe you'd find this interesting:
http://www.skorks.com/2009/08/how-a-ruby-case-statement-works-and-what-you-can-do-with-it/

This might not be anything new, but it can be helpful to see examples of some of the possibilities. I also liked that it had the 'dumb down' presentation. At my Ruby 'stage', I'm just trying to get things to work properly. Once that happens with consistency, then I'd hope to, later, optimize and/or use a more powerful syntax.

to the guides 8-)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: Radio buttons under preset manager

Postby billv » Thu Aug 22, 2013 11:34 am

RJHollins wrote: Is this 'The' new way .

Looks like it..not sure..... :?
Would be great if DSPR built us that Code Snippet Manager and installed all FS examples in..
As well as all codes used in FS.
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Radio buttons under preset manager

Postby TrojakEW » Thu Aug 22, 2013 12:17 pm

billv wrote:...but hard to modify for learner....
That's the problem with Trog...he writes code in "genius" :D .... hard to access...

Yes Trog is a problem. I'm always confused by his great examples and I get headache while I'm trying to understand what he does :D. So I have adjusted his example a little. You just need to have his ViewArea class inside your project in order to use it.
Attachments
radio_ruby.fsm
(11.58 KiB) Downloaded 881 times
User avatar
TrojakEW
 
Posts: 111
Joined: Sat Dec 25, 2010 10:12 am
Location: Slovakia

Re: Radio buttons under preset manager

Postby trogluddite » Thu Aug 22, 2013 1:14 pm

TrojakEW wrote:Yes Trog is a problem.

He he :lol:
If only I was half as good at chatting up girls as I am with Ruby! ;)

Good example, though :D - using arrays the way you do is the key to problems like this, it makes everything so much more flexible than 'case' and 'if' statements.

Here's a little example of how it might be done without using any special classes etc. to hopefully unravel a few of the mysteries of Ruby...
Cell Array.fsm
(3.06 KiB) Downloaded 908 times
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: Radio buttons under preset manager

Postby RJHollins » Thu Aug 22, 2013 6:36 pm

trogluddite wrote:
TrojakEW wrote:Yes Trog is a problem.

He he :lol:
If only I was half as good at chatting up girls as I am with Ruby! ;)

hmmm ... a 'Virtual Girl' to chat with ... Ruby. ;)
:lol:
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: Radio buttons under preset manager

Postby billv » Thu Aug 22, 2013 8:50 pm

trogluddite wrote:Here's a little example of how it might be done without using any special classes

Thanks Trog...
Looks great, Look forward to going through it when i get home.
trogluddite wrote:using arrays the way you do is the key to problems like this

I think that's where i got stuck with your selector...
I couldn't get control of that "@selected + index" relationship in the code....
I couldn't get my strings appearing properly.....
And I couldn't find the way to remove spacing between selectors...

Did manage to get all my selector in one code :D .....still tweaking it....
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Radio buttons under preset manager

Postby billv » Fri Aug 23, 2013 11:25 am

Really appreciate the cell array.fsm Trog...thanks again....
Getting lost trying to 'absorb" it using cpu screen....
So I'm printing it out and sticking it next to the ashtray downstairs....and
keep working this current "detour" for the moment....
All in one module now...
Didn't end up like i thought it would....looks a little strange....but works...
BV selector fix.fsm
(1.58 KiB) Downloaded 903 times

Next step is to declare the good stuff and bring them out....
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Radio buttons under preset manager

Postby billv » Sun Aug 25, 2013 12:01 pm

Weird bug has kicked me out of the ruby graphics section....
Weird statistics bug.... :?
last example ok....seems to work great...
.but put about more than 20 together...hit statistics...and FS freezes....
(have to use task manager to shut FS down)
spent last two days trying everything I could to find bug....no go...
About 10 is ok....statistics will give reading...

I built a switch that was easier for me to modify that the FS switch....
Same problem again...and the switch works great... :?
My Frst Ruby Switch.fsm
(1.29 KiB) Downloaded 889 times

:evil: Real bummer....losing motivation to use ruby mouse/graphic
If these parts cant survive the "statistics" button....I can't use them...
Can anyone see the issue or help fix?
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Radio buttons under preset manager

Postby Nubeat7 » Mon Aug 26, 2013 1:38 am

think it is because of the redraw in the draw methode, i did the same mistake in my ruby knob... i went through your code and did a few changes, first after it is a switch its easier to use a boolean and just change its state
(so i changed also the name to @on), the redraws are only done when needed - this means when using mouse or an event is happen (setted by preset), i also did the draw with "if" instead of case because its only 2 conditions and its more readable like this..

you can use v.width and v.height in the draw methode so you dont need ins for it

i also brought the code in a nice programming style its really bad to not structuring the code, code is much harder to read like this, it is also needless to comment like # mouse trigger when the following method is called "mouseLDown"... i left no comments because there are no needed like it is now
Attachments
My Frst Ruby Switch_nubeat7.fsm
(1.36 KiB) Downloaded 919 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 54 guests