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 Persistence question

For general discussion related FlowStone

RUBY Persistence question

Postby RJHollins » Wed Jul 17, 2013 7:31 am

Reading the manual it states:
Persistence
The Ruby component saves its state. If you save a schematic with a Ruby component in it then when
you load it back the @ins and @outs arrays are restored to exactly how they were before. This
ensures that the component maintains its state at all times.


It then goes on to mention 'User State Management'
User State Management
If you have your own data that you want to save with a Ruby component then you can implement the
saveState and loadState methods:
def loadState v
end
def saveState
end
The way this works is really simple. In the saveState method you return a Ruby object that
encapsulates all the data that you want to save. It could be a string or an array say if you have lots of
data or it could just be a simple value.


This is an intriguing concept that I've just read, and makes me think of some use possibilities.

My question ... COULD this concept be utilized to provide a basis to implement a 'Trial Period' for a demo ???
With maybe some 'Total' number of runs ... or a Date the application is first launched, with a way to have an incremented counter that would trigger after so many weeks [for example].

Just reading this and thinking out loud. Is this a possibility? Has anyone tried something like this ?

Please ... no politics or moral judgments !!! I'm looking at concepts.

Thanks.
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: RUBY Persistence question

Postby Tzarls » Thu Jul 18, 2013 5:28 pm

The problem here is that all content is saved WHEN THE SCHEMATIC IS SAVED (at least I think that´s the way it works). So for your idea to work in a plugin you should be able to save the "schematic" behind the plugin, and AFAIK that´s not possible. For a working protection system the developer is forced to use some external reference, be it a (probably hidden or encrypted) file or an entry in the windows´registry.
Tzarls
 
Posts: 54
Joined: Thu Oct 21, 2010 2:10 am


Return to General

Who is online

Users browsing this forum: No registered users and 97 guests