| | |
| | | #region << ç æ¬ 注 é >> |
| | | |
| | | /*---------------------------------------------------------------- |
| | | * å½å空é´ï¼WIDESEAWCS_QuartzJob |
| | | * å建è
ï¼è¡ç«¥åº |
| | |
| | | * ä¿®æ¹æ¶é´ï¼ |
| | | * çæ¬ï¼V1.0.1 |
| | | * ä¿®æ¹è¯´æï¼ |
| | | * |
| | | * |
| | | *----------------------------------------------------------------*/ |
| | | |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using HslCommunication; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Communicator; |
| | | using WIDESEAWCS_QuartzJob.ConveyorLine.Enum; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | |
| | | namespace WIDESEAWCS_QuartzJob |
| | | { |
| | |
| | | public class CommonRoast : IRoast |
| | | { |
| | | #region Private Member |
| | | |
| | | /// <summary> |
| | | /// çç¤é讯对象 |
| | | /// </summary> |
| | |
| | | private bool _heartStatr = true; |
| | | |
| | | private bool _isConnected = true; |
| | | |
| | | #endregion |
| | | |
| | | #region Public Member |
| | | |
| | | /// <summary> |
| | | /// çç¤é讯对象 |
| | | /// </summary> |
| | |
| | | #endregion |
| | | |
| | | #region Constructor Function |
| | | |
| | | /// <summary> |
| | | /// æé 彿° |
| | | /// </summary> |
| | |
| | | _deviceName = deviceName; |
| | | CheckConnect(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Private Method |
| | | |
| | | private void CheckConnect() |
| | | { |
| | | Task.Run(() => |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Public Method |
| | | |
| | | /// <summary> |
| | | /// 读åPLCåè®®å°åçæ°æ® |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// |
| | | /// </summary> |
| | | /// <typeparam name="T"></typeparam> |
| | | /// <param name="command"></param> |
| | |
| | | /// <exception cref="Exception"></exception> |
| | | public bool SendCommand<T>(T command, string deviceChildCode) where T : IDataTransfer, new() |
| | | { |
| | | if(Communicator is SiemensS7) |
| | | if (Communicator is MelsecA1ENetCommunicator) |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | |
| | | // åè¯åå¾åæ¶å¨ä¸åè°ç¨ç»ç»å¨ |
| | | GC.SuppressFinalize(this); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | | } |