Пример #1
0
        public void Loop()
        {
            //LogThis.LogWriter("Looping started");
                        LogThis.Report("Engine", "Looping started");
                        while (! RequestedToStop)
                            {
                                Thread.Sleep(500);
                                rfid = new Rfid(); // this also starts the event that in turn adds the RFID to the queue
                                // loops untill told to stop by boolean
                                // rfid event handler component thread

                                for (var i = 0; i < QueueOfRfids.Count; i++)
                                    {

                                        if (rfid.rfid.Equals(rfid.DiagnosticID))
                                            {
                                                Speaker sp = new Speaker(Language.Country.eng);
                                                sp.Speak("Engine loop is running nicely, last processed rfid is: " + lastUsedRfid);
                                            }
                                        else
                                            {
                                            // if its not a diagnostic scan tag, do this.
                                            lastUsedRfid = QueueOfRfids.Last();
                                            }
                                        dataFetcher = new FetchData(new ClientData());
                                        Config = new FlexConfig(true);
                                        CurrentUsersProfile = Config.GetProfile(dataFetcher.GetClientData().UserName);
                                        clientStatus = new DetermineStatus(dataFetcher.GetClientData());
                                    }

                                // Database information gathering based on the result off the rfid event (10 char long string)
                                // on completed database read interaction
                            }
                        // sjekk RFID event
        }
Пример #2
0
        public void Init()
        {
            RequestedToStop = false;

                        LogThis = new Logger(Logging);

                        Config = new FlexConfig();

                        rfid = new Rfid();

                        //QueueOfRfids.Enqueue("4475402692"); // placeholder
        }