public ValveSettingForm Setup(Valve valve) { this.valve = valve; if (this.valve.ValveSeries == ValveSeries.喷射阀) { JtValve jtValve = (JtValve)valve; LngPropertyProxyTypeDescriptor proxyObj = new LngPropertyProxyTypeDescriptor(jtValve.Prm, this.GetType().Name); this.propertyGrid1.SelectedObject = proxyObj; this.jtValvePrmBackUp = (JtValvePrm)jtValve.Prm.Clone(); } else if (this.valve.ValveSeries == ValveSeries.螺杆阀) { SvValve svValve = (SvValve)valve; LngPropertyProxyTypeDescriptor proxyObj = new LngPropertyProxyTypeDescriptor(svValve.Prm, this.GetType().Name); this.propertyGrid1.SelectedObject = proxyObj; this.svValvePrmBackUp = (SvValvePrm)svValve.Prm.Clone(); } else if (this.valve.ValveSeries == ValveSeries.齿轮泵阀) { GearValve gearValve = (GearValve)valve; LngPropertyProxyTypeDescriptor proxyObj = new LngPropertyProxyTypeDescriptor(gearValve.Prm, this.GetType().Name); this.propertyGrid1.SelectedObject = proxyObj; this.gearValvePrmBackUp = (GearValvePrm)gearValve.Prm.Clone(); } return(this); }
private void DialogCPK_Load(object sender, EventArgs e) { LngPropertyProxyTypeDescriptor proxyObj = new LngPropertyProxyTypeDescriptor(CPKMgr.Instance.Prm, this.GetType().Name); this.prog.SelectedObject = proxyObj; this.prog.ExpandAllGridItems(); //Result ret = Machine.Instance.DigitalGage.Init(); }
public SettingWeightForm Setup(ValveWeightPrm valWtPrm) { this.valveKey = valWtPrm.Key; LngPropertyProxyTypeDescriptor proxyObj = new LngPropertyProxyTypeDescriptor(valWtPrm, this.GetType().Name); this.propertyGrid1.SelectedObject = proxyObj; this.valveWeightPrm = valWtPrm; this.valveWeightPrmBackUp = (ValveWeightPrm)valWtPrm.Clone(); return(this); }
public AxisControl Setup(Axis axis) { this.axis = axis; this.lblKey.Text = this.axis.Key.ToString(); this.lblId.Text = this.axis.AxisId.ToString(); this.lblName.Text = this.axis.Name; this.PrmBackUp = (AxisPrm)this.axis.Prm.Clone(); LngPropertyProxyTypeDescriptor proxyObj = new LngPropertyProxyTypeDescriptor(axis.Prm, this.GetType().Name); this.propertyGrid1.SelectedObject = proxyObj; return(this); }
private void SettingRobotForm_OnResetClicked() { //if (MessageBox.Show("Reset robot default setting to default?", "Warning", //MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) if (MessageBox.Show("将模组的参数设置为默认值?", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { SettingUtil.ResetToDefault <RobotDefaultPrm>(Machine.Instance.Robot.DefaultPrm); LngPropertyProxyTypeDescriptor proxyObj = new LngPropertyProxyTypeDescriptor(Machine.Instance.Robot.DefaultPrm, this.GetType().Name); this.propertyGrid1.SelectedObject = Machine.Instance.Robot.DefaultPrm; CompareObj.CompareProperty(Machine.Instance.Robot.DefaultPrm, this.DefaultPrmBackUp, null, this.GetType().Name); } }
private void BindPrm() { if (Machine.Instance.Scale == null && Machine.Instance.Valve1 == null) { Log.Print("Valve1 or Scale Err ...."); return; } vsrPrm1 = new ValveSprayResultPrm(Machine.Instance.Valve1.weightPrm); LngPropertyProxyTypeDescriptor proxyObj1 = new LngPropertyProxyTypeDescriptor(vsrPrm1, this.GetType().Name); this.valve1Prg.SelectedObject = proxyObj1; if (Machine.Instance.Scale == null && Machine.Instance.Valve2 == null) { Log.Print("Valve2 or Scale Err ...."); return; } vsrPrm2 = new ValveSprayResultPrm(Machine.Instance.Valve2.weightPrm); LngPropertyProxyTypeDescriptor proxyObj2 = new LngPropertyProxyTypeDescriptor(vsrPrm2, this.GetType().Name); this.valve2Prg.SelectedObject = proxyObj2; }