| | |
| | | |
| | | if (extendedState == "伸åº") |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D1001", ext);//å·¦PLCèªå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M102", true);//ä¼¸åºæé® |
| | | devices.Value.right.Communicator.Write<int>("D1002", liftPosition);//左伸åºä½ç½® |
| | | try |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D1001", ext);//å·¦PLCèªå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M102", true);//ä¼¸åºæé® |
| | | devices.Value.left.Communicator.Write<int>("D1002", liftPosition);//左伸åºä½ç½® |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | devices.Value.right.Communicator.Write<int>("D1001", ret); //å³PLCèªå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.right.Communicator.Write<bool>("M102", true); |
| | | devices.Value.right.Communicator.Write<int>("D1002", rigtpostition);//å³ä¼¸åºä½ç½® |
| | | try |
| | | { |
| | | devices.Value.right.Communicator.Write<int>("D1001", ret); //å³PLCèªå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.right.Communicator.Write<bool>("M102", true); |
| | | devices.Value.right.Communicator.Write<int>("D1002", rigtpostition);//å³ä¼¸åºä½ç½® |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | |
| | | |
| | | |
| | | Console.WriteLine($"DeptId={deptId} ï¼å·¦é度={ext}ï¼å³é度={ret}"); |
| | | } |
| | | else if (extendedState == "缩å") |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D1001", ext);//缩åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M103", true);//缩åæé® |
| | | try |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D1001", ext);//缩åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M103", true);//缩åæé® |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | devices.Value.right.Communicator.Write<int>("D1001", ret); |
| | | devices.Value.right.Communicator.Write<bool>("M103", true); |
| | | throw; |
| | | } |
| | | |
| | | try |
| | | { |
| | | devices.Value.right.Communicator.Write<int>("D1001", ret); |
| | | devices.Value.right.Communicator.Write<bool>("M103", true); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | Console.WriteLine($"DeptId={deptId} 缩åæä½ï¼å·¦é度={ext}ï¼å³é度={ret}"); |
| | | } |
| | | else |
| | |
| | | { |
| | | //æ ¹æ®int.TryParse(AppSettings.Get("DepartmentID")读åå°å½åæ¯è½¨éå ï¼ææäººé½åªè½æä½å½å |
| | | var devices = GetDevicesByDeptId(deptid); |
| | | devices.Value.left.Communicator.Write<bool>("M104", true); |
| | | devices.Value.right.Communicator.Write<bool>("M104", true); |
| | | try |
| | | { |
| | | devices.Value.left.Communicator.Write<bool>("M104", true); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | |
| | | try |
| | | { |
| | | devices.Value.right.Communicator.Write<bool>("M104", true); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | return new WebResponseContent { Status = true, Message = "æåæå", Data = devices }; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 伸缩æå½åä½ç½® |
| | | /// 伸缩æå½åä½ç½®(è¿ä¸ªæ²¡æç¨) |
| | | /// <param name="deptid">轨éç«å·</param> |
| | | public WebResponseContent CurrentLocation(int deptid) |
| | | { |