private void InitConfigFileItems()
        {
            _logger.Information($"Initiate config files items");

            _scaleComPort          = ConfigurationManager.AppSettings["app:weightScalePort"];
            _powerSupplyComPort    = ConfigurationManager.AppSettings["app:powerSupplyPort"];
            _isWeightScaleTestMode = Convert.ToBoolean(ConfigurationManager.AppSettings["app:scaleTestMode"]);
            _isPowerSupplyTestMode = Convert.ToBoolean(ConfigurationManager.AppSettings["app:powerSupplyTestMode"]);

            var cfgPwrSupply   = new SerialPortConfig(ConfigurationManager.AppSettings["app:pwrSupplySerialConfig"]);
            var cfgWeightScale = new SerialPortConfig(ConfigurationManager.AppSettings["app:scaleSerialConfig"]);

            _powerSupplyConfig = cfgPwrSupply.GetConnectionObject();
            _weightScaleConfig = cfgWeightScale.GetConnectionObject();
        }
        public SerialPortConfigParameters GetConnectionObject()
        {
            SerialPortConfigParameters spcp = new SerialPortConfigParameters();

            spcp.DeviceType   = _deviceType;
            spcp.BaudRate     = _baudRate;
            spcp.Parity       = _parity;
            spcp.StopBits     = _stopBits;
            spcp.DataBits     = _dataBits;
            spcp.Handshake    = _handshake;
            spcp.NewLine      = _newLine;
            spcp.CheckCommand = _checkCommand;
            spcp.CheckRead    = _checkRead;
            spcp.ReadMode     = _readMode;

            return(spcp);
        }
 public DiscoverSerialConnections(SerialPortConfigParameters port, string windowTitle, string windowMessage)
 {
     _port          = port;
     _windowMessage = windowMessage;
     _windowTitle   = windowTitle;
 }