Esempio n. 1
0
        //wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

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

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

            CBIP2.Items.AddRange(Properties.Settings.Default.asIPpassiveList.Split(';'));
            CBIP2.SelectedIndex = CBIP2.FindString(Properties.Settings.Default.asIPpassive);
            if (CBIP2.SelectedIndex == -1 && CBIP2.Items.Count > 0)
            {
                CBIP2.SelectedIndex = 0;
            }

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

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

            OutMess = Inv_OutMess;
        }
        //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;
        }