Posts: 273
Threads: 38
Joined: Jan 2009
I'm looking for a consistent way to use a good programming practice to implement schemes such as a PowerOFF code for a DVD where the activity is: Play, delay of 0.5sec, Toggle power (the first 2 make sure power is On).
I would like to implement it in one place and call it from various places such as the "Play DVD", "Play CD" commands.
Another example is turning On the AV receiver (Logic is: if it's already On - return, otherwise turn it On and wait a delay before you return so next commands will take effect). Like in this case we don't want to drag the whole logic to every place we might need to turn On the AV Receiver (can be 15 places!).
Can I create hidden (or not hidden for testing/manual control) buttons at some place at the root with the desired action and later on access them and issue commands to execute their action list?
or their must be a much cleaner way.
Posts: 484
Threads: 28
Joined: Apr 2006
New beta CQC versions allow a page to have stored actions like that, which you can reference within the page.
You can also write it as a CML Macro which any part of CQC can then access with no need to duplicate across pages.
Chris.
Posts: 273
Threads: 38
Joined: Jan 2009
Bodshal Wrote:New beta CQC versions allow a page to have stored actions like that, which you can reference within the page.
Chris.
IntViewr:RunTempAction( action) can be invoked from only from the same template/page. I would like to invoke it from any template!
Bodshal Wrote:You can also write it as a CML Macro which any part of CQC can then access with no need to duplicate across pages.
Chris.
Writing macro for such a need are too heavy weight vehicles.
*** Still looking for another alternative for my original posting ***
..
Posts: 40,483
Threads: 491
Joined: Aug 2002
Actually a macro isn't too heavy weight for that. You'd be suprised. CML is designed as a single pass language. It can be downloaded and compiled and run in a twinkling of an eye as long as your system is running as it should.
Dean Roddey
Explorans limites defectum
Posts: 273
Threads: 38
Joined: Jan 2009
Dean Roddey Wrote:Actually a macro isn't too heavy weight for that. You'd be suprised. CML is designed as a single pass language. It can be downloaded and compiled and run in a twinkling of an eye as long as your system is running as it should.
Dean,
A CML macro is still a programming effort outside the editor and requires a a few steps.
If I need to experiment with different delay, i don't want to recompile each time
I like the implementation of Universal Remote Control MX3000 (or even Pronto) where you specify an action to be a command
or a link to another button on another page (this page doesn't have to be instantiate at all). So, when I create the pages for the device with all the commands I create also the power page that has the ON/OFF macros - it a typical logic this page never display.
I don't want to even guess your internal implementation, but can you think about a creative solution such as IV action list or even action the ablity to execute an action of the root template (if in your architecture the template must be "alive" in order to invoke its actions).
Rocker
Posts: 40,483
Threads: 491
Joined: Aug 2002
You can just test the macro within the test harness and prove it works, and it's a better debugging environment than the Intf Editor in that sense, because you have full debugging. So it's not a bad way to work if you are comfortable with CML.
Now, you can't interact with interface widgets from a CML macro, so that's something that wouldn't work going that route.
Dean Roddey
Explorans limites defectum
Posts: 273
Threads: 38
Joined: Jan 2009
Dean Roddey Wrote:You can just test the macro within the test harness and prove it works, and it's a better debugging environment than the Intf Editor in that sense, because you have full debugging. So it's not a bad way to work if you are comfortable with CML.
Now, you can't interact with interface widgets from a CML macro, so that's something that wouldn't work going that route.
Dean, I assume my point didn't pass well. Most of the time the entire sequence is one or two simple commands (such as power on a device) and I just want to invoke it from various places within the IV.
It's a hustle to deal with CML for this trivial usage. I don't need any debugging ability, and I don't want to recompile each time it changes.
Other environments have it and I hopping it can be a simple addition to CQC.
You currently have:
IntfViewer::RunTmplAction( action )
It will be great if you can extend it to:
IntfViewer::RunAction( template, action )
Thank you,
Rocker
Posts: 40,483
Threads: 491
Joined: Aug 2002
Quote:IntfViewer::RunAction( template, action )
Sure, I understand the interest in that. The reason it wasn't do so far is that there's no such thing as 'template'. The same template can be loaded multiple times because of overlays. That's always the issue. There's no good way to target another template. If it's done, it would likely have to be some sort of syntax that indicates levels upwards or something like that, but of course that would make it position dependent which could be an issue.
The simplest thing might be just allow for some at the root template that everyone can call througha RunRootTmplAction() command, and otherwise it has to be with the immediate parent. Most folks do end up witha single root template that everything else exists with the context of.
Dean Roddey
Explorans limites defectum
Posts: 1,858
Threads: 77
Joined: May 2007
rocker Wrote:Dean, I assume my point didn't pass well. Most of the time the entire sequence is one or two simple commands (such as power on a device) and I just want to invoke it from various places within the IV.
It's a hustle to deal with CML for this trivial usage. I don't need any debugging ability, and I don't want to recompile each time it changes.
Other environments have it and I hopping it can be a simple addition to CQC.
You currently have:
IntfViewer::RunTmplAction( action )
It will be great if you can extend it to:
IntfViewer::RunAction( template, action )
Thank you,
Rocker
I like it.
Posts: 484
Threads: 28
Joined: Apr 2006
tbh, that pronto-approach always seemed like a poor kludge to bolt on something useful to a flawed model, but generally fails. action execution is linked to buttons, irrespective of whether you intend the button to be pressed. The stupid thing is this is all based on javascript, a class-savvy interpreter - and they don't use classes for what screams to have it.
Dean: Consider where people have different root templates for different devices/users - resolution differences etc. Is there any logic to defining some sort of 'library' template just for the purpose of defining actions? (perhaps even disabling all the UI related gubbins). That way you can guarantee no dependencies on context etc.