/*********************************************************************************************************************/
/*! @file FM2014TestBench.xaml.cs
* @brief Test bench implementation for manual tests of FM2014 driver
*
* @author Thomas Wiedebusch
* @date 2026-Feb-02
*
* @details Multiple FM2014s can be tested using an FM2014 user control.
*
* @copyright © SENSUS GmbH 2026. All rights reserved.
*********************************************************************************************************************/
using Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Config;
using Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core;
using Sensus.Ui.Fm2014TestBench.UserControls;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
using Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Consts;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Utils.ProcessExec.EventArguments;
using CheckBox = System.Windows.Controls.CheckBox;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using Label = System.Windows.Controls.Label;
using TextBox = System.Windows.Controls.TextBox;
using UserControl = System.Windows.Controls.UserControl;
using static Sensus.Ui.Fm2014TestBench.Properties.Resources;
namespace Sensus.Ui.FM2014TestBench
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class FM2014TestBenchWindow
{
#region ------------------------------------------- Properties ------------------------------------------------
// cancellation token
private CancellationTokenSource _cancellationTokenSource;
private CancellationToken _cancellationToken;
// Maximal FM2014 which can be served
private const Int32 MaxFm2014s = 10;
///
/// The FM2014s served by this program
///
private readonly List Fm2014s = new List();
///
/// Stack panels for UcFM2014Device
///
private readonly List PanelsForUcFM2014 = new List();
///
/// Slot selections for FM2014s
///
private readonly List SlotSelections = new List();
///
/// User controls of FM2014Device
///
private readonly List UcFM2014s = new List();
///
/// Variable measurement labels depending on ongoing measurement shared for all
/// FM2014 devices.
///
private readonly List