Esempio n. 1
0
        public FTestDrivers()
        {
            InitializeComponent();
            sCaption = this.Text;
            Devices  = new TDevices(TPDevices);
            Params   = new TParams(TPParams, this);
            Left     = 60;
            this.Top = 0;                               //Size resolution = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size;
            Height   = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
            BTest1.Select();

            CreateTemplateIndic();
            CBStateLog.SelectedIndex = 1;
        }
Esempio n. 2
0
        public FTestDrivers()
        {
            InitializeComponent();

            DTBeginWork         = DateTime.Now;
            TrWorkTime.Elapsed += Elapsed_CalcWorkTime;
            TrWorkTime.Start();

            Devices = new TDevices(TPDevices, this);
            // Фирст даты архивов
            if (Properties.Settings.Default.DTArchDay > TPArchDay.MinDate)
            {
                TPArchDay.Value = Properties.Settings.Default.DTArchDay;
            }
            else
            {
                Properties.Settings.Default.DTArchDay = TPArchDay.Value;
            }
            if (Properties.Settings.Default.DTArchHour > TPArchHour.MinDate)
            {
                TPArchHour.Value = Properties.Settings.Default.DTArchHour;
            }
            else
            {
                Properties.Settings.Default.DTArchHour = TPArchHour.Value;
            }
            if (Properties.Settings.Default.DTInterfer > TPInterfer.MinDate)
            {
                TPInterfer.Value = Properties.Settings.Default.DTInterfer;
            }
            else
            {
                Properties.Settings.Default.DTInterfer = TPInterfer.Value;
            }
            if (Properties.Settings.Default.DTAlarm > TPAlarm.MinDate)
            {
                TPAlarm.Value = Properties.Settings.Default.DTAlarm;
            }
            else
            {
                Properties.Settings.Default.DTAlarm = TPAlarm.Value;
            }
            SetNewDTreadArch();

            Params   = new TParams(TPParams, this);
            Text    += " [Драйвер V" + DRV.GetVersion() + "]";
            sCaption = Text;
            Move    -= FTestDrivers_Move;
            Resize  -= FTestDrivers_Resize;
            Left     = Properties.Settings.Default.iLeftForm;
            //Height = Params.GV.RowCount * 18 + 200;
            //if (Height > Screen.PrimaryScreen.WorkingArea.Height)
            //	Height = Screen.PrimaryScreen.WorkingArea.Height;
            //else
            //	Top = Screen.PrimaryScreen.WorkingArea.Height - Height;
            Height  = Properties.Settings.Default.iHeightForm;
            Width   = Properties.Settings.Default.iWidthForm;
            Top     = Properties.Settings.Default.iTopForm;
            Move   += FTestDrivers_Move;
            Resize += FTestDrivers_Resize;

            BTest1.Select();

            CreateTemplateIndic();
            CBTypeData.Items.AddRange(Enum.GetNames(typeof(TYPE_DATA)));
            CBTypeData.Items.RemoveAt(CBTypeData.Items.Count - 1);
            int iTypeData = Properties.Settings.Default.iTypeData;

            if (iTypeData < CBTypeData.Items.Count)
            {
                CBTypeData.SelectedIndex = iTypeData;
            }
            else
            {
                CBTypeData.SelectedIndex = 0;
            }

            CBDataWritePar.SelectedIndexChanged -= CBDataWritePar_SelectedIndexChanged;
            CBDataWritePar.Items.AddRange(Properties.Settings.Default.asDataWritePar.Split(';'));
            if (Properties.Settings.Default.iDataWritePar >= CBDataWritePar.Items.Count)
            {
                CBDataWritePar.SelectedIndex = 0;
                Properties.Settings.Default.iDataWritePar = 0;
                Properties.Settings.Default.Save();
            }
            else
            {
                CBDataWritePar.SelectedIndex = Properties.Settings.Default.iDataWritePar;
            }
            CBDataWritePar.SelectedIndexChanged += CBDataWritePar_SelectedIndexChanged;

            CBData.SelectedIndexChanged -= CBData_SelectedIndexChanged;
            CBData.Items.AddRange(Properties.Settings.Default.asData.Split(';'));
            CBData.SelectedIndex         = Properties.Settings.Default.iData;
            CBData.SelectedIndexChanged += CBData_SelectedIndexChanged;

            CBParameterName.SelectedIndexChanged -= CBParameterName_SelectedIndexChanged;
            CBParameterName.Items.AddRange(Properties.Settings.Default.asParameterName.Split(';'));
            CBParameterName.SelectedIndex         = Properties.Settings.Default.iParameterName;
            CBParameterName.SelectedIndexChanged += CBParameterName_SelectedIndexChanged;

            NTimeResp.Value = Properties.Settings.Default.dmTimeResp;

            TrStatExchange.Elapsed += TrStatExchange_Elapsed;
            FillDevices();
            OutData = StatExchan;
        }