public void JoinMessage(string text)
 {
     if (!SentMessages.Contains(Step))
     {
         NewInstructionTextByText?.Invoke(CycleID, text);
     }
 }
 public void JoinTraceErrorDescription(int errorCode)
 {
     if (!SentMessages.Contains(Step))
     {
         GetTraceErrorDescription?.Invoke(CycleID, errorCode);
     }
 }
示例#3
0
 public void StartRFID(string name)
 {
     if (!SentMessages.Contains(Step))
     {
         TriggerRFID?.Invoke(name, true);
     }
 }
 public void EndMessage()
 {
     if (!SentMessages.Contains(Step))
     {
         SentMessages.Add(Step);
         EndOfInstructionText?.Invoke(CycleID);
     }
 }
示例#5
0
 public void StopRFID(string name)
 {
     if (!SentMessages.Contains(Step))
     {
         TriggerRFID?.Invoke(name, false);
         SentMessages.Remove(Step);
     }
 }
示例#6
0
 public void ShowPotiResultPicture(Dictionary <EngineData.AI, int> analogResults = null, Dictionary <EngineData.DI, int> digiResults = null, string resourceName = null)
 {
     if (!SentMessages.Contains(Step))
     {
         ShowPotiPicture?.Invoke(CycleId, analogResults, digiResults, resourceName);
         SentMessages.Add(Step);
         HMI.PanelStatus(EngineData.Screens.ImageMachineResults);
     }
 }
示例#7
0
 public void StopScanner(string name)
 {
     if (!SentMessages.Contains(Step))
     {
         TriggerScanner?.Invoke(name, false);
         SentMessages.Remove(Step);
         CounterTimeout = 0;
     }
 }
示例#8
0
        public bool StartScanner(string name)
        {
            if (!SentMessages.Contains(Step))
            {
                if (CounterTimeout < 100)
                {
                    TriggerScanner?.Invoke(name, true);
                    SentMessages.Add(Step);
                    CounterTimeout++;
                }
                else
                {
                    CounterTimeout = 0;
                    return(false);
                }

                return(true);
            }
            CounterTimeout = 0;
            return(false);
        }
        public void SendMessage(ZenBotMessage message)
        {
            if (SentMessages.Contains(message))
            {
                message.Message = LoopBreaker.GetRandomMessage();
            }
            SentMessages.Add(message);
            var answer = Connection.SendMessage(message.Message).Result;

            ReceivedAnswers.Add(new ZenBotMessage()
            {
                Message = answer
            });
            if (ReceivedAnswers.Count > QueueSize)
            {
                ReceivedAnswers.RemoveAt(0);
            }

            if (SentMessages.Count > QueueSize)
            {
                SentMessages.RemoveAt(0);
            }
        }