|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System;
- using BPASmartClient.Peripheral;
- using BPASmartClient.SerialPort;
- using BPASmartClient.Model.צ;
- using static BPA.Helper.EventBus;
- using BPA.Helper;
-
- namespace BPASmartClient.RobotGripper
- {
- public class RobotGripperMachine : BasePeripheral
- {
- RobotGripperHelper machineHelper = new RobotGripperHelper();
- public override void Init()
- {
- machineHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate);
- EventBus.GetInstance().Subscribe<WriteGripper>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
- {
- if (@event == null) return;
- var par = @event as WriteGripper;
- switch (par?.TagName)
- {
- case "PWMControl":
- machineHelper.Write(Convert.ToByte(par?.CH_Number), Convert.ToString(par?.PWMOutput));
- break;
- default:
- break;
- }
- });
- }
- public override void Start()
- {
-
- }
-
- public override void Stop()
- {
- machineHelper.Stop(communicationPar.SerialPort);
- }
-
- public override void WriteData(string address, object value)
- {
-
- }
-
- protected override void InitStatus()
- {
-
- }
- }
- }
|