示例#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;
        }
示例#2
0
        //wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

        public TDevices(object Owner, FTestDrvs ParentForm)
        {
            InitializeComponent();
            Parent = (Control)Owner;
            Read();
            ReSize();
        }
示例#3
0
        public void WriteToDev(int iID, int iRow)
        {
            string sParams = "[\"" + CONST.ПАРАМЕТРЫ.DeviceName.ToString() + "\":\"" + GVDataWr.Rows[iRow].Cells[(int)Params.Прибор].Value + "\"," +
                             CONST.ПАРАМЕТРЫ.Data.ToString() + "\":\"" + GVDataWr.Rows[iRow].Cells[(int)Params.Data].Value + "\"," +
                             CONST.ПАРАМЕТРЫ.ParameterType.ToString() + "\":\"" + GVDataWr.Rows[iRow].Cells[(int)Params.Typ].Value + "\"," +
                             CONST.ПАРАМЕТРЫ.ParameterName.ToString() + "\":\"" + GVDataWr.Rows[iRow].Cells[(int)Params.ParamName].Value + "\"," +
                             CONST.ПАРАМЕТРЫ.RequestName.ToString() + "\":\"MT16\"," +
                             CONST.ПАРАМЕТРЫ.INorOUT.ToString() + "\":\"out" + "\"," +
                             CONST.ПАРАМЕТРЫ.RequestType.ToString() + "\":\"" + CONST.RequestType.Single.ToString() + "\"," +
                             CONST.ПАРАМЕТРЫ.TimeRequest.ToString() + "\":\"" + GVDataWr.Rows[iRow].Cells[(int)Params.TimeResp].Value +
                             "\"]";

            FTestDrvs FormOwn = Owner as FTestDrvs;

            EReverce Reverce = (EReverce)Enum.Parse(typeof(EReverce), GVDataWr.Rows[iRow].Cells[(int)Params.ПоследовБайт].Value.ToString());

            byte[] btaDataWritePar = StrToTypeThenBytes(GVDataWr.Rows[iRow].Cells[(int)Params.DataToWr].Value.ToString(),
                                                        GVDataWr.Rows[iRow].Cells[(int)Params.Typ].Value.ToString(),
                                                        Reverce, iRow);

            if (btaDataWritePar != null)
            {
                DRV.WriteValue(iID, sParams, btaDataWritePar);
            }
        }
        //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;
        }
        public CTestDifferent(FTestDrvs Owner, TabPage Prnt)
        {
            InitializeComponent();
            Own    = Owner;
            Parent = Prnt;
            // l = new System.Collections.ArrayList ();
            //TBOut.Text = l.Capacity.ToString();
            //l.Add (5);
            //TBOut.Text = TBOut.Text + " " + l.Capacity.ToString();
            //l.Add (6);
            //TBOut.Text = TBOut.Text + " " + l.Capacity.ToString();
            CBDirBites.SelectedIndex = CBDirBites.FindString(Properties.Settings.Default.asDirBites);

            CBDayHour.Items.AddRange(Enum.GetNames(typeof(EDeltaDT)));
            CBDayHour.SelectedIndex = CBDayHour.FindString(Properties.Settings.Default.DeltaDayHour);

            string[] asRows     = Properties.Settings.Default.as8n1To7e1.Split(';');
            int      iVal       = 0;
            int      iCountRows = asRows.Count() / 2;

            for (int i = 0; i < iCountRows; i++)
            {
                GV8n1To7e1.Rows.Add();
                GV8n1To7e1.Rows[i].Cells[0].Value = asRows[iVal++];
                GV8n1To7e1.Rows[i].Cells[1].Value = asRows[iVal++];
            }
            CB7bit.Checked    = Properties.Settings.Default.b7bit;
            ChCalcBCC.Checked = Properties.Settings.Default.bCalcBCC;

            asRows     = Properties.Settings.Default.asDGBite8nTo7e.Split(';');
            iVal       = 0;
            iCountRows = asRows.Count() / 2;
            for (int i = 0; i < iCountRows; i++)
            {
                GVBites8nTo7e.Rows.Add();
                GVBites8nTo7e.Rows[i].Cells[0].Value = asRows[iVal++];
                GVBites8nTo7e.Rows[i].Cells[1].Value = asRows[iVal++];
            }

            asRows     = Properties.Settings.Default.asBtToStr.Split(';');
            iVal       = 0;
            iCountRows = asRows.Count() / 2;
            for (int i = 0; i < iCountRows; i++)
            {
                GVBtToStr.Rows.Add();
                GVBtToStr.Rows[i].Cells[0].Value = asRows[iVal++];
                GVBtToStr.Rows[i].Cells[1].Value = asRows[iVal++];
            }
            ChDataAsHex.Checked = Properties.Settings.Default.bChDataAsHex;
        }
示例#6
0
        //_________________________________________________________________________
        public TParams(object Parent, object Owner)
        {
            InitializeComponent();

            Own             = (FTestDrvs)Owner;
            sFile           = Properties.Settings.Default.sFileParam;
            FDOpenFl.Filter = "Файлы параметров|*.prmd|Все файлы|*.*";
            FDOpenFl.Title  = "Открытие файла параметров";
            CBFlDev.SelectedIndexChanged -= CBFlDev_SelectedIndexChanged;
            CBFlDev.Items.Add(sFile);
            CBFlDev.SelectedIndex         = 0;
            CBFlDev.SelectedIndexChanged += CBFlDev_SelectedIndexChanged;

            this.Parent = (Control)Parent;
            Read();
            //ReSize ();
        }
示例#7
0
        public CExtractZip(FTestDrvs Zip)
        {
            InitializeComponent();
            ZipByOwn = Zip;

            string[] asaData = Properties.Settings.Default.asZipDirs.Split(';');
            if (asaData.Length > 0)
            {
                CBZipDir.Items.AddRange(asaData);
                CBZipDir.SelectedIndex = CBZipDir.FindString(Properties.Settings.Default.asZipDir);
                if (CBZipDir.SelectedIndex < 0 && CBZipDir.Items.Count > 0)
                {
                    CBZipDir.SelectedIndex = 0;
                }
            }

            CBZipExtr.Items.AddRange(Properties.Settings.Default.asZipDirsExtr.Split(';'));
            CBZipExtr.SelectedIndex = CBZipExtr.FindString(Properties.Settings.Default.asZipDirExtr);
            if (CBZipExtr.SelectedIndex < 0 && CBZipExtr.Items.Count > 0)
            {
                CBZipExtr.SelectedIndex = 0;
            }
        }