Ejemplo n.º 1
0
 public MachineStatusData(string lineName, string machineName, MachineStatus status)
     : base(MESSAGE_ID)
 {
     base.AttachDataAttribute(MachineStatusData.LINE_NAME, lineName);
     base.AttachDataAttribute(MachineStatusData.MACHINE_NAME, machineName);
     base.AttachDataAttribute(MachineStatusData.MACHINE_STATUS, status.ToString().ToUpper());
     //
     this._lineName    = lineName;
     this._machineName = machineName;
     this._status      = status;
 }
Ejemplo n.º 2
0
 public void StursView(MachineStatus txt)
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action <MachineStatus>(StursView), txt);
     }
     else
     {
         lblTestStep.Text = txt.ToString();
     }
 }
Ejemplo n.º 3
0
 public HeartBeatManager(EvaluatorSettings settings, IRemoteIdentifier remoteId)
 {
     using (LOGGER.LogFunction("HeartBeatManager::HeartBeatManager"))
     {
         _remoteManager = settings.RemoteManager;
         _remoteId      = remoteId;
         _evaluatorId   = settings.EvalutorId;
         _observer      = _remoteManager.GetRemoteObserver(new RemoteEventEndPoint <REEFMessage>(_remoteId));
         _clock         = settings.RuntimeClock;
         _heartBeatPeriodInMillSeconds = settings.HeartBeatPeriodInMs;
         _maxHeartbeatRetries          = settings.MaxHeartbeatFailures;
         EvaluatorSettings             = settings;
         MachineStatus.ToString(); // kick start the CPU perf counter
     }
 }
Ejemplo n.º 4
0
 private HeartBeatManager(
     EvaluatorSettings settings,
     IInjectionFuture <EvaluatorRuntime> evaluatorRuntime,
     IInjectionFuture <ContextManager> contextManager,
     [Parameter(typeof(ErrorHandlerRid))] string errorHandlerRid)
 {
     using (LOGGER.LogFunction("HeartBeatManager::HeartBeatManager"))
     {
         _evaluatorSettings            = settings;
         _evaluatorRuntime             = evaluatorRuntime;
         _contextManager               = contextManager;
         _remoteManager                = settings.RemoteManager;
         _remoteId                     = new SocketRemoteIdentifier(NetUtilities.ParseIpEndpoint(errorHandlerRid));
         _observer                     = _remoteManager.GetRemoteObserver(new RemoteEventEndPoint <REEFMessage>(_remoteId));
         _clock                        = settings.RuntimeClock;
         _heartBeatPeriodInMillSeconds = settings.HeartBeatPeriodInMs;
         _maxHeartbeatRetries          = settings.MaxHeartbeatRetries;
         MachineStatus.ToString(); // kick start the CPU perf counter
     }
 }
Ejemplo n.º 5
0
    public void UpdateMachineStatus(MachineStatus status)
    {
        int           iStatus    = ACTIONFLAG;
        MachineStatus ActionFlag = (MachineStatus)iStatus;

        if ((ActionFlag & status) == 0)
        {
            ActionFlag |= status;

            using (var db = new BST_STATISTICSEntities())
            {
                db.SCHEDULEs.RemoveRange(db.SCHEDULEs.Where(x => x.LOCKEDBY == ID));

                db.PCS.First(p => p.PCNAME == NAME).ACTIONFLAG = (int)ActionFlag;
                db.SaveChanges();
            }
        }
        Log.FeedLog(string.Format("Machine {0} has been changed: {1}. By {2}", NAME, status.ToString(), CurrentContext.UserName()));
        ResetCache();
    }
Ejemplo n.º 6
0
 /// <summary>
 /// Process the serial port alarm message reply.
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public void ProcessAlarmResponse(string data)
 {
     ResponseStatus     = RespStatus.NOk;
     MachineStatusColor = Brushes.Red;
     MachineStatus      = MachStatus.Alarm;
     logger.Info("GrblTool|ProcessResponse|Data:{0}|RespStatus:{1}|MachStatus:{2}", data, ResponseStatus.ToString(), MachineStatus.ToString());
     if (!string.IsNullOrEmpty(data))
     {
         if (VersionGrbl.StartsWith("1", StringComparison.InvariantCulture))
         {
             AlarmMessage = GrblAlarmCodec.AlarmDict11[data.Split(':')[1]];
             logger.Info("GrblTool|ProcessAlarmResponse11|Alarm key {0} | description:{1}", data.Split(':')[1], AlarmMessage);
         }
         else
         {
             AlarmMessage = GrblAlarmCodec.AlarmDict09[data.Split(':')[1]];
             logger.Info("GrblTool|ProcessAlarmResponse09|Alarm key {0} | description:{1}", data.Split(':')[1], AlarmMessage);
         }
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Task host base class to hold the common stuff of both mapper and update tasks
        /// </summary>
        /// <param name="groupCommunicationsClient">Group Communication Client</param>
        /// <param name="taskCloseCoordinator">The class that handles the close event for the task</param>
        /// <param name="invokeGc">specify if want to invoke garbage collector or not </param>
        protected TaskHostBase(
            IGroupCommClient groupCommunicationsClient,
            TaskCloseCoordinator taskCloseCoordinator,
            bool invokeGc)
        {
            Logger.Log(Level.Info, "Entering TaskHostBase constructor with machine status {0}.", _machineStatus.ToString());
            _groupCommunicationsClient = groupCommunicationsClient;
            _communicationGroupClient  = groupCommunicationsClient.GetCommunicationGroup(IMRUConstants.CommunicationGroupName);

            _invokeGc             = invokeGc;
            _taskCloseCoordinator = taskCloseCoordinator;
            _cancellationSource   = new CancellationTokenSource();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Process the serial port alarm message reply.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public void ProcessAlarmResponse(string data, bool version)
        {
            ResponseStatus     = RespStatus.NOk;
            MachineStatusColor = Brushes.Red;
            MachineStatus      = MachStatus.Alarm;
            logger.Info("GrblTool|ProcessAlarmResponse|Data:{0}|RespStatus:{1}|MachStatus:{2}", data, ResponseStatus.ToString(), MachineStatus.ToString());
            try
            {
                if (!string.IsNullOrEmpty(data))
                {
                    logger.Info("GrblTool|ProcessAlarmResponse {0} VersionGrbl {1}", data, version);

                    if (version)
                    {
                        AlarmMessage = GrblAlarmCodec.AlarmDict11[data.Split(':')[1]];
                        logger.Info("GrblTool|ProcessAlarmResponse11|Alarm key {0} | description:{1}", data.Split(':')[1], AlarmMessage);
                    }
                    else
                    {
                        AlarmMessage = GrblAlarmCodec.AlarmDict09[data.Split(':')[1]];
                        logger.Info("GrblTool|ProcessAlarmResponse09|Alarm key {0} | description:{1}", data.Split(':')[1], AlarmMessage);
                    }
                }
            }
            catch (FormatException ex)
            {
                logger.Error(CultureInfo.CurrentCulture, "GrblTool|ProcessAlarmResponse {0}", ex.ToString());
            }
        }