Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void grdevice_DBGRDataLastChanged(object sender, EventArgs e)
        {
            GRDevice grdevice = sender as GRDevice;

            if (grdevice == null)
            {
                return;
            }

            DBGRDataBase dbgrdatalast = grdevice.DBGRDataLast;

            if (dbgrdatalast != null)
            {
                // TODO: updata graphic grdevice
                //
                this.UpdateGRDeviceData(grdevice, dbgrdatalast);
            }
            else
            {
                string grdevicename = DeviceNameDisplayer.GetDeviceDisplayName(
                    grdevice,
                    Config.DeviceNameDisplayMode);
                this.NotHasGRData(grdevicename);
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>

        #region UpdateGRDeviceData
        /// <summary>
        ///
        /// </summary>
        /// <param name="dbgrdatalast"></param>
        internal void UpdateGRDeviceData(GRDevice grdevice, CZGRDBI.DBGRDataBase dbgrdata)
        {
            this.lblStationName.Text = DeviceNameDisplayer.GetDeviceDisplayName(
                grdevice, Config.DeviceNameDisplayMode);

            this.lblDateTime.Text = dbgrdata.DT.ToString();


            float[] texts = new float[]
            {
                dbgrdata.GT1, dbgrdata.BT1, dbgrdata.GP1, dbgrdata.BP1,
                dbgrdata.GT2, dbgrdata.BT2, dbgrdata.GP2, dbgrdata.BP2
                //,
                //dbgrdatalast.CM, dbgrdatalast.RM
            };

            string formatstring = "f" + Config.Digits;

            for (int i = 0; i < _valuelabels.Length; i++)
            {
                Label lbl = _valuelabels[i];
                lbl.Text = texts[i].ToString(formatstring) + " " + _units[i];
            }

            this.lblCMValue.Text = string.Format(strings.CyclePump, GetCMValue(dbgrdata));
            this.lblRMValue.Text = string.Format(strings.RecruitePump, GetRMValue(dbgrdata));
            SetValuesVisible(true);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="grdeviceNode"></param>
        /// <param name="grdevice"></param>
        private void SelectedTreeViewGRDeivce(GRDevice grdevice)
        {
            if (grdevice == null)
            {
                throw new ArgumentNullException("grdevice");
            }
            this.GRDevice = grdevice;
            DBGRDataBase dbgrdatalast = grdevice.DBGRDataLast;

            if (dbgrdatalast != null)
            {
                // TODO: updata graphic grdevice
                //
                this.UpdateGRDeviceData(grdevice, dbgrdatalast);
            }
            else
            {
                string grdevicename = DeviceNameDisplayer.GetDeviceDisplayName(
                    grdevice,
                    Config.DeviceNameDisplayMode);
                this.NotHasGRData(grdevicename);
            }
        }