Example #1
0
 public DevicePage()
 {
     InitializeComponent();
     //接收设置
     btn_ReceiveSetting.Click += (o, e) =>
     {
         var formSetting = new A429ReceiveSetting();
         formSetting.Name = this.Name;
         formSetting.Text = this.Name.Replace(TreeLocalHost.PathString + "_", "") + "_ReceiveSetting";
         formSetting.ShowSingleAtCenterParent(this.FindForm());
     };
     //发送设置
     btn_SendSetting.Click += (o, e) =>
     {
         var formSetting = new A429SendSetting();
         formSetting.Name = this.Name;
         formSetting.Text = this.Name.Replace(TreeLocalHost.PathString + "_", "") + "_SendSetting";
         formSetting.ShowSingleAtCenterParent(this.FindForm());
     };
     btn_PlayBackSetting.Click += (o, e) =>
     {
         var formSetting = new A429PlayBackSetting();
         formSetting.Name = this.Name;
         formSetting.Text = this.Name.Replace(TreeLocalHost.PathString + "_", "") + "_PlayBackSetting";
         formSetting.ShowSingleAtCenterParent(this.FindForm());
     };
     //发送控制
     btn_SendControl.Click += (o, e) =>
     {
         var formSetting = new A429SendControl();
         formSetting.Name = this.Name;
         formSetting.Text = this.Name.Replace(TreeLocalHost.PathString + "_", "") + "_SendControl";
         formSetting.ShowSingleAtCenterParent(this.FindForm());
     };
     btn_ReceiveControl.Click += (o, e) =>
     {
         var formSetting = new A429ReceiveControl();
         formSetting.Name = this.Name;
         formSetting.Text = this.Name.Replace(TreeLocalHost.PathString + "_", "") + "_ReceiveControl";
         formSetting.ShowSingleAtCenterParent(this.FindForm());
     };
     button1.Click += (o, e) =>
     {
         var formSetting = new A429FactorySetting();
         formSetting.Name = this.Name;
         formSetting.Text = this.Name.Replace(TreeLocalHost.PathString + "_", "") + "_FacotorySetting";
         formSetting.ShowSingleAtCenterParent(this.FindForm());
     };
     button2.Click += (o, e) =>//过滤器设置
     {
         var formSetting = new A429FilterControl();
         formSetting.Name = this.Name;
         formSetting.Text = this.Name.Replace(TreeLocalHost.PathString + "_", "") + "_FacotorySetting";
         formSetting.ShowSingleAtCenterParent(this.FindForm());
     };
 }
Example #2
0
        public EditSendLabel(A429SendControl a429SendControl)
        {
            this._chVm            = a429SendControl.ChVm;
            this._a429SendControl = a429SendControl;

            InitializeComponent();

            //设置界面元素
            this.flgView.DataSource             = _chVm.LabelList;
            flgView.Cols["ActualValue"].Visible = false;
            flgView.Cols["Name"].Visible        = false;

            flgView.Cols["IsSelected"].Caption      = "生效";
            flgView.Cols["Interval"].Caption        = "发送间隔";
            flgView.Cols["Label"].Caption           = "标号";
            flgView.Cols["SDI"].Caption             = "SDI";
            flgView.Cols["Data"].Caption            = "数据";
            flgView.Cols["SymbolState"].Caption     = "符号状态";
            flgView.Cols["Parity"].Caption          = "奇偶校验";
            flgView.Cols["isAutoIncrement"].Caption = "是否自增";

            flgView.Cols["IsSelected"].Width      = 50;
            flgView.Cols["Interval"].Width        = 80;
            flgView.Cols["Label"].Width           = 80;
            flgView.Cols["SDI"].Width             = 80;
            flgView.Cols["Data"].Width            = this.flgView.Width - 560;
            flgView.Cols["SymbolState"].Width     = 50;
            flgView.Cols["Parity"].Width          = 50;
            flgView.Cols["isAutoIncrement"].Width = 50;

            flgView.Cols["IsSelected"].TextAlign      = TextAlignEnum.CenterCenter;
            flgView.Cols["Interval"].TextAlign        = TextAlignEnum.CenterCenter;
            flgView.Cols["Label"].TextAlign           = TextAlignEnum.CenterCenter;
            flgView.Cols["SDI"].TextAlign             = TextAlignEnum.CenterCenter;
            flgView.Cols["Data"].TextAlign            = TextAlignEnum.CenterCenter;
            flgView.Cols["SymbolState"].TextAlign     = TextAlignEnum.CenterCenter;
            flgView.Cols["Parity"].TextAlign          = TextAlignEnum.CenterCenter;
            flgView.Cols["isAutoIncrement"].TextAlign = TextAlignEnum.CenterCenter;

            flgView.Styles.Normal.TextAlign       = TextAlignEnum.CenterCenter;
            flgView.Styles.Editor.TextAlign       = TextAlignEnum.CenterCenter;
            flgView.Styles.EmptyArea.BackColor    = Color.White;
            flgView.Styles.EmptyArea.Border.Width = 0;
            flgView.ExtendLastCol = true;

            //设置按钮响应
            btnOk.Click         += OnOk;
            cmdAddItem.Click    += OnAddItem;
            cmdDeleteItem.Click += OnDeleteItem;
        }