Uw opmerkingen

Hi Patrick,

Sure its possible to write something to meet your requirements. Contact me and we can discuss this further, ( support@rocfusion.com )
Thanks,


Roger
Hi Patrick,

JSON will provide you with way to structure your data as a single object, so you would only have to save one token. JSON is is a lightweight data interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate The great thing is its a subset of Javascript so an subset iRidium script.

When you want to have the possibility to store this info or export to other systems I would look at Logic Machine. It will give you the ability to store >10 years of data. You could either get the Logic machine to gather, store the data or and an iRidium project to retrieve and visualize this information OR an iRidium project which gathers the data and stores it in the logic machine. Either way will work.

To give you an example, I was in the situation were my installations there was an increasing need by the end user to create their own scenes. I could have developed an scene saver directly into an iRidium project and used project token to store the scenes. The downside to this would be that the scenes created are specific to the iRidium client (ipad). You create a scene on the lviing ipad, then only the living ipad has that scene. I need an server\client based solution. Given the iRidium server is in development, I created my own.

I have built an scene server ( for KNX lights and shades ) on the Logic Machine, a client driver in iRidium, Both the Logic Machine server and iRidium generate, exchange JSON objects. I created a database structure using JSON to store the scenes at room, floor and house level. The Logic Machine is used to playback the scenes which can run on-demand, on-time and with time offset to sunrise\sunset..

Thanks,

Roger
Hi,

You can do something on the line of:

var mydb = [{ name:"value 1", value:100}, { name:"value 2", value:75},{ name:"value 3", value:50}];

function loaddb(){
var dbtxt = IR.GetVariable("Global.mydb");
mydb = JSON.Parse(dbtxt);
}

function savedb(){
var dbtxt = JSON.Stringify(mydb);
IR.SetVariable("Global.mydb", dbtxt);
}

Whenever I work with project tokens in script, I always create the token in the project itself with the GUI Editor.

Using these as a basis, it will allow you to structure the data you use in scripts and take advantage of project tokens to keep the data in permanent storage.

Thanks,


Roger
Hi Patrick,

The easiest way that I know of is to store the data is a JSON format. Then use JSON.Stringify(mydata); that will convert the json object into a string so you can write the string to an project token. When reloading the project token you can use JSON.Parse(mydata) to convert the string back into an json object.

Thanks,


Roger
Hi,

Ok, to get it back, I had to reset to the Default Panels..

I run the emulator a lot so as long as the save is happening then, its ok.

Thanks,


Roger
Hi,

Where is the OK button, I don't have that any more. I close the JS editor with the X in the top right and it asks to save then.

Thanks,

Roger

Hi Oksana,

Its when the graphical items all have different properties set then it will fail. See the attached project, on Popup 1, every graphical item has to have the same properties set as the "** masterbedroom", (feedback, hit, font, font size, colors, alignment and image stretch) Now select all the items, and try to change those properties. You can make the selection only once. Check all items individually and you will see they do not change.

OBJ.irpz


Thanks,


Roger
If I create an new item it still occurs. I think its project specific, since I created an new project, copied the popups from the failing project and imported the KNX driver from the failing project. It worked fine. I think the failing projects were originally created with 2.1.2 of the gui editor, so maybe something went wrong there.