public ServiceComponentsStateChangedMessage(HesStatus hesStatus, RfidStatus rfidStatus, BluetoothStatus bluetoothStatus, HesStatus tbHesStatus)
 {
     HesStatus       = hesStatus;
     RfidStatus      = rfidStatus;
     BluetoothStatus = bluetoothStatus;
     TbHesStatus     = tbHesStatus;
 }
        public async Task SendStatus(HesStatus hesStatus, HesStatus tbHesStatus, RfidStatus rfidStatus, BluetoothStatus bluetoothStatus)
        {
            WriteLine($"SendStatus: hes:{hesStatus}; tb_hes: {tbHesStatus}; rfid:{rfidStatus}; ble:{bluetoothStatus};");

            var uiList = GetClientUiList();

            foreach (var ui in uiList)
            {
                if (ui != null)
                {
                    await ui.SendStatus(hesStatus, tbHesStatus, rfidStatus, bluetoothStatus);
                }
            }
        }
        public async Task SendStatus(HesStatus hesStatus, HesStatus tbHesStatus, RfidStatus rfidStatus, BluetoothStatus bluetoothStatus)
        {
            var statuses = new List <string>();

            if (bluetoothStatus != BluetoothStatus.Ok)
            {
                statuses.Add(TranslationSource.Instance.Format("ServiceComponentStatus.Bluetooth.NotAvailable", bluetoothStatus));
            }

            if (rfidStatus != RfidStatus.Disabled && rfidStatus != RfidStatus.Ok)
            {
                if (rfidStatus == RfidStatus.RfidServiceNotConnected)
                {
                    statuses.Add(TranslationSource.Instance["ServiceComponentStatus.RFID.ServiceNotConnected"]);
                }
                else if (rfidStatus == RfidStatus.RfidReaderNotConnected)
                {
                    statuses.Add(TranslationSource.Instance["ServiceComponentStatus.RFID.ReaderNotConnected"]);
                }
            }

            if (hesStatus != HesStatus.Ok)
            {
                if (hesStatus == HesStatus.NotApproved)
                {
                    statuses.Add(TranslationSource.Instance["ServiceComponentStatus.HES.WorkstationNotApproved"]);
                }
                else
                {
                    statuses.Add(TranslationSource.Instance["ServiceComponentStatus.HES.NotConnected"]);
                }
            }

            if (statuses.Count > 0)
            {
                await SendStatus(TranslationSource.Instance.Format("ServiceComponentStatus.Message.Base", string.Join("; ", statuses)));
            }
            else
            {
                await SendStatus(string.Empty);
            }
        }
Example #4
0
 public async Task SendStatus(HesStatus hesStatus, HesStatus tbHesStatus, RfidStatus rfidStatus, BluetoothStatus bluetoothStatus)
 {
     await _metaMessenger.Publish(new ServiceComponentsStateChangedMessage(hesStatus, rfidStatus, bluetoothStatus, tbHesStatus));
 }