V 10
1
LANG:1 8 (NoName)
PANEL,341 71 244 200 N "_3DFace" 0
EEE E E 1 -1 -1 0  40 100
"" 0 1
EE 2
"CBRef""1"
"EClose"E
""
DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
LAYER, 0 
1
LANG:1 6 Layer1
6 17
"Border1"
""
1 10 150 E E E 1 E 1 E N {0,0,0} E N {204,204,255} E E
 E E
17 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 10 10 210 150
2 30
"Text2"
""
1 24 60 E E E 1 E 1 E N {0,0,0} E N {204,204,255} E E
 E E
29 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 26 62 204 77
0 2 0 "s" 0 0 0 192 0 0  26 62
 1
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
1
LANG:1 34 crate | channel |  State | timeout
13 24
"Button4"
""
1 30 20 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
23 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
28 18 112 52
T 
1
LANG:1 10 TRIGGER ST
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

// SimpleCtrlScriptEnd {EP_toggleDP}

EP_setDP()
{
dyn_errClass err;
bool state;

  dpGet(\"SCTmops1:changeState.trigger:_original.._value\", state);
  if (state==1) {
    dpSetWait(\"SCTmops1:changeState.trigger:_original.._value\", 0);
     DebugN(\"Trigger has changed to 0\");
     }
  else {
     dpSetWait(\"SCTmops1:changeState.trigger:_original.._value\", 1);
     DebugN(\"Trigger has changed to 1\");
     }
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_setDP}
// DP1 {SCTmops1:ChangeState.trigger}
// Config1 {:_original.._value}
// Type1 {bool}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
14 28
"TextField1"
""
1 24 87 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
27 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
22 85 186 111
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {valid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

  if( dpSubStr( \"SCTmops1:changeState.parameters:_online.._value\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

  dpConnect(\"EP_textFieldInCB\",
            \"SCTmops1:changeState.parameters:_online.._value\");
  err = getLastError();
  if (dynlen(err) > 0)
    setValue(\"\", \"color\", \"_dpdoesnotexist\");

}


EP_textFieldInCB(string dp, string sNewValue)
{
  setValue(\"\", \"text\", sNewValue);
}

EP_setInvalid()
{
dyn_errClass err;

  if( dpSubStr( \"SCTmops1:changeState.parameters:_online.._invalid\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:changeState.parameters:_online.._invalid\");
  err = getLastError();
  if (dynlen(err) > 0)
    setValue(\"\", \"color\", \"_dpdoesnotexist\");

}

EP_setInvalidCB(string dp, bool boInvalid)
{
  setValue(\"\", \"color\", (boInvalid ? \"_invalid\" : \"\"));
}

// SimpleCtrlScript {EP_textFieldIn}
// DP {SCTmops1:changeState.parameters}
// DPConfig {:_online.._value}
// DPType {string}
// UseDPUnit {FALSE}
// UseDPFormat {FALSE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:changeState.parameters}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldOut();
}

EP_textFieldOut()
{
string sNewValue;
dyn_errClass err;

  getValue(\"\", \"text\", sNewValue);
  dpSetWait(\"changeState.parameters:_original.._value\", sNewValue);
  DebugN(sNewValue);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:ChangeState.parameters}
// Config {:_original.._value}
// DPType {string}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

25 33
"Table1"
""
1 58 17 E E E 1 E 1 E N "_WindowText" E N {204,204,255} E E
 E E
32 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
21 114 202 142
"main()
{
  EP_textFieldIn();
}


EP_textFieldIn()
{
dyn_errClass err;


  dpConnect(\"EP_textFieldInCB\",
            \"SCTmops1:changeState.parameters:_online.._value\");
  err = getLastError();
  if (dynlen(err) > 0)
    setValue(\"\", \"color\", \"_dpdoesnotexist\");

}


EP_textFieldInCB(string dp, string sInfo )
{
  int row,col;
  time t;
  string tim;
  int iState,crate,channel,timeout;
  string allChannels;
  string info, values;
  dyn_string para_split;



//Get Values from DAQ
dpGet(\"changeState.parameters:_original.._value\", values);
para_split=strsplit(values,\"|\");
//DebugN(\"sParameter\", sParameter);

//Split string and get status. The format of the parameters send by DDC is Crate|Channel|State
 
sscanf(para_split[1],\"%d\", crate);
sscanf(para_split[2],\"%s\", allChannels);
sscanf(para_split[3],\"%d\", iState);
sscanf(para_split[4],\"%d\", timeout);

  getValue(\"\", \"currentCell\", row, col);
    t=getCurrentTime();
	  tim=formatTime(\"%H:%M:%S\", t); 

//DebugN(iState);

if (iState==0){
	setValue(\"\", \"appendLine\", row, \"#1\", tim, \"#2\", \"OFF\");
   info==\"RST: OFF\";
   }
if (iState==1){
	setValue(\"\", \"appendLine\", row, \"#1\", tim, \"#2\", \"ON\");
   info==\"RST: ON\";
   } 
if (iState==2){
	setValue(\"\", \"appendLine\", row, \"#1\", tim, \"#2\", \"ERROR:STB1\");
   info==\"ERROR: STB1\";
   }
if (iState==4){
	setValue(\"\", \"appendLine\", row, \"#1\", tim, \"#2\", \"STB2\");
   info==\"RST: STB2\";
   } 
if (iState==5){
	setValue(\"\", \"appendLine\", row, \"#1\", tim, \"#2\", \"STB2\");
   info==\"RST: STB2\";
   }    
    
}



" 0
 E 0 0 1 2 1 "#1" 0 1 0 "s" 1
LANG:1 2 #1
E1
LANG:1 0 
 80 "#2" 0 1 0 "s" 1
LANG:1 2 #2
E1
LANG:1 0 
 200 25 25 "" 1 1
LANG:1 2 #1
8 18 1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
0 1 0 0 0
1 0
0
LAYER, 1 
1
LANG:1 6 Layer2
0
LAYER, 2 
1
LANG:1 6 Layer3
0
LAYER, 3 
1
LANG:1 6 Layer4
0
LAYER, 4 
1
LANG:1 6 Layer5
0
LAYER, 5 
1
LANG:1 6 Layer6
0
LAYER, 6 
1
LANG:1 6 Layer7
0
LAYER, 7 
1
LANG:1 6 Layer8
0
0