Exemple #1
0
        private void cbpam1PanelControl_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DgvList.CurrentRow.Index < 0)
            {
                return;
            }
            if (DgvList.RowCount <= 0)
            {
                return;
            }
            int index = DgvList.CurrentRow.Index;

            if (cbpam1PanelControl.SelectedIndex == 15 || cbpam1PanelControl.SelectedIndex == 16 ||
                cbpam1PanelControl.SelectedIndex == 17 || cbpam1PanelControl.SelectedIndex == 18)
            {
                HDLSysPF.AddTextBoxToDGV(txtpam2, DgvList, 7, index);
            }
            else
            {
                txtpam2.Visible         = false;
                DgvList[7, index].Value = "N/A";
            }
            DgvList[6, index].Value = cbpam1PanelControl.Text;
            ModifyMultilinesIfNeeds(DgvList[6, index].Value.ToString(), 6);
        }
Exemple #2
0
        private void cbtype_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DgvList.CurrentRow.Index < 0)
            {
                return;
            }
            if (DgvList.RowCount <= 0)
            {
                return;
            }
            int index = DgvList.CurrentRow.Index;

            setAllVisible(false);
            switch (cbtype.SelectedIndex)
            {
            case 0:
                DgvList[6, index].Value = CsConst.mstrInvalid;
                DgvList[7, index].Value = CsConst.mstrInvalid;
                break;

            case 1:    //场景
            case 2:    //序列
            case 3:    //通用开关
            case 5:    //时间开关
            case 6:    //窗帘开关
            case 7:    //GPRS控制
            case 11:   //消防模块
            case 13:   ///干接点
            case 15:   //温度读取(1 byte)
            case 16:   //温度读取(4 byte)
            case 17:   //读取DALI灯状态
                HDLSysPF.AddTextBoxToDGV(txtpam1, DgvList, 6, index);
                DgvList[7, index].Value = CsConst.mstrInvalid;
                break;

            case 4:    //单路调节
                HDLSysPF.AddTextBoxToDGV(txtpam1, DgvList, 6, index);
                addcontrols(7, index, timetxt);
                timetxt.Text = HDLPF.GetTimeFromString(DgvList[7, index].Value.ToString(), ':');
                break;

            case 8:    ///面板控制
                HDLSysPF.AddComboboxToDGV(cbpam1PanelControl, DgvList, 6, index);
                break;

            case 9:    //广播场景
                DgvList[6, index].Value = CsConst.WholeTextsList[2566].sDisplayName;
                DgvList[7, index].Value = CsConst.mstrInvalid;
                break;

            case 10:    //广播回路
                DgvList[6, index].Value = CsConst.WholeTextsList[2567].sDisplayName;
                addcontrols(7, index, timetxt);
                timetxt.Text = HDLPF.GetTimeFromString(DgvList[7, index].Value.ToString(), ':');
                break;

            case 12:    //通用控制
                HDLSysPF.AddTextBoxToDGV(txtpam1, DgvList, 6, index);
                HDLSysPF.AddTextBoxToDGV(txtpam2, DgvList, 7, index);
                break;

            case 14:    ///模拟量输出
            case 18:    ///模拟量设置
                HDLSysPF.AddComboboxToDGV(cbpam1Analog, DgvList, 6, index);
                DgvList[7, index].Value = CsConst.mstrInvalid;
                break;
            }
            if (cbpam1PanelControl.Visible && cbpam1PanelControl.SelectedIndex < 0)
            {
                cbpam1PanelControl.SelectedIndex = 0;
            }
            if (cbpam1Analog.Visible && cbpam1Analog.SelectedIndex < 0)
            {
                cbpam1Analog.SelectedIndex = 0;
            }
            DgvList[3, index].Value = cbtype.Text;
            ModifyMultilinesIfNeeds(DgvList[3, index].Value.ToString(), 3);
            if (txtpam1.Visible)
            {
                txtpam1_TextChanged(null, null);
            }
            if (txtpam2.Visible)
            {
                txtpam2_TextChanged(null, null);
            }
            if (cbpam1PanelControl.Visible)
            {
                cbpam1PanelControl_SelectedIndexChanged(null, null);
            }
            if (timetxt.Visible)
            {
                timetxt_TextChanged(null, null);
            }
            if (cbpam1Analog.Visible)
            {
                cbpam1Analog_SelectedIndexChanged(null, null);
            }
        }