Got another one for you @jamespeltzer ! Heh...
So... In the dashboard I am creating, I wan to incorporate two buttons that both control out Carbonite switcher.
What I want the two buttons to do are the following.
-
Show Preview GFX / Hide Preview GFX: Basically this calls on a CustomControl on the Carbonite. What it does is that it takes the graphics in M1, and keys them in on keyer 1 in the PV window in the Multivew with whatever background it has in PV.
The button is based on a toggle button that has a value of 0 (when not showing) and 1 (when showing in preview).
- First click brings the graphics up in PV and sets value to 1 (works fine).
- Second click takes off the GFX from the PV and sets the value to 0 (works fine, kinda).
-
Show GFX PGM / Hide GFX PGM: This one just includes the key 1 in transitions, then performs a key transition NOT taking with the background from PV (want that as a separate button). This one too it based on a toogle button with parameter value of 0 (not showing) and 1 (showing).
- First click transitions in key 1 on top of PGM and sets value to 1(works fine, in theory).
- Second click transitions out key 1 from PGM into PV again. (also works).
Here's the problem however:
- IF Show/Hide GFX PGM is value 1 this button should be disabled (not do anything).
- Set the Preview paramter value to 1 (giving the button the right appereance).
- This is where the problem is. If this fires, it goes into a loop when it tries to set itself back to 1 (I dont want the appereance to change when it "cant" remove the preview). It will also continue to spam the debug window with the following message...
- Debug message: "GFX showing. Cannot hide...
- ELSE (Show GFX PGM is value 0) this button should take away the keyer on PV (another Custom Control).
- Run CC B1:C2 removes the GFX from PV.
- Sets the parameter to 0 just from the click.
-
"‹IF Show/Hide Preview GFX is value 0 this button should be disabled (not do anything).
- Set the Program parameter value to 0 (giving the button the right appereance).
- This is where the problem is. Same thing as above. Setting the value of self back to what it was when pressed send it into a loop.
- Debug message: "No preview. Cannot show GFX."
- ELSE (Preview GFX is value 1) this button should take key 1 and transition this into PGM.
- Include Key 1 in transition.
- Perform key 1 transition.
I'll include the code for this that fails. So beware whoever takes this code.
You will have to shut down DashBoard through Task Manager (or MAC equivalent).
<abs contexttype="opengear">
<meta>
<params>
<param access="1" constrainttype="INT_CHOICE" name="GFX Preview" oid="GFX_Preview" precision="0" type="INT32" value="0" widget="toggle">
<constraint key="0">Show GFX PV</constraint>
<constraint key="1">Hide GFX PV</constraint>
</param>
<param access="1" constrainttype="INT_CHOICE" name="GFX PGM" oid="GFX_PGM" precision="0" type="INT32" value="0" widget="toggle">
<constraint key="0">Show GFX PGM</constraint>
<constraint key="1">Hide GFX PGM</constraint>
</param>
</params>
<context contexttype="opengear" id="Carbonite.1" objectid="Carbonite 00:0F:9B:02:F4:E8<br>Slot 0<br>Carbonite" objecttype="Carbonite"/>
</meta>
<param expand="true" height="76" left="120" oid="GFX_Preview" style="style:toggleButton;" top="80" width="114">
<task tasktype="ogscript">/*! block id=1001,1000,1005,1006,1004,1007,1009,1008 !*/
if (params.getValue('GFX_PGM', 0) == 1) {
params.setValue('GFX_Preview', 0, 1);
ogscript.debug("GFX Showing. Cannot hide...");
} else {
if (params.getValue('GFX_Preview', 0) == 1) { rosstalk.sendMessage("192.168.38.150", 7788, "CC " + 1 + ":" + 1);
ogscript.debug("Showing Preview");
} else { rosstalk.sendMessage("192.168.38.150", 7788, "CC " + 1 + ":" + 2);
ogscript.debug("Hiding Preview");
}
}
/*!!
<block id="1001" type="if" x="302" y="69" w="268" INPUT1="ID:1000" OPERATION="equals" INPUT2="1" TRUE="" FALSE="ID:1005" IGNORE="" />
<block id="1000" type="param_GFX PGM (GFX_PGM)[0]" x="24" y="54" w="243" SET="" />
<block id="1005" type="if" x="518" y="279" w="268" INPUT1="ID:1006" OPERATION="equals" INPUT2="1" TRUE="ID:1004" FALSE="ID:1009" IGNORE="" />
<block id="1006" type="param_GFX Preview (GFX_Preview)[0]" x="255" y="312" w="243" SET="" />
<block id="1004" type="Carbonite.1_carbonite_runCC" x="854" y="249" w="243" BANK="1" CC="1" next="ID:1007" />
<block id="1007" type="ogscript_debug" x="854" y="353" w="243" MESSAGE="Showing Preview" />
<block id="1009" type="Carbonite.1_carbonite_runCC" x="786" y="453" w="243" BANK="1" CC="2" next="ID:1008" />
<block id="1008" type="ogscript_debug" x="780" y="578" w="243" MESSAGE="Hiding Preview" />
!!*/
/*!!<checksum>917f769596ef64bae2b3e527ee7b80eb</checksum>!!*/</task>
</param>
<param expand="true" height="78" left="120" oid="GFX_PGM" style="style:toggleButton;" top="158" width="115">
<task tasktype="ogscript">/*! block id=1012,1010,1014,1015,1020,1017 !*/
if (params.getValue('GFX_Preview', 0) == 0)
{
params.setValue('GFX_PGM', 0, 0);
ogscript.debug("No preview. Cannot show GFX");
} else {
rosstalk.sendMessage("192.168.38.150", 7788, "KEYAUTO ME:" + 1 + ":" + 1);
ogscript.debug("Performing transition");
}
/*!!
<block id="1012" type="if" x="314" y="35" w="268" INPUT1="ID:1010" OPERATION="equals" INPUT2="0" TRUE="ID:1014" FALSE="ID:1020" IGNORE="" />
<block id="1010" type="param_GFX Preview (GFX_Preview)[0]" x="40" y="47" w="243" SET="" />
<block id="1014" type="param_setvalue" x="647" y="70" w="318" PARAM="[root, Panel Parameters, GFX PGM (GFX_PGM)]" VALUE="0" next="ID:1015" />
<block id="1015" type="ogscript_debug" x="705" y="185" w="243" MESSAGE="No preview. Cannot show GFX" />
<block id="1020" type="Carbonite.1_carbonite_keyauto" x="587" y="327" w="243" MESRC="ME" MENUM="1" KEYER="1" next="ID:1017" />
<block id="1017" type="ogscript_debug" x="587" y="480" w="243" MESSAGE="Performing transition" />
!!*/
/*!!<checksum>da6b5583bd090d518e02bf69ae8751f0</checksum>!!*/</task>
</param>
</abs>
I do know that this might seem overly reduntant for a professional user of a switcher etc, and removes some functionality when it comes to performing a transition with BKGD and Key 1 at the same time. However, some of the guys that will be operating this has next to no technical knowledge. So I am trying to make it as "user friendly" as possible with making sure they SEE the graphics etc before going live, making sure it is correct etc...