using DevExpress.XtraBars;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class AddXhsSchemeDlg : DevExpress.XtraBars.Ribbon.RibbonForm
|
{
|
public AddXhsSchemeDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
this.ribbon.SetFormStyle();
|
|
}
|
|
|
private HStation.Vmo.XhsProjectVmo _project = null;//项目
|
private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//项目站
|
private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public async Task SetBindingData
|
(
|
HStation.Vmo.XhsProjectVmo project,
|
HStation.Vmo.XhsProjectSiteVmo projectSite,
|
Yw.Model.HydroModelInfo hydroInfo
|
)
|
{
|
if (project == null)
|
{
|
return;
|
}
|
_project = project;
|
_projectSite = projectSite;
|
_hydroInfo = hydroInfo;
|
if (_projectSite == null)
|
{
|
_projectSite = await BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetDefaultByProjectID(_project.ID);
|
}
|
if (_hydroInfo == null)
|
{
|
var hydroRelation = await BLLFactory<Yw.BLL.HydroModelRelation>.Instance
|
.GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, _projectSite.ID, HStation.Xhs.Purpose.Simulation);
|
_hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroRelation.ModelID);
|
}
|
|
ShowBimfaceCtrl();
|
}
|
|
#region Bimface
|
|
//bimface控件
|
private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null;
|
|
//获取 bimface 控件
|
private async Task<XhsProjectSimulationBimfaceCtrl> GetBimfaceCtrl()
|
{
|
if (_bimfaceCtrl == null)
|
{
|
_bimfaceCtrl = new XhsProjectSimulationBimfaceCtrl();
|
_bimfaceCtrl.Dock = DockStyle.Fill;
|
await _bimfaceCtrl.InitialData(_project, _projectSite, () => _hydroInfo);
|
_bimfaceCtrl.LoadCompletedEvent += () =>
|
{
|
//view加载完成事件
|
if (_hydroInfo == null)
|
{
|
return;
|
}
|
};
|
_bimfaceCtrl.HydroMouseLeftClickEvent += (obj) =>
|
{//鼠标左键点击事件
|
if (_hydroInfo == null)
|
{
|
return;
|
}
|
};
|
}
|
return _bimfaceCtrl;
|
}
|
|
//显示 bimface 控件
|
private async void ShowBimfaceCtrl()
|
{
|
var bimfaceCtrl = await GetBimfaceCtrl();
|
this.sidePanel3dModel.Controls.Clear();
|
this.sidePanel3dModel.Controls.Add(bimfaceCtrl);
|
}
|
|
private void SelectBimfaceParter()
|
{
|
|
}
|
|
#endregion
|
}
|
}
|