V 10
1
LANG:1 6 STATes
PANEL,258 70 185 90 N "_3DFace" 0
"/* REMARKS ON PVSS:
      1) this panel can't contain Eventinitialize Script !
      2) there is no checking of declared names (hungup);
      3) user functions may be used with references only;
      4) all the arguments should be preinstalled;
      5) user function call takes ~ 1 sec ! ;
      6) return value from these functions is impossible;
      7) PVSS does not see \"doubled\" names: 'DCS Folder';
*//*  8) the number of comment lines is limited (<-see);
      9) comment lines are not green after inserting ;
     10) \".\" can't be typed directly in Script Editor;
     11) strltrim(s06w,\"MA\") does not work;
     12) referenced objects (GEdi doc-s) can't be renamed;
     13) why:  dyn_int inpi;  int int1;
               int1=0; while(int1 < 32)
               { inpi[int1] = 20 * int1; int1++;
               }   - is not allowed ?  ( memory abort ! );
     14) there are some problems with graphical objects moving on the panel
         ('arrow cross' does not arrive sometimes);
     15) sometimes instead of 'Mouse arrow' the 'arrow cross' is appearing;
*//* 16) 'dp_fct param' table may \"close\" and can't be open again;
     17) the complex Conversion formulas need several intermediate variables
         for storing some primary values of the first step; on the second
         step that values are using for the final calculations.
            In usual language ('C') the dynamic (subroutine) variables are
         using for intermediate storage; in PVSS a 'dp_fct' mechanism needs
         additional STATIC DP_elements for intermediate storing, i.e. the
         DP_base size is larger in several times;
     18) \"Match Case\" does not work in the Text Editor;
     19) some examples have the errors - TextField  ) -> };
     20) if PVSS did not close (after Project closing) then NIcan diagnostics
         gives the error;
     21) limitation of SensIndi: ~1000 (no lables), ~500 (with lables);
     22) the loop of checking DP-states (delay(1) is included for waiting)
         really takes ~1 sec in the first call but a loop time is increasing
         to several seconds in the next calls.
*//* 23) PVSS execution speed depends strongly on NET productivity (Sunday
         effect - minutes instead of seconds).
     24) Column number (second digit) is invisible often in NG_panel
     25) Alias can not be changed (SetAlias() causes error-message in the Log.
     26) Debugger is \"excellent\" (in comparison with 'C').
     27) 4-levels (and more !) DataPointType (Port.Unit.Chan.Para) may be
         created for ONE 3-level agent only (for >1 - structure owerflow) !
     28) dpGet() is practically impossible from dP_configs (large delay) !
     29) Semicolumn (empty) operator stops the script ! (works in \"C\")
  ===================================-======================================*/
main()
{ ;
}" 0
EE E E 1 -1 -1 0  19 20
"" 0 1
EE 2
"CBRef""0"
"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
1 63 11 "" 6
0
1 64 12 "" 6
0
1 65 13 "" 6
0
1 66 14 "" 6
0
1 67 15 "" 6
0
1 68 16 "" 6
0
1 69 17 "" 6
0
1 70 18 "" 6
0
13 12
"Off_Butn"
""
1 10 10 E E E 1 E 1 E N "_3DText" E N {204,204,204} E E
 E E
12 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
8 8 62 42
T 
1
LANG:1 8  Det_OFF
"/* Det_Off Local Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int syss;

  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if((syss & 0x3C) == 0x0)         /* From Init State only                */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x24);
  }
    if(syss & 0x20)                  /* From other States - in manual Mode  */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x24);
  }
}" 0
 E E "/* Det_Off Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                   SYSTEM OFF STATE CONTROL/INDICATOR                     */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour control/indicator of a System
                   Off state

   MODIF_HISTORY:  01.03.2001 - first version
                   04.11.2002 -  2-nd version, DPconfig state is added
                   21.12.2002 -  3-rd version, Run,HV,LV Indi-s are added
                   04.07.2003 -  4-th version, for MoPS Project
                   12.10.2003 -  5-th version, Off,Stb,On+Conf+StUP States
  ===================================-======================================*/

main()
{
  dpConnect(\"OffColour\"    ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"OffGrey\"      ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"OffStbColour\" ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"OffStbGrey\"   ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"OffConfColour\",\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"OffConfGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"OffMode\"      ,\"SCTmops1:Syst.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF STATE BUTTON OR TRANSITION INDICATOR               */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetOffColour(string Name, int Stus) 
 {
   switch(Stus & 0x7)
   { case  0:                        /* Normal  Status                      */
                if(Stus & 0x10)      /* System is in the Global Mode        */
              { setValue(Name,\"backCol\",\"kobaltblau\");
              } else
              { setValue(Name,\"backCol\",\"Green\");
              }
              break;
     case  2:                        /* Warning Status                      */
              setValue(Name,\"backCol\",\"Yellow\");
              break;
     case  1:                        /* Alarm   Status                      */
              setValue(Name,\"backCol\",\"Red\");
              break;
     case  3:                        /* Disable Status                      */
              setValue(Name,\"backCol\",\"Grey\");
              break;
     default: setValue(Name,\"backCol\",\"Grey\");
   }
 }

/* SHOW COLOUR OF \"OFF\" BUTTON                                              */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OffColour(string Dapo, int Stat) 
 { int syss, stat, stus;             /* System STATe & STatUS               */

   dpGet(\"SCTmops1:Host.Stat:_original.._value\", stat);
   stat = stat & 0xC;                /* Final State                         */
   syss = Stat & 0xC;  stus = Stat & 0x33;
     if(syss == 0x4)                 /* If System State is 'Off'            */
   {   if(!((stat > 0x4) &&
            (!(Stat & 0x40000))))       /* State can't be skipped - New Config */
     { SetOffColour(\"Off_Butn\", stus);
     }
   } else
   { SetOffColour(\"Off_Butn\", 0x5);            /* Grey Colour               */
   }
 }

 OffGrey(string Dapo, int Stat) 
 {
   SetOffColour(\"Off_Butn\", 0x5);              /* Grey Colour               */
 }

/* SHOW COLOUR OF \"OFF->STANDBY\" TRANSITION INDICATOR                       */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OffStbColour(string Dapo, int Stat) 
 { int next, stat, stus;             /* Next state, System STATe & STatUS   */

   dpGet(\"SCTmops1:Syst.Stat:_original.._value\", stat);
   next = Stat & 0xC;  stus = Stat & 0x33;
     if((next == 0x8) && ((stat & 0xC) == 0x4))
   { SetOffColour(\"OffStbIndi\", stus);
   } else
   { SetOffColour(\"OffStbIndi\", 0x5);          /* Grey Colour               */
   }
 }

 OffStbGrey(string Dapo, int Stat) 
 {
   SetOffColour(\"OffStbIndi\", 0x5);            /* Grey Colour               */
 }

/* SHOW COLOUR OF \"OFF->CONF\" TRANSITION INDICATOR                          */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OffConfColour(string Dapo, int Stat) 
 { int syss, next, stat, stus;       /* Next state, System STATe & STatUS   */

   dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
   next = Stat & 0x3C;                  stus = syss & 0x33;
   dpGet(\"SCTmops1:Host.Stat:_original.._value\", stat);
     if(((next == 0x10) || (next == 0x20) || (stat == 0x0)) &&
        ((syss & 0xC) == 0x4))
   { SetOffColour(\"OffConfIndi\", stus);
   } else
   { SetOffColour(\"OffConfIndi\", 0x5);         /* Grey Colour               */
   }
 }

 OffConfGrey(string Dapo, int Stat) 
 {
   SetOffColour(\"OffConfIndi\", 0x5);          /* Grey Colour                */
 }
 
/* SHOW COLOUR OF \"OFF_MODE\" INDICATORS                                     */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OffMode(string Dapo, int Stat) 
 {
     if((Stat & 0x20000) > 0)
   { setValue(\"OffModeDn\",\"backCol\",\"Yellow\");
   } else
   { setValue(\"OffModeDn\",\"backCol\",\"Green\");
   }
     if((Stat & 0x20000) > 0)
   { setValue(\"OffModeUp\",\"backCol\",\"Yellow\");
   } else
   { setValue(\"OffModeUp\",\"backCol\",\"Green\");
   }
 }" 0

13 24
"On__Butn"
""
1 125 10 E E E 1 E 1 E N "_3DText" E N {204,204,204} E E
 E E
23 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
123 8 177 42
T 
1
LANG:1 6 Det_ON
"/* Det_On Local Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int syss;

  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if((syss & 0x3C) == 0x0)         /* From Init State only                */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x2C);
  }
    if(syss & 0x20)                  /* From other States - in manual Mode  */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x2C);
  }
}
" 0
 E E "/* Det_On Butn
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                    SYSTEM 'ON' STATE CONTROL/INDICATOR                   */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour control/indicator of a System
                   'On' state

   MODIF_HISTORY:  01.03.2001 - first version
                   04.11.2001 -  2-nd version, Server State is added
                   04.11.2002 -  3-rd version, DPconfig state is added
                   04.07.2003 -  4-th version, for MoPS Project
                   12.10.2003 -  5-th version, Off,Stb,On+Conf+StUP States
  ===================================-======================================*/

main()
{
  dpConnect(\"OnColour\"   ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"OnGrey\"     ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"OnStbGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"OnStbColour\",\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"OnMode\"     ,\"SCTmops1:Syst.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF STATE BUTTON OR TRANSITION INDICATOR               */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetOnColour(string Name, int Stus) 
 { 
   switch(Stus & 0x7)
   { case  0:                        /* Normal  Status                      */
                if(Stus & 0x10)      /* System is in the Global Mode        */
              { setValue(Name,\"backCol\",\"kobaltblau\");
              } else
              { setValue(Name,\"backCol\",\"Green\");
              }
              break;
     case  2:                        /* Warning Status                      */
              setValue(Name,\"backCol\",\"Yellow\");
              break;
     case  1:                        /* Alarm   Status                      */
              setValue(Name,\"backCol\",\"Red\");
              break;
     case  3:                        /* Disable Status                      */
              setValue(Name,\"backCol\",\"Grey\");
              break;
     default: setValue(Name,\"backCol\",\"Grey\");
   }
 }

/* SHOW COLOUR OF \"ON\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OnColour(string Dapo, int Stat) 
 { int syss, stus;                   /* System STATe & STatUS               */
 
   syss = Stat & 0xC;  stus = Stat & 0x33;
     if(syss == 0xC)                 /* If System State is 'On'             */
   { SetOnColour(\"On__Butn\", stus);
   } else
   { SetOnColour(\"On__Butn\", 0x5);             /* Grey Colour               */
   }
 }

 OnGrey(string Dapo, int Stat) 
 { 
   SetOnColour(\"On__Butn\", 0x5);               /* Grey Colour               */
 }

/* SHOW COLOUR OF \"RUN->MONI\" TRANSITION INDICATOR                          */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OnStbColour(string Dapo, int Stat) 
 { int next, stat, stus;             /* Next state, System STATe & STatUS   */
 
   dpGet(\"SCTmops1:Syst.Stat:_original.._value\", stat);
   next = Stat & 0xC;  stus = Stat & 0x33;
     if((next == 0x8) && ((stat & 0xC) == 0xC))
   { SetOnColour(\"OnStbIndi\", stus);
   } else
   { SetOnColour(\"OnStbIndi\", 0x5);            /* Grey Colour               */
   }
 }

 OnStbGrey(string Dapo, int Stat) 
 { 
   SetOnColour(\"OnStbIndi\", 0x5);              /* Grey Colour               */
 }
/* SHOW COLOUR OF \"ON_MODE\" INDICATORS                                      */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OnMode(string Dapo, int Stat) 
 {
     if((Stat & 0x80000) > 0)
   { setValue(\"OnModeDn\",\"backCol\",\"Yellow\");
   } else
   { setValue(\"OnModeDn\",\"backCol\",\"Green\");
   }
     if((Stat & 0x80000) > 0)
   { setValue(\"OnModeUp\",\"backCol\",\"Yellow\");
   } else
   { setValue(\"OnModeUp\",\"backCol\",\"Green\");
   }
 }" 0

13 13
"InoutButn"
""
1 96 47 E E E 1 E 1 E N "_3DText" E N {204,204,204} E E
 E E
13 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
94 45 177 79
T 
1
LANG:1 8 Init/Out
"/* StartUP Local Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int    syss, stat;
  string mstr;

  dpSet(\"SCTmops1:Eror.Stat:_original.._value\", 0x0);
  dpSet(\"SCTmops1:Eror.Numb:_original.._value\", 0);
  dpSet(\"SCTmops1:Eror.Name:_original.._value\", \"\");
  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if(syss & 0x20)                  /* System is in the Manual Mode        */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x0);
  } else
  {   if(!(syss & 0x10))             /* System is in NON_External Mode: Out */
    { dpGet(\"SCTmops1:Host.Stat:_original.._value\", stat);
        if(stat == 0x0)
      { dpSet(\"SCTmops1:Moni.Stat:_original.._value\",0x2);
        sprintf(mstr,\" BY...!\");
        dpSet(\"SCTmops1:Moni.Name:_original.._value\", mstr);  delay(2);
        dpSet(\"SCTmops1:Conf.Numb:_original.._value\", 0);/* Reset Panel Flag*/
        PanelOff();
      }
    }
  }
    if(syss == 0)
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x0);    
  }
}" 0
 E E "/* Init/Out Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                  SYSTEM INIT/OUT_STATE CONTROL/INDICATOR                 */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System 'Init/Out'
                   state and the set of Initialisation commands

   MODIF_HISTORY:  01.03.2001 - first version
                   04.11.2001 -  2-nd version, Initialisation is added
                   04.11.2002 -  3-rd version, DPconfig state is added
                   21.12.2002 -  4-th version, Run,HV,LV Indi-s are added
                   28.09.2003 -  5-th version, Control Script is added
                   12.10.2003 -  6-th version, Off,Stb,On+Conf+StUP States
  ===================================-======================================*/

  main()
{ int host, busy, tout, eror;
  int syss, stat, pmon, int1, int2;  /* SYStem STATe, Period of MONitoring  */
  string    stri, mstr, estr, snam;  /* STRIng;Moni,Error STRing;System NAMe*/

  host = 1;                          /* Host number for Mops                */
  tout = 10 * 60;                    /* TimeOut is 10 minutes               */

  dpSet(\"SCTmops1:Conf.Numb:_original.._value\", 0);      /* Init Panel  Flag*/
  dpSet(\"SCTmops1:Moni.Stat:_original.._value\", 0x2);    /*Yellow Background*/
  dpSet(\"SCTmops1:Busy.Stat:_original.._value\", 0x4);    /* Busy for Transi */
  dpSet(\"SCTmops1:Busy.Indx:_original.._value\", 0);      /* Skip first print*/
  dpSet(\"SCTmops1:Busy.Numb:_original.._value\", 0);      /* Init PanOff Flag*/
  dpSet(\"SCTmops1:Eror.Stat:_original.._value\", 0x0);    /* Green Background*/
  dpSet(\"SCTmops1:Eror.Name:_original.._value\", \"\");
  dpSet(\"SCTmops1:Arch.Stat:_original.._value\", 0x4);    /* Archive On State*/
  dpSet(\"SCTmops1:Alrm.Indx:_original.._value\", 0x0);    /* AlertFile Index */
  dpConnect(\"InitColour\"    ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"InitGrey\"      ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"InitConfGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"InitConfColour\",\"SCTmops1:Next.Stat:_original.._value\");
  dpSet(\"SCTmops1:RequArbi.Req1:_original.._value\", 0x0);
  dpSet(\"SCTmops1:RequArbi.Req2:_original.._value\", 0x0);
  dpSet(\"SCTmops1:RequArbi.Req3:_original.._value\", 0x0);
  dpSet(\"SCTmops1:RequArbi.Req4:_original.._value\", 0x0);
  dpSet(\"SCTmops1:RequArbi.Next:_original.._value\", 0x0);
  dpSet(\"SCTmops1:Fatl.Numb:_original.._value\", 0);
  dpSet(\"SCTmops1:Fatl.Indx:_original.._value\", 0);
  dpSet(\"SCTmops1:Alrm.Numb:_original.._value\", 0);
  dpSet(\"SCTmops1:Warn.Numb:_original.._value\", 0);
  dpSet(\"SCTmops1:Eror.Numb:_original.._value\", 0);
  dpSet(\"SCTmops1:Scan.Numb:_original.._value\", 0);
  dpSet(\"SCTmops1:Indi.Numb:_original.._value\", 1);
  dpSet(\"SCTmops1:Plot.Numb:_original.._value\", 1);
  int1=0; while(int1 < 9)            /* Subsystem DB_Name taking            */
  { stri = getSystemName(int1);
    int2 = strlen(stri); if(int2 > 0)
    { sprintf(snam,\"%s\", stri);
      strreplace(snam,\":\",\"\");  break;
    } int1++;
  }
  sprintf(mstr,\" %s_n%d IS STARTING...\", snam, int1);
  dpSet(\"SCTmops1:Moni.Name:_original.._value\", mstr);
  dpSet(\"SCTmops1:Conf.Name:_original.._value\", snam);
  dpSet(\"SCTmops1:Host.Numb:_original.._value\", host);
  sprintf(stri,\"SCTmops1:Host0%d.Pmon:_original.._value\", host);
  dpGet(stri, pmon);
  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
  InitColour(\"\", syss);
  int1=0; busy=0x4; while(busy > 0)  /* Waiting for Busy from subPanels     */
  { delay(1);
    int1++; if(int1 >= tout)
    { sprintf(estr,\" TimeOut '%d sec' - 'BUSY' RESET Waiting \", tout);
      ErrorStop(estr,\" CHECK ERROR AND PUSH EXIT [X] \");
    } dpGet(\"SCTmops1:Busy.Stat:_original.._value\", busy);
  }
  dpSet(\"SCTmops1:Conf.Numb:_original.._value\", 1);      /* Set Panel Flag  */
/*
  dpGet(\"SCTmops1:Host.Stat:_original.._value\", int1);
  dpGet(\"SCTmops1:Next.Stat:_original.._value\", stat);
  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
  dpGet(\"SCTmops1:Conf.Numb:_original.._value\", int2);
  sprintf(mstr,\" Start: Host=%Xh, Next=%Xh, Syst=%Xh, ConfNumb=%d, Pmon=%d\",
                        int1, stat, syss, int2, pmon);  stat=0;  syss=0;
  setValue(\"MoniIndi\",\"text\", mstr);    delay(2);                  /* Debug */
}

/* STOP ON ERROR, SHOW ERR0R & DEBUG TEXTs IN THE ERROR & MONI INDICATORs   */
/*                                                                          */
/*                      Estr - Error STRing (text) for Error Indicator      */
/*                      Dstr - Debug STRing (text) for Moni  Indicator      */
/*                                                                          */
 ErrorStop(string Estr, string Dstr)
 { string stri;
 
   dpSet(\"SCTmops1:Eror.Stat:_original.._value\", 0x1);   /* Red Background  */
   dpSet(\"SCTmops1:Moni.Stat:_original.._value\", 0x2);   /*Yellow Background*/
   sprintf(stri,\"%s\\n           PROJECT SCRIPTS ARE STOPPED ! \", Estr);
   dpSet(\"SCTmops1:Eror.Name:_original.._value\", stri); 
   setValue(\"MoniIndi\",\"text\", Dstr); 
   dpSet(\"SCTmops1:Conf.Numb:_original.._value\", 3);      /* Panel  Flag    */
   dpSet(\"SCTmops1:Conf.Stat:_original.._value\", 0x0);
   dpSet(\"SCTmops1:Conf.Data:_original.._value\", 0.0);
   dpSet(\"SCTmops1:Conf.Indx:_original.._value\", 3);      /* Script Flag    */
   while(1) { delay(1); }
 }

/* SHOW STATUS COLOUR OF STATE BUTTON OR TRANSITION INDICATOR               */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetInitColour(string Name, int Stus) 
 {
   switch(Stus & 0x7)
   { case  0:                        /* Normal  Status                      */
              setValue(Name,\"backCol\",\"Green\");
              break;
     case  2:                        /* Warning Status                      */
              setValue(Name,\"backCol\",\"Yellow\");
              break;
     case  1:                        /* Alarm   Status                      */
              setValue(Name,\"backCol\",\"Red\");
              break;
     case  3:                        /* Disable Status                      */
              setValue(Name,\"backCol\",\"Grey\");
              break;
     default: setValue(Name,\"backCol\",\"Grey\");
   }
 }

/* SHOW COLOUR OF \"INIT/OUT\" BUTTON                                         */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 InitColour(string Dapo, int Stat) 
 { int stat, stus;                   /* System STATe & STatUS               */

   stat = Stat & 0x3C;  stus = Stat & 0x3;
     if(stat == 0x0)                 /* If System State is in 'Init/Out'    */
   { SetInitColour(\"InoutButn\", stus);
   } else
   { SetInitColour(\"InoutButn\", 0x5);/* Grey Colour                         */
   }
 }

 InitGrey(string Dapo, int Stat) 
 {
     if(Stat & 0x3C)
   { SetInitColour(\"InoutButn\", 0x5);/* Grey Colour                         */
   }
 }

/* SHOW COLOUR OF \"INIT->CONFIG\" TRANSITION INDICATOR                       */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 InitConfColour(string Dapo, int Stat) 
 { int syss, next, stat, stus;       /* Next state, System STATe & STatUS   */
 
   dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
   next = Stat & 0x3C;  stus = Stat & 0x33;
   dpGet(\"SCTmops1:Host.Stat:_original.._value\", stat);
     if((syss & 0x3C) == 0x0)
   {   if((next == 0x10) || (next == 0x20) || ((stat & 0xC) > 0x0))
     { SetInitColour(\"InitConfIndi\", stus);
     } else
     { SetInitColour(\"InitConfIndi\", 0x5);  /* Grey Colour                    */
     }
   }
 }

 InitConfGrey(string Dapo, int Stat) 
 {
   SetInitColour(\"InitConfIndi\", 0x5);      /* Grey Colour                    */
 }" 0

13 11
"Stb_Butn"
""
1 68 10 E E E 1 E 1 E N "_3DText" E N {204,204,204} E E
 E E
11 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
66 8 120 42
T 
1
LANG:1 8  Det_STB
"/* Det_Stb Local Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int syss;

  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if((syss & 0x3C) == 0x0)         /* From Init State only                */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x28);
  }
    if(syss & 0x20)                  /* From other States - in manual Mode  */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x28);
  }
}" 0
 E E "/* Det_Stb Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                  SYSTEM 'STANDBY' STATE CONTROL/INDICATOR                */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour control/indicator of a System
                   'Standby' state

   MODIF_HISTORY:  01.03.2001 - first version
                   04.11.2002 -  2-nd version, DPconfig state is added
                   21.12.2002 -  3-rd version, Run,HV,LV Indi-s are added
                   04.07.2003 -  4-th version, for MoPS Project
                   12.10.2003 -  5-th version, Off,Stb,On+Conf+StUP States
  ===================================-======================================*/
main()
{
  dpConnect(\"StbColour\"   ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"StbGrey\"     ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"StbOnGrey\"   ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"StbOnColour\" ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"StbOffGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"StbOffColour\",\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"StbMode\"     ,\"SCTmops1:Syst.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF STATE BUTTON OR TRANSITION INDICATOR               */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetStbColour(string Name, int Stus) 
 { 
   switch(Stus & 0x7)
   { case  0:                        /* Normal  Status                      */
                if(Stus & 0x10)      /* System is in the Global Mode        */
              { setValue(Name,\"backCol\",\"kobaltblau\");
              } else
              {   if(Stus & 0x20)    /* System is in the Local  Mode        */
                { setValue(Name,\"backCol\",\"Green\");
                } else
                { setValue(Name,\"backCol\",\"Blue\");
                }
              }
              break;
     case  2:                        /* Warning Status                      */
              setValue(Name,\"backCol\",\"Yellow\");
              break;
     case  1:                        /* Alarm   Status                      */
              setValue(Name,\"backCol\",\"Red\");
              break;
     case  3:                        /* Disable Status                      */
              setValue(Name,\"backCol\",\"Grey\");
              break;
     default: setValue(Name,\"backCol\",\"Grey\");
   }
 }

/* SHOW COLOUR OF \"STANDBY\" BUTTON                                          */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 StbColour(string Dapo, int Stat) 
 { int syss, stat, stus;             /* System STATe & STatUS               */

   dpGet(\"SCTmops1:Host.Stat:_original.._value\", stat);
   stat = stat & 0xC;                /* Final State                         */
   syss = Stat & 0xC;  stus = Stat & 0x33;
     if(syss == 0x8)                 /* If System State is 'Standby'        */
   {   if(!((stat > 0x8) &&
          (!(Stat & 0x100000))))     /* State can't be skipped - New Config */
     { SetStbColour(\"Stb_Butn\", stus);
     }
   } else
   { SetStbColour(\"Stb_Butn\", 0x5);            /* Grey Colour               */
   }
 }

 StbGrey(string Dapo, int Stat) 
 { 
   SetStbColour(\"Stb_Butn\", 0x5);              /* Grey Colour               */
 }

/* SHOW COLOUR OF \"STANDBY->ON\" TRANSITION INDICATOR                        */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 StbOnColour(string Dapo, int Stat) 
 { int next, stat, stus;             /* Next state, System STATe & STatUS   */
 
   dpGet(\"SCTmops1:Syst.Stat:_original.._value\", stat);
   next = Stat & 0xC;  stus = Stat & 0x33;
     if((next == 0xC) && ((stat & 0xC) == 0x8))
   { SetStbColour(\"StbOnIndi\", stus);   delay(1);
   } else
   { SetStbColour(\"StbOnIndi\", 0x5);           /* Grey Colour               */
   }
 }

 StbOnGrey(string Dapo, int Stat) 
 { 
   SetStbColour(\"StbOnIndi\", 0x5);             /* Grey Colour               */
 }

/* SHOW COLOUR OF \"STANDBY->OFF\" TRANSITION INDICATOR                       */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 StbOffColour(string Dapo, int Stat) 
 { int next, stat, stus;             /* Next state, System STATe & STatUS   */
 
   dpGet(\"SCTmops1:Syst.Stat:_original.._value\", stat);
   next = Stat & 0xC;  stus = Stat & 0x33;
     if((next == 0x4) && ((stat & 0xC) == 0x8))
   { SetStbColour(\"StbOffIndi\", stus);
   } else
   { SetStbColour(\"StbOffIndi\", 0x5);          /* Grey Colour               */
   }
 }

 StbOffGrey(string Dapo, int Stat) 
 { 
   SetStbColour(\"StbOffIndi\", 0x5);            /* Grey Colour               */
 }
 
/* SHOW COLOUR OF \"STANDBY_MODE\" INDICATORS                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 StbMode(string Dapo, int Stat) 
 {
     if((Stat & 0x40000) > 0)
   { setValue(\"StbModeDn\",\"backCol\",\"Yellow\");
   } else
   { setValue(\"StbModeDn\",\"backCol\",\"Green\");
   }
     if((Stat & 0x40000) > 0)
   { setValue(\"StbModeUp\",\"backCol\",\"Yellow\");
   } else
   { setValue(\"StbModeUp\",\"backCol\",\"Green\");
   }
 }" 0

13 49
"ConfButn"
""
1 10 47 E E E 1 E 1 E N "_3DText" E N {204,204,204} E E
 E E
45 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
8 45 91 79
T 
1
LANG:1 10 Configured
"/* Config Local Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int syss;

  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if((syss & 0x3C) == 0x0)         /* From Init State only - ALL_Config   */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x20);//0x550020);
  }
    if(syss & 0x20)                  /* From other States - in manual Mode  */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x20 | (syss & 0x7FFFFF00));
  }
}" 0
 E E "/* Config Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                   SYSTEM CONFIG STATE CONTROL/INDICATOR                  */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour control/indicator of a System
                   Configured state

   MODIF_HISTORY:  01.03.2001 - first version
                   04.11.2002 -  2-nd version, DPconfig state is added
                   21.12.2002 -  3-rd version, Run,HV,LV Indi-s are added
                   04.07.2003 -  4-th version, for MoPS Project
                   12.10.2003 -  5-th version, Off,Stb,On+Conf+StUP States
  ===================================-======================================*/

main()
{
  dpConnect(\"ConfColour\"   ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"ConfGrey\"     ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"ConfOffGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"ConfOffColour\",\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"ConfOutGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"ConfOutColour\",\"SCTmops1:Next.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF STATE BUTTON OR TRANSITION INDICATOR               */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetConfColour(string Name, int Stus) 
 {
   switch(Stus & 0x7)
   { case  0:                        /* Normal  Status                      */
                if(Stus & 0x10)      /* System is in the Global Mode        */
              { setValue(Name,\"backCol\",\"kobaltblau\");
              } else
              { setValue(Name,\"backCol\",\"Green\");
              }
              break;
     case  2:                        /* Warning Status                      */
              setValue(Name,\"backCol\",\"Yellow\");
              break;
     case  1:                        /* Alarm   Status                      */
              setValue(Name,\"backCol\",\"Red\");
              break;
     case  3:                        /* Disable Status                      */
              setValue(Name,\"backCol\",\"Grey\");
              break;
     default: setValue(Name,\"backCol\",\"Grey\");
   }
 }

/* SHOW COLOUR OF \"CONFIG\" BUTTON                                           */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 ConfColour(string Dapo, int Stat) 
 { int syss, stus;                   /* System STATe & STatUS               */

   syss = Stat & 0x3C;  stus = Stat & 0x33;
     if((syss == 0x10) || (syss == 0x20))      /* If SystemState is 'Config'*/
   { SetConfColour(\"ConfButn\", stus);
   } else
   { SetConfColour(\"ConfButn\", 0x5);           /* Grey Colour               */
   }
 }

 ConfGrey(string Dapo, int Stat) 
 {
   SetConfColour(\"ConfButn\", 0x5);             /* Grey Colour               */
 }

/* SHOW COLOUR OF \"CONF->OFF\" TRANSITION INDICATOR                          */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 ConfOffColour(string Dapo, int Stat) 
 { int next, stat, stus;             /* Next state, System STATe & STatUS   */

   dpGet(\"SCTmops1:Syst.Stat:_original.._value\", stat);
   next = Stat & 0xC;                   stus = stat & 0x33;
     if((next == 0x4) && (((stat & 0x3C) == 0x10) ||
                          ((stat & 0x3C) == 0x20) || ((stat & 0x3C) == 0x0)))
   { SetConfColour(\"ConfOffIndi\", stus);
   } else
   { SetConfColour(\"ConfOffIndi\", 0x5);        /* Grey Colour               */
   }
 }

 ConfOffGrey(string Dapo, int Stat) 
 {
   SetConfColour(\"ConfOffIndi\", 0x5);          /* Grey Colour               */
 }

/* SHOW COLOUR OF \"CONF->OUT\" TRANSITION INDICATOR                          */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 ConfOutColour(string Dapo, int Stat) 
 { int syss, next, stus;             /* Next state, System STATe & STatUS   */

   dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
   next = Stat & 0x3C; stus = (syss & 0x3) | 0x20;
     if((next == 0x0) && ((syss & 0x3C) > 0))
   { SetConfColour(\"ConfOutIndi\", stus);
   } else
   { SetConfColour(\"ConfOutIndi\", 0x5);        /* Grey Colour               */
   }
 }

 ConfOutGrey(string Dapo, int Stat) 
 {
   SetConfColour(\"ConfOutIndi\", 0x5);          /* Grey Colour               */
 }" 0

1 71 19 "" 9
0
1 72 20 "" 9
0
1 73 21 "" 9
0
1 74 22 "" 9
0
1 75 23 "" 9
0
1 76 24 "" 9
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
3 11 "InitConfIndi"
"objects\\SCT_StatTran.pnl" 50 110 T 59 1 0 1  100 -38  
0
3 12 "ConfOutIndi"
"objects\\SCT_StatTran.pnl" 40 110 T 60 1 0 1  105 -50  
0
3 13 "ConfOffIndi"
"objects\\SCT_StatTran.pnl" 40 110 T 61 1 0 1  40 -59  
0
3 14 "OffConfIndi"
"objects\\SCT_StatTran.pnl" 50 110 T 62 1 0 1  49 -64  
0
3 15 "OffStbIndi"
"objects\\SCT_StatTran.pnl" 50 130 T 63 1 0 1  66 -105  
0
3 16 "StbOffIndi"
"objects\\SCT_StatTran.pnl" 90 120 T 64 1 0 1  32 -83  
0
3 17 "StbOnIndi"
"objects\\SCT_StatTran.pnl" 80 110 T 65 1 0 1  94 -86  
0
3 18 "OnStbIndi"
"objects\\SCT_StatTran.pnl" 50 110 T 66 1 0 1  129 -74  
0
3 19 "OffModeDn"
"objects\\SCT_horzBord.pnl" 90 120 T 67 1 0 1  -20 -74  
0
3 20 "OffModeUp"
"objects\\SCT_horzBord.pnl" 50 120 T 68 1 0 1  20 -100  
0
3 21 "StbModeUp"
"objects\\SCT_horzBord.pnl" 70 120 T 69 1 0 1  58 -100  
0
3 22 "StbModeDn"
"objects\\SCT_horzBord.pnl" 50 110 T 70 1 0 1  78 -64  
0
3 23 "OnModeUp"
"objects\\SCT_horzBord.pnl" 80 130 T 71 1 0 1  105 -110  
0
3 24 "OnModeDn"
"objects\\SCT_horzBord.pnl" 40 110 T 72 1 0 1  145 -64  
0
0