| | |
| | | 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; |
| | | |
| | |
| | | } |
| | | public void InitialParas() |
| | | { |
| | | var hdrBaseInfo = InitialHistoryParas(); |
| | | ViewModel.GeomBaseInfo geomBaseInfo; |
| | | ViewModel.HdrBaseInfo hdrBaseInfo; |
| | | |
| | | ViewModel.GeomBaseInfo geomBaseInfo = new ViewModel.GeomBaseInfo(); |
| | | geomBaseInfo.Initial(hdrBaseInfo); |
| | | 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); |
| | | } |
| | | InitialHistoryParas(out hdrBaseInfo , out geomBaseInfo); |
| | | |
| | | SetBindingData(hdrBaseInfo); |
| | | SetBindingData(geomBaseInfo); |
| | | } |
| | | public ViewModel.HdrBaseInfo InitialHistoryParas() |
| | | public void InitialHistoryParas(out ViewModel.HdrBaseInfo hdrBaseInfo, out ViewModel.GeomBaseInfo geomBaseInfo) |
| | | { |
| | | ViewModel.HdrBaseInfo hdrBaseInfo = new ViewModel.HdrBaseInfo(); |
| | | 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.B2 = Convert.ToDouble(DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB2); |
| | | } |
| | | SetBindingData(hdrBaseInfo); |
| | | |
| | | return hdrBaseInfo; |
| | | |
| | | 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 ; |
| | | } |
| | | |
| | | |
| | |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB2 = |
| | | hdrBaseInfo.B2.ToString(); |
| | | |
| | | if (geomBaseInfo == null) |
| | | if (geomBaseInfo != null) |
| | | { |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseD3 = |
| | | geomBaseInfo.D3.ToString(); |
| | | DPumpHydr.WinFrmUI.Volute.Properties.Settings.Default.HistoryHdrBaseB3 = |
| | | geomBaseInfo.B3.ToString(); |
| | | 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(); |
| | | } |
| | |
| | | string error; |
| | | if (!Verify(out error)) |
| | | { |
| | | return null; |
| | | return error; |
| | | } |
| | | error = null; |
| | | |
| | |
| | | skyLabelåºå宽度.Text = error; |
| | | skyLabelåºå宽度.Visible = true; |
| | | } |
| | | |
| | | if (double.Parse(mTextBoxEditåºåç´å¾D3.Text) <= double.Parse(mTextBoxEditåºå£ç´å¾D2.Text) + 2) |
| | | if (isOk) |
| | | { |
| | | isOk = false; |
| | | error = "åºåç´å¾è¦å¤§äºå¶è½®å¤å¾"; |
| | | mTextBoxEditåºåç´å¾D3.TrailingIcon = GlobalResource.GetTipTrailingIcon(); |
| | | skyLabelåºåç´å¾.Text = error; |
| | | skyLabelåºåç´å¾.Visible = true; |
| | | } |
| | | 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; |
| | | 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; |
| | | } |
| | |
| | | mTextBoxEditåºåç´å¾D3.Text = D3.ToString(); |
| | | |
| | | //计ç®å¹¶è®¾ç½®FAIO |
| | | double FAI0 = 0, FAI0min, FAI0max; |
| | | double FAI0 = 0;//, FAI0min, FAI0max; |
| | | if (ns < 100) |
| | | { |
| | | FAI0 = 25 + (int)(ns / 20); |
| | | FAI0min = 25.0; |
| | | FAI0max = 30.0; |
| | | // FAI0min = 25.0; |
| | | // FAI0max = 30.0; |
| | | } |
| | | if (ns >= 100 && ns < 200) |
| | | { |
| | | FAI0 = 30 + (int)((ns - 100) / 12.5); |
| | | FAI0min = 30.0; |
| | | FAI0max = 38.0; |
| | | // FAI0min = 30.0; |
| | | // FAI0max = 38.0; |
| | | } |
| | | if (ns >= 200 && ns < 300) |
| | | { |
| | | FAI0 = 38 + (int)((ns - 200) / 50); |
| | | FAI0min = 38.0; |
| | | FAI0max = 40.0; |
| | | // FAI0min = 38.0; |
| | | // FAI0max = 40.0; |
| | | } |
| | | if (ns > 300) |
| | | { |
| | | FAI0 = 42; |
| | | FAI0min = 40.0; |
| | | FAI0max = 45.0; |
| | | // FAI0min = 40.0; |
| | | // FAI0max = 45.0; |
| | | } |
| | | |
| | | mTextBoxEditéè宿¾è§.Text = FAI0.ToString(); |
| | |
| | | |
| | | private void mTextBoxEditæ»æµé_TextChanged(object sender, EventArgs e) |
| | | { |
| | | double v = 0; |
| | | if (!double.TryParse(mTextBoxEditæ»æµé.Text, out v)) |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ°åæ ¼å¼ï¼"); |
| | | return; |
| | | } |
| | | CalcNs(); |
| | | } |
| | | |
| | | private void mTextBoxEditæ¬ç¨_TextChanged(object sender, EventArgs e) |
| | | { |
| | | double v = 0; |
| | | if (!double.TryParse(mTextBoxEditæ¬ç¨.Text, out v)) |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ°åæ ¼å¼ï¼"); |
| | | return; |
| | | } |
| | | CalcNs(); |
| | | } |
| | | |
| | | private void mTextBoxEdit转é_TextChanged(object sender, EventArgs e) |
| | | { |
| | | double v = 0; |
| | | if (!double.TryParse(mTextBoxEdit转é.Text, out v)) |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ°åæ ¼å¼ï¼"); |
| | | return; |
| | | } |
| | | CalcNs(); |
| | | } |
| | | |