| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using System.Threading.Tasks;
- using TeamAAS.Feeder.Enums;
- using TeamAAS.Feeder.Models;
- namespace TeamAAS.Feeder.Interfaces
- {
- /// <summary>
- /// 单个供料器设备接口(抽象硬件能力)
- /// </summary>
- public interface IFeeder : IDisposable
- {
- Guid Id { get; }
- int FeederNo { get; }
- string Name { get; }
- FeederBrand Brand { get; }
- bool IsConnected { get; }
- bool IsBacklightOn { get; }
- event Action<IFeeder, bool> ConnectionChanged;
- /// <summary>收发报文事件:content=报文文本,isSend=true 为发送(TX)、false 为接收(RX)。</summary>
- event Action<IFeeder, string, bool> MessageExchanged;
- Task ConnectAsync();
- Task DisconnectAsync();
- Task OpenBacklightAsync();
- Task CloseBacklightAsync();
- Task<bool> QueryBacklightAsync();
- Task<int> RunDirectionAsync(FeederAction action, int? durationMs = null);
- Task StopAsync();
- Task<SingleActionParam> GetActionParamAsync(int index);
- Task SetActionParamAsync(int index, SingleActionParam param);
- Task DownloadAllParamsAsync(FeederInfo info);
- Task SaveToDeviceAsync();
- // ===== 系统参数(超时/背光):全局地址 44/34/33/65/66 =====
- Task<FeederSystemParam> GetSystemParamAsync();
- Task SetSystemParamAsync(FeederSystemParam param);
- // ===== 料斗输入输出:地址 742+8*n =====
- Task<HopperOutputParam> GetHopperParamAsync(int group);
- Task SetHopperParamAsync(int group, HopperOutputParam param);
- Task<int> RunHopperOutputAsync(int id, int? timespan = null);
- Task StopHopperOutputAsync();
- // ===== 输入触发序列ID:地址 39+index =====
- Task<int> GetInputTriggerAsync(int index);
- Task SetInputTriggerAsync(int index, int sequenceId);
- // ===== 通用参数读写(RP/WP)=====
- Task<int> ReadParamAsync(int id);
- Task WriteParamAsync(int id, int value);
- }
- }
|