public void ProcLineInfo(object sender, StanMsgHandlerArgs handler) { var bytes = handler.Message.Data; //var vehicle_obj_info = sc.BLL.VehicleBLL.Convert2Object_VehicleInfo(bytes); // var vh_obj = ZeroFormatterSerializer.Deserialize<AVEHICLE>(bytes); sc.ProtocolFormat.OHTMessage.LINE_INFO line_info = sc.BLL.LineBLL.Convert2Object_LineInfo(bytes); app.ObjCacheManager.putLine(line_info); }
public static void set(this sc.ALINE line, sc.ProtocolFormat.OHTMessage.LINE_INFO new_line) { line.Secs_Link_Stat = new_line.Host == sc.ProtocolFormat.OHTMessage.LinkStatus.LinkOk ? sc.App.SCAppConstants.LinkStatus.LinkOK : sc.App.SCAppConstants.LinkStatus.LinkFail; line.DetectionSystemExist = new_line.IMS == sc.ProtocolFormat.OHTMessage.LinkStatus.LinkOk ? sc.App.SCAppConstants.ExistStatus.Exist : sc.App.SCAppConstants.ExistStatus.NoExist; line.Secs_Link_Stat = new_line.Host == sc.ProtocolFormat.OHTMessage.LinkStatus.LinkOk ? sc.App.SCAppConstants.LinkStatus.LinkOK : sc.App.SCAppConstants.LinkStatus.LinkFail; line.Host_Control_State = new_line.HostMode == sc.ProtocolFormat.OHTMessage.HostMode.OnlineRemote ? sc.App.SCAppConstants.LineHostControlState.HostControlState.On_Line_Remote : (new_line.HostMode == sc.ProtocolFormat.OHTMessage.HostMode.OnlineLocal ? sc.App.SCAppConstants.LineHostControlState.HostControlState.On_Line_Local : sc.App.SCAppConstants.LineHostControlState.HostControlState.EQ_Off_line); if (new_line.TSCState == sc.ProtocolFormat.OHTMessage.TSCState.Auto) { line.SCStats = sc.ALINE.TSCState.AUTO; } else if (new_line.TSCState == sc.ProtocolFormat.OHTMessage.TSCState.Paused) { line.SCStats = sc.ALINE.TSCState.PAUSED; } else if (new_line.TSCState == sc.ProtocolFormat.OHTMessage.TSCState.Pausing) { line.SCStats = sc.ALINE.TSCState.PAUSING; } else if (new_line.TSCState == sc.ProtocolFormat.OHTMessage.TSCState.Tscint) { line.SCStats = sc.ALINE.TSCState.TSC_INIT; } else if (new_line.TSCState == sc.ProtocolFormat.OHTMessage.TSCState.Tscnone) { line.SCStats = sc.ALINE.TSCState.NONE; } line.CurrntVehicleModeAutoRemoteCount = (ushort)new_line.CurrntVehicleModeAutoRemoteCount; line.CurrntVehicleModeAutoLoaclCount = (ushort)new_line.CurrntVehicleModeAutoLoaclCount; line.CurrntVehicleStatusIdelCount = (ushort)new_line.CurrntVehicleStatusIdelCount; line.CurrntVehicleStatusErrorCount = (ushort)new_line.CurrntVehicleStatusErrorCount; line.CurrntCSTStatueTransferCount = (ushort)new_line.CurrntCSTStatueTransferCount; line.CurrntCSTStatueWaitingCount = (ushort)new_line.CurrntCSTStatueWaitingCount; line.CurrntHostCommandTransferStatueAssignedCount = (ushort)new_line.CurrntHostCommandTransferStatueAssignedCount; line.CurrntHostCommandTransferStatueWaitingCounr = (ushort)new_line.CurrntHostCommandTransferStatueWaitingCounr; line.NotifyLineStatusChange(); }
public void putConnectionInfo(sc.ProtocolFormat.OHTMessage.LINE_INFO newLineInfo) { Line.set(newLineInfo); ConnectionInfoUpdate?.Invoke(this, EventArgs.Empty); }
//public void PutVehicle(AVEHICLE new_vh) //{ // if (new_vh == null) return; // AVEHICLE vh = Vehicles.Where(v => v.VEHICLE_ID == new_vh.VEHICLE_ID.Trim()).SingleOrDefault(); // vh.set(new_vh); // vh.NotifyVhPositionChange(); // vh.NotifyVhStatusChange(); //} public void putLine(sc.ProtocolFormat.OHTMessage.LINE_INFO newLineInfo) { Line.set(newLineInfo); Line.NotifyLineStatusChange(); }