12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using Aitex.Core.RT.Log;
- using athosRT.tool;
- using MECF.Framework.Common.Communications;
- namespace athosRT.Modules.Robot
- {
- public class RorzeRobot751ReadHandler : RorzeRobot751Handler
- {
- public RorzeRobot751ReadHandler(RorzeRobot751 robot, string command, string parameter = null)
- : base(robot, command, parameter)
- {
- string text = (string.IsNullOrEmpty(parameter) ? parameter : "");
- LOG.Write(robot.Name + " execute read command " + command + " " + text + " in ASCII.", 2, "D:\\sorter\\trunk\\Efem\\Jet\\Jet_001_2P_Jet\\EfemRT\\Devices\\Rorze751\\RorzeRobot751Handler.cs", ".ctor", 87);
- }
- public override bool HandleMessage(MessageBase msg, out bool transactionComplete)
- {
- RorzeRobot751Message rorzeRobot751Message = msg as RorzeRobot751Message;
- LogObject.Info("Robot", $"Robot Handle Message: {rorzeRobot751Message.RawMessage}" + $"{(rorzeRobot751Message.IsError ? $",Error:{rorzeRobot751Message.ErrorCode}" : "")}");
- if (!rorzeRobot751Message.RawMessage.Contains(_command))
- {
- transactionComplete = false;
- return false;
- }
- if (rorzeRobot751Message.IsEvent)
- {
- transactionComplete = false;
- return false;
- }
- if (!rorzeRobot751Message.IsAck)
- {
- base.Device.OnError("GetErrorMsg:" + rorzeRobot751Message.RawMessage);
- transactionComplete = true;
- return true;
- }
- base.Device.ParseReadData(_command, rorzeRobot751Message.Data);
- transactionComplete = true;
- return true;
- }
- }
- }
|