public void initFormParam() { // 初始化下拉菜单 this.boxConName.Items.AddRange(SCOM.comName); this.boxConRate.Items.AddRange(SCOM.ratName); this.boxDrName.Items.AddRange(SCOM.comName); this.boxDrRate.Items.AddRange(SCOM.ratName); this.boxUrgName.Items.AddRange(SCOM.comName); this.boxUrgRate.Items.AddRange(SCOM.ratName); // 新建参数模型 DataArea.infoModel = new InfoModel( this.boxConName, this.boxConRate, this.boxDrName, this.boxDrRate, this.boxUrgName, this.boxUrgRate, this.txtFront, this.txtLeft, this.txtRot, this.txtWayWidth, this.txtWayLeft, this.txtWayRight, this.txtCarW, this.txtCarH, this.txtRadTop, this.txtRadLeft ); // 绑定TracBar DataArea.infoModel.addTracBar( this.txtFront, this.traFront, this.txtLeft, this.traLeft, this.txtRot, this.traRot ); // 创建参数配置文件并读取数据 DataArea.infoFile = new InfoFile(); DataArea.infoFile.readNodeData(DataArea.infoModel); InfoManager.init(); InfoManager.updateAllInfo(); // 更新界面 DataArea.infoModel.updateUIFromData(); // 绑定更新事件 EventHandler handler = new EventHandler(traFront_ValueChanged); this.traFront.ValueChanged += handler; this.traLeft.ValueChanged += handler; this.traRot.ValueChanged += handler; }
/// <summary> /// 跟随数据变化 更新各类信息 /// </summary> private void paramDataChanged() { InfoManager.updateAllInfo(); }