App: Add SerialPortWatcher
Some checks failed
Test / Run tests (push) Has been cancelled

This commit is contained in:
2025-11-09 23:46:19 +01:00
parent 01f4480a08
commit e6367da286
4 changed files with 121 additions and 6 deletions

View File

@@ -1168,6 +1168,19 @@ namespace Elwig.Windows {
WeighingDButton.IsEnabled = n > 3 && App.CommandScales[3].IsReady;
}
public void UpdateScales() {
if (!ViewModel.IsReceipt) return;
foreach (var s in App.EventScales) {
s.WeighingEvent -= Scale_Weighing;
s.WeighingEvent += Scale_Weighing;
}
if (WeighingManualButton.IsEnabled) {
EnableWeighingButtons();
} else {
DisableWeighingButtons();
}
}
private async Task UpdateLsNr() {
if (string.IsNullOrEmpty(ViewModel.Date) || ViewModel.Branch == null) {
ViewModel.LsNr = "";