using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.IO;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
using DPumpHydr.WinFrmUI.RLT.Controls;
|
using DPumpHydr.WinFrmUI.Volute.ViewModel;
|
|
namespace DPumpHydr.WinFrmUI.Volute
|
{
|
/// <summary>
|
/// 厚度
|
/// </summary>
|
public partial class ctrlThicknessParas : ParasInfoBaseCtrl
|
{
|
public ctrlThicknessParas()
|
{
|
InitializeComponent();
|
BuildAllTips();
|
BuildIcon();
|
}
|
|
|
public void ShowPage()
|
{
|
|
}
|
|
|
public bool Verify(out string error)
|
{
|
error = "";
|
bool isOk = true;
|
if (string.IsNullOrEmpty(mTextBoxEdit厚度.Text) || double.Parse(mTextBoxEdit厚度.Text) == 0)
|
{
|
error = "请输入必填项!";
|
isOk = false;
|
mTextBoxEdit厚度.TrailingIcon = GlobalResource.GetTipTrailingIcon();
|
skyLabel蜗室厚度.Visible = true;
|
}
|
|
return isOk;
|
}
|
|
|
|
private void BuildIcon()
|
{
|
//对话框前缀图片
|
mTextBoxEdit厚度.LeadingIcon = GlobalResource.GetLeadingIcon();
|
|
|
}
|
|
private void BuildAllTips()
|
{
|
metroToolTip提示.SetToolTip(this.mTextBoxEdit厚度, "蜗室厚度");
|
}
|
|
|
private void mTextBoxEdit蜗室平均速度_Enter(object sender, EventArgs e)
|
{
|
skyLabel蜗室厚度.Visible = false;
|
mTextBoxEdit厚度.TrailingIcon = null;
|
}
|
|
private void mTextBoxEdit蜗室平均速度_Leave(object sender, EventArgs e)
|
{
|
//if (string.IsNullOrEmpty(mTextBoxEdit厚度.Text) || double.Parse(mTextBoxEdit厚度.Text) == 0)
|
//{
|
// mTextBoxEdit厚度.Text = _paras.V3.ToString();
|
//}
|
}
|
|
private void mTextBoxEdit蜗室平均速度_TextChanged(object sender, EventArgs e)
|
{
|
|
if (!double.TryParse(mTextBoxEdit厚度.Text, out double result) && !string.IsNullOrEmpty(mTextBoxEdit厚度.Text))
|
{
|
mTextBoxEdit厚度.UseAccent = true;
|
mTextBoxEdit厚度.ShowAssistiveText = true;
|
}
|
else
|
{
|
mTextBoxEdit厚度.ShowAssistiveText = false;
|
mTextBoxEdit厚度.UseAccent = false;
|
}
|
|
}
|
|
|
|
public Action<double> OnRefreshShape = null;
|
|
|
public double InitialParas(
|
ViewModel.HdrBaseInfo hdrBaseInfo,
|
ViewModel.GeomBaseInfo geomBaseInfo,
|
ViewModel.OutflowParas outflowParas,
|
double bodyThickness)
|
{
|
double thickness = 8;
|
if (outflowParas.Dia < 60)
|
thickness = 5;
|
else if (outflowParas.Dia < 100)
|
thickness = 6;
|
else if (outflowParas.Dia < 150)
|
thickness = 8;
|
else if (outflowParas.Dia < 200)
|
thickness = 10;
|
else if (outflowParas.Dia < 250)
|
thickness = 12;
|
else
|
thickness = 15;
|
if (bodyThickness != 0)
|
{
|
thickness = bodyThickness;
|
}
|
mTextBoxEdit厚度.Text = thickness.ToString();
|
return thickness;
|
}
|
public double GetBindingData(out string error)
|
{
|
error = null;
|
if (!double.TryParse(mTextBoxEdit厚度.Text, out double thickness))
|
{
|
error = "厚度不是正确的格式";
|
return 0;
|
}
|
return thickness;
|
|
}
|
internal void InitialParas(double thickness)
|
{
|
|
|
mTextBoxEdit厚度.Text = thickness.ToString();
|
}
|
|
private void mBtn更新模型_Click(object sender, EventArgs e)
|
{
|
if (OnRefreshShape == null)
|
return;
|
var paras = Convert.ToDouble(mTextBoxEdit厚度.Text);
|
//paras.InitialAllParameters(this._hdrBaseInfo,this._geomBaseInfo);
|
OnRefreshShape.Invoke(paras);
|
}
|
|
private void btnNextPrev_Click(object sender, EventArgs e)
|
{
|
PrevStep();
|
}
|
}
|
}
|