//写入RFID private async void WriteRFIDCommandExecute() { WarehousePLCWriteRFIDCommand writeRFIDCommand = new WarehousePLCWriteRFIDCommand(); writeRFIDCommand.WriteRFIDCommand = InputNewRFIDNumber.ToString(); await _client.SendAsync(DataHelper.SerializeToBinary(writeRFIDCommand)); }
// 入库执行 private async void InputCommandExecute() { WarehousePLCInputExecuteCommand inputExecuteCommand = new WarehousePLCInputExecuteCommand(); if (InputCategory.Dispatcher.Thread != Thread.CurrentThread) { InputCategory.Dispatcher.Invoke(new Action(() => { inputExecuteCommand.InputExecuteCommandAmount = Convert.ToInt32(InputAmount.Content.ToString()); })); InputCategory.Dispatcher.Invoke(new Action(() => { inputExecuteCommand.InputExecuteCommandCategory = InputCategory.Content.ToString(); })); InputCategory.Dispatcher.Invoke(new Action(() => { inputExecuteCommand.InputExecuteCommandRFID = InputNewRFIDNumber; })); InputCategory.Dispatcher.Invoke(new Action(() => { inputExecuteCommand.InputExecuteCommandStorageLocation = Convert.ToInt32(InputNewRFIDNumber.Substring(0, 4), 16); })); } else { inputExecuteCommand.InputExecuteCommandAmount = Convert.ToInt32(InputAmount.Content.ToString()); inputExecuteCommand.InputExecuteCommandCategory = InputCategory.Content.ToString(); inputExecuteCommand.InputExecuteCommandRFID = InputNewRFIDNumber; inputExecuteCommand.InputExecuteCommandStorageLocation = Convert.ToInt32(InputNewRFIDNumber.Substring(0, 4), 16); } await _client.SendAsync(DataHelper.SerializeToBinary(inputExecuteCommand)); }