| | |
| | | using IStation.DataDockingSocket.MsgHandle; |
| | | using IStation.Untity; |
| | | using IStation.Untity; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | NtLogHelper.Info("南通控制命令,数据序列化失败"); |
| | | return true; |
| | | } |
| | | |
| | | switch (paras.Type) |
| | | {//0代表关机 1代表开机 - 1代表变频 |
| | | case 0: |
| | | JobShutDownPump(session); |
| | | break;//从辅助类中获取 关闭 |
| | | case 1: |
| | | ShunUpMsgHelper.JobStartUpPump(session); |
| | | break;//从辅助类中获取 开启 |
| | | switch (paras.ControlType) |
| | | { |
| | | case Model.MonitorTestControlParas.eControlType.Stop: |
| | | { |
| | | ShutDownMsgHelper.StartJob(session); |
| | | } |
| | | break; |
| | | case Model.MonitorTestControlParas.eControlType.Start: |
| | | { |
| | | if (string.IsNullOrEmpty(paras.Context)) |
| | | return false; |
| | | var context = Model.MonitorTestControlParas.StartContext.ToModel(paras.Context); |
| | | if (context == null) |
| | | return default; |
| | | NtLogHelper.Debug(context.ToJson()); |
| | | StartUpMsgHelper.StartJob(session, context); |
| | | } |
| | | break; |
| | | default: |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 关机 |
| | | /// </summary> |
| | | /// <param name="session"></param> |
| | | /// <returns></returns> |
| | | public static bool JobShutDownPump(Model.IMonitorDataDockingSession session) |
| | | { |
| | | if (session != null) |
| | | { |
| | | NtLogHelper.Error($"关机 session:Close"); |
| | | return false; |
| | | } |
| | | |
| | | if (session.IsConnected) |
| | | { |
| | | //byte[] bts = MonitorMsgHelper.GetControlMsg关机(); |
| | | //session.Send(bts, 0, bts.Length); |
| | | |
| | | //NtLogHelper.Info("关机 " + session.SessionName + ":" + BitTransfer.ToString(bts) + |
| | | // ", 发送一条请求控制指令"); |
| | | |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | NtLogHelper.Error($"关机时 session:Not connected"); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |