private void InitializeBindings() { var fluent = mvvmContext1.OfType <LayerCraftModel>(); fluent.SetBinding(this.cmbMaterialTypes, c => c.EditValue, x => x.MaterialType); fluent.SetBinding(this.cmbThickness, c => c.EditValue, x => x.Thickness); fluent.SetBinding(this.cmbNozzle, c => c.EditValue, x => x.Nozzle); fluent.SetBinding(this.ckShortUnLift, c => c.Checked, x => x.IsShortUnLift); fluent.SetBinding(this.ckPrePierce, c => c.Checked, x => x.IsPrePierce); fluent.SetBinding(this.ckEvaporationFilm, c => c.Checked, x => x.IsEvaporationFilm); fluent.SetBinding(this.ckPathRecooling, c => c.Checked, x => x.IsPathRecooling); fluent.SetBinding(this.ckMultiTime, c => c.Checked, x => x.IsMultiTime); fluent.SetBinding(this.txtMultiTime.PopupEdit, c => c.Text, x => x.MultiTime); fluent.SetBinding(this.ckKeepPuffing, c => c.Checked, x => x.IsKeepPuffing); fluent.SetBinding(this.ckUnprocessed, c => c.Checked, x => x.IsUnprocessed); fluent.SetBinding(this.ckNoFollow, c => c.Checked, x => x.IsNoFollow); fluent.SetBinding(this.cmbProcessedTypes, c => c.SelectedIndex, x => x.ProcessedType, m => { return((int)m); }, r => { return((ProcessedTypes)r); }); //切割 fluent.SetBinding(this.txtCutSpeed.PopupEdit, c => c.Text, x => x.CutSpeed, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtLiftHeight.PopupEdit, c => c.Text, x => x.LiftHeight); fluent.SetBinding(this.txtNozzleHeight.PopupEdit, c => c.Text, x => x.NozzleHeight); fluent.SetBinding(this.cmbGasKind, c => c.Text, x => x.GasKind); fluent.SetBinding(this.txtGasPressure.PopupEdit, c => c.Text, x => x.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent.PopupEdit, c => c.Text, x => x.PowerPercent); fluent.SetBinding(this.txtPowerValue.PopupEdit, c => c.Text, x => x.PowerValue); fluent.SetBinding(this.txtPulseDutyFactorPercent.PopupEdit, c => c.Text, x => x.PulseDutyFactorPercent); fluent.SetBinding(this.txtPulseFrequency.PopupEdit, c => c.Text, x => x.PulseFrequency); fluent.SetBinding(this.txtBeamSize.PopupEdit, c => c.Text, x => x.BeamSize); fluent.SetBinding(this.txtFocusPosition.PopupEdit, c => c.Text, x => x.FocusPosition); fluent.SetBinding(this.txtDelayTime.PopupEdit, c => c.Text, x => x.DelayTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtLaserOffDelay.PopupEdit, c => c.Text, x => x.LaserOffDelay, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.ckSlowStart, c => c.Checked, x => x.IsSlowStart); fluent.SetBinding(this.ckSlowStop, c => c.Checked, x => x.IsSlowStop); fluent.SetBinding(this.txtSlowStartDistance.PopupEdit, c => c.Text, x => x.SlowStartDistance); fluent.SetBinding(this.txtSlowStopDistance.PopupEdit, c => c.Text, x => x.SlowStopDistance); fluent.SetBinding(this.txtSlowStartSpeed.PopupEdit, c => c.Text, x => x.SlowStartSpeed, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtSlowStopSpeed.PopupEdit, c => c.Text, x => x.SlowStopSpeed, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); //fluent.SetBinding(this.ckDynamicAdjustPower, c => c.Checked, x => x.IsDynamicAdjustPower); //fluent.SetBinding(this.ckDynamicAdjustFrequency, c => c.Checked, x => x.IsDynamicAdjustFrequency); //fluent.SetBinding(this.ckIsShowAbs, c => c.Checked, x => x.IsShowAbs); fluent.SetBinding(this.ckDynamicAdjustPower, c => c.Checked, x => x.PwrCtrlPara.PowerAdjustmentEnabled); fluent.SetBinding(this.ckDynamicAdjustFrequency, c => c.Checked, x => x.PwrCtrlPara.FreqAdjustmentEnabled); fluent.SetBinding(this.ckIsShowAbs, c => c.Checked, x => x.PwrCtrlPara.ShowAbs); fluent.SetBinding(this.txtUserNotes, c => c.Text, x => x.UserNotes); //穿孔 fluent.SetBinding(this.rbtnPierceLevelNone, c => c.Checked, x => x.PierceLevel, m => { return(PierceLevels.None == m); }, r => { return(PierceLevels.None); }); fluent.SetBinding(this.rbtnPierceLevel1, c => c.Checked, x => x.PierceLevel, m => { return(PierceLevels.Level1 == m); }, r => { return(PierceLevels.Level1); }); fluent.SetBinding(this.rbtnPierceLevel2, c => c.Checked, x => x.PierceLevel, m => { return(PierceLevels.Level2 == m); }, r => { return(PierceLevels.Level2); }); fluent.SetBinding(this.rbtnPierceLevel3, c => c.Checked, x => x.PierceLevel, m => { return(PierceLevels.Level3 == m); }, r => { return(PierceLevels.Level3); }); //等级一 fluent.SetBinding(this.ckStepTime1, c => c.Checked, x => x.PierceLevel1.IsStepTime); fluent.SetBinding(this.txtStepTime1.PopupEdit, c => c.Text, x => x.PierceLevel1.StepTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtNozzleHeight1.PopupEdit, c => c.Text, x => x.PierceLevel1.NozzleHeight); fluent.SetBinding(this.cmbGasKind1, c => c.Text, x => x.PierceLevel1.GasKind); fluent.SetBinding(this.txtGasPressure1.PopupEdit, c => c.Text, x => x.PierceLevel1.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent1.PopupEdit, c => c.Text, x => x.PierceLevel1.PowerPercent); fluent.SetBinding(this.txtPowerValue1.PopupEdit, c => c.Text, x => x.PierceLevel1.PowerValue); fluent.SetBinding(this.txtPulseDutyFactorPercent1.PopupEdit, c => c.Text, x => x.PierceLevel1.PulseDutyFactorPercent); fluent.SetBinding(this.txtPulseFrequency1.PopupEdit, c => c.Text, x => x.PierceLevel1.PulseFrequency); fluent.SetBinding(this.txtBeamSize1.PopupEdit, c => c.Text, x => x.PierceLevel1.BeamSize); fluent.SetBinding(this.txtFocusPosition1.PopupEdit, c => c.Text, x => x.PierceLevel1.FocusPosition); fluent.SetBinding(this.txtDelayTime1.PopupEdit, c => c.Text, x => x.PierceLevel1.DelayTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.ckExtraPuffing1, c => c.Checked, x => x.PierceLevel1.IsExtraPuffing); fluent.SetBinding(this.txtExtraPuffing1.PopupEdit, c => c.Text, x => x.PierceLevel1.ExtraPuffing, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); //等级二 fluent.SetBinding(this.ckStepTime2, c => c.Checked, x => x.PierceLevel2.IsStepTime); fluent.SetBinding(this.txtStepTime2.PopupEdit, c => c.Text, x => x.PierceLevel2.StepTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtNozzleHeight2.PopupEdit, c => c.Text, x => x.PierceLevel2.NozzleHeight); fluent.SetBinding(this.cmbGasKind2, c => c.Text, x => x.PierceLevel2.GasKind); fluent.SetBinding(this.txtGasPressure2.PopupEdit, c => c.Text, x => x.PierceLevel2.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent2.PopupEdit, c => c.Text, x => x.PierceLevel2.PowerPercent); fluent.SetBinding(this.txtPowerValue2.PopupEdit, c => c.Text, x => x.PierceLevel2.PowerValue); fluent.SetBinding(this.txtPulseDutyFactorPercent2.PopupEdit, c => c.Text, x => x.PierceLevel2.PulseDutyFactorPercent); fluent.SetBinding(this.txtPulseFrequency2.PopupEdit, c => c.Text, x => x.PierceLevel2.PulseFrequency); fluent.SetBinding(this.txtBeamSize2.PopupEdit, c => c.Text, x => x.PierceLevel2.BeamSize); fluent.SetBinding(this.txtFocusPosition2.PopupEdit, c => c.Text, x => x.PierceLevel2.FocusPosition); fluent.SetBinding(this.txtDelayTime2.PopupEdit, c => c.Text, x => x.PierceLevel2.DelayTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.ckExtraPuffing2, c => c.Checked, x => x.PierceLevel2.IsExtraPuffing); fluent.SetBinding(this.txtExtraPuffing2.PopupEdit, c => c.Text, x => x.PierceLevel2.ExtraPuffing, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); //等级三 fluent.SetBinding(this.ckStepTime3, c => c.Checked, x => x.PierceLevel3.IsStepTime); fluent.SetBinding(this.txtStepTime3.PopupEdit, c => c.Text, x => x.PierceLevel3.StepTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtNozzleHeight3.PopupEdit, c => c.Text, x => x.PierceLevel3.NozzleHeight); fluent.SetBinding(this.cmbGasKind3, c => c.Text, x => x.PierceLevel3.GasKind); fluent.SetBinding(this.txtGasPressure3.PopupEdit, c => c.Text, x => x.PierceLevel3.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent3.PopupEdit, c => c.Text, x => x.PierceLevel3.PowerPercent); fluent.SetBinding(this.txtPowerValue3.PopupEdit, c => c.Text, x => x.PierceLevel3.PowerValue); fluent.SetBinding(this.txtPulseDutyFactorPercent3.PopupEdit, c => c.Text, x => x.PierceLevel3.PulseDutyFactorPercent); fluent.SetBinding(this.txtPulseFrequency3.PopupEdit, c => c.Text, x => x.PierceLevel3.PulseFrequency); fluent.SetBinding(this.txtBeamSize3.PopupEdit, c => c.Text, x => x.PierceLevel3.BeamSize); fluent.SetBinding(this.txtFocusPosition3.PopupEdit, c => c.Text, x => x.PierceLevel3.FocusPosition); fluent.SetBinding(this.txtDelayTime3.PopupEdit, c => c.Text, x => x.PierceLevel3.DelayTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.ckExtraPuffing3, c => c.Checked, x => x.PierceLevel3.IsExtraPuffing); fluent.SetBinding(this.txtExtraPuffing3.PopupEdit, c => c.Text, x => x.PierceLevel3.ExtraPuffing, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); //UI上的绑定 this.txtMultiTime.DataBindings.Add("Enabled", this.ckMultiTime, "Checked"); this.txtStepTime1.DataBindings.Add("Enabled", this.ckStepTime1, "Checked"); this.txtExtraPuffing1.DataBindings.Add("Enabled", this.ckExtraPuffing1, "Checked"); this.txtStepTime2.DataBindings.Add("Enabled", this.ckStepTime2, "Checked"); this.txtExtraPuffing2.DataBindings.Add("Enabled", this.ckExtraPuffing2, "Checked"); this.txtStepTime3.DataBindings.Add("Enabled", this.ckStepTime3, "Checked"); this.txtExtraPuffing3.DataBindings.Add("Enabled", this.ckExtraPuffing3, "Checked"); //UI上的关联行为 this.txtPowerPercent.NumberChanged += (sender, e) => this.txtPowerValue.Number = Constants.MaxPower * this.txtPowerPercent.Number / 100.0; this.txtPowerPercent1.NumberChanged += (sender, e) => this.txtPowerValue1.Number = Constants.MaxPower * this.txtPowerPercent1.Number / 100.0; this.txtPowerPercent2.NumberChanged += (sender, e) => this.txtPowerValue2.Number = Constants.MaxPower * this.txtPowerPercent2.Number / 100.0; this.txtPowerPercent3.NumberChanged += (sender, e) => this.txtPowerValue3.Number = Constants.MaxPower * this.txtPowerPercent3.Number / 100.0; }
private void InitializeBindings() { var fluent = mvvmContext1.OfType <LayerEvaporateModel>(); //切割 fluent.SetBinding(this.txtCutSpeed.PopupEdit, c => c.Text, x => x.CutSpeed, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtLiftHeight.PopupEdit, c => c.Text, x => x.LiftHeight); fluent.SetBinding(this.txtNozzleHeight.PopupEdit, c => c.Text, x => x.NozzleHeight); fluent.SetBinding(this.cmbGasKind, c => c.Text, x => x.GasKind); fluent.SetBinding(this.txtGasPressure.PopupEdit, c => c.Text, x => x.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent.PopupEdit, c => c.Text, x => x.PowerPercent); fluent.SetBinding(this.txtPulseFrequency.PopupEdit, c => c.Text, x => x.PulseFrequency); fluent.SetBinding(this.txtPulseDutyFactorPercent.PopupEdit, c => c.Text, x => x.PulseDutyFactorPercent); fluent.SetBinding(this.txtBeamSize.PopupEdit, c => c.Text, x => x.BeamSize); fluent.SetBinding(this.txtFocusPosition.PopupEdit, c => c.Text, x => x.FocusPosition); fluent.SetBinding(this.txtLaserOpenDelay.PopupEdit, c => c.Text, x => x.LaserOpenDelay); //fluent.SetBinding(this.ckDynamicAdjustPower, c => c.Checked, x => x.IsDynamicAdjustPower); //fluent.SetBinding(this.ckDynamicAdjustFrequency, c => c.Checked, x => x.IsDynamicAdjustFrequency); //fluent.SetBinding(this.ckShowAbs, c => c.Checked, x => x.IsShowAbs); fluent.SetBinding(this.ckDynamicAdjustPower, c => c.Checked, x => x.PwrCtrlPara.PowerAdjustmentEnabled); fluent.SetBinding(this.ckDynamicAdjustFrequency, c => c.Checked, x => x.PwrCtrlPara.FreqAdjustmentEnabled); fluent.SetBinding(this.ckShowAbs, c => c.Checked, x => x.PwrCtrlPara.ShowAbs); fluent.SetBinding(this.txtUserNotes, c => c.Text, x => x.UserNotes); }
private void InitializeBindings() { var fluent = mvvmContext1.OfType <LayerCoolingModel>(); fluent.SetBinding(this.txtCoolingSpeed.PopupEdit, c => c.Text, x => x.CoolingSpeed, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtLiftHeight.PopupEdit, c => c.Text, x => x.LiftHeight); fluent.SetBinding(this.txtNozzleHeight.PopupEdit, c => c.Text, x => x.NozzleHeight); fluent.SetBinding(this.cmbGasKind, c => c.Text, x => x.GasKind); fluent.SetBinding(this.txtGasPressure.PopupEdit, c => c.Text, x => x.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtUserNotes, c => c.Text, x => x.UserNotes); }
private void InitializeBindings() { var fluent = mvvmContext1.OfType <LayerConfigModel>(); #region 运动控制参数 //fluent.SetBinding(this.rbtnUseCommon, c => c.Checked, x => x.EmptyMoveParamType, // m => { return EmptyMoveParamTypes.UseCommon == m; }, // r => { return EmptyMoveParamTypes.UseCommon; }); //fluent.SetBinding(this.rbtnUseAlone, c => c.Checked, x => x.EmptyMoveParamType, // m => { return EmptyMoveParamTypes.UseAlone == m; }, // r => { return EmptyMoveParamTypes.UseAlone; }); fluent.SetBinding(this.txtEmptyMoveSpeed.PopupEdit, c => c.Text, x => x.EmptyMoveSpeed, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtEmptyMoveSpeedX.PopupEdit, c => c.Text, x => x.EmptyMoveSpeedX, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtEmptyMoveSpeedY.PopupEdit, c => c.Text, x => x.EmptyMoveSpeedY, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtEmptyMoveAcceleratedSpeed.PopupEdit, c => c.Text, x => x.EmptyMoveAcceleratedSpeed, m => AccelerationUnitConverter.Convert(m), r => AccelerationUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtEmptyMoveAcceleratedSpeedX.PopupEdit, c => c.Text, x => x.EmptyMoveSpeedX, m => AccelerationUnitConverter.Convert(m), r => AccelerationUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtEmptyMoveAcceleratedSpeedY.PopupEdit, c => c.Text, x => x.EmptyMoveSpeedY, m => AccelerationUnitConverter.Convert(m), r => AccelerationUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtEmptyMoveLowpassHz.PopupEdit, c => c.Text, x => x.EmptyMoveLowpassHz); fluent.SetBinding(this.txtEmptyMoveLowpassXHz.PopupEdit, c => c.Text, x => x.EmptyMoveLowpassXHz); fluent.SetBinding(this.txtEmptyMoveLowpassYHz.PopupEdit, c => c.Text, x => x.EmptyMoveLowpassYHz); fluent.SetBinding(this.txtCheckEdgeSpeed.PopupEdit, c => c.Text, x => x.CheckEdgeSpeed, m => SpeedUnitConverter.Convert(m), r => SpeedUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtProcessAcceleratedSpeed.PopupEdit, c => c.Text, x => x.ProcessAcceleratedSpeed, m => AccelerationUnitConverter.Convert(m), r => AccelerationUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtProcessLowpassHz.PopupEdit, c => c.Text, x => x.ProcessLowpassHz); fluent.SetBinding(this.spCurveControlPrecision, c => c.Value, x => x.CurveControlPrecision); fluent.SetBinding(this.spCornerControlPrecision, c => c.Value, x => x.CornerControlPrecision); #endregion #region 默认参数 fluent.SetBinding(this.txtDotBurstPulseFrequency.PopupEdit, c => c.Text, x => x.DotBurstPulseFrequency); fluent.SetBinding(this.txtDotBurstPeakPower.PopupEdit, c => c.Text, x => x.DotBurstPeakPower); fluent.SetBinding(this.txtDefalutAirPressure.PopupEdit, c => c.Text, x => x.DefalutAirPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtOpenAirDelay.PopupEdit, c => c.Text, x => x.OpenAirDelay, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtFirstOpenAirDelay.PopupEdit, c => c.Text, x => x.FirstOpenAirDelay, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtExchangeAirDelay.PopupEdit, c => c.Text, x => x.ExchangeAirDelay, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtCoolingDotDelay.PopupEdit, c => c.Text, x => x.CoolingDotDelay, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPauseBackspaceDistance.PopupEdit, c => c.Text, x => x.PauseBackspaceDistance); #endregion #region 单位选择 fluent.SetBinding(this.cmbUnitTimeTypes, c => c.SelectedIndex, x => x.UnitTimeType, m => { return((int)m); }, r => { return((UnitTimeTypes)r); }); fluent.SetBinding(this.cmbUnitSpeedTypes, c => c.SelectedIndex, x => x.UnitSpeedType, m => { return((int)m); }, r => { return((UnitSpeedTypes)r); }); fluent.SetBinding(this.cmbUnitAcceleratedType, c => c.SelectedIndex, x => x.UnitAcceleratedType, m => { return((int)m); }, r => { return((UnitAcceleratedTypes)r); }); fluent.SetBinding(this.cmbUnitPressureTypes, c => c.SelectedIndex, x => x.UnitPressureType, m => { return((int)m); }, r => { return((UnitPressureTypes)r); }); #endregion #region 跟随控制 fluent.SetBinding(this.txtFollowMaxHeight.PopupEdit, c => c.Text, x => x.FollowMaxHeight); fluent.SetBinding(this.ckFrogStyleLift, c => c.Checked, x => x.IsFrogStyleLift); fluent.SetBinding(this.ckEnableFollowEmptyMove, c => c.Checked, x => x.IsEnableFollowEmptyMove); fluent.SetBinding(this.ckDisableFollowProcessed, c => c.Checked, x => x.IsDisableFollowProcessed); fluent.SetBinding(this.ckOnlyPositionZCoordinate, c => c.Checked, x => x.IsOnlyPositionZCoordinate); fluent.SetBinding(this.txtPositionZCoordinate.PopupEdit, c => c.Text, x => x.PositionZCoordinate); fluent.SetBinding(this.txtUnLiftMaxEmptyMoveLength.PopupEdit, c => c.Text, x => x.UnLiftMaxEmptyMoveLength); fluent.SetBinding(this.ckShortDistanceOptimization, c => c.Checked, x => x.IsShortDistanceOptimization); fluent.SetBinding(this.ckIsFollowWithFocus, c => c.Checked, x => x.IsFollowWithFocus); #endregion #region 高级 fluent.SetBinding(this.ckEnableNurmbsIntepolation, c => c.Checked, x => x.IsEnableNurmbsIntepolation); fluent.SetBinding(this.ckAllAlarmsManuallyClear, c => c.Checked, x => x.IsAllAlarmsManuallyClear); fluent.SetBinding(this.ckGroupPrePiercing, c => c.Checked, x => x.IsGroupPrePiercing); fluent.SetBinding(this.ckMicroJointFlyingCut, c => c.Checked, x => x.IsMicroJointFlyingCut); fluent.SetBinding(this.ckEnableMachineProtection, c => c.Checked, x => x.IsEnableMachineProtection); fluent.SetBinding(this.txtCompensatePrecision, c => c.Value, x => x.CompensatePrecision); fluent.SetBinding(this.txtFlyingCutOverDistance, c => c.Value, x => x.FlyingCutOverDistance); #endregion }
private void InitializeBindings() { var fluent = mvvmContext1.OfType <PointMoveCutModel>(); fluent.SetBinding(this.cmbMaterialTypes, c => c.EditValue, x => x.MaterialType); fluent.SetBinding(this.cmbThickness, c => c.EditValue, x => x.Thickness); fluent.SetBinding(this.cmbNozzle, c => c.EditValue, x => x.Nozzle); //切割 fluent.SetBinding(this.txtLiftHeight.PopupEdit, c => c.Text, x => x.LiftHeight); fluent.SetBinding(this.txtNozzleHeight.PopupEdit, c => c.Text, x => x.NozzleHeight); fluent.SetBinding(this.cmbGasKind, c => c.Text, x => x.GasKind); fluent.SetBinding(this.txtGasPressure.PopupEdit, c => c.Text, x => x.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent.PopupEdit, c => c.Text, x => x.PowerPercent); fluent.SetBinding(this.txtPowerValue.PopupEdit, c => c.Text, x => x.PowerValue); fluent.SetBinding(this.txtPulseDutyFactorPercent.PopupEdit, c => c.Text, x => x.PulseDutyFactorPercent); fluent.SetBinding(this.txtPulseFrequency.PopupEdit, c => c.Text, x => x.PulseFrequency); fluent.SetBinding(this.txtBeamSize.PopupEdit, c => c.Text, x => x.BeamSize); fluent.SetBinding(this.txtFocusPosition.PopupEdit, c => c.Text, x => x.FocusPosition); fluent.SetBinding(this.txtDelayTime.PopupEdit, c => c.Text, x => x.DelayTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtLaserOffDelay.PopupEdit, c => c.Text, x => x.LaserOffDelay, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); //穿孔 fluent.SetBinding(this.rbtnPierceLevelNone, c => c.Checked, x => x.PierceLevel, m => { return(PierceLevels.None == m); }, r => { return(PierceLevels.None); }); fluent.SetBinding(this.rbtnPierceLevel1, c => c.Checked, x => x.PierceLevel, m => { return(PierceLevels.Level1 == m); }, r => { return(PierceLevels.Level1); }); fluent.SetBinding(this.rbtnPierceLevel2, c => c.Checked, x => x.PierceLevel, m => { return(PierceLevels.Level2 == m); }, r => { return(PierceLevels.Level2); }); fluent.SetBinding(this.rbtnPierceLevel3, c => c.Checked, x => x.PierceLevel, m => { return(PierceLevels.Level3 == m); }, r => { return(PierceLevels.Level3); }); //等级一 fluent.SetBinding(this.ckStepTime1, c => c.Checked, x => x.PierceLevel1.IsStepTime); fluent.SetBinding(this.txtStepTime1.PopupEdit, c => c.Text, x => x.PierceLevel1.StepTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtNozzleHeight1.PopupEdit, c => c.Text, x => x.PierceLevel1.NozzleHeight); fluent.SetBinding(this.cmbGasKind1, c => c.Text, x => x.PierceLevel1.GasKind); fluent.SetBinding(this.txtGasPressure1.PopupEdit, c => c.Text, x => x.PierceLevel1.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent1.PopupEdit, c => c.Text, x => x.PierceLevel1.PowerPercent); fluent.SetBinding(this.txtPowerValue1.PopupEdit, c => c.Text, x => x.PierceLevel1.PowerValue); fluent.SetBinding(this.txtPulseDutyFactorPercent1.PopupEdit, c => c.Text, x => x.PierceLevel1.PulseDutyFactorPercent); fluent.SetBinding(this.txtPulseFrequency1.PopupEdit, c => c.Text, x => x.PierceLevel1.PulseFrequency); fluent.SetBinding(this.txtBeamSize1.PopupEdit, c => c.Text, x => x.PierceLevel1.BeamSize); fluent.SetBinding(this.txtFocusPosition1.PopupEdit, c => c.Text, x => x.PierceLevel1.FocusPosition); fluent.SetBinding(this.txtDelayTime1.PopupEdit, c => c.Text, x => x.PierceLevel1.DelayTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.ckExtraPuffing1, c => c.Checked, x => x.PierceLevel1.IsExtraPuffing); fluent.SetBinding(this.txtExtraPuffing1.PopupEdit, c => c.Text, x => x.PierceLevel1.ExtraPuffing, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); //等级二 fluent.SetBinding(this.ckStepTime2, c => c.Checked, x => x.PierceLevel2.IsStepTime); fluent.SetBinding(this.txtStepTime2.PopupEdit, c => c.Text, x => x.PierceLevel2.StepTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtNozzleHeight2.PopupEdit, c => c.Text, x => x.PierceLevel2.NozzleHeight); fluent.SetBinding(this.cmbGasKind2, c => c.Text, x => x.PierceLevel2.GasKind); fluent.SetBinding(this.txtGasPressure2.PopupEdit, c => c.Text, x => x.PierceLevel2.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent2.PopupEdit, c => c.Text, x => x.PierceLevel2.PowerPercent); fluent.SetBinding(this.txtPowerValue2.PopupEdit, c => c.Text, x => x.PierceLevel2.PowerValue); fluent.SetBinding(this.txtPulseDutyFactorPercent2.PopupEdit, c => c.Text, x => x.PierceLevel2.PulseDutyFactorPercent); fluent.SetBinding(this.txtPulseFrequency2.PopupEdit, c => c.Text, x => x.PierceLevel2.PulseFrequency); fluent.SetBinding(this.txtBeamSize2.PopupEdit, c => c.Text, x => x.PierceLevel2.BeamSize); fluent.SetBinding(this.txtFocusPosition2.PopupEdit, c => c.Text, x => x.PierceLevel2.FocusPosition); fluent.SetBinding(this.txtDelayTime2.PopupEdit, c => c.Text, x => x.PierceLevel2.DelayTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.ckExtraPuffing2, c => c.Checked, x => x.PierceLevel2.IsExtraPuffing); fluent.SetBinding(this.txtExtraPuffing2.PopupEdit, c => c.Text, x => x.PierceLevel2.ExtraPuffing, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); //等级三 fluent.SetBinding(this.ckStepTime3, c => c.Checked, x => x.PierceLevel3.IsStepTime); fluent.SetBinding(this.txtStepTime3.PopupEdit, c => c.Text, x => x.PierceLevel3.StepTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtNozzleHeight3.PopupEdit, c => c.Text, x => x.PierceLevel3.NozzleHeight); fluent.SetBinding(this.cmbGasKind3, c => c.Text, x => x.PierceLevel3.GasKind); fluent.SetBinding(this.txtGasPressure3.PopupEdit, c => c.Text, x => x.PierceLevel3.GasPressure, m => PressureUnitConverter.Convert(m), r => PressureUnitConverter.ConvertBack(r)); fluent.SetBinding(this.txtPowerPercent3.PopupEdit, c => c.Text, x => x.PierceLevel3.PowerPercent); fluent.SetBinding(this.txtPowerValue3.PopupEdit, c => c.Text, x => x.PierceLevel3.PowerValue); fluent.SetBinding(this.txtPulseDutyFactorPercent3.PopupEdit, c => c.Text, x => x.PierceLevel3.PulseDutyFactorPercent); fluent.SetBinding(this.txtPulseFrequency3.PopupEdit, c => c.Text, x => x.PierceLevel3.PulseFrequency); fluent.SetBinding(this.txtBeamSize3.PopupEdit, c => c.Text, x => x.PierceLevel3.BeamSize); fluent.SetBinding(this.txtFocusPosition3.PopupEdit, c => c.Text, x => x.PierceLevel3.FocusPosition); fluent.SetBinding(this.txtDelayTime3.PopupEdit, c => c.Text, x => x.PierceLevel3.DelayTime, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); fluent.SetBinding(this.ckExtraPuffing3, c => c.Checked, x => x.PierceLevel3.IsExtraPuffing); fluent.SetBinding(this.txtExtraPuffing3.PopupEdit, c => c.Text, x => x.PierceLevel3.ExtraPuffing, m => TimeUnitConverter.Convert(m), r => TimeUnitConverter.ConvertBack(r)); //UI上的绑定 this.txtStepTime1.DataBindings.Add("Enabled", this.ckStepTime1, "Checked"); this.txtExtraPuffing1.DataBindings.Add("Enabled", this.ckExtraPuffing1, "Checked"); this.txtStepTime2.DataBindings.Add("Enabled", this.ckStepTime2, "Checked"); this.txtExtraPuffing2.DataBindings.Add("Enabled", this.ckExtraPuffing2, "Checked"); this.txtStepTime3.DataBindings.Add("Enabled", this.ckStepTime3, "Checked"); this.txtExtraPuffing3.DataBindings.Add("Enabled", this.ckExtraPuffing3, "Checked"); }