using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace TProduct.WinFrmUI.TPump
{
///
/// 性能测试
///
public partial class FeatTestViewMainPage : DocumentPage
{
//
public FeatTestViewMainPage()
{
InitializeComponent();
this.PageTitle.Caption = "性能测试";
InitialUI();
}
protected TProduct.Model.ProductSeries _currentPumpSeries = null;
protected TProduct.Model.ProductMainExPump _currentPump = null;
protected TProduct.Model.ProductMainExMotor _currentMotor = null;
protected TProduct.Model.PartBase _currentPart = null;
protected TProduct.Model.RatedParas4Pump _ratedParas = null;
protected TProduct.Model.WorkBenchBase _workBenchInfo = null;
protected TProduct.Model.TestStandard _testStandard = null;
protected TProduct.Model.TestGrade _testGrade = null;
protected List _testJudgeItems = null;
protected TProduct.Model.TestProjectBase _testProject = null;
protected List _testItems = null;//所有测试,包括汽蚀
protected TProduct.Model.TestProjectItemView _featTestItem = null;//只针对性能测试
//通知外部更新测试信息
public Action OnChangeFeatTestInfo = null;//只针对性能测试的修改
public Action OnChangeTestItemInfo = null;//针对所有工位
public Action OnChangeTestProjectInfo = null;
public Action OnChangeProductInfo = null;
protected List _allRecords = null;
//
private List _allMonitorPointList = null;
//列表控件
private GridFeatMonitorRecordCtrl _monitorGridCtrl = null;
//图表控件
private ChartLxpFeatCurveCtrl _chartMainCtrl = null;
private ChartFeatTestBarCtrl _chartBarCtrl = null;
//产品信息
private PartInfoCtrl _partInfoCtrl = null;
private void InitialUI()
{
bbi延长到零扬程.Visibility =
TProduct.UserSetting.Setting.PumpTest.IsDispCmdExtendZeroH ?
DevExpress.XtraBars.BarItemVisibility.Always :
DevExpress.XtraBars.BarItemVisibility.Never;
rpg曲线操作.Visible = TProduct.UserSetting.Setting.PumpTest.IsDispCmdExtendZeroH;
if (!TProduct.CorpConfig.Instance.TestPackRemoteService.IsSynFeatTest)
{
bbi测试数据网页.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
bbi质检所报告.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
}
}
public void HideRibbonCtrl()
{
ribbonControl1.Visible = false;
}
///
/// 质检所: 同步测试数据
///
///
///
private void bbi同步到云平台_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (!TProduct.CorpConfig.Instance.TestPackRemoteService.IsSynFeatTest)
{
MessageBox.Show("还未开通此功能,如需,请与上海义维联系");
return;
}
if( this._allRecords == null || this._allRecords.Count < 4)
{
MessageBox.Show("有效点过少,无法同步");
return;
}
DialogResult resultQ = MessageBox.Show("请问是否同步到服务器上", "询问",
System.Windows.Forms.MessageBoxButtons.YesNo,
System.Windows.Forms.MessageBoxIcon.Warning);
if (resultQ != DialogResult.Yes)
{
return;
}
var helper = new TProduct.OpenDto.FeatTestPackInfoHelper();
helper.CurrentPumpSeries = this._currentPumpSeries;
helper.CurrentPump = this._currentPump;
helper.CurrentMotor = this._currentMotor;
helper.CurrentPart = this._currentPart;
helper.RatedParas = this._ratedParas;
helper.WorkBenchInfo = this._workBenchInfo;
helper.TestItem = this._featTestItem;
helper.AllMonitorPointList = this._allMonitorPointList;
helper.AllLoginUser = new BLL.LoginUser().GetAll();
helper.AllManufacturer = new BLL.ManufacturerBase().GetAll();
helper.AllRecords = this._allRecords;
string info;
var result = helper.Synch(out info);//开始同步
if (string.IsNullOrEmpty(info) &&
result != null &&
result.Data != null &&
result.Data.ID > 0)
{
if (!string.IsNullOrEmpty(result.Data.ErrorCode))
{
MessageBox.Show("同步失败,错误信息:" + info);
return;
}
if(this._featTestItem.IStationID != result.Data.ID.ToString() ||
this._featTestItem.IStationReportFileNO != result.Data.ReportNO)
{
this._featTestItem.IStationID = result.Data.ID.ToString();
this._featTestItem.IStationReportFileNO = result.Data.ReportNO;
new BLL.TestProject().Update(new Model.TestProjectBase(this._featTestItem));
}
MessageBox.Show("同步成功");
}
else
{
MessageBox.Show("同步失败,错误信息:"+ info);
}
}
private void bbi质检所报告_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (string.IsNullOrEmpty(this._featTestItem.IStationID))
{
MessageBox.Show("测试数据, 还未上传到云平台");
return;
}
var url = string.Format("http://SQI.beng35.com/test/mobile/report/view.html?rid=0&pid={0}&cid=1&from=1", this._featTestItem.IStationID);
SmiReportQrForm frm = new SmiReportQrForm();
frm.SetBindingData(url);
frm.ShowDialog();
}
//工艺流程图
private void InitialProcessDrawing()
{
if (!TProduct.UserSetting.Setting.Disp.IsShowProcessDiagram || !TProduct.CorpConfig.Instance.Module.IsHaveProcessDrawing )
{
this.tabPage工艺图.PageVisible = false;
return;
}
var elementHost1 = new System.Windows.Forms.Integration.ElementHost();
TProduct.ProcessDrawing.MainView.MainDisplayWindow process_ctrl = new TProduct.ProcessDrawing.MainView.MainDisplayWindow();
process_ctrl.SetCurrentPipeIndex(this._workBenchInfo.PipeIndex);
process_ctrl.SetContaiterSize(tabPage3D.Width, tabPage3D.Height);
elementHost1.Dock = System.Windows.Forms.DockStyle.Fill;
elementHost1.Location = new System.Drawing.Point(0, 0);
elementHost1.Name = "elementHost1";
elementHost1.Size = new System.Drawing.Size(1461, 861);
elementHost1.TabIndex = 0;
elementHost1.Child = process_ctrl;
elementHost1.Dock = DockStyle.Fill;
this.tabPage工艺图.Controls.Add(elementHost1);
}
private void bbi测试数据网页_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (string.IsNullOrEmpty(this._featTestItem.IStationID))
{
MessageBox.Show("测试数据, 还未上传到云平台");
return;
}
string target = string.Format("http://sqi.beng35.com/test/#/testProject/view?id={0}&hideSideMenu=true", this._featTestItem.IStationID);
//"C:\\Program Files\\Microsoft Visual Studio\\INSTALL.HTM";
System.Diagnostics.Process.Start(target);
}
}
}