Example #1
0
        private int[] fctext = new int[50];//故障配置
        
        //public FaultInfoConfigForm(SerialPort paramPortDev)
        public FaultInfoConfigForm(DevExpress.XtraBars.Ribbon.RibbonForm form)
        {
            InitializeComponent();
            //mSerialPort = paramPortDev;
            //mSerialPort.ReceivedBytesThreshold = 1; 
            this._form = form;

            //初始化配置值
            //获取静态配置类中的配置值
            List<string> configList = FaultInfoConfigValue.getConfigList();
            if (null == configList || configList.Count != 25)
            {
                 
            }
            else
            {
                //1-23循环显示在相应输入框
                for (int i = 1; i <= 23; i++)
                {
                    string configVal = configList[i - 1];
                    Control control = Controls.Find("numericUpDown" + Convert.ToString(i), true)[0];
                    control.GetType().GetProperty("Text").SetValue(control, configVal, null);
                    //String value = control.GetType().GetProperty("Text").GetValue(control, null).ToString();
                }

                //combox设置值
                for (int i = 1; i <= 2; i++)
                { 
                    Control control = Controls.Find("comboBox" + Convert.ToString(i), true)[0]; 
                    control.GetType().GetProperty("SelectedIndex").SetValue(control, configList[22 + i] == "0" ? 1 : 0, null);
                }
            }

        }
        //private IPEndPoint localIpep = new IPEndPoint(IPAddress.Parse(localIpAddress), 10101);


        //public SensorChannelConfigForm(SerialPort paramPortDev)
        public SensorChannelConfigForm(DevExpress.XtraBars.Ribbon.RibbonForm form)
        {
            InitializeComponent();
            //mSerialPort = paramPortDev;
            //mSerialPort.ReceivedBytesThreshold = 1;
            this._form = form;

            //初始化配置值
            //获取静态配置类中的配置值
            List <string> configList = SensorChannelConfigValue.getSensorChannelConfigList();

            if (null == configList || configList.Count != 30)
            {
            }
            else
            {
                //1-30循环显示在相应输入框
                for (int i = 1; i <= 30; i++)
                {
                    string  configVal = configList[i - 1];
                    Control control   = Controls.Find("numericUpDown" + Convert.ToString(i), true)[0];
                    control.GetType().GetProperty("Text").SetValue(control, configVal, null);
                    //String value = control.GetType().GetProperty("Text").GetValue(control, null).ToString();
                }
            }
        }
 public void TextBoslukKontrol_DevExpress(DevExpress.XtraBars.Ribbon.RibbonForm winForm, DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider, string warningMessage)
 {
     foreach (DevExpress.XtraBars.Ribbon.RibbonForm formControl in winForm.Controls)
     {
         if (formControl is DevExpress.XtraEditors.TextEdit)
         {
             if (formControl.Text == string.Empty)
             {
                 dxErrorProvider.SetError(formControl, warningMessage);
             }
             else
             {
                 dxErrorProvider.ClearErrors();
             }
         }
     }
 }
Example #4
0
        private StringBuilder builder = new StringBuilder();//避免在事件处理方法中反复的创建,定义到外面。

        //public SensorStateConfigForm(SerialPort paramPortDev)
        public SensorStateConfigForm(DevExpress.XtraBars.Ribbon.RibbonForm form)
        {
            InitializeComponent();
            //mSerialPort = paramPortDev;
            //mSerialPort.ReceivedBytesThreshold = 1;
            this._form = form;

            //获取静态配置类中的配置值
            List <string> configList = SensorStateConfigValue.getSensorStateConfigList();

            if (null == configList || configList.Count != 5)
            {
            }
            else
            {
                //1-5循环显示在相应输入框
                for (int i = 1; i <= 5; i++)
                {
                    Boolean configVal = configList[i - 1] == "True" ? true : false;
                    Control control   = Controls.Find("toggleSwitch" + Convert.ToString(i), true)[0];
                    control.GetType().GetProperty("IsOn").SetValue(control, configVal, null);
                }
            }
        }
Example #5
0
 private void ShowChildForm(DevExpress.XtraBars.Ribbon.RibbonForm form)
 {
     form.MdiParent = this;
     form.Show();
 }