Author |
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: July 06 2011 at 23:03 | IP Logged
|
|
|
Anyone know the correct syntax for PH_CHECKTRIGGER. I am still having CID plugin problems and need to check the CID trigger for a work around.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: July 07 2011 at 11:59 | IP Logged
|
|
|
How about a little help Dave. Trigger Type – Generic Plugin, trigger ID – CID, trigger number – Command 1, trigger value – Option 1. What is the dim value, command, data, formula and auxvalue? The Action is a macro. With so many variables here I can’t get pass the syntax error.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: July 11 2011 at 15:03 | IP Logged
|
|
|
I can help with that .
First thing to consider is that the ph_checktrigger function is primarily meant to be called from external routines such as plugins. With that said, this function will simulate the events to fire a trigger check within PowerHome. It does not call a specific trigger...only makes the call for a set of trigger events and if any triggers match, then they will be called just as if an actual trigger event had occurred.
The first parameter is an integer requesting the type of trigger check to perform. You can get a list of these numbers by running the following SQL from the Multi-Editor in SQL mode (shift-F5).
select * from dropdowns where ddtype = 22;
The ddnumval column contains the trigger type integer and the dddisplay is the English equivalent of the Trigger Type.
The next parameter is a string containing the Trigger ID. This is not the actual ID of the trigger that shows in the first column of the Triggers screen in PH Explorer but is instead the 7th column labeled "Trigger ID".
The next two parameters match the next two columns (8 and 9) and correspond to "Trigger ID Number" and "Trigger Value". Both of these parameters are integer types. To figure out what values to put in these parms, it starts to get a little complicated. For a list of values for "Trigger ID Number", you can run this SQL in the multi-editor.
select * from all_value;
The key_number is the value that should be used for this parameter. Not all values listed in this SQL are valid though and its actually a significant number of lines of code that filters out what is a valid value based upon the Trigger Type field. Some of this filtering is also based upon other columns (such as ID) depending upon the Trigger Type value. Probably the best way to see the actual value you may want to test for is by running this SQL:
select * from triggers;
You can see the actual value stored for the particular trigger or group of triggers you're attempting to fire.
To get the list of valid Trigger Value integers, you can run this SQL:
select * from dropdowns where ddtype = 23;
The ddnumval is the integer value of interest. This column also has special filtering done on it so not every value listed is valid for every trigger. The previous SQL against the triggers table will in determining the appropriate value for this field as well.
These 3 parms are whats necessary to determine the specific triggers to check. The remaining fields are just extra data that gets passed based upon the type of trigger and will ultimately end up getting passed to the action macro or formula in the various [TEMP] variables. These values may also be checked or referenced within the Boolean field. The specific values that should appear are completely trigger dependant but if you let me know the specific type of trigger you're firing, I can trace and lookup the various values that should appear. These values have no determination on whether a trigger is actually checked or not (the first 3 parms determine this), but may have an effect on whether the trigger action is launched if you use these values in the Boolean field. You can use the TEMP variable macro/formula to display the TEMP vars to see samples of what values are actually passed in these vars.
Of course, to properly call this function, you'll need to know the variable types to pass. The dim parm takes a double value (you can use a 0 or any integer but it is acceptable to pass a decimal number), the command parm is an unsignedlong (integer and non negative), the data parm is a long, and the formula and auxvalue parms are both strings.
Hope this helps,
Dave.
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: July 12 2011 at 13:04 | IP Logged
|
|
|
Thanks for the invaluable input. I will see if this will do what I believe will eventually relieve my CID plugin failure. I have no way of knowing when the CID failed other than visually looking at the monitor. If I can programmatically detect the failure then I can circumvent it.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: July 18 2011 at 09:32 | IP Logged
|
|
|
The ph_ checktrigger did not expose anything when the CID Plugin failed. The help screen shows it as “inactive”. I guess my question is how do I inquire the plugin went inactive? There must be some ph_? as the help screen can display it’s status.
EDIT: Update, another failure did not show, in the help screen, the plugin as inactive.
Edited by BeachBum - July 18 2011 at 19:53
__________________ Pete - X10 Oldie
|
Back to Top |
|
|