V 10
1
LANG:1 8 (NoName)
PANEL,440 200 229 396 N "_3DFace" 0
EEE E E 1 -1 -1 0  30 70
"" 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 21
"Border1"
""
1 10 340 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
20 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 340
2 48
"Text1"
""
1 10 10 E E E 1 E 1 E N {0,0,0} E N {178,178,178} E E
 E E
43 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 12 12 208 33
1 2 0 "s" 0 0 0 65 0 0  12 12
 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 15 Long Term Tests
2 53
"Text2"
""
1 20 43 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
48 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 22 45 89 60
0 2 0 "s" 0 0 0 192 0 0  22 45
 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 11 Nb of Loops
2 54
"Text3"
""
1 20 69 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
49 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 22 71 129 86
0 2 0 "s" 0 0 0 192 0 0  22 71
 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 19 Time Interval > 30s
2 60
"Text57"
""
1 41 199 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
54 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  0 E 43 201 89 214
0 2 0 "s" 0 0 0 64 0 0  43 201
 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 4 Vcc 
2 61
"Text58"
""
1 41 226 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
55 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  0 E 43 228 89 241
0 2 0 "s" 0 0 0 64 0 0  43 228
 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 4 Vdd 
2 62
"Text59"
""
1 31 252 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
56 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  0 E 33 254 89 270
0 2 0 "s" 0 0 0 64 0 0  33 254
 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 6 VCSEL 
2 63
"Text60"
""
1 21 275 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
57 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  0 E 23 277 89 293
0 2 0 "s" 0 0 0 64 0 0  23 277
 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 9 PIN Bias 
2 72
"Text92"
""
1 51 301 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
65 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  0 E 53 303 89 329
0 2 0 "s" 0 0 0 64 0 0  53 303
 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 2 HV
2 91
"Text5"
""
1 80 178 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
83 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  0 E 82 180 128 193
0 2 0 "s" 0 0 0 64 0 0  82 180
 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 3 Low
2 92
"Text6"
""
1 130 178 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
84 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  0 E 132 180 178 193
0 2 0 "s" 0 0 0 64 0 0  132 180
 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 4 High
2 94
"Text4"
""
1 187 67 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
85 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 189 69 196 84
0 2 0 "s" 0 0 0 192 0 0  189 69
 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 1 s
2 95
"Text7"
""
1 171 201 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
86 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 173 203 181 218
0 2 0 "s" 0 0 0 192 0 0  173 203
 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 1 V
2 96
"Text8"
""
1 171 225 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
87 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 173 227 181 242
0 2 0 "s" 0 0 0 192 0 0  173 227
 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 1 V
2 97
"Text9"
""
1 171 249 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
88 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 173 251 181 266
0 2 0 "s" 0 0 0 192 0 0  173 251
 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 1 V
2 98
"Text10"
""
1 171 273 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
89 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 173 275 181 290
0 2 0 "s" 0 0 0 192 0 0  173 275
 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 1 V
2 99
"Text11"
""
1 171 297 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
90 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 173 299 181 314
0 2 0 "s" 0 0 0 192 0 0  173 299
 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 1 V
13 51
"Button8"
""
1 20 95 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
46 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 ""
18 93 112 122
T 
1
LANG:1 6 ON/OFF
"// SimpleCtrlScriptStart {invalid}
main()
{

int iState, i, NbLoops, TimeInt, crate, channel, timeout, trigger;
string  allChannels, sParameter;
string max, on, off, stb;
dyn_string para_split;
 
//NbLoops=100;
//TimeInt=5;

DebugN(\"\", \"- CS- Starting Long Term Testing...\");
dpSet(\"Info.Name:_original.._value\", \"- CS- Starting Long Term Testing...\");

dpGet(\"Test.Numb:_original.._value\", NbLoops);
dpGet(\"Test.Indx:_original.._value\", TimeInt);
//DebugN(\" Loops\",NbLoops,TimeInt);

    //Get Values from DAQ
    dpGet(\"changeState.parameters:_original.._value\", sParameter);
    //dpGet(\"changeState.trigger:_original.._value\", trigger);
    dpSetWait(\"changeState.trigger:_original.._value\", 0);
    


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

allChannels=\"all\";
setValue(\"\", \"backCol\", \"Red\");
DebugN(\"- CS- Started\");

for (i=0; i< NbLoops; i++) {
   
//DebugN(\"- X0- Parameters\", sNewValue, iState);

   if (iState==0){
      iState=1;
      //DebugN(\"- CS1- Parameters\", sNewValue, iState);
      sprintf(on, \"%02d|%02s|%02d|%02d\", crate, allChannels, iState, timeout);
       stb=\"0|all|2|20\";
      dpSetWait(\"changeState.parameters:_original.._value\", stb);
      dpSetWait(\"changeState.trigger:_original.._value\", 1);
      delay(10,0); 
      DebugN(\"standby2\");
      dpSetWait(\"changeState.parameters:_original.._value\", on);
      dpSetWait(\"changeState.trigger:_original.._value\", 1);
    delay(1,0);  
      DebugN(\"- CS- Turning channels on\", on);
      dpSet(\"Info.Name:_original.._value\", \"- CS- Turning channels on\");
      }
   else if (iState==1) {
      iState=0;
      //DebugN(\"- CS2- Parameters\", sNewValue, iState); 
      sprintf(off, \"%02d|%02s|%02d|%02d\", crate, allChannels, iState, timeout);
      stb=\"0|all|4|20\";
      dpSetWait(\"changeState.parameters:_original.._value\", stb);
      dpSetWait(\"changeState.trigger:_original.._value\", 1);
      delay(10,0); 
      DebugN(\"standby4\");
      dpSetWait(\"changeState.parameters:_original.._value\", off);
      dpSetWait(\"changeState.trigger:_original.._value\", 1);
    delay(1,0); 
      DebugN(\"- CS- Turning channels off\", off);
      dpSet(\"Info.Name:_original.._value\", \"- CS- Turning channels off\");
      }
      delay(TimeInt,0); 
      dpSetWait(\"changeState.trigger:_original.._value\", 0);

   }  
   setValue(\"\", \"backCol\", \"{214,211,206}\");
   DebugN(\"- CS- Finished\");
}


// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
14 58
"NbofLoops"
""
1 134 39 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
53 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 ""
132 37 186 63
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {valid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, int iNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, iNewValue, FALSE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:Test.Numb:_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:Test.Numb}
// DPConfig {:_online.._value}
// DPType {int}
// UseDPUnit {FALSE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:Test.Numb}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
int iNewValue;
dyn_errClass err;
string sTmp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%d\", iNewValue);

  if( iNewValue != sTmp )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:Test.Numb:_original.._value\", iNewValue);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:Test.Numb}
// Config {:_online.._value}
// DPType {int}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 59
"TextField1"
""
1 242 115 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
54 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 ""
132 63 186 89
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, int iNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, iNewValue, FALSE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:Test.Indx:_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:Test.Indx}
// DPConfig {:_online.._value}
// DPType {int}
// UseDPUnit {FALSE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:Test.Indx}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
int iNewValue;
dyn_errClass err;
string sTmp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%d\", iNewValue);

  if( iNewValue != sTmp )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }
if(iNewValue<5)
{
 setValue(\"\", \"text\", \"too low\");
}
if(iNewValue>=5)
{
  dpSetWait(\"SCTmops1:Test.Indx:_original.._value\", iNewValue);
} 
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:Test.Numb}
// Config {:_online.._value}
// DPType {int}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 64
"TextField8"
""
1 81 198 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
58 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 ""
79 196 123 222
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {valid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.Vcc.Low:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.Vcc.Low:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.Vcc.Low:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 78
"TextField6"
""
1 81 223 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
70 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 ""
79 221 123 247
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.Vdd.Low:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.Vdd.Low:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.Vdd.Low:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 79
"TextField7"
""
1 81 248 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
71 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 ""
79 246 123 272
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.VCSL.Low:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.VCSL.Low:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.VCSL.Low:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 80
"TextField9"
""
1 81 273 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
72 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 ""
79 271 123 297
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.PINV.Low:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.PINV.Low:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.PINV.Low:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 81
"TextField11"
""
1 81 298 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
73 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 ""
79 296 123 322
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.HV.Low:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.HV.Low:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.HV.Low:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 82
"TextField12"
""
1 129 198 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
74 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 ""
127 196 171 222
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.Vcc.High:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.Vcc.High:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.Vcc.High:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 83
"TextField13"
""
1 129 223 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
75 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 ""
127 221 171 247
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.Vdd.High:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.Vdd.High:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.Vdd.High:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 84
"TextField14"
""
1 129 248 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
76 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 ""
127 246 171 272
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.VCSL.High:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.VCSL.High:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.VCSL.High:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 85
"TextField15"
""
1 129 273 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
77 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 ""
127 271 171 297
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.PINV.High:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.PINV.High:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.PINV.High:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

14 86
"TextField16"
""
1 129 298 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
78 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 ""
127 296 171 322
3 "s" 0 0 0 0 0 0 
E
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_textFieldIn();
  EP_setInvalid();
}

EP_textFieldIn()
{
dyn_errClass err;

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

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

}


EP_textFieldInCB(string dp, float fNewValue)
{
  setValue(\"\", \"text\", dpValToString(dp, fNewValue, TRUE) );
}

EP_setInvalid()
{
dyn_errClass err;

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

  dpConnect(\"EP_setInvalidCB\",
            \"SCTmops1:LTT.HV.High:_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:LTT.Vcc.Low}
// DPConfig {:_online.._value}
// DPType {float}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
// SimpleCtrlScript {EP_setInvalid}
// DP {SCTmops1:LTT.Vcc.Low}
// DPConfig {:_online.._invalid}
// DPType {bool}
// Attribut {color}
// SimpleCtrlScriptEnd {EP_setInvalid}
" 0

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

EP_textFieldOut()
{
float fNewValue;
dyn_errClass err;
string sTmp;
string sFormat, sDp;

  getValue(\"\", \"text\", sTmp);
  sscanf(sTmp, \"%f\", fNewValue);

  sDp = dpSubStr(\"SCTmops1:LTT.HV.High:_original.._value\",  DPSUB_SYS_DP_EL);
  if ( strpos(sDp,\".\") < 1 )
    sDp += \".\";

  sFormat = dpGetFormat( sDp );
  if( !checkStringFormat(sTmp, sFormat) )
  {
    ChildPanelOnCentral( \"vision/MessageWarning\",
                         getCatStr( \"e_para\", \"warning\" ),
                         makeDynString( getCatStr( \"e_para\", \"wrongFormat\" )));
    return;
  }

  dpSetWait(\"SCTmops1:LTT.HV.High:_original.._value\", sTmp);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
}

// SimpleCtrlScript {EP_textFieldOut}
// DP {SCTmops1:LTT.Vcc.Low}
// Config {:_original.._value}
// DPType {float}
// SimpleCtrlScriptEnd {EP_textFieldOut}
" 0

13 88
"Button1"
""
1 110 95 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
80 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 ""
108 93 202 122
T 
1
LANG:1 8 High/Low
"// SimpleCtrlScriptStart {invalid}
main()
{

int iState, i, NbLoops, TimeInt, sStartPoint;
//float sStartPoint;

dpGet(\"Test.Numb:_original.._value\", NbLoops);
dpGet(\"Test.Indx:_original.._value\", TimeInt);
//DebugN(\" Loops\",NbLoops,TimeInt);

//Set to start running from high values
//dpSet(\"ToggleState.parameters:_original.._value\", 1);

// Set background coulor to red
setValue(\"\", \"backCol\", \"Red\");
DebugN(\"- TS - Started\");
dpSet(\"Info.Name:_original.._value\", \"- TS - Started\");

// Start from somewhere
//iState = 1;
//dpSet(\"ToggleState.trigger:_original.._value\", iState);

//Loop the action
for (i=0; i< NbLoops; i++) {

dpGet(\"ToggleState.parameters:_original.._value\", sStartPoint);
dpGet(\"ToggleState.trigger:_original.._value\", iState);
//DebugN(\"- X0- Parameters\", sStartPoint, iState);

   if (sStartPoint==\"0\"){
      sStartPoint=\"1\";
 //     DebugN(\"- X1- Parameters\", sStartPoint, iState);
      dpSetWait(\"ToggleState.parameters:_original.._value\", sStartPoint,
                \"ToggleState.trigger:_original.._value\", 1);
      //dpSet(\"Info.Name:_original.._value\", \"LTT: Setting PS channels high\");
    delay(5,0);  
//      DebugN(\"- LTT- Setting PS channels high\");
      }
   else {
      sStartPoint=\"0\";
      //DebugN(\"- X2- Parameters\", sStartPoint, iState); 
      dpSetWait(\"ToggleState.parameters:_original.._value\", sStartPoint,
                \"ToggleState.trigger:_original.._value\", 1);
      //dpSet(\"Info.Name:_original.._value\", \"LTT: Setting PS channels low\");
    delay(5,0); 
      //DebugN(\"- LTT- Setting PS channels low\");
      }
      delay(TimeInt,0); 
      dpSetWait(\"ToggleState.trigger:_original.._value\", 0); 
   
 }  
   setValue(\"\", \"backCol\", \"{214,211,206}\");
   DebugN(\"- TS - Finished\");
   dpSet(\"Info.Name:_original.._value\", \"- TS - Finished\");
}



// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 93
"Button2"
""
1 20 120 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
84 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 ""
18 118 112 147
T 
1
LANG:1 11 ON/OFF/Save
"// SimpleCtrlScriptStart {invalid}
main()
{

int iState, i, NbLoops, TimeInt, crate, channel, timeout, trigger;
string  allChannels, sParameter;
string max, on, off, stb;
dyn_string para_split;
 
//NbLoops=100;
//TimeInt=5;

dpGet(\"Test.Numb:_original.._value\", NbLoops);
dpGet(\"Test.Indx:_original.._value\", TimeInt);
//DebugN(\" Loops\",NbLoops,TimeInt);
//getValue()
//  getValue(\"\", \"text\", sTmp);
//  sscanf(sTmp, \"%d\", iNewValue);

setValue(\"\", \"backCol\", \"Red\");
DebugN(\"- CS- Started\");

    //Get Values from DAQ
    dpGet(\"changeState.parameters:_original.._value\", sParameter);
    //dpGet(\"changeState.trigger:_original.._value\", trigger);
    dpSetWait(\"changeState.trigger:_original.._value\", 0);
    
    //Split string and get status. The format of the parameters send by DDC is Crate|Channel|State|timeout
    para_split = strsplit(sParameter,\"|\");
    DebugN(\"sParameter\", sParameter);
    sscanf(para_split[1],\"%d\", crate);
    sscanf(para_split[2],\"%s\", allChannels);
    sscanf(para_split[3],\"%d\", iState);
    sscanf(para_split[4],\"%d\", timeout);
    //DebugN(\"iState\", iState);


Save_Init();

for (i=0; i< NbLoops; i++) {

   if (iState==0){
      iState=1;
      //DebugN(\"- CS1- Parameters\", sNewValue, iState);
      sprintf(on, \"%02d|%02s|%02d|%02d\", crate, allChannels, iState, timeout);
       stb=\"0|all|2|20\";
      dpSetWait(\"changeState.parameters:_original.._value\", stb);
      dpSetWait(\"changeState.trigger:_original.._value\", 1);
      delay(10,0); 
      DebugN(\"standby2\");
      dpSetWait(\"changeState.parameters:_original.._value\", on);
      dpSetWait(\"changeState.trigger:_original.._value\", 1);
    delay(12,0);
     Read(); 
     Save_Values();   
      DebugN(\"- CS- Turning channels on\", on);
      dpSet(\"Info.Name:_original.._value\", \"- CS- Turning channels on\");
      }

   else if (iState==1) {
      iState=0;
      //DebugN(\"- CS2- Parameters\", sNewValue, iState); 
      sprintf(off, \"%02d|%02s|%02d|%02d\", crate, allChannels, iState, timeout);
      stb=\"0|all|4|20\";
      dpSetWait(\"changeState.parameters:_original.._value\", stb);
      dpSetWait(\"changeState.trigger:_original.._value\", 1);
     delay(10,0); 
      DebugN(\"standby4\");
      dpSetWait(\"changeState.parameters:_original.._value\", off);
      dpSetWait(\"changeState.trigger:_original.._value\", 1);
     delay(12,0);
      Read(); 
      Save_Values();  
      DebugN(\"- CS- Turning channels off\", off);
      dpSet(\"Info.Name:_original.._value\", \"- CS- Turning channels off\");
      }
      delay(TimeInt,0); 
      dpSetWait(\"changeState.trigger:_original.._value\", 0);

   }  
   setValue(\"\", \"backCol\", \"{214,211,206}\");
   DebugN(\"- CS- Finished\");
}

Read() {

int i,icard, channel, statusLV, statusHV,statusLVCard, crate;
string datapoint;

//Get crate number
dpGet(\"Crate.Numb:_online.._value\", crate);

delay(10);
for (i=0; i<=47; i++){
    // Read all HV  and LV channel values
    sprintf(datapoint, \"Crate%02d.Controller.CCchRead.Send:_original.._value\", crate);
    dpSetWait(datapoint,i);
    delay(0,50);
    channel=i+64;
    dpSetWait(datapoint, channel);
    delay(0,50);
    //Read all values from cards
    //icard=i/4;
  }
}

Save_Values()
{
int i,j, crate;
dyn_float fValues_dp;
dyn_string sNames_dp;
string filename, filename1, channelAddress;
file TestFile, TestFile1, ErrorFile;
time t, tm1;
string tim, date;
string systemName = getSystemName();
int LVchStat, HVchStat;
float LVch_Vcc, LVps_Vcc, LVretVcc, LVch_Icc,
      LVch_Vdd, LVps_Vdd, LVretVdd, LVch_Idd, LVchVCSV,
      LVchVCSI, LVchPINV, LVchPINI, MOch_Tm0, MOch_Tm1,
      HVchVolt, HVchCurr;

DebugN(\"Saving Values...\");

//Get crate number
dpGet(\"Crate.Numb:_online.._value\", crate);

//iLV = hv/4;
//iHV = hv/8;

t=getCurrentTime();
//dpGet(date, tm1);
tim=formatTime(\"%H:%M:%S\", t);
date = formatTime(\"%Y%m%d\", tm1);

//DebugN(\"tim\", tim, \"date\", date);
 
//err = ferror(f); // export error
//DebugN(\"File Cnf_ParaV.txt did not open / correctly\");       

//fprintf(TestFile, \"%f\\n\", tim);

      // Read all channels
      for (i=0;i<=47;i++) {
      
          //Read all values for one channel
//          sprintf(filename, \"D:/SCT_DCS_DATA/LLT/CHAN%02d_LLT.txt\",i);
            sprintf(filename, \"D:/SCT_DCS_DATA/LTT/CRATE%02d_CHAN%02d_LTT.txt\",crate, i); 
 //        DebugN(\"filename\", filename);
          TestFile = fopen(filename,\"a\");  
        
          // make datapoint name
          sprintf(channelAddress,\"Crate%02d.Channel%02d\", crate, i);
          
          // get values
          dpGet(systemName+channelAddress+\".LVchStat.Recv:_original.._value\", LVchStat,
                systemName+channelAddress+\".LVch_Vcc.Recv:_original.._value\", LVch_Vcc,
                systemName+channelAddress+\".LVps_Vcc.Recv:_original.._value\", LVps_Vcc,
                systemName+channelAddress+\".LVretVcc.Recv:_original.._value\", LVretVcc,
                systemName+channelAddress+\".LVch_Icc.Recv:_original.._value\", LVch_Icc,
                systemName+channelAddress+\".LVch_Vdd.Recv:_original.._value\", LVch_Vdd,
                systemName+channelAddress+\".LVps_Vdd.Recv:_original.._value\", LVps_Vdd,
                systemName+channelAddress+\".LVretVdd.Recv:_original.._value\", LVretVdd,
                systemName+channelAddress+\".LVch_Idd.Recv:_original.._value\", LVch_Idd,
                systemName+channelAddress+\".LVchVCSV.Recv:_original.._value\", LVchVCSV,
                systemName+channelAddress+\".LVchVCSI.Recv:_original.._value\", LVchVCSI,
                systemName+channelAddress+\".LVchPINV.Recv:_original.._value\", LVchPINV,
                systemName+channelAddress+\".LVchPINI.Recv:_original.._value\", LVchPINI,
                systemName+channelAddress+\".MOch_Tm0.Recv:_original.._value\", MOch_Tm0,
                systemName+channelAddress+\".MOch_Tm1.Recv:_original.._value\", MOch_Tm1,
                systemName+channelAddress+\".HVchStat.Recv:_original.._value\", HVchStat,
                systemName+channelAddress+\".HVchVolt.Recv:_original.._value\", HVchVolt,
                systemName+channelAddress+\".HVchCurr.Recv:_original.._value\", HVchCurr);      
 //         DebugN(LVchStat, \"LVchStat\");      
          // save in file:
         fprintf(TestFile, \"%s\\t%s\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\n\",
                 date, tim, i, 
                 LVchStat, LVch_Vcc, LVps_Vcc, LVretVcc,LVch_Icc, LVch_Vdd, LVps_Vdd,
                 LVretVdd, LVch_Idd, LVchVCSV, LVchVCSI, LVchPINV, LVchPINI, MOch_Tm0, 
                 MOch_Tm1, HVchStat,HVchVolt, HVchCurr);
          fclose(TestFile);
          
          // Save values if there is an error in the status:
          //if ((LVchStat&192) || (LVchStat&128) || (LVchStat&0) || (HVchStat>3)) {
          if ((LVchStat&192) || (LVchStat&128) || (LVchStat==0) || (HVchStat>3)) {
             }
          else {           
             sprintf(filename1, \"D:/SCT_DCS_DATA/LTT/CRATE%02d_LTTerror.txt\", crate);
             ErrorFile = fopen(filename1,\"a\");
             fprintf(ErrorFile, \"%s\\t%s\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\n\",
                    date, tim, i, 
                    LVchStat, LVch_Vcc, LVps_Vcc, LVretVcc,LVch_Icc, LVch_Vdd, LVps_Vdd,
                    LVretVdd, LVch_Idd, LVchVCSV, LVchVCSI, LVchPINV, LVchPINI, MOch_Tm0, 
                    MOch_Tm1, HVchStat,HVchVolt, HVchCurr);
             fclose(ErrorFile);
             }
         
          
//		  if (err!=0) DebugN(\"Error no. \",err,\" occurred\");
          }
                      
//fprintf(TestFile, \"%f\\n\", tim);
   

}

Save_Init()
{
int i, crate;
string filename, filename1;
file TestFile, ErrorFile;
string date;
time tm1;

string all = \"date	tim	i	LVchStat	LVch_Vcc	LVps_Vcc	LVretVcc	LVch_Icc	LVch_Vdd	LVps_Vdd	LVretVdd	LVch_Idd	LVchVCSL	LVchVCSI	LVchPINV	LVchPINI	MOch_Tm0	MOch_Tm1	HVchStat	HVchVolt	HVchCurr\";
//DebugN(\"all\", all);

date = formatTime(\"%Y%m%d\", tm1);
dpGet(\"Crate.Numb:_original.._value\", crate);

DebugN(\"Saving Inital parameters...\");

//err = ferror(f); // export error
//DebugN(\"File Cnf_ParaV.txt did not open / correctly\");       

//fprintf(TestFile, \"%f\\n\", tim);

      // Read all channels
      for (i=0;i<=47;i++) {
      
          //Read all values for one channel
          sprintf(filename, \"D:/SCT_DCS_DATA/LTT/CRATE%02d_CHAN%02d_LTT.txt\",crate, i);
          
 //         fprintf(TestFile, \"%s\\t%f\\n\", date, i);
         
          TestFile = fopen(filename,\"a\");
          fprintf(TestFile, \"\\n%s\\n\", all);
//          fprintf(TestFile, \"%s\", all);
         
          fclose(TestFile); 
		  }
//save error file
      sprintf(filename1, \"D:/SCT_DCS_DATA/LTT/CRATE%02d_LTTerror.txt\",crate);
      ErrorFile = fopen(filename1,\"a\");
      fprintf(ErrorFile, \"\\n%s\\n\", all);
      fclose(ErrorFile);

}


// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 90
"HLsave"
""
1 110 120 E E E 1 E 1 E N {0,0,0} E N {214,211,206} E E
 E E
82 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 ""
108 118 202 147
T 
1
LANG:1 13 High/Low/Save
"// SimpleCtrlScriptStart {invalid}
main()
{

int iState, i, NbLoops, TimeInt, sStartPoint;

dpGet(\"Test.Numb:_original.._value\", NbLoops);
dpGet(\"Test.Indx:_original.._value\", TimeInt);
             //DebugN(\" Loops\",NbLoops,TimeInt);

// Set background coulor to red
setValue(\"\", \"backCol\", \"Red\");
DebugN(\"- TS - Started\");
dpSet(\"Info.Name:_original.._value\", \"- TS - Started\");

Save_Init();

//Loop the action
for (i=0; i< NbLoops; i++) {

dpGet(\"ToggleState.parameters:_original.._value\", sStartPoint);
dpGet(\"ToggleState.trigger:_original.._value\", iState);
              //DebugN(\"- X0- Parameters\", sStartPoint, iState);

   if (sStartPoint==\"0\"){
      sStartPoint=\"1\";
      dpSetWait(\"ToggleState.parameters:_original.._value\", sStartPoint,
                \"ToggleState.trigger:_original.._value\", 1);
    delay(3,0);  
               //DebugN(\"- LTT- Setting PS channels high\");
      // Read values and save
      Read();
      Save_Values();
      }
   else {
      sStartPoint=\"0\"; 
      dpSetWait(\"ToggleState.parameters:_original.._value\", sStartPoint,
                \"ToggleState.trigger:_original.._value\", 1);
    delay(3,0); 
               //DebugN(\"- LTT- Setting PS channels low\");
      // Read values and save 
      Read();
      Save_Values();
      }
      delay(TimeInt,0); 
      dpSetWait(\"ToggleState.trigger:_original.._value\", 0); 
   
 }  
   setValue(\"\", \"backCol\", \"{214,211,206}\");
   DebugN(\"- TS - Finished\");
   dpSet(\"Info.Name:_original.._value\", \"- TS - Finished\");
}


Read() {

int i,icard, channel, statusLV, statusHV,statusLVCard, crate;
string datapoint;

//Get crate number
dpGet(\"Crate.Numb:_online.._value\", crate);

delay(10);
for (i=0; i<=47; i++){
    // Read all HV  and LV channel values
    sprintf(datapoint, \"Crate%02d.Controller.CCchRead.Send:_original.._value\", crate);
    dpSetWait(datapoint,i);
    delay(0,50);
    channel=i+64;
    dpSetWait(datapoint, channel);
    delay(0,50);
    //Read all values from cards
    //icard=i/4;
  }
}

Save_Values()
{
int i,j, crate;
dyn_float fValues_dp;
dyn_string sNames_dp;
string filename, filename1, channelAddress;
file TestFile, TestFile1, ErrorFile;
time t, tm1;
string tim, date;
string systemName = getSystemName();
int LVchStat, HVchStat;
float LVch_Vcc, LVps_Vcc, LVretVcc, LVch_Icc,
      LVch_Vdd, LVps_Vdd, LVretVdd, LVch_Idd, LVchVCSV,
      LVchVCSI, LVchPINV, LVchPINI, MOch_Tm0, MOch_Tm1,
      HVchVolt, HVchCurr;

DebugN(\"Saving Values...\");

//Get crate number
dpGet(\"Crate.Numb:_online.._value\", crate);
//iLV = hv/4;
//iHV = hv/8;

t=getCurrentTime();
//dpGet(date, tm1);
tim=formatTime(\"%H:%M:%S\", t);
date = formatTime(\"%Y%m%d\", tm1);

//DebugN(\"tim\", tim, \"date\", date);
 
//err = ferror(f); // export error
//DebugN(\"File Cnf_ParaV.txt did not open / correctly\");       

//fprintf(TestFile, \"%f\\n\", tim);

      // Read all channels
      for (i=0;i<=47;i++) {
      
          //Read all values for one channel
//          sprintf(filename, \"D:/SCT_DCS_DATA/LLT/CHAN%02d_LLT.txt\",i);
            sprintf(filename, \"D:/SCT_DCS_DATA/LTT/CRATE%02d_CHAN%02d_LTT.txt\",crate, i); 
 //        DebugN(\"filename\", filename);
          TestFile = fopen(filename,\"a\");  
        
          // make datapoint name
          sprintf(channelAddress,\"Crate%02d.Channel%02d\", crate, i);
          
          // get values
          dpGet(systemName+channelAddress+\".LVchStat.Recv:_original.._value\", LVchStat,
                systemName+channelAddress+\".LVch_Vcc.Recv:_original.._value\", LVch_Vcc,
                systemName+channelAddress+\".LVps_Vcc.Recv:_original.._value\", LVps_Vcc,
                systemName+channelAddress+\".LVretVcc.Recv:_original.._value\", LVretVcc,
                systemName+channelAddress+\".LVch_Icc.Recv:_original.._value\", LVch_Icc,
                systemName+channelAddress+\".LVch_Vdd.Recv:_original.._value\", LVch_Vdd,
                systemName+channelAddress+\".LVps_Vdd.Recv:_original.._value\", LVps_Vdd,
                systemName+channelAddress+\".LVretVdd.Recv:_original.._value\", LVretVdd,
                systemName+channelAddress+\".LVch_Idd.Recv:_original.._value\", LVch_Idd,
                systemName+channelAddress+\".LVchVCSV.Recv:_original.._value\", LVchVCSV,
                systemName+channelAddress+\".LVchVCSI.Recv:_original.._value\", LVchVCSI,
                systemName+channelAddress+\".LVchPINV.Recv:_original.._value\", LVchPINV,
                systemName+channelAddress+\".LVchPINI.Recv:_original.._value\", LVchPINI,
                systemName+channelAddress+\".MOch_Tm0.Recv:_original.._value\", MOch_Tm0,
                systemName+channelAddress+\".MOch_Tm1.Recv:_original.._value\", MOch_Tm1,
                systemName+channelAddress+\".HVchStat.Recv:_original.._value\", HVchStat,
                systemName+channelAddress+\".HVchVolt.Recv:_original.._value\", HVchVolt,
                systemName+channelAddress+\".HVchCurr.Recv:_original.._value\", HVchCurr);      
 //         DebugN(LVchStat, \"LVchStat\");      
          // save in file:
         fprintf(TestFile, \"%s\\t%s\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\n\",
                 date, tim, i, 
                 LVchStat, LVch_Vcc, LVps_Vcc, LVretVcc,LVch_Icc, LVch_Vdd, LVps_Vdd,
                 LVretVdd, LVch_Idd, LVchVCSV, LVchVCSI, LVchPINV, LVchPINI, MOch_Tm0, 
                 MOch_Tm1, HVchStat,HVchVolt, HVchCurr);
          fclose(TestFile); 
//		  if (err!=0) DebugN(\"Error no. \",err,\" occurred\");
          // Save values if there is an error in the status:
          //if ((LVchStat&192) || (LVchStat&128) || (LVchStat&0) || (HVchStat>3)) {
          if ((LVchStat&192) || (LVchStat&128) || (LVchStat==0) || (HVchStat>3)) {
             }
          else {           
             sprintf(filename1, \"D:/SCT_DCS_DATA/LTT/CRATE%02d_LTTerror.txt\", crate);
             ErrorFile = fopen(filename1,\"a\");
             fprintf(ErrorFile, \"%s\\t%s\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\n\",
                    date, tim, i, 
                    LVchStat, LVch_Vcc, LVps_Vcc, LVretVcc,LVch_Icc, LVch_Vdd, LVps_Vdd,
                    LVretVdd, LVch_Idd, LVchVCSV, LVchVCSI, LVchPINV, LVchPINI, MOch_Tm0, 
                    MOch_Tm1, HVchStat,HVchVolt, HVchCurr);
             fclose(ErrorFile);
             }
         


          }
     
//fprintf(TestFile, \"%f\\n\", tim);
   

}

Save_Init()
{
int i, crate;
string filename, filename1;
file TestFile, ErrorFile;
string date;
time tm1;

string all = \"date	tim	i	LVchStat	LVch_Vcc	LVps_Vcc	LVretVcc	LVch_Icc	LVch_Vdd	LVps_Vdd	LVretVdd	LVch_Idd	LVchVCSL	LVchVCSI	LVchPINV	LVchPINI	MOch_Tm0	MOch_Tm1	HVchStat	HVchVolt	HVchCurr\";
//DebugN(\"all\", all);

date = formatTime(\"%Y%m%d\", tm1);
dpGet(\"Crate.Numb:_original.._value\", crate);

DebugN(\"Saving Inital parameters...\");

//err = ferror(f); // export error
//DebugN(\"File Cnf_ParaV.txt did not open / correctly\");       

//fprintf(TestFile, \"%f\\n\", tim);

      // Read all channels
      for (i=0;i<=47;i++) {
      
          //Read all values for one channel
          sprintf(filename, \"D:/SCT_DCS_DATA/LTT/CRATE%02d_CHAN%02d_LTT.txt\",crate, i);
          
 //         fprintf(TestFile, \"%s\\t%f\\n\", date, i);
         
          TestFile = fopen(filename,\"a\");
          fprintf(TestFile, \"\\n%s\\n\", all);
//          fprintf(TestFile, \"%s\", all);
         
          fclose(TestFile); 
		  }
//save error file
      sprintf(filename1, \"D:/SCT_DCS_DATA/LTT/CRATE%02d_LTTerror.txt\",crate);
      ErrorFile = fopen(filename1,\"a\");
      fprintf(ErrorFile, \"\\n%s\\n\", all);
      fclose(ErrorFile);

}



// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}

//Function Button2_EventClick()
" 0
 E E E
13 100
"ReadCard"
""
1 493 174 E E E 1 E 1 E N {0,0,0} E N {153,153,153} E E
 E E
90 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 ""
18 142 112 176
T 
1
LANG:1 4 READ
"// SimpleCtrlScriptStart {invalid}

main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int crate,channel, i;
string datapoint;

dpGet(\"Crate.Numb:_original.._value\",crate);
sprintf(datapoint,\"Crate%02d.Controller.CCchRead.Send:_original.._value\", crate);
for (i=0;i<=47;i++){
channel=i+64;
dpSetWait(datapoint, channel);
dpSetWait(datapoint,i);
delay(0,10);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate00.Controller.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 102
"MainPanel"
""
1 583 174 E E E 1 E 1 E N {0,0,0} E N {153,153,153} E E
 E E
91 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 ""
108 142 202 176
T 
1
LANG:1 10 MAIN PANEL
"// SimpleCtrlScriptStart {valid}
main()
{
  EP_childPanelOn();
}

EP_childPanelOn()
{
  ChildPanelOnCentral(\"subpanels/LTT_Advanced.pnl\",
      \"LTT_Advanced\",
      makeDynString(\"\"));
}

// SimpleCtrlScript {EP_childPanelOn}
// Function {ChildPanelOnCentral}
// File {subpanels/LTT_Advanced.pnl}
// Panel {LTT_Advanced}
// Parent {}
// Module {}
// OffsetX {0}
// OffsetY {0}
// SimpleCtrlScriptEnd {EP_childPanelOn}
" 0
 E E E
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