Example #1
0
 public override void Initialize(BasicWarehouse w)
 {
     base.Initialize(w);
     try
     {
         base.Initialize(w);
         if (ConveyorInfo != null)
         {
             ConveyorInfo.Initialize();
         }
         if (XmlRouteNode != null)
         {
             Route = new RouteNode {
                 Next = Warehouse.FindConveyorBasic(XmlRouteNode.Next), Cost = XmlRouteNode.Cost
             };
             if (Route.Next is Crane)
             {
                 Warehouse.ConnectCraneInConveyor(this, Route);
             }
         }
     }
     catch (Exception ex)
     {
         Warehouse.AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, ex.Message);
         throw new ConveyorException(String.Format("{0} Conveyor.Initialize failed", Name));
     }
 }
Example #2
0
 public virtual void OnTelegramTransportStatus(Telegram t)
 {
     try
     {
         if (t != null)
         {
             PLC_Status = t as TelegramTransportStatus;
         }
         // call action
         if (ConveyorInfo != null && PLC_Status != null)
         {
             ConveyorInfo.Name    = Name;
             ConveyorInfo.AlarmID = PLC_Status.FirstAlarmID;
             ConveyorInfo.Fault   = PLC_Status.Fault;
             ConveyorInfo.SetAlarms(PLC_Status.Alarms, Warehouse);
             ConveyorInfo.SetSensors(PLC_Status.State);
             ConveyorInfo.SetState(PLC_Status.Status);
             ConveyorInfo.Status   = PLC_Status.Status;
             ConveyorInfo.State    = PLC_Status.State;
             ConveyorInfo.Online   = Online();
             ConveyorInfo.Material = Place != null ? Place.Material : 0;
             CallNotifyVM(ConveyorInfo);
         }
     }
     catch (Exception ex)
     {
         Warehouse.AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, String.Format("Conveyor.OnTelegramTransportStatus {0}", ex.Message));
         Warehouse.SteeringCommands.Run = false;
     }
 }
Example #3
0
 public override void DirectVMNotify()
 {
     if (ConveyorInfo != null && PLC_Status != null)
     {
         ConveyorInfo.Name    = Name;
         ConveyorInfo.AlarmID = PLC_Status.FirstAlarmID;
         ConveyorInfo.Fault   = PLC_Status.Fault;
         ConveyorInfo.SetAlarms(PLC_Status.Alarms, Warehouse);
         ConveyorInfo.SetSensors(PLC_Status.State);
         ConveyorInfo.SetState(PLC_Status.Status);
         ConveyorInfo.Status   = PLC_Status.Status;
         ConveyorInfo.State    = PLC_Status.State;
         ConveyorInfo.Online   = Online();
         ConveyorInfo.Material = Place != null ? Place.Material : 0;
         CallNotifyVM(ConveyorInfo);
     }
 }
Example #4
0
 public override void Initialize(BasicWarehouse w)
 {
     try
     {
         Warehouse    = w;
         Communicator = Warehouse.Communicator[CommunicatorName];
         if (ConveyorInfo != null)
         {
             ConveyorInfo.Name = Name;
             ConveyorInfo.Initialize();
         }
     }
     catch (Exception ex)
     {
         Warehouse.AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, ex.Message);
         throw new ConveyorException(String.Format("{0} MainPanel.Initialize failed", Name));
     }
 }