using DevExpress.XtraEditors;
|
using System;
|
using System.Collections.Generic;
|
using System.Windows.Forms;
|
|
namespace TProduct.WinFrmUI.TPump
|
{
|
public partial class FeatTestIngMainDialog : XtraForm
|
{
|
public FeatTestIngMainDialog()
|
{
|
InitializeComponent();
|
|
featTestIngMainPage1.OnChangeProductInfo += (pump, motor) =>
|
{
|
if (OnChangeProductInfo != null)
|
{
|
OnChangeProductInfo(pump, motor);
|
}
|
};
|
|
featTestIngMainPage1.OnChangeTestInfo += (item) =>
|
{
|
if (OnChangeTestInfo != null)
|
{
|
OnChangeTestInfo(item);
|
}
|
};
|
featTestIngMainPage1.OnCloseAndView += () =>
|
{
|
featTestIngMainPage1.CheckTestEndTime();
|
|
if (!featTestIngMainPage1.IsCloseFrmAble())
|
{
|
return;
|
}
|
|
this.DialogResult = DialogResult.Yes;//用YES ,外部会启动查看界面
|
this.Close();
|
};
|
}
|
public Action<TProduct.Model.ProductMainExPump, TProduct.Model.ProductMainExMotor> OnChangeProductInfo = null;
|
public Action<TProduct.Model.TestProjectItemView> OnChangeTestInfo = null;
|
|
private void FeatTestIngMainDialog_Load(object sender, EventArgs e)
|
{
|
|
}
|
public void SetBindingData(
|
TProduct.Model.ProductMainExPumpPart pumpExPart,
|
TProduct.Model.TestProjectItemView item,
|
TProduct.Model.WorkBenchBase workBench)
|
{
|
TProduct.Model.ProductMainExPump pump = new Model.ProductMainExPump(pumpExPart);
|
var part = new BLL.PartBase().GetByID(pumpExPart.PartID);
|
featTestIngMainPage1.SetBindingData(
|
pump, part, item,
|
workBench);
|
this.Text = string.Format("测试:{0}", pump.Name);
|
// TProduct.WinFrmUI.GlobeParas.MainForm.CreatePage(ctrl, new SurfaceGuid() {
|
// DockType = eDockType.Tab, Modular = eModular.PumpTestDetail,
|
// Function = "PumpTestDetail",
|
// Tag = "PumpTestDetail" });
|
}
|
public void SetBindingData(
|
TProduct.Model.ProductMainExPump pump,
|
TProduct.Model.PartBase part,
|
TProduct.Model.TestProjectItemView item,
|
TProduct.Model.WorkBenchBase workBench)
|
{
|
featTestIngMainPage1.SetBindingData(
|
pump, part, item,
|
workBench);
|
this.Text = string.Format("测试:{0}", pump.Name);
|
// TProduct.WinFrmUI.GlobeParas.MainForm.CreatePage(ctrl, new SurfaceGuid() {
|
// DockType = eDockType.Tab, Modular = eModular.PumpTestDetail,
|
// Function = "PumpTestDetail",
|
// Tag = "PumpTestDetail" });
|
}
|
|
internal void SetParallelInfo(List<Model.ParallelPumpInfoEx> parappleInfo)
|
{
|
featTestIngMainPage1.SetParallelInfo(parappleInfo);
|
}
|
|
|
private void FeatTestIngMainDialog_FormClosing(object sender, FormClosingEventArgs e)
|
{
|
featTestIngMainPage1.CheckTestEndTime();
|
|
if (!featTestIngMainPage1.IsCloseFrmAble())
|
{
|
e.Cancel = true;
|
return;
|
}
|
}
|
|
public int GetTestRecordCount()
|
{
|
return featTestIngMainPage1.GetTestRecordCount();
|
}
|
public bool IsConnetctCommPort
|
{
|
get
|
{
|
return featTestIngMainPage1.IsConnetctCommPort;
|
}
|
}
|
public bool IsModifyTestRecord
|
{
|
get
|
{
|
return featTestIngMainPage1.IsModifyTestRecord;
|
}
|
}
|
}
|
}
|