|
|
namespace TProduct.WinFrmUI.TPump
|
{
|
/// <summary>
|
/// 性能测试
|
/// </summary>
|
public partial class NpshTestIngMainPage
|
{
|
private void IntialPartInfoCtrl()
|
{
|
if (_partInfoCtrl == null)
|
{
|
this._partInfoCtrl = new TProduct.WinFrmUI.TPump.PartInfoCtrl();
|
|
this._partInfoCtrl.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
this._partInfoCtrl.Appearance.Options.UseBackColor = true;
|
this._partInfoCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
this._partInfoCtrl.Location = new System.Drawing.Point(0, 0);
|
this._partInfoCtrl.Name = "PartInfoCtrl";
|
|
this._partInfoCtrl.Size = new System.Drawing.Size(967, 555);
|
//this._partInfoCtrl.SurfaceGuid = null;
|
this._partInfoCtrl.TabIndex = 0;
|
this._partInfoCtrl.OnChangeMotorInfo += (motor ) =>
|
{
|
if (_currentMotor == null)
|
return;
|
this._currentMotor = motor;
|
var rated_motor = TProduct.Model.RatedParas4Motor.ToModel(_currentMotor.RatedParas);
|
|
if (theCalcDataDlg != null)
|
theCalcDataDlg.SetMotorInfo(rated_motor.E_Self, motor.EtaCurve);
|
|
if (this._linkHelper != null)
|
{
|
this._linkHelper.ResetProductInfo(this._currentPump, this._currentMotor);
|
}
|
|
var bllMtor = new BLL.ProductMain();
|
new BLL.ProductMotor().UpdateEx(_currentMotor);
|
|
if (OnChangeProductInfo != null)
|
{
|
OnChangeProductInfo(this._currentPump, _currentMotor);
|
}
|
};
|
this._partInfoCtrl.OnChangeElectricInfo += (eleInfo) =>
|
{
|
if (eleInfo == null)
|
return;
|
|
if (this._linkHelper != null)
|
{
|
this._linkHelper.ResetElectricInfo(eleInfo);
|
this._testItem.ElectricInfo = eleInfo;
|
new BLL.TestProjectItem().Update(new Model.TestProjectItem(
|
this._testItem));
|
}
|
};
|
this._partInfoCtrl.OnChangeRatedParas += (rateParas) =>
|
{
|
if (rateParas != this._ratedParas.ToJson())
|
{
|
this._ratedParas = Model.RatedParas4Pump.ToModel(rateParas);
|
this._currentPump.RatedParas = _ratedParas.ToJson();
|
//this._chartMainCtrl.RefreshRatedParas(this._ratedParas, this._testJudgeItems);
|
new BLL.ProductMain().UpdateRatedParas(_currentPump.ID, rateParas);
|
|
if (OnChangeProductInfo != null)
|
{
|
OnChangeProductInfo(this._currentPump, _currentMotor);
|
}
|
}
|
};
|
|
this.tabPagePartInfo.Controls.Add(this._partInfoCtrl);
|
}
|
if (_currentPump.MotorMainID.HasValue && _currentPump.MotorMainID > 0)
|
{
|
_currentMotor = new BLL.ProductMotor().GetExByProductID((long)_currentPump.MotorMainID);
|
}
|
|
this._partInfoCtrl.SetBindingData(
|
this._currentPump,
|
this._currentMotor,
|
this._currentPart,
|
this._testItem.ElectricInfo);
|
}
|
|
//TProduct.WinFrmUI.TBase.ProductTestBimfaceCtrl _model3dCtrl = null;
|
private void InitialModel3d()
|
{
|
if (string.IsNullOrEmpty(_workBenchInfo.Model3dPath))
|
{
|
this.tabPage3D.PageVisible = false;
|
return;
|
}
|
if (!TProduct.UserSetting.Setting.Disp.IsShowModel3d)
|
{
|
this.tabPage3D.PageVisible = false;
|
return;
|
}
|
|
//if (_model3dCtrl == null)
|
//{
|
// _model3dCtrl = new TProduct.WinFrmUI.TBase.ProductTestBimfaceCtrl();
|
// _model3dCtrl.Dock = DockStyle.Fill;
|
// _model3dCtrl.Name = "PumpTestBimfaceViewCtrl";
|
// _model3dCtrl.Padding = new Padding(0);
|
// string error_info;
|
// var url = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Model3d", _workBenchInfo.Model3dPath);
|
// if (_model3dCtrl.SetBindingData(url, out error_info) == false)
|
// {
|
// this.tabPage3D.PageVisible = false;
|
// MessageBox.Show(error_info);
|
// return;
|
// }
|
|
// this.tabPage3D.Controls.Add(_model3dCtrl);
|
//}
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void barBtn测试台测点_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
{
|
TProduct.WinFrmUI.TestBench.ListWorkBenchMonitorPointDlg frm = new TProduct.WinFrmUI.TestBench.ListWorkBenchMonitorPointDlg();
|
frm.SetBindingData(this._workBenchInfo);
|
frm.Show();
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
private void barBtn测试台仪表_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
{
|
var frm = new TProduct.WinFrmUI.TPump.ViewWorkBenchInfoDlg();
|
frm.SetBindingData(this._workBenchInfo, this._testItem);
|
frm.Show();
|
}
|
}
|
}
|