Esempio n. 1
0
        private void Cmb_FastSetup_SelectedIndexChanged(object sender, EventArgs e)
        {
            Cmb_Item.Items.Clear();
            if (Cmb_FastSetup.SelectedIndex == -1)
            {
                Cmb_Item.Items.Clear();
                return;
            }
            if (Cmb_FastSetup.SelectedIndex == 0 || Cmb_FastSetup.SelectedIndex == 3)       //全部
            {
                Cmb_Item.Items.Add("All");
            }

            if (Cmb_FastSetup.SelectedIndex == 1 || Cmb_FastSetup.SelectedIndex == 4)        //功率因素
            {
                Cmb_Item.Items.AddRange(CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysName().ToArray());
            }

            if (Cmb_FastSetup.SelectedIndex == 2 || Cmb_FastSetup.SelectedIndex == 5)            //电流倍数
            {
                CLDC_DataCore.SystemModel.Item.csxIbDic _xIb = new CLDC_DataCore.SystemModel.Item.csxIbDic();
                _xIb.Load();
                Cmb_Item.Items.AddRange(_xIb.getxIb().ToArray());

                _xIb = null;
            }

            Cmb_Item.SelectedIndex = 0;
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化表格ComboBoxEx
        /// </summary>
        private void DefaultCombo()
        {
            base.FaNameCombInit(Cmb_Fa, CLDC_DataCore.Const.Variable.CONST_FA_YURE_FOLDERNAME);

            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("正向有功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("反向有功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("正向无功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("反向无功");

            #region 初始化电流倍数下拉菜单
            CLDC_DataCore.SystemModel.Item.csxIbDic _xIbCol = new CLDC_DataCore.SystemModel.Item.csxIbDic();
            _xIbCol.Load();
            List <string> _xIbs = _xIbCol.getxIb();

            for (int i = 0; i < _xIbs.Count; i++)
            {
                ((DataGridViewComboBoxColumn)Dgv_Data.Columns[2]).Items.Add(_xIbs[i]);
            }
            #endregion

            int RowIndex = Dgv_Data.Rows.Add();
            Dgv_Data.Rows[RowIndex].Cells[Dgv_Data.Columns.Count - 1].Value           = "添加";
            Dgv_Data.Rows[RowIndex].Cells[Dgv_Data.Columns.Count - 1].Style.ForeColor = Color.Blue;
            Dgv_Data.Refresh();
        }
        /// <summary>
        /// 从字典里获取电流倍数到UI
        /// </summary>
        void GetZziConfig()
        {
            CLDC_DataCore.SystemModel.Item.csxIbDic csx = new CLDC_DataCore.SystemModel.Item.csxIbDic();
            csx.Load();
            List <string> Getstrings = csx.getxIb();

            cmbZzi.DataSource = Getstrings;
        }
Esempio n. 4
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="Yj">元件(H,A,B,C)</param>
        public WcFaSetup(CLDC_Comm.Enum.Cus_PowerYuanJian Yj)
        {
            InitializeComponent();


            _Yj = Yj;

            #region 初始化表格样式

            CLDC_DataCore.SystemModel.Item.csxIbDic _xIb = new CLDC_DataCore.SystemModel.Item.csxIbDic();
            _xIb.Load();
            List <string> _xIbs = _xIb.getxIb();
            for (int i = 0; i < _xIbs.Count; i++)
            {
                DGW_FA.Columns.Add("Col_" + _xIb.getxIbID(_xIbs[i]), _xIbs[i]);
                DGW_FA.Columns[i].Width = 50;
                DGW_FA.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                DGW_FA.Columns[i].Tag      = _xIb.getxIbID(_xIbs[i]);
                DGW_FA.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
            }


            List <string> _Glyss = CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysName();

            for (int i = 0; i < _Glyss.Count; i++)
            {
                DGW_FA.RowHeadersWidth = 90;
                DGW_FA.Rows.Add("");
                DGW_FA.Rows[i].HeaderCell.Value = _Glyss[i];
                DGW_FA.Rows[i].HeaderCell.Tag   = CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysID(_Glyss[i]);
            }

            DGW_FA.RowHeadersWidth = 90;
            DGW_FA.Rows.Add("");
            DGW_FA.Rows[_Glyss.Count].HeaderCell.Value = "标准偏差";
            _intPcRpw = _Glyss.Count;
            for (int i = 0; i < DGW_FA.Columns.Count; i++)
            {
                DGW_FA.Rows[_Glyss.Count].Cells[i].Style.BackColor = this.BackColor;
            }
            for (int i = 0; i < _Glyss.Count; i++)
            {
                DGW_FA.RowHeadersWidth = 90;
                DGW_FA.Rows.Add("");
                DGW_FA.Rows[i + _Glyss.Count + 1].HeaderCell.Value = _Glyss[i];
                DGW_FA.Rows[i + _Glyss.Count + 1].HeaderCell.Tag   = CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysID(_Glyss[i]);
            }
            DGW_FA.TopLeftHeaderCell.Value = _Yj == CLDC_Comm.Enum.Cus_PowerYuanJian.H?"合元件":_Yj.ToString() + "元件";

            #endregion
            this.DGW_FA.Rows[0].Cells[0].Selected = false;
        }
        /// <summary>
        /// UI初始化
        /// </summary>
        private void InitUI()
        {
            if (dgv_ModeByte.Rows.Count != 1)
            {
                dgv_ModeByte.Rows.Clear();
                dgv_ModeByte.Rows.Add();
            }
            #region ---------功率方向下拉菜单----------------------
            ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[1]).Items.Add("正向有功");
            ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[1]).Items.Add("反向有功");
            ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[1]).Items.Add("正向无功");
            ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[1]).Items.Add("反向无功");
            ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[1]).Items.Add("第一象限无功");
            ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[1]).Items.Add("第二象限无功");
            ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[1]).Items.Add("第三象限无功");
            ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[1]).Items.Add("第四象限无功");
            #endregion

            #region ------------初始化电流倍数下拉菜单--------------------
            CLDC_DataCore.SystemModel.Item.csxIbDic _xIbCol = new CLDC_DataCore.SystemModel.Item.csxIbDic();
            _xIbCol.Load();
            List <string> _xIbs = _xIbCol.getxIb();

            for (int i = 0; i < _xIbs.Count; i++)
            {
                ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[2]).Items.Add(_xIbs[i]);
            }

            _xIbs   = null;
            _xIbCol = null;
            #endregion

            #region -------------------初始化功率因素下拉菜单---------------

            List <string> _Glyss = CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysName();

            for (int i = 0; i < _Glyss.Count; i++)
            {
                ((DataGridViewComboBoxColumn)dgv_RunningE.Columns[3]).Items.Add(_Glyss[i]);
            }

            _Glyss = null;

            #endregion

            int RowIndex = dgv_RunningE.Rows.Add();
            dgv_RunningE.Rows[RowIndex].Cells[dgv_RunningE.Columns.Count - 1].Value           = CONST_ADD;
            dgv_RunningE.Rows[RowIndex].Cells[dgv_RunningE.Columns.Count - 1].Style.ForeColor = Color.Blue;
            dgv_RunningE.Refresh();
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="FaList">方案列表</param>
        /// <param name="CzFzd">参照负载点</param>
        /// <param name="CzQs">参照圈数</param>
        public WcPrjView(ref CLDC_DataCore.Model.DnbModel.DnbGroupInfo MeterGroup)
        {
            _DnbGroup = MeterGroup;

            InitializeComponent();

            #region 加载电流倍数字典列表
            CLDC_DataCore.SystemModel.Item.csxIbDic _xIbDic = new CLDC_DataCore.SystemModel.Item.csxIbDic();
            _xIbDic.Load();
            List <string> _xIbs = _xIbDic.getxIb();
            Cmb_xIb.Items.Clear();
            for (int i = 0; i < _xIbs.Count; i++)
            {
                Cmb_xIb.Items.Add(_xIbs[i]);
            }

            _xIbs = null;

            _xIbDic = null;
            #endregion


            #region 加载误差限列表

            CLDC_DataCore.DataBase.clsWcLimitDataControl _WcLimit = new CLDC_DataCore.DataBase.clsWcLimitDataControl();

            List <CLDC_DataCore.DataBase.IDAndValue> _WcLimitNames = _WcLimit.WcLimitName();

            Cmb_WcLimit.Items.Add("规程误差限");

            for (int i = 0; i < _WcLimitNames.Count; i++)
            {
                Cmb_WcLimit.Items.Add(_WcLimitNames[i].Value);
            }

            _WcLimitNames = null;

            _WcLimit = null;

            #endregion

            this.CreateFaInfo();
        }
Esempio n. 7
0
        /// <summary>
        /// 初始化表格ComboBoxEx
        /// </summary>
        private void DefaultCombo()
        {
            //初始化方案项目名称下拉菜单
            base.FaNameCombInit(Cmb_Fa, CLDC_DataCore.Const.Variable.CONST_FA_YZX_FOLDERNAME);

            #region 初始化电流倍数下拉菜单
            CLDC_DataCore.SystemModel.Item.csxIbDic _xIbCol = new CLDC_DataCore.SystemModel.Item.csxIbDic();
            _xIbCol.Load();
            List <string> _xIbs = _xIbCol.getxIb();

            for (int i = 0; i < _xIbs.Count; i++)
            {
                ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add(_xIbs[i]);

                #region 2010-03-26 Add by Gqs:初始化升降选择的电流点下拉菜单
                cbo_Value1.Items.Add(_xIbs[i]);
                cbo_Value2.Items.Add(_xIbs[i]);
                cbo_Value3.Items.Add(_xIbs[i]);
                cbo_Value4.Items.Add(_xIbs[i]);
                #endregion
            }
            #endregion

            #region 初始化功率因数下拉菜单

            List <string> _Glys = CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysName();
            for (int i = 0; i < _Glys.Count; i++)
            {
                ((DataGridViewComboBoxColumn)Dgv_Data.Columns[2]).Items.Add(_Glys[i]);
            }
            #endregion

            #region 2010-03-26 Add by Gqs:增加各项的颜色区分
            //tlp_Bc.BackColor = Variable.Color_Grid_Alter;
            //tlp_Gz.BackColor = Variable.Color_Grid_Alter;
            #endregion

            #region 2010-03-26 Add by Gqs:升降电流点给默认值
            try
            {
                cbo_Value1.Text = "0.01Ib";
                cbo_Value2.Text = "0.05Ib";
                cbo_Value3.Text = "1.0Ib";
                cbo_Value4.Text = "Imax";
            }
            catch
            {
            }
            #endregion

            #region 2010-03-29 Add by Gqs:误差一致性默认为四个检定点
            string[] strXIb   = { "1.0Ib", "1.0Ib", "0.01Ib", "0.01Ib" };
            string[] strGlys  = { "1.0", "0.5L", "1.0", "0.5L" };
            int      RowIndex = 0;
            for (int i = 0; i < 4; i++)
            {
                RowIndex = Dgv_Data.Rows.Add();
                Dgv_Data.Rows[RowIndex].Cells[0].Value = i + 1;
                ((DataGridViewComboBoxCell)Dgv_Data.Rows[RowIndex].Cells[1]).Value = strXIb[i];
                ((DataGridViewComboBoxCell)Dgv_Data.Rows[RowIndex].Cells[2]).Value = strGlys[i];
            }
            Dgv_Data.Refresh();
            #endregion
        }
Esempio n. 8
0
        /// <summary>
        /// 初始化表格ComboBoxEx
        /// </summary>
        private void DefaultCombo()
        {
            base.FaNameCombInit(Cmb_Fa, CLDC_DataCore.Const.Variable.CONST_FA_ZOUZI_FOLDERNAME);

            #region ---------功率方向下拉菜单----------------------
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("正向有功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("反向有功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("正向无功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("反向无功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("第一象限无功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("第二象限无功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("第三象限无功");
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[1]).Items.Add("第四象限无功");
            #endregion

            #region -----------初始化元件下拉菜单----------------

            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[2]).Items.Add(CLDC_Comm.Enum.Cus_PowerYuanJian.H.ToString());
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[2]).Items.Add(CLDC_Comm.Enum.Cus_PowerYuanJian.A.ToString());
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[2]).Items.Add(CLDC_Comm.Enum.Cus_PowerYuanJian.B.ToString());
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[2]).Items.Add(CLDC_Comm.Enum.Cus_PowerYuanJian.C.ToString());

            #endregion

            #region -------------------初始化功率因素下拉菜单---------------

            List <string> _Glyss = CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.GlysZiDian.getGlysName();

            for (int i = 0; i < _Glyss.Count; i++)
            {
                ((DataGridViewComboBoxColumn)Dgv_Data.Columns[3]).Items.Add(_Glyss[i]);
            }

            _Glyss = null;

            #endregion

            #region ------------初始化电流倍数下拉菜单--------------------
            CLDC_DataCore.SystemModel.Item.csxIbDic _xIbCol = new CLDC_DataCore.SystemModel.Item.csxIbDic();
            _xIbCol.Load();
            List <string> _xIbs = _xIbCol.getxIb();

            for (int i = 0; i < _xIbs.Count; i++)
            {
                ((DataGridViewComboBoxColumn)Dgv_Data.Columns[4]).Items.Add(_xIbs[i]);
            }

            _xIbs   = null;
            _xIbCol = null;
            #endregion

            #region -----------初始化走字方式下拉菜单--------------
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[5]).Items.Add(CLDC_Comm.Enum.Cus_ZouZiMethod.校核常数.ToString());
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[5]).Items.Add(CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法.ToString());
            ((DataGridViewComboBoxColumn)Dgv_Data.Columns[5]).Items.Add(CLDC_Comm.Enum.Cus_ZouZiMethod.基本走字法.ToString());

            #endregion

            int RowIndex = Dgv_Data.Rows.Add();
            Dgv_Data.Rows[RowIndex].Cells[6].Value = CONST_NOTESTRING;
            Dgv_Data.Rows[RowIndex].Cells[Dgv_Data.Columns.Count - 1].Value           = CONST_ADD;
            Dgv_Data.Rows[RowIndex].Cells[Dgv_Data.Columns.Count - 1].Style.ForeColor = Color.Blue;
            Dgv_Data.Refresh();
        }