namespace HStation.WinFrmUI
|
{
|
public partial class XhsProjectSimulationBimfaceInfoCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public XhsProjectSimulationBimfaceInfoCtrl()
|
{
|
InitializeComponent();
|
this.bimfaceInterop3dContainer1.LoadCompletedEvent += BimfaceInterop3dContainer1_LoadCompletedEvent;
|
}
|
|
private HStation.Vmo.XhsProjectVmo _project = null;//项目
|
private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//项目站
|
private Yw.Vmo.BimfaceFileRelationVmo _bimfaceFileRelation = null;//bimface关联
|
private Yw.Vmo.BimfaceFileVmo _bimfaceFile = null;//bimface文件
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public async Task SetBindingData(XhsProjectVmo project, XhsProjectSiteVmo projectSite)
|
{
|
if (project == null)
|
{
|
return;
|
}
|
_project = project;
|
_projectSite = projectSite;
|
if (_projectSite == null)
|
{
|
_projectSite = await BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetDefaultByProjectID(_project.ID);
|
}
|
await this.bimfaceInterop3dContainer1.InitialContainer();
|
}
|
|
/// <summary>
|
/// 页面加载完成后触发
|
/// </summary>
|
private async void BimfaceInterop3dContainer1_LoadCompletedEvent()
|
{
|
if (_project == null)
|
{
|
return;
|
}
|
if (_projectSite == null)
|
{
|
return;
|
}
|
|
_bimfaceFileRelation = await BLLFactory<Yw.BLL.BimfaceFileRelation>.Instance
|
.GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, _projectSite.ID, HStation.Xhs.Purpose.Simulation);
|
if (_bimfaceFileRelation == null)
|
{
|
return;
|
}
|
|
_bimfaceFile = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.GetByID(_bimfaceFileRelation.BimfaceFileID);
|
if (_bimfaceFile == null)
|
{
|
return;
|
}
|
|
var viewToken = await BimfaceHelper.GetViewToken(_bimfaceFile.BimfaceId);
|
if (string.IsNullOrEmpty(viewToken))
|
{
|
return;
|
}
|
await this.bimfaceInterop3dContainer1.LoadView(viewToken);
|
|
}
|
|
}
|
}
|