Exemplo n.º 1
0
        public override void DirectVMNotify()
        {
            System.Collections.BitArray ta;

            if (SegmentInfo != null && PLC_Status != null)
            {
                TelegramTransportStatus tel = PLC_Status as TelegramTransportStatus;

                SegmentInfo.Name    = Name;
                SegmentInfo.AlarmID = tel.FirstAlarmID;
                SegmentInfo.Fault   = tel.Fault;
                ta = tel.Alarms.Clone() as System.Collections.BitArray;
                if (SegmentConveyors.Count() == 0) // only main cabinet
                {
                    Warehouse.StrategyList.ForEach(bs => ta[98] = (bs is Strategy.StrategyGeneral)? (bs as Strategy.StrategyGeneral).DatabaseToLarge: ta[98]);
                }
                SegmentInfo.SetAlarms(ta, Warehouse);
                SegmentInfo.SetSensors(tel.State);
                SegmentInfo.SetState(tel.Status);
                SegmentInfo.Status = tel.Status;
                SegmentInfo.State  = tel.State;
                SegmentInfo.Online = Communicator.Online();
                CallNotifyVM(SegmentInfo);
            }
        }
Exemplo n.º 2
0
 public override void Refresh()
 {
     base.Refresh();
     if (!UINotified)
     {
         SegmentConveyors.ForEach(prop => prop.DirectVMNotify());
         Warehouse.SteeringCommands.DirectVMNotify();
         DirectVMNotify();
         UINotified = true;
     }
 }
Exemplo n.º 3
0
 public override void OnlineTrigger()
 {
     if (Communicator.Online() && !_oldOnline)
     {
         Startup();
         DirectVMNotify();
         SegmentConveyors.ForEach(prop => prop.DirectVMNotify());
     }
     if (!Communicator.Online() && _oldOnline)
     {
         DirectVMNotify();
         SegmentConveyors.ForEach(prop => prop.DirectVMNotify());
     }
     _oldOnline = Communicator.Online();
 }
Exemplo n.º 4
0
 public virtual void OnTelegramTransportStatus(Telegram t)
 {
     // notify all segment conveyors
     try
     {
         SegmentConveyors.ForEach(prop => prop.OnTelegramTransportStatus(t));
         if (t != null)
         {
             PLC_Status = t;
         }
         DirectVMNotify();
     }
     catch (Exception ex)
     {
         Warehouse.AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, ex.Message);
         throw new SegmentException(String.Format("{0} SegmentMainPanel.OnTelegramTransportStatus failed ", Name));
     }
 }