1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using Aitex.Core.RT.Log;
- using athosRT.tool;
- using MECF.Framework.Common.Communications;
- using System.Diagnostics;
- namespace athosRT.Modules.Robot
- {
- public class RorzeRobot751SetHandler : RorzeRobot751Handler
- {
- private string cmd;
- public RorzeRobot751SetHandler(RorzeRobot751 robot, string command, string parameter = null)
- : base(robot, command, parameter)
- {
- cmd = command;
- 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.Info("Robot", $"Robot Handle Message: {rorzeRobot751Message.RawMessage}"+ $"{(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;
- }
- }
- }
|