示例#1
0
        public Magazine_Driver(LabManager.LabManager parent, int nMagazine_ID)
        {
            _nMagazine_ID = nMagazine_ID;
             _parent = parent;

             myMagazineHelper = new MagazineHelper(_nMagazine_ID);

             string IniFilePath = myDef.LanguageFile;
             myIniHandler = IniStructure.ReadIni(IniFilePath);

              //  _parent.InsertLoggingEntry((int)Definition.ThorLogWindows.ROUTING, "starting magazine '" + myMagazineHelper.GetMagazineName() + "' ");
             string strStarting = String.Format(myIniHandler.GetValue("Magazine", "StartMagazineInit"), myMagazineHelper.GetMagazineName());

             WriteLoggEntry((int)Definition.ThorLogWindows.ROUTING, strStarting, (int)Definition.Message.D_MESSAGE);

             UpdateMagazine();

             // Hook up the Elapsed event for the timer.
             MagazineDriverTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);

             // Set the Interval to 1 seconds (1000 milliseconds).
             MagazineDriverTimer.Interval = 1000;
             MagazineDriverTimer.Enabled = true;

             if (myMagazineHelper.GetOutputPosition() == -1 || myMagazineHelper.GetMachine_ID() == -1)
             {
                 string strCorruptConf = String.Format(myIniHandler.GetValue("Magazine", "CorruptConfiguration"), myMagazineHelper.GetOutputPosition(), myMagazineHelper.GetMachine_ID());
                 WriteLoggEntry((int)Definition.ThorLogWindows.ERROR, strCorruptConf, (int)Definition.Message.D_ALARM);
             }

             // Keep the timer alive until the end of Main.
              //GC.KeepAlive(MagazineDriverTimer);
        }
示例#2
0
        //  private string strActualValue = null;
        public RoutingCheck(LabManager.LabManager parent)
        {
            _parent = parent;

            // reset all conditions on start and check the routing lines again if connection to WinCC is established
            string SQL_StatementResetConditions = "UPDATE routing_conditions Set Condition_comply=0";
            myHC.return_SQL_Statement(SQL_StatementResetConditions);

            /* Adds the event and the event handler for the method that will
               process the timer event to the timer. */
            RoutingCeckTimer.Tick += new EventHandler(TimerEventProcessor);

            // Sets the timer interval to 1 second.
            RoutingCeckTimer.Interval = 1000;
            RoutingCeckTimer.Start();

            LoadRoutingTable();
        }
示例#3
0
        public RoutingCommand(LabManager.LabManager parent)
        {
            _parent = parent;
            //_parent.InsertLoggingEntry((int)Definition.ThorLogWindows.ROUTING, "starting checking commands for routing... ");
            WriteLoggEntry((int)Definition.ThorLogWindows.ROUTING, "starting checking commands for routing ... ", (int)Definition.Message.D_MESSAGE);

            //process the timer event to the timer.
            CommandTimer.Tick += new EventHandler(TimerEventProcessorForCommands);

            // Set the timer interval to 1 second! do not change the time otherwise the Count of the TimeForWaning/TimeForAlarm are not correct
            CommandTimer.Interval = 1000;
            CommandTimer.Start();

            // first check the routing conditions
            routingCheck = new RoutingCheck(_parent);
            routingCheck.CheckRoutingTableForActiveConditions();

            myHC.ResetActualTimeAndAlarmsOnRoutingPositionEntries();
            myHC.WriteWinCCTagFromSampleValuesByValueName("WarningTimeOn", "false", 1);
            myHC.WriteWinCCTagFromSampleValuesByValueName("AlarmTimeOn", "false", 1);
        }
示例#4
0
 public TCPIPHelper( LabManager.LabManager parent)
 {
     this.parent = parent;
 }