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