| Author |
Message |
GMartin
Joined: Feb 5, 2010 Posts: 308
|
Posted: Apr 1, 2020 7:10 PM Post subject: Count number of sessions |
|
Jarek, I am woking with a provider who wants to keep count of the number of sessions used in a design. Is there a way that is possible? Thanks
George |
|
 |
GMartin
Joined: Feb 5, 2010 Posts: 308
|
Posted: Apr 1, 2020 8:17 PM Post subject: |
|
Jarek,
After multiple filed attempts I finally got a simple routine working. I was using a scalarvakue but could not get it to save the value. I inserted a slider and had it remember value, hid it, and that worked to increment by one each a button is clicked. |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Apr 1, 2020 11:10 PM Post subject: |
|
This is a good way.
Another way (I figured before I saw your response) would be to use an external configuration file, read the value and increment it.
Here is a snippet which counts all design loads (and reloads).
http://proatech.com/design/design_load_counter.bpd
You could modify it and trigger when your session is complete. |
|
 |
GMartin
Joined: Feb 5, 2010 Posts: 308
|
Posted: Apr 1, 2020 11:24 PM Post subject: |
|
Jarek Thanks |
|
 |
GMartin
Joined: Feb 5, 2010 Posts: 308
|
Posted: Apr 2, 2020 8:06 PM Post subject: |
|
This is more elegant than my solution. This will be used to monitor session use for home trainers. It will stop the design from loading asger a certain number of sessions. If more sessions are required how could this counter be reset?
Thanks |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Apr 2, 2020 8:15 PM Post subject: |
|
To reset you can simply delete the xml file, in this case "example.xml" in main folder.
Or write 0 (zero) to the XmlWriter. |
|