MatKlucznyk / Qsys

Qsys library for S#P and SIMPL
MIT License
53 stars 18 forks source link

Snapshots #41

Open devMikeFrancis opened 8 months ago

devMikeFrancis commented 8 months ago

The QRC JSON command issued for Snapshots appears to be sending Component.Set method instead of Snapshot.Set methods.

Following the API guide for a Snapshot named "MySpecialBank" with a single bank:

{ "jsonrpc": "2.0", "method": "Snapshot.Load", "params": { "Name": "MySpecialBank", "Bank": 1, "Ramp": 8.5 }, "id": 1234 }

What the drivers are sending (from debug output):

{ "jsonrpc": "2.0", "id": "{\"app\":\"crestron\",\"caller\":\"MySpecialBank\",\"valueType\":\"value\",\"method\":\"load_1\",\"value\":1.0,\"stringValue\":\"1\",\"position\":0.0}", "method": "Component.Set", "params": { "Name": "MySpecialBank", "Controls": [ { "Name": "load_1", "Value": 1.0 } ] } }

which returns that the component does not exist.

MatKlucznyk commented 8 months ago

The Snapshot commands did not exist when I wrote these modules. Have you tried naming the snapshot component in the designer window/properties (depending on the version of qsys you are using)?

Example of a non-named snapshot component and a named one: image

devMikeFrancis commented 8 months ago

It looks like it is possible to rename the component like you showed and it will function with the Component method, you just loose the ability to dynamically assign ramp time that you get with using the dedicated method. I am not sure if there are any other differences between the two.

MatKlucznyk commented 8 months ago

Im going to assign this as an enhancement. I'll update this thread if its feasible or not.

astingen commented 7 months ago

So, I've used the Snapshot.Set methods in my other qsys modules. (They were undocumented at the time, and we had to call qsys).

One downside of them, there's no feedback with them like the component has. At least, not from what I've found. Which is quite handy for some scenarios (camera presets for example).