Exemplo n.º 1
0
        //xxxxxxxxxxxxxxxxxxxxxxxx       К О Д        xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        public FTCPserver(Form Prnt)
        {
            InitializeComponent();
            Owner   = Prnt;
            CurrDev = new CTCPdevice(this);

            OutRecieve_d = ExchangeMessIN;
            ListenStop_d = ListenRestart;
            OutToWind_d  = OutToWind;
            DIncUD       = IncUD;

            string[] asaIP = Properties.Settings.Default.IP.Split(';');
            CBIP.Items.Clear();
            CBIP.Items.AddRange(asaIP);
            CBIP.SelectedIndex = Array.IndexOf(asaIP, Properties.Settings.Default.asIPserver);

            UDPort.Value = Properties.Settings.Default.iPort;
            TrRestartListener.Elapsed  += TrRestartListener_Elapsed;            // TODO: RESTORE?
            TrRestartListener.AutoReset = false;

            string[] asaDevs = Enum.GetNames(typeof(DEVICE));
            CBDev.Items.AddRange(asaDevs);
            string asD = Properties.Settings.Default.asTCPdeviceCurr;

            CBDev.SelectedIndex = Array.IndexOf(asaDevs, Properties.Settings.Default.asTCPdeviceCurr);             //iTCPdeviceCurr
            CBDev_SelectedIndexChanged(this, null);

            UDSizeBufOut.Value   = Properties.Settings.Default.dmSizeBufOut;
            UDWriteTimeout.Value = Properties.Settings.Default.dmWriteTimeout;

            ReopenListener = BStartStop_Click;
            CounterServers++;
        }
Exemplo n.º 2
0
        //___________________________________________________________________________
        private void CBDev_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (CBDev.Text)
            {
            case "IRGA2": CurrDev = new CDevIRGA2(this); break;

            case "MAG": CurrDev = new CDevMAG(this); break;

            case "Vympel500": CurrDev = new CDevVympel(this); break;

            case "UFGF": CurrDev = new CDevUFG_F(this); break;

            case "EK270": CurrDev = new CDevEK270(this); break;

            default: CurrDev = new CTCPdevice(this); break;
            }
        }
Exemplo n.º 3
0
 private void BTCP_Com_Click(object sender, EventArgs e)
 {
     BStartStop_Click(sender, e);
     if (BTCP_Com.BackColor == Color.BurlyWood)
     {
         TCP_Com.PortClose();
         TCP_Com            = null;
         AccumRecieve       = null;
         BTCP_Com.BackColor = SystemColors.ControlLight;
     }
     else
     {
         BTCP_Com.BackColor = Color.BurlyWood;
         AccumRecieve       = new CAccumRecieve(this, Invoke_OutToWind);
         if (Owner != null)
         {
             TCP_Com = new CTCP_Com(((FTestDrvs)Owner).TestExch, AccumRecieve.RecieveTCP_Com);
         }
         CurrDev = new CRMG_Pass(this, TCP_Com);
     }
 }