123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using Aitex.Core.RT.Log;
- using athosRT.tool;
- using MECF.Framework.Common.Communications;
- using System.Diagnostics;
- namespace athosRT.Modules.Robot
- {
- public class RorzeRobot751SetHandler : RorzeRobot751Handler
- {
- public RorzeRobot751SetHandler(RorzeRobot751 robot, string command, string parameter = null)
- : base(robot, command, parameter)
- {
- string text = (string.IsNullOrEmpty(parameter) ? parameter : "");
- LOG.Write(robot.Name + " execute set command " + command + " " + text + " in ASCII.", 2, "D:\\sorter\\trunk\\Efem\\Jet\\Jet_001_2P_Jet\\EfemRT\\Devices\\Rorze751\\RorzeRobot751Handler.cs", ".ctor", 124);
- }
- public override bool HandleMessage(MessageBase msg, out bool transactionComplete)
- {
- //Trace.WriteLine("Ö´ÐÐÒÔÏÂÖ¸Áî");
- RorzeRobot751Message rorzeRobot751Message = msg as RorzeRobot751Message;
- LogObject.Warning("Robot", $"Command:{(rorzeRobot751Message.Command != null ? $"{rorzeRobot751Message.Command}":"None")}," +
- $"RawMessage:{(rorzeRobot751Message.RawMessage != null ? $"{rorzeRobot751Message.RawMessage}" : "None")}" +
- $"{(rorzeRobot751Message.IsError ? $"Error:{rorzeRobot751Message.ErrorCode}":"")}");
- if (!rorzeRobot751Message.RawMessage.Contains(_command))
- {
- transactionComplete = false;
- return false;
- }
- if (rorzeRobot751Message.IsAck)
- {
- base.Device.OnActionDone(null);
- transactionComplete = true;
- return true;
- }
- transactionComplete = true;
- return false;
- }
- }
- }
|