コード例 #1
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);
            }
        }
コード例 #2
0
 //_________________________________________________________________________
 public void CreateTemplateIndic()
 {
     ВсегоПараметров = Params.GV.RowCount - 1;
     //baIsSingle = new bool[ВсегоПараметров];
     for (int i = 1; i <= ВсегоПараметров; i++)
     {
         string    sParams  = Params.InitStr(i - 1);
         TFindPair FindPair = new TFindPair(sParams);
         if (FindPair.Value(CONST.ПАРАМЕТРЫ.RequestType.ToString()) == CONST.RequestType.Single.ToString())
         {
             CreateLabel((string)Params.GV.Rows[i - 1].Cells[1].Value, PParameters);
         }
         else
         {
             CreateComboBox((string)Params.GV.Rows[i - 1].Cells[1].Value, PParameters);
         }
     }
 }