| | |
| | | /// </summary> |
| | | /// <param name="item">运动对象</param> |
| | | /// <returns>运动控制+停止判断</returns> |
| | | public bool MoveToPoint(IOperationConfig opConfig) |
| | | public ResponseMessage MoveToPoint(IOperationConfig opConfig) |
| | | { |
| | | bool resultOK = false; |
| | | var gtsOperationConfig = opConfig as GTSCardOperationConfig; |
| | |
| | | Task.WaitAll(taskList.ToArray()); |
| | | resultOK = taskList.All(u => u.GetAwaiter().GetResult()); |
| | | |
| | | return resultOK; |
| | | //return resultOK; |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | IONum = index, |
| | | Value = (inValue & (1 << index)) == 0 ? 1 : 0, |
| | | Model = IOModel.In |
| | | IOType = IOType.In |
| | | }; |
| | | IOItem outItem = new IOItem() |
| | | { |
| | | IONum = index, |
| | | Value = (outValue & (1 << index)) == 0 ? 1 : 0, |
| | | Model = IOModel.Out |
| | | IOType = IOType.Out |
| | | }; |
| | | result.Add(inItem); |
| | | result.Add(outItem); |
| | |
| | | sw.Start(); |
| | | if (MonitorValues.Count == newValues.Count) |
| | | { |
| | | var tempNew = new List<IOItem>(newValues);//clone |
| | | var tempOld = new List<IOItem>(MonitorValues); |
| | | var tempNew = newValues.DeepSerializeClone();//clone |
| | | var tempOld = MonitorValues.DeepSerializeClone(); |
| | | MonitorCheckAndInvoke(tempNew, tempOld); |
| | | } |
| | | MonitorValues = new List<IOItem>(newValues); |
| | |
| | | foreach (var replyIOData in monitorSet.ReplyIODatas) |
| | | { |
| | | //写入IO输出 |
| | | if (replyIOData.Model == IOModel.Out) |
| | | if (replyIOData.IOType == IOType.Out) |
| | | { |
| | | GTSCardAPI.GT_SetDoBit((short)IConfig.CardNum, GTSCardAPI.MC_GPI, (short)replyIOData.IONum, (short)replyIOData.Value); |
| | | } |
| | |
| | | { |
| | | MotionCardWarningSet warningSet = wSet as MotionCardWarningSet; |
| | | |
| | | bool isOn = ((tempNew.FirstOrDefault(u => u.IONum == warningSet.TriggerIndex && u.Model == warningSet.WarningIOModel)?.Value >> warningSet.TriggerIndex) & 1) == (warningSet.TriggerValue ? 1 : 0); |
| | | bool isOn = ((tempNew.FirstOrDefault(u => u.IONum == warningSet.TriggerIndex && u.IOType == warningSet.WarningIOModel)?.Value >> warningSet.TriggerIndex) & 1) == (warningSet.TriggerValue ? 1 : 0); |
| | | |
| | | if (warningSet.CurrentStatus != isOn) |
| | | { |