예제 #1
0
        private void LoadPointInfo(Jc_DefInfo Point)
        {
            #region ==================扩展属性==================
            if (Point.K4 > 0)
            {
                CcmbLogicAlarmCon.SelectedIndex = Point.K4;//报警逻辑
            }
            if (Point.K5 > 0)
            {
                Jc_DefInfo LogicPoint = Model.DEFServiceModel.QueryPointByCodeCache(Point.Fzh.ToString().PadLeft(3, '0') + "D" + Point.K5.ToString().PadLeft(2, '0') + Point.K6.ToString());
                if (null != LogicPoint)
                {
                    CcmbLogicAlarmPoint.SelectedItem = LogicPoint.Point + "." + LogicPoint.Wz;
                }
            }
            CtxbDesc.Text = Point.Remark;//描述
            #endregion

            ////各态控制口
            //cckLocalControlZero.Text = SetLocalControlText(Point.K1);
            //cckLocalControlOne.Text = SetLocalControlText(Point.K2);
            //cckLocalControlTwo.Text = SetLocalControlText(Point.K3);
            #region ==================报警控制==================

            Jc_DevInfo tempDev = Model.DEVServiceModel.QueryDevByDevIDCache(Point.Devid);

            if ((Point.K8 & 0x01) == 1) //0态度是否报警
            {
                CckZeroAlarm.Checked = true;
            }
            else
            {
                CckZeroAlarm.Checked = false;
            }

            if ((Point.K8 & 0x02) == 2)  //1态度是否报警
            {
                CckOneAlarm.Checked = true;
            }
            else
            {
                CckOneAlarm.Checked = false;
            }

            if ((Point.K8 & 0x04) == 4) //2态度是否报警
            {
                CckTwoAlarm.Checked = true;
            }
            else
            {
                CckTwoAlarm.Checked = false;
            }
            //颜色显示
            try
            {
                this.CpZeroColour.Color = Color.FromArgb(int.Parse(Point.Bz9.ToString()));
                this.CpOneColour.Color  = Color.FromArgb(int.Parse(Point.Bz10.ToString()));
                this.CpTwoColour.Color  = Color.FromArgb(int.Parse(Point.Bz11.ToString()));
            }
            catch
            { }
            //显示内容
            this.CcmbZeroContent.Text = Point.Bz6;
            this.CcmbOneContent.Text  = Point.Bz7;
            this.CcmbTwoContent.Text  = Point.Bz8;
            //各态控制口
            cckLocalControlZero.Text = SetLocalControlText(Point.K1);
            cckLocalControlOne.Text  = SetLocalControlText(Point.K2);
            cckLocalControlTwo.Text  = SetLocalControlText(Point.K3);

            #endregion

            #region ==================交叉控制==================
            getCrossInf(Point.Point);
            CrossControlDT        = ToDataTable(CrossControlList);
            CdgControl.DataSource = CrossControlDT;
            CdgControl.RefreshDataSource();
            #endregion
        }
예제 #2
0
        /// <summary>
        /// 设备类型变化产生的影响
        /// </summary>
        public override void DevTypeChanngeEvent(long DevID, Jc_DefInfo Point)
        {
            try
            {
                if (Point != null)
                {
                    CcmbLogicAlarmCon.Text   = "";
                    CcmbLogicAlarmPoint.Text = "";
                    LoadPointInfo(Point);
                }
                else
                {//取jc_dev的定义信息
                    CcmbLogicAlarmCon.Text   = "";
                    CcmbLogicAlarmPoint.Text = "";
                    CtxbDesc.Text            = "";

                    //各态控制口
                    cckLocalControlZero.Text = "";
                    cckLocalControlOne.Text  = "";
                    cckLocalControlTwo.Text  = "";

                    #region ==================交叉控制==================
                    CrossControlList.Clear();
                    CrossControlDT        = ToDataTable(CrossControlList);
                    CdgControl.DataSource = CrossControlDT;
                    CdgControl.RefreshDataSource();
                    #endregion


                    Jc_DevInfo temp = Model.DEVServiceModel.QueryDevByDevIDCache(DevID.ToString());
                    if (null == temp)
                    {
                        return;
                    }

                    #region ==================报警属性==================
                    if (temp.Pl1 == 1)
                    {
                        CckZeroAlarm.Checked = true;
                    }
                    else
                    {
                        CckZeroAlarm.Checked = false;
                    }
                    if (temp.Pl2 == 1)
                    {
                        CckOneAlarm.Checked = true;
                    }
                    else
                    {
                        CckOneAlarm.Checked = false;
                    }
                    if (temp.Pl3 == 1)
                    {
                        CckTwoAlarm.Checked = true;
                    }
                    else
                    {
                        CckTwoAlarm.Checked = false;
                    }

                    //显示内容
                    this.CcmbZeroContent.Text = temp.Xs1;
                    this.CcmbOneContent.Text  = temp.Xs2;
                    this.CcmbTwoContent.Text  = temp.Xs3;
                    //颜色显示
                    this.CpZeroColour.Color = Color.FromArgb(temp.Color1);
                    this.CpOneColour.Color  = Color.FromArgb(temp.Color2);
                    this.CpTwoColour.Color  = Color.FromArgb(temp.Color3);
                    #endregion
                }
            }
            catch (Exception ex)
            {
                Basic.Framework.Logging.LogHelper.Error(ex);
            }
        }