V 10
1
LANG:1 6 STATes
PANEL,258 70 205 90 N "_3DFace" 0
"/* REMARKS ON PVSS:
      1) there is no checking of declared names (hungup);
      2) user functions may be used with references only;
      3) all the arguments should be preinstalled;
      4) user function call takes ~ 1 sec ! ;
      5) return value from these functions is impossible;
      6) PVSS does not see \"doubled\" names: 'DCS Folder';
*//*  7) the number of comment lines is limited (<-see);
      8) comment lines are not green after inserting ;
      9) \".\" can't be typed directly in Script Editor;
     10) strltrim(s06w,\"MA\") does not work;
     11) referenced objects (GEdi doc-s) can't be renamed;
     12) why:  dyn_int inpi;  int int1;
               int1=0; while(int1 < 32)
               { inpi[int1] = 20 * int1; int1++;
               }   - is not allowed ?  ( memory abort ! );
     13) there are some problems with graphical objects moving on the panel
         ('arrow cross' does not arrive sometimes);
     14) sometimes instead of 'Mouse arrow' the 'arrow cross' is appearing;
*//* 15) 'dp_fct param' table may \"close\" and can't be open again;
     16) 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;
     17) \"Match Case\" does not work in the Text Editor;
     18) some examples have the errors - TextField  ) -> };
     19) if PVSS did not close (after Project closing) then NIcan diagnostics
         gives the error;
     20) limitation of SensIndi: ~1000 (no lables), ~500 (with lables);
     21) 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.
*//* 22) PVSS execution speed depends strongly on NET productivity (Sunday
         effect - minutes instead of seconds).
     23) Column number (second digit) is invisible often in NG_panel
     25) Alias can not be changed (SetAlias() causes error-message in the Log.
     25) Debugger is \"excellent\" (in comparison with 'C').
     26) 4-levels (and more !) DataPointType (Port.Unit.Chan.Para) may be
         created for ONE 3-level agent only (for >1 - structure owerflow) !
     27) dpGet() is impossible from dP_configs !
  ===================================-======================================*/
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 43 0 "" 6
0
1 44 1 "" 6
0
1 45 2 "" 6
0
1 46 3 "" 44
0
1 47 4 "" 44
0
1 48 5 "" 44
0
13 38
"LVstbIndi"
""
1 10 10 E E E 1 E 1 E N "_3DText" E N {153,153,153} E E
 E E
35 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
8 8 32 42
T 
1
LANG:1 2 LV
E E E "/* LV 'Stb'Indi
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                         SYSTEM LV STATE INDICATOR                        */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System LV state

   MODIF_HISTORY:  21.12.2002 - first version
  ===================================-======================================*/

main()
{
  dpConnect(\"LVstbColour\",\"SCTmops1:LVol.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF LV INDICATOR                                       */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetLVstbColour(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 \"LV\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 LVstbColour(string Dapo, int Stat) 
 { int stat, stus;
 
   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0x8)
   { SetLVstbColour(\"LVstbIndi\", stus);
   } else
   { SetLVstbColour(\"LVstbIndi\", 0x5);   /* Grey Colour                         */
   }
 }" 0

13 41
"HVoffIndi"
""
1 175 47 E E E 1 E 1 E N "_3DText" E N {153,153,153} E E
 E E
38 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
173 45 197 79
T 
1
LANG:1 2 HV
E E E "/* HV 'Off'Indi
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                         SYSTEM HV STATE INDICATOR                        */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System HV state

   MODIF_HISTORY:  21.12.2002 - first version
  ===================================-======================================*/

main()
{
  dpConnect(\"HVoffColour\",\"SCTmops1:HVol.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF HV INDICATOR                                       */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetHVoffColour(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 \"HV\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 HVoffColour(string Dapo, int Stat) 
 { int stat, stus;
 
   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0x0)
   { SetHVoffColour(\"HVoffIndi\", stus);
   } else
   { SetHVoffColour(\"HVoffIndi\", 0x5);   /* Grey Colour                         */
   }
 }" 0

13 35
"HVonIndi"
""
1 175 10 E E E 1 E 1 E N "_3DText" E N {153,153,153} E E
 E E
33 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
173 8 197 42
T 
1
LANG:1 2 HV
E E E "/* HV 'On' Indi
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                         SYSTEM HV STATE INDICATOR                        */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System HV state

   MODIF_HISTORY:  21.12.2002 - first version
  ===================================-======================================*/

main()
{
  dpConnect(\"HVonColour\",\"SCTmops1:HVol.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF HV INDICATOR                                       */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetHVonColour(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 \"HV\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 HVonColour(string Dapo, int Stat) 
 { int stat, stus;
 
   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0xC)
   { SetHVonColour(\"HVonIndi\", stus);
   } else
   { SetHVonColour(\"HVonIndi\", 0x5);   /* Grey Colour                         */
   }
 }" 0

13 39
"LVcnfIndi"
""
1 10 47 E E E 1 E 1 E N "_3DText" E N {153,153,153} E E
 E E
36 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
8 45 32 79
T 
1
LANG:1 2 LV
E E E "/* LV 'Cnf'Indi
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                         SYSTEM LV STATE INDICATOR                        */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System LV state

   MODIF_HISTORY:  21.12.2002 - first version
  ===================================-======================================*/

main()
{
  dpConnect(\"LVcnfColour\",\"SCTmops1:LVol.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF LV INDICATOR                                       */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetLVcnfColour(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 \"LV\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 LVcnfColour(string Dapo, int Stat) 
 { int stat, stus;
 
   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0x4)
   { SetLVcnfColour(\"LVcnfIndi\", stus);
   } else
   { SetLVcnfColour(\"LVcnfIndi\", 0x5);   /* Grey Colour                         */
   }
 }" 0

13 40
"HVcnfIndi"
""
1 30 47 E E E 1 E 1 E N "_3DText" E N {153,153,153} E E
 E E
37 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
28 45 52 79
T 
1
LANG:1 2 HV
E E E "/* HV 'Cnf'Indi
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                         SYSTEM HV STATE INDICATOR                        */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System HV state

   MODIF_HISTORY:  21.12.2002 - first version
  ===================================-======================================*/

main()
{
  dpConnect(\"HVcnfColour\",\"SCTmops1:HVol.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF HV INDICATOR                                       */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetHVcnfColour(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 \"HV\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 HVcnfColour(string Dapo, int Stat) 
 { int stat, stus;
 
   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0x4)
   { SetHVcnfColour(\"HVcnfIndi\", stus);
   } else
   { SetHVcnfColour(\"HVcnfIndi\", 0x5); /* Grey Colour                         */
   }
 }" 0

13 12
"ConfButn"
""
1 49 47 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 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 ""
47 45 101 79
T 
1
LANG:1 6 Config
"/* Config_Local Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int syss;

  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if(syss & 0x20)                  /* System is in the Local mode         */
  {   if((syss & 0xC) == 0x0)        /* From Off State only                 */
    { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x24);
    }
  }
}" 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
  ===================================-======================================*/

main()
{
  dpConnect(\"ConfColour\"   ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"ConfGrey\"     ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"ConfStbGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"ConfStbColour\",\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"ConfOffGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"ConfOffColour\",\"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
              {   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 \"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 & 0xC;  stus = Stat & 0x33;
     if(syss == 0x4)                 /* If System State 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->STANDBY\" TRANSITION INDICATOR                      */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 ConfStbColour(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))
   { SetConfColour(\"ConfStbIndi\", stus);
   } else
   { SetConfColour(\"ConfStbIndi\", 0x5);        /* Grey Colour               */
   }
 }

 ConfStbGrey(string Dapo, int Stat) 
 {
   SetConfColour(\"ConfStbIndi\", 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 == 0x0) && ((stat & 0xC) == 0x4))
   { SetConfColour(\"ConfOffIndi\", stus);
   } else
   { SetConfColour(\"ConfOffIndi\", 0x5);        /* Grey Colour               */
   }
 }

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

13 42
"LVoffIndi"
""
1 156 47 E E E 1 E 1 E N "_3DText" E N {153,153,153} E E
 E E
39 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
154 45 178 79
T 
1
LANG:1 2 LV
E E E "/* LV 'Off' Indi
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                         SYSTEM LV STATE INDICATOR                        */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System LV state

   MODIF_HISTORY:  21.12.2002 - first version
  ===================================-======================================*/

main()
{
  dpConnect(\"LVoffColour\",\"SCTmops1:LVol.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF LV INDICATOR                                       */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetLVoffColour(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 \"LV\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 LVoffColour(string Dapo, int Stat) 
 { int stat, stus;
 
   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0x0)
   { SetLVoffColour(\"LVoffIndi\", stus);
   } else
   { SetLVoffColour(\"LVoffIndi\", 0x5);   /* Grey Colour                         */
   }
 }" 0

13 36
"LVonIndi"
""
1 156 10 E E E 1 E 1 E N "_3DText" E N {153,153,153} E E
 E E
34 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
154 8 178 42
T 
1
LANG:1 2 LV
E E E "/* LV 'On' Indi
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                         SYSTEM LV STATE INDICATOR                        */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System LV state

   MODIF_HISTORY:  21.12.2002 - first version
  ===================================-======================================*/

main()
{
  dpConnect(\"LVonColour\",\"SCTmops1:LVol.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF LV INDICATOR                                       */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetLVonColour(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 \"LV\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 LVonColour(string Dapo, int Stat) 
 { int stat, stus;
 
   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0xC)
   { SetLVonColour(\"LVonIndi\", stus);
   } else
   { SetLVonColour(\"LVonIndi\", 0x5);   /* Grey Colour                         */
   }
 }" 0

13 24
"On__Butn"
""
1 106 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 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 ""
104 8 158 42
T 
1
LANG:1 2 On
"/* On_Local Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int syss;

  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if(syss & 0x20)                  /* System is in the Local mode         */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x2C);
  }
}
" 0
 E E "/* 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
  ===================================-======================================*/

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\");
}

/* 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
              {   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 \"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               */
 }" 0

13 13
"Off_Butn"
""
1 106 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|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
104 45 158 79
T 
1
LANG:1 3 Off
"/* Off Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int syss;


  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if(syss & 0x30)                  /* System is in the Local or Glob mode */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x20);
  }
}" 0
 E E "/* 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 indicator of a System 'Off' 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
                   04.07.2003 -  5-th version, for MoPS Project
  ===================================-======================================*/

  main()
{ int syss, stat, pmon, int1, int2;  /* SYStem STATe, Period of MONitoring  */
  int hmax, nmax, pmax, umax, cmax;  /* Host, Node, Unit, Chan_MAX values   */
  string    stri, mstr, estr, snam;  /* STRIng;Moni,Error STRing;System NAMe*/

  dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x20);   /* Local Off State */
  dpSet(\"SCTmops1:Next.Stat:_original.._value\", 0x20);   /* Local Off State */
  dpSet(\"SCTmops1:Syst.Stat:_original.._value\", 0x20);   /* Local Off State */
  dpSet(\"SCTmops1:HVol.Stat:_original.._value\", 0x20);   /* Local Off State */
  dpSet(\"SCTmops1:LVol.Stat:_original.._value\", 0x20);   /* Local Off State */
  dpSet(\"SCTmops1:Busy.Stat:_original.._value\", 0x4);    /* Busy for Transi */
  dpSet(\"SCTmops1:Eror.Stat:_original.._value\", 0x0);
  dpSet(\"SCTmops1:Moni.Stat:_original.._value\", 0x2);    /* Yellow Backgr-d */
  dpSet(\"SCTmops1:Busy.Numb:_original.._value\", 0);      /* Start Busy Numb */
/*
  dpGet(\"SCTmops1:Host.Stat:_original.._value\", int1);
  dpGet(\"SCTmops1:Next.Stat:_original.._value\", stat);
  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
  dpGet(\"SCTmops1:Busy.Numb:_original.._value\", int2);
  sprintf(mstr,\" Start: Host=%Xh, Next=%Xh, Syst=%Xh, BusyNumb=%d\",
                        int1, stat, syss, int2);  stat=0;  syss=0;
  setValue(\"MoniIndi\",\"text\", mstr);    delay(3);                  /* Debug */
  dpSet(\"SCTmops1:RequArbi.Hold:_original.._value\", 0x0);/* Arbitration     */
  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);
  dpConnect(\"OffColour\"    ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"OffGrey\"      ,\"SCTmops1:Next.Stat:_original.._value\");
  dpConnect(\"OffConfGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"OffConfColour\",\"SCTmops1:Next.Stat:_original.._value\");
  setValue(\"MoniIndi\",\"text\",\" WAIT 30 sec FOR...\");
  dpSet(\"SCTmops1:Fatl.Numb:_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 < 20)           /* Subsystem DB_Name taking            */
  { stri = getSystemName(int1);
    int2 = strlen(stri); if(int2 > 0)
    { sprintf(snam,\"%s\", stri);
      strreplace(snam,\":\",\"\");  break;
    } int1++;
  }
  sprintf(mstr,\" WAIT 30 sec FOR %s INITIALISATION \", snam);
  setValue(\"MoniIndi\",\"text\", mstr);
//  delay(10);
  sprintf(mstr,\" WAIT 20 sec FOR %s INITIALISATION \", snam);
  setValue(\"MoniIndi\",\"text\", mstr);
//  delay(10);
  dpGet(\"SCTmops1:Hmax.Numb:_original.._value\"  , hmax);
  dpGet(\"SCTmops1:Nmax.Numb:_original.._value\"  , nmax);
  dpGet(\"SCTmops1:Pmax.Numb:_original.._value\"  , pmax);
  dpGet(\"SCTmops1:Umax.Numb:_original.._value\"  , umax);
  dpGet(\"SCTmops1:Cmax.Numb:_original.._value\"  , cmax);
  sprintf(stri,\"%s\", snam);             strreplace(stri,\"SCTmops\",\"\");
  sscanf( stri,\"%d\", int1);          /* Host number                         */
  sprintf(stri,\"SCTmops1:Host0%d.Pmon:_original.._value\", int1);
  dpGet(stri, pmon);
/*
  sprintf(mstr,\" Hmax=%d Nmax=%d Pmax=%d Umax=%d Cmax=%d Pmon=%d\",
                 hmax, nmax, pmax, umax, cmax, pmon);
  setValue(\"MoniIndi\",\"text\", mstr);    delay(3);                  /* Debug */
    if(int1 >  9)
  { setValue(\"ErorIndi\",\"backCol\",\"Red\");
    sprintf(estr,\" ERROR: System Config - HostNumb is too large: %d\", host); 
    setValue(\"ErorIndi\",\"text\", estr);
    setValue(\"MoniIndi\",\"text\",
                        \" Push Exit [X] button and reload DPs on restart\"); 
    while(1) { delay(1); }
  } if(nmax >  2)
  { setValue(\"ErorIndi\",\"backCol\",\"Red\");
    sprintf(estr,\" ERROR: System Config - NodeMax is too large: %d\", nmax); 
    setValue(\"ErorIndi\",\"text\", estr);
    setValue(\"MoniIndi\",\"text\",
                        \" Push Exit [X] button and reload DPs on restart\"); 
    while(1) { delay(1); }
  } if(pmax >  4)
  { setValue(\"ErorIndi\",\"backCol\",\"Red\");
    sprintf(estr,\" ERROR: System Config - PortMax is too large: %d\", pmax); 
    setValue(\"ErorIndi\",\"text\", estr);
    setValue(\"MoniIndi\",\"text\",
                        \" Push Exit [X] button and reload DPs on restart\"); 
    while(1) { delay(1); }
  } if(umax > 16)
  { setValue(\"ErorIndi\",\"backCol\",\"Red\");
    sprintf(estr,\" ERROR: System Config - UnitMax is too large: %d\", umax); 
    setValue(\"ErorIndi\",\"text\", estr);
    setValue(\"MoniIndi\",\"text\",
                        \" Push Exit [X] button and reload DPs on restart\"); 
    while(1) { delay(1); }
  } if(cmax > 48)
  { setValue(\"ErorIndi\",\"backCol\",\"Red\");
    sprintf(estr,\" ERROR: System Config - ChanMax is too large: %d\", cmax); 
    setValue(\"ErorIndi\",\"text\", estr);
    setValue(\"MoniIndi\",\"text\",
                        \" Push Exit [X] button and reload DPs on restart\"); 
    while(1) { delay(1); }
  }
  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
  OffColour(\"SCTmops1:Syst.Stat:_original.._value\", syss);
  sprintf(mstr,\" WAIT 10 sec FOR %s INITIALISATION \", snam);
  setValue(\"MoniIndi\",\"text\", mstr);
  delay(10);
  dpSet(\"SCTmops1:Busy.Stat:_original.._value\", 0x0);
//  dpSet(\"SCTmops1:Moni.Stat:_original.._value\", 0x0);  /* Green Background*/
  sprintf(mstr,\" %s IS WAITING... \", snam);
  setValue(\"MoniIndi\",\"text\", mstr);
}

/* 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
              {   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 \"OFF\" BUTTON                                              */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OffColour(string Dapo, int Stat) 
 { int stat, stus;                   /* System STATe & STatUS               */

   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0x0)                 /* If System State is 'Off'            */
   { 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->CONFIG\" TRANSITION INDICATOR                        */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 OffConfColour(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((stat & 0xC) == 0x0)
   {   if(next == 0x4)
     { SetOffColour(\"OffConfIndi\", stus);
     } else
     { SetOffColour(\"OffConfIndi\", 0x5);  /* Grey Colour                    */
     }
   }
 }

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

13 37
"HVstbIndi"
""
1 30 10 E E E 1 E 1 E N "_3DText" E N {153,153,153} E E
 E E
34 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Arial Narrow-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
28 8 52 42
T 
1
LANG:1 2 HV
E E E "/* HV 'Stb'Indi
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
/*===================================-======================================*/
/*                         SYSTEM HV STATE INDICATOR                        */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        S.G.Basiladze

   DESIGN ISSUEs:  This object has a colour indicator of a System HV state

   MODIF_HISTORY:  21.12.2002 - first version
  ===================================-======================================*/

main()
{
  dpConnect(\"HVstbColour\",\"SCTmops1:HVol.Stat:_original.._value\");
}

/* SHOW STATUS COLOUR OF HV INDICATOR                                       */
/*                                                                          */
/*                      Name - NAME   of the Button or Indicator            */
/*                      Stus - STatUS of the Button or Indicator            */ 
/*                                                                          */
 SetHVstbColour(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 \"HV\" INDI                                                 */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 HVstbColour(string Dapo, int Stat) 
 { int stat, stus;
 
   stat = Stat & 0xC;  stus = Stat & 0x33;
     if(stat == 0x8)
   { SetHVstbColour(\"HVstbIndi\", stus);
   } else
   { SetHVstbColour(\"HVstbIndi\", 0x5); /* Grey Colour                         */
   }
 }" 0

13 11
"Stb_Butn"
""
1 49 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|-13,0,0,0,700,0,0,0,0,3,2,1,34,Arial Narrow
0 ""
47 8 101 42
T 
1
LANG:1 7 Standby
"/* Standby_Local Button
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ int syss;

  dpGet(\"SCTmops1:Syst.Stat:_original.._value\", syss);
    if(syss & 0x20)                  /* System is in the Local mode         */
  { dpSet(\"SCTmops1:Host.Stat:_original.._value\", 0x28);
  }
}" 0
 E E "/* Standby 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
  ===================================-======================================*/
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(\"StbConfGrey\"  ,\"SCTmops1:Syst.Stat:_original.._value\");
  dpConnect(\"StbConfColour\",\"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            */ 
/*                                                                          */
 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, stus;                   /* System STATe & STatUS               */
 
   syss = Stat & 0xC;  stus = Stat & 0x33;
     if(syss == 0x8)                 /* If System State is 'Standby'        */
   { 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->CONF\" TRANSITION INDICATOR                      */
/*                                                                          */
/*                      Dapo - System state DAta POint (object)             */
/*                      Stat - System STATe and STatUS                      */ 
/*                                                                          */
 StbConfColour(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(\"StbConfIndi\", stus);
   } else
   { SetStbColour(\"StbConfIndi\", 0x5);         /* Grey Colour               */
   }
 }

 StbConfGrey(string Dapo, int Stat) 
 { 
   SetStbColour(\"StbConfIndi\", 0x5);           /* Grey Colour               */
 }" 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 0 "OffConfIndi"
"objects\\SCT_TrUp.pnl" 40 100 T 40 1 0 1  120 -28  
0
3 1 "ConfStbIndi"
"objects\\SCT_TrUp.pnl" 120 110 T 41 1 0 1  0 -59  
0
3 2 "StbOnIndi"
"objects\\SCT_TrUp.pnl" 50 100 T 42 1 0 1  105 -75  
0
3 3 "ConfOffIndi"
"objects\\SCT_TrDn.pnl" 130 110 T 43 1 0 1  25 -50  
0
3 4 "StbConfIndi"
"objects\\SCT_TrDn.pnl" 110 100 T 44 1 0 1  30 -54  
0
3 5 "OnStbIndi"
"objects\\SCT_TrDn.pnl" 70 100 T 45 1 0 1  90 -62  
0
0