using System;
|
|
namespace TProduct.WinFrmUI.TValve
|
{
|
public partial class SetValveCoordinateDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public event Action<TProduct.Model.ValveCoordinateParas> OnChangedCoord = null;
|
|
private TProduct.Model.ValveCoordinateParas _coordinateParas = null;
|
public TProduct.Model.ValveCoordinateParas CoordinateParas { get { return _coordinateParas; } set { _coordinateParas = value; } }
|
|
|
|
public void SetCoordinate(TProduct.Model.ValveCoordinateParas coordinateParas)
|
{
|
|
this._coordinateParas = coordinateParas;
|
|
}
|
|
|
public SetValveCoordinateDlg()
|
{
|
InitializeComponent();
|
this.btnSet.SetCancelButtonColor();
|
this.btnClose.SetCancelButtonColor();
|
}
|
|
private void LoadWindow(object sender, EventArgs e)
|
{
|
if (_coordinateParas == null)
|
return;
|
|
|
|
//流量刻度间隔数
|
//textGridNumberX.Text = _coordinateParas.GridSpaceNumberX.ToString();
|
//textGridNumberY.Text = _coordinateParas.GridSpaceNumberY.ToString();
|
//textGridNumberX.Enabled = true;
|
|
//textMinDispX.Text = _coordinateParas.CoordMinX.ToString();
|
//textCoordSpaceX.Text = _coordinateParas.CoordSpaceX.ToString();
|
|
|
|
|
//textStartLineNoKv.Text = _coordinateParas.StartLineNoKv.ToString();
|
//textEndLineNoKv.Text = _coordinateParas.EndLineNoKv.ToString();
|
|
//textMaxDispKv.Text = (_coordinateParas.CoordMinKv + _coordinateParas.EndLineNoKv * _coordinateParas.CoordSpaceKv).ToString();
|
//textCoordSpaceKv.Text = _coordinateParas.CoordSpaceKv.ToString();
|
|
|
|
|
|
//textEndLineNoRc.Text = _coordinateParas.EndLineNoRc.ToString();
|
//textStartLineNoRc.Text = _coordinateParas.StartLineNoRc.ToString();
|
//textCoordSpaceRc.Text = _coordinateParas.CoordSpaceRc.ToString();
|
//textMaxDispRc.Text = (_coordinateParas.CoordMinRc + _coordinateParas.EndLineNoRc * _coordinateParas.CoordSpaceRc).ToString();
|
|
|
|
|
|
|
}
|
|
|
|
private void btnClose_Click(object sender, EventArgs e)
|
{
|
this.Close();
|
}
|
|
private void btnSet_Click(object sender, EventArgs e)
|
{
|
if (OnChangedCoord == null || _coordinateParas == null)
|
return;
|
|
//double space = 0;
|
//int start = 0, end = 0, num = 0;
|
//double maxValue = 0;
|
|
|
|
//if (!double.TryParse(textCoordSpaceX.Text, out space))
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
|
// return;
|
//}
|
//if (space < 0.01)
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("刻度值过小,请重新调整"));
|
// return;
|
//}
|
|
//if (!int.TryParse(textGridNumberX.Text, out num))
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString(" 刻度数请输入合理值"));
|
// return;
|
//}
|
//_coordinateParas.GridSpaceNumberX = num;
|
|
//if (!int.TryParse(textGridNumberY.Text, out num))
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString(" 刻度数请输入合理值"));
|
// return;
|
//}
|
//_coordinateParas.GridSpaceNumberY = num;
|
|
|
|
//double CoordMinX = 0;
|
//double.TryParse(textMinDispX.Text, out CoordMinX);
|
|
|
|
//_coordinateParas.CoordMinX = CoordMinX;
|
//_coordinateParas.CoordSpaceX = space;
|
|
|
|
|
|
|
|
//if (!int.TryParse(textStartLineNoKv.Text, out start))
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("扬程刻度数请输入合理值"));
|
// return;
|
//}
|
//if (!int.TryParse(textEndLineNoKv.Text, out end))
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("扬程刻度数请输入合理值"));
|
// return;
|
//}
|
//if (start >= end - 1)
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("扬程刻度设置不合理"));
|
// return;
|
//}
|
//if (!double.TryParse(textCoordSpaceKv.Text, out space))
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
|
// return;
|
//}
|
|
|
//if (!double.TryParse(textMaxDispKv.Text, out maxValue))
|
//{
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
|
// return;
|
//}
|
|
//_coordinateParas.StartLineNoKv = start;
|
//_coordinateParas.EndLineNoKv = end;
|
|
//_coordinateParas.CoordSpaceKv = space;
|
//_coordinateParas.CoordMinKv = maxValue - _coordinateParas.EndLineNoKv * space;
|
|
|
|
|
|
|
//if (groupBoxE.Visible)
|
//{
|
// if (!int.TryParse(textEndLineNoRc.Text, out end))
|
// {
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("效率刻度数请输入合理值"));
|
// return;
|
// }
|
// if (!int.TryParse(textStartLineNoRc.Text, out start))
|
// {
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("效率刻度数请输入合理值"));
|
// return;
|
// }
|
// if (start >= end - 1)
|
// {
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("Rc刻度设置不合理"));
|
// return;
|
// }
|
// if (!double.TryParse(textCoordSpaceRc.Text, out space))
|
// {
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
|
// return;
|
// }
|
// if (space < 0.001)
|
// {
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("刻度值过小,请重新调整"));
|
// return;
|
// }
|
// if (!double.TryParse(textMaxDispRc.Text, out maxValue))
|
// {
|
// XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
|
// return;
|
// }
|
// _coordinateParas.CoordSpaceRc = space;
|
// _coordinateParas.StartLineNoRc = start;
|
// _coordinateParas.EndLineNoRc = end;
|
// _coordinateParas.CoordMinRc = maxValue - _coordinateParas.EndLineNoRc * _coordinateParas.CoordSpaceRc;
|
//}
|
|
|
|
|
|
|
|
|
|
//
|
if (OnChangedCoord != null)
|
OnChangedCoord(_coordinateParas);
|
}
|
|
|
}
|
}
|