コード例 #1
0
        private void BTest1_Click(object sender, EventArgs e)
        {
            //DRV.Close();
            //DRV.GetValue(1, ref ip);
            //unsafe {	int* f = (int*)ip.ToPointer();}
            CBErrors.Items.Clear();

            DRV.Init(null, Devices.InitStr());
            for (int i = 1; i <= ВсегоПараметров; i++)
            {
                string sParams = Params.InitStr(i - 1);
                DRV.Subscribe(i, sParams);
                CBErrors.Items.Add(sParams);
            }
            Text = sCaption + " РАБОТАЕТ";
        }
コード例 #2
0
        private void BTest1_Click(object sender, EventArgs e)
        {
            try
            {
                BStopDrv_Click(sender, e);
                Properties.Settings.Default.Save();
                CBErrors.Items.Clear();

                DRV.Init(null, Devices.InitStr());

                for (int i = 1; i <= ВсегоПараметров; i++)
                {
                    string sParams = Params.InitStr(i - 1);
                    if (CBReadArch.Checked == false)
                    {
                        TFindPair FindPair = new TFindPair(sParams);
                        if (FindPair.Value(CONST.ПАРАМЕТРЫ.RequestType.ToString()) == CONST.RequestType.Single.ToString())
                        {
                            DRV.Subscribe(i, sParams);
                        }
                    }
                    else
                    {
                        DRV.Subscribe(i, sParams);
                    }
                    CBErrors.Items.Add(i + "." + sParams);
                }
                Text = sCaption + " РАБОТАЕТ";
                TrStatExchange.Start();
                if (CBErrors.Items.Count > 0)
                {
                    CBErrors.SelectedIndex = 0;
                }
                LPuskTime.Text = "0";
                DTPusk         = DateTime.Now;
                //TrWorkTime.Start ();
                BWritePar.Enabled = true;
                BStartWr.Enabled  = true;
                bReadingValues    = false;
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }