Facility Control

 View Only
  • 1.  Visual Logic Switch Block with Custom Code

    Posted 08-21-2023 15:00

    I am using a Switch block in Visual Logic to trigger some custom functions that I've set up in the API. The code fails because of missing semi-colons that the visual logic seems to fail to include, only for my custom code calls though. I can add them manually but I really don't want to break the visual logic function. First section of code is VL tied to my button. Second section is the custom function.

    switch (params.getValue('dayPart', 0))
    {
    	case 0:
    		if (new Date().getTime() > new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),00,00,0,0).getTime() && new Date().getTime() < new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),09,00,0,0).getTime()) { takeTess1(100001) takeTess2(200001) ogscript.debug("test h");
    		} else {  } if (new Date().getTime() > new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),09,01,0,0).getTime() && new Date().getTime() < new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),12,00,0,0).getTime()) { takeTess1(100002) takeTess2(200002) ogscript.debug("test g");
    		} else {  } if (new Date().getTime() > new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),12,01,0,0).getTime() && new Date().getTime() < new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),15,00,0,0).getTime()) { takeTess1(100003) takeTess2(200003) ogscript.debug("test f");
    		} else {  } if (new Date().getTime() > new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),15,01,0,0).getTime() && new Date().getTime() < new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),23,59,0,0).getTime()) { takeTess1(100004) takeTess2(200004) ogscript.debug("test e");
    		} else {  } break;
    	case 1:
    		takeTess1(100001) takeTess2(200001) ogscript.debug("test d");
    		break;
    	case 2:
    		takeTess1(100002) takeTess2(200002) ogscript.debug("test c");
    		break;
    	case 3:
    		takeTess1(100003) takeTess2(200003) break;
    	case 4:
    		takeTess1(100004) takeTess2(200004) ogscript.debug("test a");
    		ogscript.debug("test b");
    		break;
    }

    <api>
    function takeTess1(takeID1) {
    	/*-arg takeID1: { "type": "STRING",  "widget": "text",  "value": "123456"} -*/
    
    	/*! block id=1110 !*/
    	rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'tessera1.host'), parseInt(ogscript.getPrivateString('hosts', 'tessera1.port')), 'TAKE ' + takeID1);
    	/*! block id=1115 !*/
    	ogscript.debug("Tess 1 Take " + takeID1);
    	/*!!
     	&lt;block id="1110" type="customcode" x="10" y="10" w="971" CODE="rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'tessera1.host'), parseInt(ogscript.getPrivateString('hosts', 'tessera1.port')), 'TAKE ' + takeID1);" /&gt;
    	&lt;block id="1115" type="customcode" x="10" y="174" w="343" CODE="ogscript.debug(&amp;amp;quot;Tess 1 Take &amp;amp;quot; + takeID1);" /&gt;
    	!!*/
    }


    ------------------------------
    Joshua Coats
    Newsroom Artist Supervisor
    Scripps News
    Atlanta United States
    ------------------------------


  • 2.  RE: Visual Logic Switch Block with Custom Code

    Posted 08-21-2023 17:14

    Hi Joshua

    This issue should be resolved as of DashBoard 9.6.0  (the current release is 9.6.1).

    If possible, please confirm you're running the latest version and try again. If the issue is still occurring for you, we will want to investigate further.

    Cheers

    James



    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 3.  RE: Visual Logic Switch Block with Custom Code

    Posted 08-21-2023 17:31

    I was on 9.2! That did the trick. Thanks @James Peltzer🤘

    P.S. should I be worried about the red square next to the tab name? 



    ------------------------------
    Joshua Coats
    Newsroom Artist Supervisor
    Scripps News
    Atlanta United States
    ------------------------------