| | |
| | | using System; |
| | | using DPumpHydr.WinFrmUI.RLT.Controls; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using static System.Net.Mime.MediaTypeNames; |
| | | using static System.Windows.Forms.VisualStyles.VisualStyleElement; |
| | | namespace DPumpHydr.WinFrmUI.Volute |
| | | using System.Windows.Forms; |
| | | |
| | | namespace DPumpHydr.WinFrmUI.Volute |
| | | { |
| | | public partial class ctrlHdrBaseInfo : UserControl |
| | | public partial class ctrlHdrBaseInfo : ParasInfoBaseCtrl |
| | | { |
| | | public ctrlHdrBaseInfo() |
| | | { |
| | | InitializeComponent(); |
| | | BuildAllTips(); |
| | | BuildIcon(); |
| | | |
| | | |
| | | labelNs.Text = ""; |
| | | } |
| | | |
| | | ViewModel.HdrBaseInfo _paras = null; |
| | | public void InitialParas() |
| | | { |
| | | ViewModel.GeomBaseInfo geomBaseInfo; |
| | | ViewModel.HdrBaseInfo hdrBaseInfo; |
| | | |
| | | InitialHistoryParas(out hdrBaseInfo , out geomBaseInfo); |
| | | |
| | | SetBindingData(hdrBaseInfo); |
| | | SetBindingData(geomBaseInfo); |
| | | } |
| | | public void InitialHistoryParas(out ViewModel.HdrBaseInfo hdrBaseInfo, out ViewModel.GeomBaseInfo geomBaseInfo) |
| | | { |
| | | hdrBaseInfo = new ViewModel.HdrBaseInfo(); |
| | | hdrBaseInfo.Q = 250; |
| | | hdrBaseInfo.H = 20; |
| | | hdrBaseInfo.n = 1480; |
| | | hdrBaseInfo.D2 = 270; |
| | | hdrBaseInfo.B2 = 50; |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty( |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseQ)) |
| | | { |
| | | hdrBaseInfo.Q = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseQ); |
| | | } |
| | | if (!string.IsNullOrEmpty( |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseH)) |
| | | { |
| | | hdrBaseInfo.H = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseH); |
| | | } |
| | | if (!string.IsNullOrEmpty( |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseN)) |
| | | { |
| | | hdrBaseInfo.n = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseN); |
| | | } |
| | | if (!string.IsNullOrEmpty( |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseD2)) |
| | | { |
| | | hdrBaseInfo.D2 = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseD2); |
| | | } |
| | | if (!string.IsNullOrEmpty( |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB2)) |
| | | { |
| | | hdrBaseInfo.B2 = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB2); |
| | | } |
| | | |
| | | |
| | | geomBaseInfo = new ViewModel.GeomBaseInfo(); |
| | | geomBaseInfo.Initial(hdrBaseInfo); |
| | | if (!string.IsNullOrEmpty( |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseFAI0)) |
| | | { |
| | | geomBaseInfo.FAI0 = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseFAI0); |
| | | } |
| | | if (!string.IsNullOrEmpty( |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB3)) |
| | | { |
| | | geomBaseInfo.B3 = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB3); |
| | | } |
| | | if (!string.IsNullOrEmpty( |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseD3)) |
| | | { |
| | | geomBaseInfo.D3 = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseD3); |
| | | } |
| | | |
| | | |
| | | |
| | | return ; |
| | | } |
| | | |
| | | |
| | | public void SetBindingData(ViewModel.HdrBaseInfo vm) |
| | | { |
| | | this._paras = vm; |
| | | if (vm == null) { |
| | | if (vm == null) |
| | | { |
| | | return; |
| | | } |
| | | this.mTextBoxEditæ»æµé.Text = vm.Q.ToString(); |
| | | this.mTextBoxEditæ¬ç¨.Text = vm.H.ToString(); |
| | | this.mTextBoxEdit转é.Text = vm.n.ToString(); |
| | | this.mTextBoxEditåºå£ç´å¾.Text = vm.D2.ToString(); |
| | | this.mTextBoxEditåºå£å®½åº¦.Text = vm.B2.ToString(); |
| | | this.mTextBoxEditåºå£ç´å¾D2.Text = vm.D2.ToString(); |
| | | this.mTextBoxåºå£å®½åº¦B2.Text = vm.B2.ToString(); |
| | | this.RBtnå叿³µ.Checked = vm.IsSXB; |
| | | } |
| | | public ViewModel.HdrBaseInfo GetBindingData(out string error) |
| | | public void SetBindingData(ViewModel.GeomBaseInfo vm) |
| | | { |
| | | if(!Verify(out error)) |
| | | if (vm == null) |
| | | { |
| | | return null; |
| | | return; |
| | | } |
| | | //this.crownLabelæ¯è½¬é.Text = vm.ns.ToString(); |
| | | //this.mTextBoxEdité度系æ°.Text = vm.K3.ToString(); |
| | | this.mTextBoxEditåºåç´å¾D3.Text = vm.D3.ToString(); |
| | | this.mTextBoxåºå宽度B3.Text = vm.B3.ToString(); |
| | | this.mTextBoxEditéè宿¾è§.Text = vm.FAI0.ToString(); |
| | | } |
| | | |
| | | public void SaveHistoryParas(ViewModel.HdrBaseInfo hdrBaseInfo, ViewModel.GeomBaseInfo geomBaseInfo) |
| | | { |
| | | if (hdrBaseInfo == null) return; |
| | | |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseQ = |
| | | hdrBaseInfo.Q.ToString(); |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseH = |
| | | hdrBaseInfo.H.ToString(); |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseN = |
| | | hdrBaseInfo.n.ToString(); |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseD2 = |
| | | hdrBaseInfo.D2.ToString(); |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB2 = |
| | | hdrBaseInfo.B2.ToString(); |
| | | |
| | | if (geomBaseInfo != null) |
| | | { |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseD3 = |
| | | geomBaseInfo.D3.ToString(); |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB3 = |
| | | geomBaseInfo.B3.ToString(); |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseFAI0 = |
| | | geomBaseInfo.FAI0.ToString(); |
| | | } |
| | | |
| | | |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.Save(); |
| | | } |
| | | |
| | | |
| | | public string GetBindingData( |
| | | out ViewModel.HdrBaseInfo hdrParas, |
| | | out ViewModel.GeomBaseInfo geomParas) |
| | | { |
| | | geomParas = null; |
| | | hdrParas = null; |
| | | string error; |
| | | if (!Verify(out error)) |
| | | { |
| | | return error; |
| | | } |
| | | error = null; |
| | | if(_paras == null) |
| | | { |
| | | _paras = new ViewModel.HdrBaseInfo(); |
| | | } |
| | | _paras.Q = Convert.ToDouble(this.mTextBoxEditæ»æµé.Text); |
| | | _paras.H = Convert.ToDouble(this.mTextBoxEditæ¬ç¨.Text); |
| | | _paras.n = Convert.ToDouble(this.mTextBoxEdit转é.Text); |
| | | _paras.D2 = Convert.ToDouble(this.mTextBoxEditåºå£ç´å¾.Text); |
| | | _paras.B2 = Convert.ToDouble(this.mTextBoxEditåºå£å®½åº¦.Text); |
| | | _paras.IsSXB = this.RBtnå叿³µ.Checked; |
| | | return _paras; |
| | | |
| | | |
| | | hdrParas = new ViewModel.HdrBaseInfo(); |
| | | |
| | | hdrParas.Q = Convert.ToDouble(this.mTextBoxEditæ»æµé.Text); |
| | | hdrParas.H = Convert.ToDouble(this.mTextBoxEditæ¬ç¨.Text); |
| | | hdrParas.n = Convert.ToDouble(this.mTextBoxEdit转é.Text); |
| | | hdrParas.D2 = Convert.ToDouble(this.mTextBoxEditåºå£ç´å¾D2.Text); |
| | | hdrParas.B2 = Convert.ToDouble(this.mTextBoxåºå£å®½åº¦B2.Text); |
| | | hdrParas.IsSXB = this.RBtnå叿³µ.Checked; |
| | | |
| | | |
| | | |
| | | geomParas = new ViewModel.GeomBaseInfo(); |
| | | |
| | | //geomParas.K3 = Convert.ToDouble(this.mTextBoxEdité度系æ°.Text); |
| | | geomParas.D3 = Convert.ToDouble(this.mTextBoxEditåºåç´å¾D3.Text); |
| | | geomParas.B3 = Convert.ToDouble(this.mTextBoxåºå宽度B3.Text); |
| | | geomParas.FAI0 = Convert.ToDouble(this.mTextBoxEditéè宿¾è§.Text); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | public bool Verify(out string error) |
| | | { |
| | | error = ""; |
| | | //if (!RBtnæè½¬å.Checked && !RBtnåè壳å.Checked && !RBtnç¯å.Checked && !RBtnåæè½¬å.Checked) |
| | | //{ |
| | | // error = "è¯·éæ©åæ°´å®¤ç±»åï¼"; |
| | | // return false; |
| | | // |
| | | |
| | | bool isOk = true ; |
| | | if (string.IsNullOrEmpty(mTextBoxEditæ»æµé.Text) || mTextBoxEditæ»æµé.Text == "请è¾å
¥æ»æµé" || double.Parse(mTextBoxEditæ»æµé.Text) == 0) |
| | | |
| | | skyLabelæ»æµé.Visible = false; |
| | | mTextBoxEditæ»æµé.TrailingIcon = null; |
| | | |
| | | skyLabel转é.Visible = false; |
| | | mTextBoxEdit转é.TrailingIcon = null; |
| | | |
| | | skyLabelæ¬ç¨.Visible = false; |
| | | mTextBoxEditæ¬ç¨.TrailingIcon = null; |
| | | |
| | | skyLabelåºå£ç´å¾.Visible = false; |
| | | mTextBoxEditåºå£ç´å¾D2.TrailingIcon = null; |
| | | |
| | | skyLabelåºå£å®½åº¦.Visible = false; |
| | | mTextBoxåºå£å®½åº¦B2.TrailingIcon = null; |
| | | double v = 0; |
| | | bool isOk = true; |
| | | if (string.IsNullOrEmpty(mTextBoxEditæ»æµé.Text) || mTextBoxEditæ»æµé.Text == "请è¾å
¥æ»æµé" || |
| | | !double.TryParse(mTextBoxEditæ»æµé.Text, out v) || |
| | | double.Parse(mTextBoxEditæ»æµé.Text) <= 0) |
| | | { |
| | | isOk = false; |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | mTextBoxEditæ»æµé.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelæ»æµé.Text = error; |
| | | skyLabelæ»æµé.Visible = true; |
| | | } |
| | | if (string.IsNullOrEmpty(mTextBoxEdit转é.Text) || mTextBoxEdit转é.Text == "请è¾å
¥è½¬é" || double.Parse(mTextBoxEdit转é.Text) == 0) |
| | | |
| | | if (string.IsNullOrEmpty(mTextBoxEdit转é.Text) || mTextBoxEdit转é.Text == "请è¾å
¥è½¬é" || |
| | | !double.TryParse(mTextBoxEdit转é.Text, out v) || |
| | | double.Parse(mTextBoxEdit转é.Text) <= 0) |
| | | { |
| | | isOk = false; |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | mTextBoxEdit转é.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | mTextBoxEdit转é.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabel转é.Text = error; |
| | | skyLabel转é.Visible = true; |
| | | } |
| | | if (string.IsNullOrEmpty(mTextBoxEditæ¬ç¨.Text) || mTextBoxEditæ¬ç¨.Text == "请è¾å
¥æ¬ç¨" || double.Parse(mTextBoxEditæ¬ç¨.Text) == 0) |
| | | if (string.IsNullOrEmpty(mTextBoxEditæ¬ç¨.Text) || mTextBoxEditæ¬ç¨.Text == "请è¾å
¥æ¬ç¨" || |
| | | !double.TryParse(mTextBoxEditæ¬ç¨.Text, out v) || |
| | | double.Parse(mTextBoxEditæ¬ç¨.Text) <= 0) |
| | | { |
| | | isOk = false; |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | mTextBoxEditæ¬ç¨.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | mTextBoxEditæ¬ç¨.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelæ¬ç¨.Text = error; |
| | | skyLabelæ¬ç¨.Visible = true; |
| | | } |
| | | if (string.IsNullOrEmpty(mTextBoxEditåºå£ç´å¾.Text) || mTextBoxEditåºå£ç´å¾.Text == "请è¾å
¥åºå£ç´å¾" || double.Parse(mTextBoxEditåºå£ç´å¾.Text) == 0) |
| | | if (string.IsNullOrEmpty(mTextBoxEditåºå£ç´å¾D2.Text) || mTextBoxEditåºå£ç´å¾D2.Text == "请è¾å
¥åºå£ç´å¾" || |
| | | !double.TryParse(mTextBoxEditåºå£ç´å¾D2.Text, out v) || |
| | | double.Parse(mTextBoxEditåºå£ç´å¾D2.Text) <= 0) |
| | | { |
| | | isOk = false; |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | mTextBoxEditåºå£ç´å¾.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | mTextBoxEditåºå£ç´å¾D2.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelåºå£ç´å¾.Text = error; |
| | | skyLabelåºå£ç´å¾.Visible = true; |
| | | } |
| | | if (string.IsNullOrEmpty(mTextBoxEditåºå£å®½åº¦.Text) || mTextBoxEditåºå£å®½åº¦.Text == "请è¾å
¥åºå£å®½åº¦" || double.Parse(mTextBoxEditåºå£å®½åº¦.Text) == 0) |
| | | |
| | | if (string.IsNullOrEmpty(mTextBoxåºå£å®½åº¦B2.Text) || mTextBoxåºå£å®½åº¦B2.Text == "请è¾å
¥åºå£å®½åº¦" || |
| | | !double.TryParse(mTextBoxåºå£å®½åº¦B2.Text, out v) || |
| | | double.Parse(mTextBoxåºå£å®½åº¦B2.Text) <= 0) |
| | | { |
| | | isOk = false; |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | mTextBoxEditåºå£å®½åº¦.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | mTextBoxåºå£å®½åº¦B2.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelåºå£å®½åº¦.Text = error; |
| | | skyLabelåºå£å®½åº¦.Visible = true; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(mTextBoxEditåºåç´å¾D3.Text) || |
| | | !double.TryParse(mTextBoxEditåºåç´å¾D3.Text, out v) || |
| | | double.Parse(mTextBoxEditåºåç´å¾D3.Text) <= 0) |
| | | { |
| | | isOk = false; |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | mTextBoxEditåºåç´å¾D3.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelåºåç´å¾.Text = error; |
| | | skyLabelåºåç´å¾.Visible = true; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(mTextBoxåºå宽度B3.Text) || |
| | | !double.TryParse(mTextBoxåºå宽度B3.Text, out v) || |
| | | double.Parse(mTextBoxåºå宽度B3.Text) <= 0) |
| | | { |
| | | isOk = false; |
| | | error = "请è¾å
¥å¿
填项ï¼"; |
| | | mTextBoxåºå宽度B3.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelåºå宽度.Text = error; |
| | | skyLabelåºå宽度.Visible = true; |
| | | } |
| | | if (isOk) |
| | | { |
| | | if (double.Parse(mTextBoxEditåºåç´å¾D3.Text) <= double.Parse(mTextBoxEditåºå£ç´å¾D2.Text) + 2) |
| | | { |
| | | isOk = false; |
| | | error = "åºåç´å¾è¦å¤§äºå¶è½®å¤å¾"; |
| | | mTextBoxEditåºåç´å¾D3.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelåºåç´å¾.Text = error; |
| | | skyLabelåºåç´å¾.Visible = true; |
| | | } |
| | | |
| | | if (double.Parse(mTextBoxåºå宽度B3.Text) <= double.Parse(mTextBoxåºå£å®½åº¦B2.Text)) |
| | | { |
| | | isOk = false; |
| | | error = "åºå宽度è¦å¤§äºå¶è½®å®½åº¦"; |
| | | mTextBoxåºå宽度B3.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelåºå宽度.Text = error; |
| | | skyLabelåºå宽度.Visible = true; |
| | | } |
| | | } |
| | | |
| | | |
| | | return isOk; |
| | | |
| | | } |
| | | |
| | | |
| | | double ns = 0; |
| | | private void CalcNs() |
| | | { |
| | | if (string.IsNullOrEmpty(this.mTextBoxEditæ»æµé.Text)) |
| | | return; |
| | | if (string.IsNullOrEmpty(this.mTextBoxEditæ¬ç¨.Text)) |
| | | return; |
| | | if (string.IsNullOrEmpty(this.mTextBoxEdit转é.Text)) |
| | | return; |
| | | |
| | | |
| | | |
| | | |
| | | var Q = Convert.ToDouble(this.mTextBoxEditæ»æµé.Text); |
| | | var H = Convert.ToDouble(this.mTextBoxEditæ¬ç¨.Text); |
| | | var n = Convert.ToDouble(this.mTextBoxEdit转é.Text); |
| | | if (Q < 1 || H < 1 || n < 10) |
| | | { |
| | | return; |
| | | } |
| | | var IsSXB = this.RBtnå叿³µ.Checked; |
| | | |
| | | var calc_q = Q; |
| | | if (IsSXB) calc_q = Q / 2; |
| | | ns = Math.Round(3.65 * n * Math.Sqrt(calc_q / 3600) / Math.Pow(H, 0.75), 2); |
| | | |
| | | labelNs.Text = string.Format(" æ¯è½¬é:{0}", ns); |
| | | } |
| | | |
| | | |
| | | private void BuildIcon() |
| | |
| | | mTextBoxEditæ»æµé.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | mTextBoxEdit转é.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | mTextBoxEditæ¬ç¨.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | mTextBoxEditåºå£ç´å¾.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | mTextBoxEditåºå£å®½åº¦.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | |
| | | mTextBoxEditåºå£ç´å¾D2.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | mTextBoxåºå£å®½åº¦B2.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | |
| | | //mTextBoxEdité度系æ°.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | mTextBoxEditåºåç´å¾D3.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | mTextBoxåºå宽度B3.LeadingIcon = GlobalResource.GetLeadingIcon(); |
| | | } |
| | | |
| | | private void BuildAllTips() |
| | | { |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.RBtnæè½¬å, "æè½¬å"); |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.RBtnåè壳å, "åè壳å"); |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.RBtnç¯å, "ç¯å"); |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.RBtnåæè½¬å, "åæè½¬å"); |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.mTextBoxEditæ»æµé, "æ»æµé"); |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.mTextBoxEdit转é, "转é"); |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.mTextBoxEditæ¬ç¨, "æ¬ç¨"); |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.mTextBoxEditåºå£ç´å¾, "åºå£ç´å¾"); |
| | | metroToolTipç¬¬ä¸æ¥æç¤º.SetToolTip(this.mTextBoxEditåºå£å®½åº¦, "åºå£å®½åº¦"); |
| | | //metroToolTipæç¤º.SetToolTip(this.RBtnèºæå, "èºæå"); |
| | | //metroToolTipæç¤º.SetToolTip(this.RBtnåè壳å, "åè壳å"); |
| | | //metroToolTipæç¤º.SetToolTip(this.RBtnç¯å, "ç¯å"); |
| | | //metroToolTipæç¤º.SetToolTip(this.RBtnåèºæå, "åèºæå"); |
| | | |
| | | //metroToolTipæç¤º.SetToolTip(this.mTextBoxEditæ»æµé, "æ»æµé"); |
| | | //metroToolTipæç¤º.SetToolTip(this.mTextBoxEdit转é, "转é"); |
| | | //metroToolTipæç¤º.SetToolTip(this.mTextBoxEditæ¬ç¨, "æ¬ç¨"); |
| | | //metroToolTipæç¤º.SetToolTip(this.mTextBoxEditåºå£ç´å¾, "åºå£ç´å¾"); |
| | | //metroToolTipæç¤º.SetToolTip(this.mTextBoxEditåºå£å®½åº¦, "åºå£å®½åº¦"); |
| | | |
| | | //metroToolTipæç¤º.SetToolTip(this.mTextBoxEditåºåç´å¾, "D3 è§£é"); |
| | | //metroToolTipæç¤º.SetToolTip(this.mTextBoxEditåºå宽度, "b3 è§£é"); |
| | | } |
| | | |
| | | private void pictureBox1_Click(object sender, EventArgs e) |
| | | { |
| | | if (string.IsNullOrEmpty(mTextBoxåºå£å®½åº¦B2.Text)) |
| | | return; |
| | | var b2 = double.Parse(mTextBoxåºå£å®½åº¦B2.Text); |
| | | double b3 = 0; |
| | | if (b2 <= 7) |
| | | b3 = b2 * 3; |
| | | if (b2 <= 32 && b2 > 7) |
| | | b3 = b2 * 2; |
| | | if (b2 > 32 && b2 <= 60) |
| | | b3 = b2 * 1.5; |
| | | if (b2 > 60) |
| | | b3 = b2 * 1.2; |
| | | |
| | | mTextBoxåºå宽度B3.Text = b3.ToString(); |
| | | |
| | | if (string.IsNullOrEmpty(mTextBoxEditåºå£ç´å¾D2.Text)) |
| | | return; |
| | | double D2 = double.Parse(mTextBoxEditåºå£ç´å¾D2.Text); |
| | | double D3 = (int)(1.05 * D2); |
| | | mTextBoxEditåºåç´å¾D3.Text = D3.ToString(); |
| | | |
| | | //计ç®å¹¶è®¾ç½®FAIO |
| | | double FAI0 = 0;//, FAI0min, FAI0max; |
| | | if (ns < 100) |
| | | { |
| | | FAI0 = 25 + (int)(ns / 20); |
| | | // FAI0min = 25.0; |
| | | // FAI0max = 30.0; |
| | | } |
| | | if (ns >= 100 && ns < 200) |
| | | { |
| | | FAI0 = 30 + (int)((ns - 100) / 12.5); |
| | | // FAI0min = 30.0; |
| | | // FAI0max = 38.0; |
| | | } |
| | | if (ns >= 200 && ns < 300) |
| | | { |
| | | FAI0 = 38 + (int)((ns - 200) / 50); |
| | | // FAI0min = 38.0; |
| | | // FAI0max = 40.0; |
| | | } |
| | | if (ns > 300) |
| | | { |
| | | FAI0 = 42; |
| | | // FAI0min = 40.0; |
| | | // FAI0max = 45.0; |
| | | } |
| | | |
| | | mTextBoxEditéè宿¾è§.Text = FAI0.ToString(); |
| | | } |
| | | |
| | | private void mTextBoxEditæ»æµé_TextChanged(object sender, EventArgs e) |
| | | { |
| | | foreach (var s in mTextBoxEditæ»æµé.Text) |
| | | double v = 0; |
| | | if (!double.TryParse(mTextBoxEditæ»æµé.Text, out v)) |
| | | { |
| | | if (!double.TryParse(mTextBoxEditæ»æµé.Text, out double result) && !string.IsNullOrEmpty(mTextBoxEditæ»æµé.Text) && mTextBoxEditæ»æµé.Text != "请è¾å
¥æ»æµé") |
| | | { |
| | | mTextBoxEditæ»æµé.UseAccent = true; |
| | | mTextBoxEditæ»æµé.ShowAssistiveText = true; |
| | | mTextBoxEditæ»æµé.HelperText = "请è¾å
¥æ£ç¡®æ»æµéï¼"; |
| | | mTextBoxEditæ»æµé.Text = ""; |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | mTextBoxEditæ»æµé.ShowAssistiveText = false; |
| | | mTextBoxEditæ»æµé.UseAccent = false; |
| | | } |
| | | MessageBox.Show("请è¾å
¥æ°åæ ¼å¼ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | private void mTextBoxEdit转é_TextChanged(object sender, EventArgs e) |
| | | { |
| | | foreach (var s in mTextBoxEdit转é.Text) |
| | | { |
| | | if (!double.TryParse(mTextBoxEdit转é.Text, out double result) && !string.IsNullOrEmpty(mTextBoxEdit转é.Text) && mTextBoxEdit转é.Text != "请è¾å
¥è½¬é") |
| | | { |
| | | mTextBoxEdit转é.UseAccent = true; |
| | | mTextBoxEdit转é.ShowAssistiveText = true; |
| | | mTextBoxEdit转é.HelperText = "请è¾å
¥æ£ç¡®è½¬éï¼"; |
| | | mTextBoxEdit转é.Text = ""; |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | mTextBoxEdit转é.ShowAssistiveText = false; |
| | | mTextBoxEdit转é.UseAccent = false; |
| | | } |
| | | } |
| | | CalcNs(); |
| | | } |
| | | |
| | | private void mTextBoxEditæ¬ç¨_TextChanged(object sender, EventArgs e) |
| | | { |
| | | foreach (var s in mTextBoxEditæ¬ç¨.Text) |
| | | double v = 0; |
| | | if (!double.TryParse(mTextBoxEditæ¬ç¨.Text, out v)) |
| | | { |
| | | if (!double.TryParse(mTextBoxEditæ¬ç¨.Text, out double result) && !string.IsNullOrEmpty(mTextBoxEditæ¬ç¨.Text) && mTextBoxEditæ¬ç¨.Text != "请è¾å
¥æ¬ç¨") |
| | | { |
| | | mTextBoxEditæ¬ç¨.UseAccent = true; |
| | | mTextBoxEditæ¬ç¨.ShowAssistiveText = true; |
| | | mTextBoxEditæ¬ç¨.HelperText = "请è¾å
¥æ£ç¡®æ¬ç¨ï¼"; |
| | | mTextBoxEditæ¬ç¨.Text = ""; |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | mTextBoxEditæ¬ç¨.ShowAssistiveText = false; |
| | | mTextBoxEditæ¬ç¨.UseAccent = false; |
| | | } |
| | | MessageBox.Show("请è¾å
¥æ°åæ ¼å¼ï¼"); |
| | | return; |
| | | } |
| | | CalcNs(); |
| | | } |
| | | |
| | | private void mTextBoxEditåºå£ç´å¾_TextChanged(object sender, EventArgs e) |
| | | private void mTextBoxEdit转é_TextChanged(object sender, EventArgs e) |
| | | { |
| | | foreach (var s in mTextBoxEditåºå£ç´å¾.Text) |
| | | double v = 0; |
| | | if (!double.TryParse(mTextBoxEdit转é.Text, out v)) |
| | | { |
| | | if (!double.TryParse(mTextBoxEditåºå£ç´å¾.Text, out double result) && !string.IsNullOrEmpty(mTextBoxEditåºå£ç´å¾.Text) && mTextBoxEditåºå£ç´å¾.Text != "请è¾å
¥åºå£ç´å¾") |
| | | { |
| | | mTextBoxEditåºå£ç´å¾.UseAccent = true; |
| | | mTextBoxEditåºå£ç´å¾.ShowAssistiveText = true; |
| | | mTextBoxEditåºå£ç´å¾.HelperText = "请è¾å
¥æ£ç¡®åºå£ç´å¾ï¼"; |
| | | mTextBoxEditåºå£ç´å¾.Text = ""; |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | mTextBoxEditåºå£ç´å¾.ShowAssistiveText = false; |
| | | mTextBoxEditåºå£ç´å¾.UseAccent = false; |
| | | } |
| | | MessageBox.Show("请è¾å
¥æ°åæ ¼å¼ï¼"); |
| | | return; |
| | | } |
| | | CalcNs(); |
| | | } |
| | | |
| | | private void mTextBoxEditåºå£å®½åº¦_TextChanged(object sender, EventArgs e) |
| | | private void RBtnå叿³µ_CheckedChanged(object sender) |
| | | { |
| | | foreach (var s in mTextBoxEditåºå£å®½åº¦.Text) |
| | | { |
| | | if (!double.TryParse(mTextBoxEditåºå£å®½åº¦.Text, out double result) && !string.IsNullOrEmpty(mTextBoxEditåºå£å®½åº¦.Text) && mTextBoxEditåºå£å®½åº¦.Text != "请è¾å
¥åºå£å®½åº¦") |
| | | { |
| | | mTextBoxEditåºå£å®½åº¦.UseAccent = true; |
| | | mTextBoxEditåºå£å®½åº¦.ShowAssistiveText = true; |
| | | mTextBoxEditåºå£å®½åº¦.HelperText = "è¯·è¾æ£ç¡®åºå£å®½åº¦ï¼"; |
| | | mTextBoxEditåºå£å®½åº¦.Text = ""; |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | mTextBoxEditåºå£å®½åº¦.ShowAssistiveText = false; |
| | | mTextBoxEditåºå£å®½åº¦.UseAccent = false; |
| | | } |
| | | } |
| | | CalcNs(); |
| | | } |
| | | |
| | | private void mTextBoxEditæ»æµé_Leave(object sender, EventArgs e) |
| | | private void btnNextStep_Click(object sender, EventArgs e) |
| | | { |
| | | if (string.IsNullOrEmpty(mTextBoxEditæ»æµé.Text) || double.Parse(mTextBoxEditæ»æµé.Text) == 0) |
| | | { |
| | | mTextBoxEditæ»æµé.Text = "请è¾å
¥æ»æµé"; |
| | | } |
| | | NextStep(); |
| | | } |
| | | |
| | | private void mTextBoxEditæ»æµé_Enter(object sender, EventArgs e) |
| | | { |
| | | skyLabelæ»æµé.Visible = false; |
| | | mTextBoxEditæ»æµé.TrailingIcon = null; |
| | | if (mTextBoxEditæ»æµé.Text == "请è¾å
¥æ»æµé") |
| | | { |
| | | mTextBoxEditæ»æµé.Text = ""; |
| | | } |
| | | } |
| | | |
| | | private void mTextBoxEdit转é_Leave(object sender, EventArgs e) |
| | | { |
| | | if (string.IsNullOrEmpty(mTextBoxEdit转é.Text) || double.Parse(mTextBoxEdit转é.Text) == 0) |
| | | { |
| | | mTextBoxEdit转é.Text = "请è¾å
¥è½¬é"; |
| | | } |
| | | } |
| | | |
| | | private void mTextBoxEdit转é_Enter(object sender, EventArgs e) |
| | | { |
| | | skyLabel转é.Visible = false; |
| | | mTextBoxEdit转é.TrailingIcon = null; |
| | | if (mTextBoxEdit转é.Text == "请è¾å
¥è½¬é") |
| | | { |
| | | mTextBoxEdit转é.Text = ""; |
| | | } |
| | | } |
| | | |
| | | private void mTextBoxEditæ¬ç¨_Leave(object sender, EventArgs e) |
| | | { |
| | | |
| | | if (string.IsNullOrEmpty(mTextBoxEditæ¬ç¨.Text) || double.Parse(mTextBoxEditæ¬ç¨.Text) == 0) |
| | | { |
| | | mTextBoxEditæ¬ç¨.Text = "请è¾å
¥æ¬ç¨"; |
| | | } |
| | | } |
| | | |
| | | private void mTextBoxEditæ¬ç¨_Enter(object sender, EventArgs e) |
| | | { |
| | | skyLabelæ¬ç¨.Visible = false; |
| | | mTextBoxEditæ¬ç¨.TrailingIcon = null; |
| | | if (mTextBoxEditæ¬ç¨.Text == "请è¾å
¥æ¬ç¨") |
| | | { |
| | | mTextBoxEditæ¬ç¨.Text = ""; |
| | | } |
| | | } |
| | | |
| | | |
| | | private void mTextBoxEditåºå£ç´å¾D_Leave(object sender, EventArgs e) |
| | | { |
| | | if (string.IsNullOrEmpty(mTextBoxEditåºå£ç´å¾.Text) || double.Parse(mTextBoxEditåºå£ç´å¾.Text) == 0) |
| | | { |
| | | mTextBoxEditåºå£ç´å¾.Text = "请è¾å
¥åºå£ç´å¾"; |
| | | } |
| | | } |
| | | |
| | | private void mTextBoxEditåºå£ç´å¾_Enter(object sender, EventArgs e) |
| | | { |
| | | skyLabelåºå£ç´å¾.Visible = false; |
| | | mTextBoxEditåºå£ç´å¾.TrailingIcon = null; |
| | | if (mTextBoxEditåºå£ç´å¾.Text == "请è¾å
¥åºå£ç´å¾") |
| | | { |
| | | mTextBoxEditåºå£ç´å¾.Text = ""; |
| | | } |
| | | } |
| | | |
| | | private void mTextBoxEditåºå£å®½åº¦_Leave(object sender, EventArgs e) |
| | | { |
| | | if (string.IsNullOrEmpty(mTextBoxEditåºå£å®½åº¦.Text) || double.Parse(mTextBoxEditåºå£å®½åº¦.Text) == 0) |
| | | { |
| | | mTextBoxEditåºå£å®½åº¦.Text = "请è¾å
¥åºå£å®½åº¦"; |
| | | } |
| | | } |
| | | |
| | | private void mTextBoxEditåºå£å®½åº¦_Enter(object sender, EventArgs e) |
| | | { |
| | | skyLabelåºå£å®½åº¦.Visible = false; |
| | | mTextBoxEditåºå£å®½åº¦.TrailingIcon = null; |
| | | if (mTextBoxEditåºå£å®½åº¦.Text == "请è¾å
¥åºå£å®½åº¦") |
| | | { |
| | | mTextBoxEditåºå£å®½åº¦.Text = ""; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |