public void ControlOil(string gpsCode, EnumOilCommandType commandType, GPSType type, Guid sequnceNo) { ControlOilCircuit control = new ControlOilCircuit(); control.Data.GpsType = GPSType.YouWei; control.BreakOilCircuitTime = DateTime.Now; control.GPSCode = gpsCode; control.SerialNumber = sequnceNo.ToString(); control.Data.GpsType = type; control.Data.IsGpsAckMsg = true; bool flag = false; if (commandType == EnumOilCommandType.BreakOil) { flag = CommandService.GetInstance().BreakOilCircuitBySmart(control); EnumOilCommandState state = flag == true ? EnumOilCommandState.Sended : EnumOilCommandState.SendFail; DACFacade.Gps.BreakOilHistoryRecordDAC.UpdateState(sequnceNo, state); WirteSendLog(flag, gpsCode, "智能断电."); } if (commandType == EnumOilCommandType.Support) { flag = CommandService.GetInstance().SupplyOilCircuit(control); EnumOilCommandState state = flag == true ? EnumOilCommandState.Sended : EnumOilCommandState.SendFail; DACFacade.Gps.BreakOilHistoryRecordDAC.UpdateState(sequnceNo, state); WirteSendLog(flag, gpsCode, "供电供油."); } }
public void ControlOil(string gpsCode, EnumOilCommandType commandType, GPSType type, Guid sequnceNo) { switch (type) { case GPSType.YouWei: YWGPSController ywController = new YWGPSController(); ywController.ControlOil(gpsCode, commandType, type, sequnceNo); break; case GPSType.BuBiao: BBGPSController bbController = new BBGPSController(); bbController.ControlOil(gpsCode, commandType, type, sequnceNo); break; } }
private static void CheckInput(string[] args) { string invalidCommandLine = "Invalid command line! \nExample: GPSTrackConverter.exe type inputfile outputfile \ntype = GPX | O | M"; if (args.Length != 3) throw new Exception(invalidCommandLine); if (args[0] == "M") ms_gpsType = GPSType.Magellan; else if (args[0] == "O") ms_gpsType = GPSType.Ozi; else if (args[0] == "GPX") ms_gpsType = GPSType.GPX; else throw new Exception(invalidCommandLine); ms_inputFileName = args[1]; ms_outputFileName = ReplaceIncorectSymbols(args[2]); if (!File.Exists(ms_inputFileName)) throw new Exception("Input file doesn't exist!"); if (File.Exists(ms_outputFileName)) throw new Exception("Output file already exists!"); }
public void ControlOil(string gpsCode, EnumOilCommandType commandType, GPSType type, Guid sequnceNo) { YWGPSController controller = new YWGPSController(); controller.ControlOil(gpsCode, commandType, type, sequnceNo); }