Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Links or function calls to code: A Good Programming Practice advise
#11
Any root level template actions would likely need to be of that non-UI accessing type, since there's no way to provide a context create the commands anyway.
Dean Roddey
Explorans limites defectum
Reply
#12
Dean Roddey Wrote: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 Wrote:Any root level template actions would likely need to be of that non-UI accessing type, since there's no way to provide a context create the commands anyway.

Dean,

Your suggestion is very reasonable and provide an acceptable solution to the challenge. These kind of actions don't need to provide a UI access type, the address the need for all the rest (logic, device driver, .....system,GVars). The truth is that If/Else and device driver are by far more important.

Your solution provides a nice encapsulation (we invoke the action not knowing how it being done), you offer re-usability of code and the only question I have is:
how soon can you implement it :-)
Am I too pushy? Well, I promise to be the beta tester of your new RunRootTmplAction( action )!!

Please...,
Rocker
Reply
#13
It would be nice if these global functions were accessible from the event system (scheduled/triggered events) as well.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#14
A "hack" that I use all the time is to create a new template and place the "macro" code in the onload for the template. These would be actions that I want to be able to run from anyplace in IV. The last command in onload needs to be to exit interface viewer. I invoke the template as a pop-up anywhere I want to run the commands. The pop-up runs the onload commands and then closes itself since the last command is to exit. Voilà! I now have commands that can be run from anywhere in IV. I also have the additional feature of being able to add some friendly text on the template to let the user know what is happening and to please wait. I also add a "close" button on the template just in case there is an error so that the user can close the template.
Reply
#15
Dean,

Any plans to address the issue? We can use Vida's idea but I'm not sure you would like us to go this way.

Thanks,
Reply
#16
Nothing is going to happen for this release. It's way too close to be doing anything like that. We can look at it after 3.0 goes out.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Configure Elk Function Keys kblagron 2 1,416 12-29-2019, 11:30 PM
Last Post: kblagron
  I've open sourced my general purpose code Dean Roddey 0 1,020 03-09-2019, 06:53 PM
Last Post: Dean Roddey
  Is it possible to pass onto CQC what user code was used on the ELK? ghurty 9 4,400 01-23-2015, 12:53 PM
Last Post: wuench
  General CML/Programming Question standon 4 1,797 12-13-2012, 01:30 PM
Last Post: Dean Roddey
  simple CQC programming question js19707 1 1,389 08-14-2012, 10:09 PM
Last Post: Dean Roddey
  CQC Logic programming w/ movie watch list rtarver 2 1,469 05-21-2012, 07:50 AM
Last Post: rtarver
  How do you spelunk what Ajax calls are doing? Dean Roddey 4 1,909 11-30-2010, 10:33 AM
Last Post: Dean Roddey
  using a pronto hex ir code... pjwinstalls 6 2,655 11-06-2010, 09:01 PM
Last Post: pjwinstalls
  Repeating Code??? damian.flynn 5 1,709 02-24-2010, 11:48 AM
Last Post: Dean Roddey
  Good Practices Question (for driver's development) rocker 5 2,023 08-04-2009, 12:12 AM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)