//wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

        public CTCPtoComPort(FTestDrvs Own)
        {
            InitializeComponent();
            this.Own           = Own;
            ChWordWrap.Checked = Properties.Settings.Default.bWordWrap;
            TBOut.WordWrap     = ChWordWrap.Checked;

            CBIP1.Items.AddRange(Properties.Settings.Default.asIPactiveListComP.Split(';'));
            CBIP1.SelectedIndex = CBIP1.FindString(Properties.Settings.Default.asIPactive);
            if (CBIP1.SelectedIndex == -1 && CBIP1.Items.Count > 0)
            {
                CBIP1.SelectedIndex = 0;
            }

            CBComPort.Items.AddRange(SerialPort.GetPortNames());
            CBComPort.SelectedIndex = CBComPort.FindString(Properties.Settings.Default.asComPortToComP);
            if (CBComPort.SelectedIndex == -1 && CBComPort.Items.Count > 0)
            {
                CBComPort.SelectedIndex = 0;
            }

            UDPort1.Value = Properties.Settings.Default.iPortActive;

            NUDFont.Value = Properties.Settings.Default.dmSiseFontTCTtoTCT;

            CBBaud.SelectedIndex = CBBaud.FindString(Properties.Settings.Default.asBaudToComP);
            if (CBBaud.SelectedIndex == -1 && CBBaud.Items.Count > 0)
            {
                CBBaud.SelectedIndex = 0;
            }

            CBParity.Items.AddRange(Enum.GetNames(typeof(Parity)));
            CBParity.SelectedIndex = CBParity.FindString(Properties.Settings.Default.asParityTCTtoComP);
            if (CBParity.SelectedIndex == -1 && CBParity.Items.Count > 0)
            {
                CBParity.SelectedIndex = 0;
            }

            CBStopBits.Items.AddRange(Enum.GetNames(typeof(StopBits)));
            CBStopBits.SelectedIndex = CBStopBits.FindString(Properties.Settings.Default.asStopBitsTCPtoComP);
            if (CBStopBits.SelectedIndex == -1 && CBStopBits.Items.Count > 0)
            {
                CBStopBits.SelectedIndex = 0;
            }

            CBDataBit.SelectedIndex = CBDataBit.FindString(Properties.Settings.Default.asDataBit);
            if (CBDataBit.SelectedIndex == -1 && CBDataBit.Items.Count > 0)
            {
                CBDataBit.SelectedIndex = 0;
            }

            ChWordWrap.Checked = Properties.Settings.Default.bWordWrapByComPort;

            OutMess     = Inv_OutMess;
            bFirstInput = false;
        }
Esempio n. 2
0
        //wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

        public FCOMserver(Form own)
        {
            InitializeComponent();
            Owner       = own;
            ColorCBPort = CBPort.BackColor;

            CBBaud.SelectedIndex = CBBaud.FindString(Properties.Settings.Default.asBaud);
            CBPort.Items.AddRange(SerialPort.GetPortNames());
            CBPort.SelectedIndex = CBPort.FindString(Properties.Settings.Default.asCOMport);
            CBDevice.Items.AddRange(Enum.GetNames(typeof(EDevs)));
            CBDevice.SelectedIndex       = CBDevice.FindString(Properties.Settings.Default.asDevComPort);
            NUDFont.Value                = Properties.Settings.Default.dmSizeFontByComPort;
            ChBChangePar.CheckedChanged -= ChBChangePar_CheckedChanged;
            ChBChangePar.Checked         = Properties.Settings.Default.bChangeVal_ComP;
            ChBChangePar.CheckedChanged += ChBChangePar_CheckedChanged;
            //Log = new TTrace ();
        }