| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using AutoMapper; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using SqlSugar; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | |
| | | continue; |
| | | } |
| | | |
| | | int ext = (int)para.ExtendSpeed; |
| | | int ret = (int)para.RetractionSpeed; |
| | | int ext = (int)para.ExtendSpeed;//å·¦PLCèªå¨ä¼¸åºç¼©åé度 |
| | | int ret = (int)para.RetractionSpeed;//å³PLCèªå¨ä¼¸åºç¼©åé度 |
| | | |
| | | if (extendedState == "伸åº") |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D500", ext);//伸åºé度 |
| | | devices.Value.left.Communicator.Write<bool>("M100", true);//ä¼¸åºæé® |
| | | devices.Value.left.Communicator.Write<int>("D1001", ext);//伸åºé度 |
| | | devices.Value.left.Communicator.Write<bool>("M102", true);//ä¼¸åºæé® |
| | | |
| | | devices.Value.right.Communicator.Write<int>("D500", ext); |
| | | devices.Value.right.Communicator.Write<bool>("M100", true); |
| | | devices.Value.right.Communicator.Write<int>("D1001", ret); |
| | | devices.Value.right.Communicator.Write<bool>("M102", true); |
| | | |
| | | Console.WriteLine($"DeptId={deptId} ä¼¸åºæä½ï¼é度={ext}"); |
| | | Console.WriteLine($"DeptId={deptId} ï¼å·¦é度={ext}ï¼å³é度={ret}"); |
| | | } |
| | | else if (extendedState == "缩å") |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D501", ret);//伸åºé度 |
| | | devices.Value.left.Communicator.Write<bool>("M101", true);//ä¼¸åºæé® |
| | | devices.Value.left.Communicator.Write<int>("D1001", ext);//缩åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M103", true);//缩åæé® |
| | | |
| | | devices.Value.right.Communicator.Write<int>("D501", ret); |
| | | devices.Value.right.Communicator.Write<bool>("M101", true); |
| | | devices.Value.right.Communicator.Write<int>("D1001", ret); |
| | | devices.Value.right.Communicator.Write<bool>("M103", true); |
| | | |
| | | Console.WriteLine($"DeptId={deptId} 缩åæä½ï¼é度={ret}"); |
| | | Console.WriteLine($"DeptId={deptId} 缩åæä½ï¼å·¦é度={ext}ï¼å³é度={ret}"); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | return new WebResponseContent { Status = true, Message = "å
¨é¨è®¾å¤æä½å®æ" }; |
| | | return new WebResponseContent { Status = true, Message = "å
¨é¨è®¾å¤æä½å®æ", |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | if (para == null) |
| | | return new WebResponseContent { Status = false, Message = "åæ°æªé
ç½®" }; |
| | | |
| | | int ext = (int)para.ExtendSpeed; |
| | | int ret = (int)para.RetractionSpeed; |
| | | int ext = (int)para.ManualExtend;//å·¦PLCæå¨ä¼¸åºç¼©åé度 |
| | | int ret = (int)para.ManualRetraction;//å³PLCæå¨ä¼¸åºç¼©åé度 |
| | | |
| | | if (position == "å·¦" && ExtendedState == "伸åº") |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D500", ext);//伸åºé度 |
| | | devices.Value.left.Communicator.Write<int>("D1000", ext);//å·¦PLCæå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M100", true);//ä¼¸åºæé® |
| | | Console.WriteLine($"{position}伸缩ææå¨ä¼¸åº{ext}"); |
| | | Console.WriteLine($"{position}å·¦PLCèªå¨ä¼¸åºç¼©åé度{ext}"); |
| | | } |
| | | else if (position == "å·¦" && ExtendedState == "缩å") |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D501", ret);//缩åé度 |
| | | devices.Value.left.Communicator.Write<int>("D1000", ext);//å·¦PLCæå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M101", true); |
| | | Console.WriteLine($"{position}伸缩ææå¨ç¼©å{ret}"); |
| | | Console.WriteLine($"{position}å·¦PLCèªå¨ä¼¸åºç¼©åé度{ext}"); |
| | | } |
| | | else if (position == "å³" && ExtendedState == "伸åº") |
| | | { |
| | | devices.Value.right.Communicator.Write<int>("D500", ext); |
| | | devices.Value.right.Communicator.Write<int>("D1000", ret);//å³PLCæå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.right.Communicator.Write<bool>("M100", true); |
| | | Console.WriteLine($"{position}伸缩ææå¨ä¼¸åº{ext}"); |
| | | Console.WriteLine($"{position}å³PLCèªå¨ä¼¸åºç¼©åé度{ext}"); |
| | | } |
| | | else if (position == "å³" && ExtendedState == "缩å") |
| | | { |
| | | devices.Value.right.Communicator.Write<int>("D501", ret); |
| | | devices.Value.right.Communicator.Write<int>("D1000", ret);//å³PLCæå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.right.Communicator.Write<bool>("M101", true); |
| | | Console.WriteLine($"{position}伸缩ææå¨ç¼©å{ret}"); |
| | | Console.WriteLine($"{position}å³PLCèªå¨ä¼¸åºç¼©åé度{ret}"); |
| | | } |
| | | |
| | | else |
| | |
| | | return new WebResponseContent { Status = false, Message = "ç¶æåæ°é误" }; |
| | | } |
| | | |
| | | return new WebResponseContent { Status = true, Message = "æå" }; |
| | | return new WebResponseContent { Status = true, Message = "æå", |
| | | Data = new |
| | | { |
| | | ManualExtend = ext, |
| | | ManualRetraction = ret |
| | | } |
| | | |
| | | }; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | return (left, right); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |