Exemplo n.º 1
0
        public static bool DataClassToFrm(frmSys mFrmSys, cSystemSet SystemSet)
        {
            bool isOk = false;
            int  i = 0, index = 0;

            try
            {
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.mPrevBar;
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.mPrevId;
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.mPLCCOM;
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.mBarCom;
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.m485COM;
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.mSnCom;
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.mPQCom;
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.mPassWord;
                for (i = 0; i < cMain.mSysSet.PressK.Length; i++)
                {
                    mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.PressK[i];
                }
                for (i = 0; i < cMain.mSysSet.PressB.Length; i++)
                {
                    mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.PressB[i];
                }
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.ZYSFArea;
                mFrmSys.GridSys.Rows[index++].Cells[1].Value = SystemSet.ZYSFDoing;
                isOk = true;
            }
            catch (Exception exc)
            {
                cMain.WriteErrorToLog("FrmSys DataClassToFrm is Error " + exc.ToString());
                isOk = false;
            }
            return(isOk);
        }
Exemplo n.º 2
0
        public static bool DataClassToFrm(frmSys mFrmSys, cSystemSet SystemSet)
        {
            bool isOk = false;

            try
            {
                for (int i = 0; i < mFrmSys.lblCom.Length; i++)
                {
                    mFrmSys.lblCom[i].Text = SystemSet.ComPort[i];
                }
                mFrmSys.textBox1.Text = SystemSet.mPassWord;
                isOk = true;
            }
            catch (Exception exc)
            {
                cMain.WriteErrorToLog("FrmSys DataClassToFrm is Error " + exc.ToString());
                isOk = false;
            }
            return(isOk);
        }
Exemplo n.º 3
0
        public static bool DataFrmToClass(frmSys mFrmSys, out cSystemSet SystemSet)
        {
            bool       isOk       = false;
            cSystemSet mSystemSet = new cSystemSet();

            try
            {
                for (int i = 0; i < mFrmSys.lblCom.Length; i++)
                {
                    mSystemSet.ComPort[i] = mFrmSys.lblCom[i].Text;
                }
                mSystemSet.mPassWord = mFrmSys.textBox1.Text;
                isOk = true;
            }
            catch (Exception exc)
            {
                cMain.WriteErrorToLog("FrmSys DataFrmToClass is Error " + exc.ToString());
                isOk = false;
            }
            SystemSet = mSystemSet;
            return(isOk);
        }
Exemplo n.º 4
0
        public static bool DataFrmToClass(frmSys mFrmSys, out cSystemSet SystemSet)
        {
            bool       isOk       = false;
            cSystemSet mSystemSet = new cSystemSet();
            int        i;
            int        index = 0;

            try
            {
                mSystemSet.mPrevBar  = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString();
                mSystemSet.mPrevId   = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString();
                mSystemSet.mPLCCOM   = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString();
                mSystemSet.mBarCom   = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString();
                mSystemSet.m485COM   = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString();
                mSystemSet.mSnCom    = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString();
                mSystemSet.mPQCom    = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString();
                mSystemSet.mPassWord = Num.StringParse(mFrmSys.GridSys.Rows[index++].Cells[1].Value);
                for (i = 0; i < mSystemSet.PressK.Length; i++)
                {
                    mSystemSet.PressK[i] = Num.DoubleParse(mFrmSys.GridSys.Rows[index++].Cells[1].Value);
                }
                for (i = 0; i < mSystemSet.PressB.Length; i++)
                {
                    mSystemSet.PressB[i] = Num.DoubleParse(mFrmSys.GridSys.Rows[index++].Cells[1].Value);
                }
                mSystemSet.ZYSFArea  = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString().ToInt();
                mSystemSet.ZYSFDoing = mFrmSys.GridSys.Rows[index++].Cells[1].Value.ToString().ToInt();
                isOk = true;
            }
            catch (Exception exc)
            {
                cMain.WriteErrorToLog("FrmSys DataFrmToClass is Error " + exc.ToString());
                isOk = false;
            }
            SystemSet = mSystemSet;
            return(isOk);
        }