duheng
2024-11-03 28402b6df09de5e106422878246f7ac814d353b0
Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0
已删除1个文件
已修改7个文件
已添加3个文件
302 ■■■■■ 文件已修改
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/00-core/05-logic-flow/LogicFlowEffect.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/01-interop/01-interop3d/BimfaceInterop3dContainer.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/01-interop/01-interop3d/IBimfaceInterop3dContainer.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/Yw.WinFrmUI.Bimface.Core.csproj 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/html/Interop3d.html 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/img/flowEffect.png 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicFlowEffect.js 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/PipeFlow.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs
@@ -482,6 +482,26 @@
        #endregion
        #region ä¸šåŠ¡æ°´æµåŠ¨ç”»
        /// <summary>
        /// åŠ è½½æ°´æµåŠ¨ç”»
        /// </summary>
        public async Task LoadFlowEffect(LogicFlowEffect obj)
        {
            await _bimfaceInteropContainer?.LoadFlowEffect(obj);
        }
        /// <summary>
        /// åŠ è½½æ°´æµåŠ¨ç”»åˆ—è¡¨
        /// </summary>
        public async Task LoadFlowEffectList(List<LogicFlowEffect> obj)
        {
            await _bimfaceInteropContainer?.LoadFlowEffectList(obj);
        }
        #endregion
        #region è¿žæŽ¥æž„件颜色
        private const string _linkComponentColor = "#008B00";//连接构件颜色
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs
@@ -84,6 +84,7 @@
            controlContainerBottom = new DevExpress.XtraBars.Docking.ControlContainer();
            svgImg32 = new DevExpress.Utils.SvgImageCollection(components);
            rmSet = new DevExpress.XtraBars.Ribbon.RadialMenu(components);
            barButtonItem1 = new DevExpress.XtraBars.BarButtonItem();
            ((ISupportInitialize)ribbonControl1).BeginInit();
            ((ISupportInitialize)tabPane1).BeginInit();
            tabPane1.SuspendLayout();
@@ -98,9 +99,9 @@
            // 
            ribbonControl1.ExpandCollapseItem.Id = 0;
            ribbonControl1.ItemPanelStyle = DevExpress.XtraBars.Ribbon.RibbonItemPanelStyle.Classic;
            ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbonControl1.ExpandCollapseItem, barBtnHydroCheck, barBtnHydroCalcu, barBtnHydroExportInp, barBtnSave, barBtnHydroParterList, barBtnFastShowHidden, barBtnMatchingList, barBtnUnMatchingList, barBtnSetList, barBtnSetPumpList, barBtnSetValveList, barBtnSetPipeList, barBtnSetElbowsList, barBtnSetThreelinkList, barBtnSetFourlinkList, barBtnSetTranslationList, barBtnSetExchangerList, barBtnSetJunctionList, barBtnParallelAnaly, barBtnSearch, barBtnGradingSet, barBtnGradingApply, barBtnRefresh, barBtnSetMark, barBtnSetReservoirList, barBtnSetTankList, barBtnSetWaterboxList, barBtnSetBluntheadList, barBtnSetNozzleList, barBtnSetHydrantList, barBtnSetMeterList, barBtnSetCompressorList, barBtnSetFlowmeterList, barBtnSetPressmeterList });
            ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbonControl1.ExpandCollapseItem, barBtnHydroCheck, barBtnHydroCalcu, barBtnHydroExportInp, barBtnSave, barBtnHydroParterList, barBtnFastShowHidden, barBtnMatchingList, barBtnUnMatchingList, barBtnSetList, barBtnSetPumpList, barBtnSetValveList, barBtnSetPipeList, barBtnSetElbowsList, barBtnSetThreelinkList, barBtnSetFourlinkList, barBtnSetTranslationList, barBtnSetExchangerList, barBtnSetJunctionList, barBtnParallelAnaly, barBtnSearch, barBtnGradingSet, barBtnGradingApply, barBtnRefresh, barBtnSetMark, barBtnSetReservoirList, barBtnSetTankList, barBtnSetWaterboxList, barBtnSetBluntheadList, barBtnSetNozzleList, barBtnSetHydrantList, barBtnSetMeterList, barBtnSetCompressorList, barBtnSetFlowmeterList, barBtnSetPressmeterList, barButtonItem1 });
            ribbonControl1.Location = new Point(0, 0);
            ribbonControl1.MaxItemId = 51;
            ribbonControl1.MaxItemId = 52;
            ribbonControl1.Name = "ribbonControl1";
            ribbonControl1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { ribbonPage1 });
            ribbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False;
@@ -382,6 +383,7 @@
            pageGroupModel.ItemLinks.Add(barBtnHydroParterList);
            pageGroupModel.ItemLinks.Add(barBtnSetList);
            pageGroupModel.ItemLinks.Add(barBtnSetMark);
            pageGroupModel.ItemLinks.Add(barButtonItem1);
            pageGroupModel.Name = "pageGroupModel";
            pageGroupModel.Text = "模型";
            // 
@@ -513,6 +515,13 @@
            rmSet.Ribbon = ribbonControl1;
            rmSet.BeforePopup += rmSet_BeforePopup;
            // 
            // barButtonItem1
            //
            barButtonItem1.Caption = "barButtonItem1";
            barButtonItem1.Id = 51;
            barButtonItem1.Name = "barButtonItem1";
            barButtonItem1.ItemClick += barButtonItem1_ItemClick;
            //
            // XhsProjectSimulationCorePage
            // 
            Appearance.BackColor = SystemColors.Control;
@@ -592,5 +601,6 @@
        private DevExpress.XtraBars.BarButtonItem barBtnSetCompressorList;
        private DevExpress.XtraBars.BarButtonItem barBtnSetFlowmeterList;
        private DevExpress.XtraBars.BarButtonItem barBtnSetPressmeterList;
        private DevExpress.XtraBars.BarButtonItem barButtonItem1;
    }
}
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -1996,5 +1996,28 @@
        }
        #endregion
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var pipes = _hydroInfo.Pipes;
            var list = pipes.Select(x =>
            {
                return new Yw.WinFrmUI.Bimface.LogicFlowEffect()
                {
                    Id = x.Code,
                    Rotation = 90,
                    Speed = 0.1d
                };
            }).ToList();
            _bimfaceCtrl?.LoadFlowEffectList(list);
            //var obj = new LogicFlowEffect()
            //{
            //    Id = "757125",
            //    Rotation = 90,
            //    Speed = 0.1d
            //};
            //_bimfaceCtrl?.LoadFlowEffect(obj);
        }
    }
}
WinFrmUI/Yw.WinFrmUI.Bimface.Core/00-core/05-logic-flow/LogicFlowEffect.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
namespace Yw.WinFrmUI.Bimface
{
    /// <summary>
    /// ä¸šåŠ¡æµå‘åŠ¨ç”»
    /// </summary>
    public class LogicFlowEffect
    {
        /// <summary>
        /// ç¼–码
        /// </summary>
        [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
        public string Id { get; set; }
        /// <summary>
        /// æ—‹è½¬è§’度
        /// </summary>
        [JsonProperty("rotation", NullValueHandling = NullValueHandling.Ignore)]
        public int Rotation { get; set; }
        /// <summary>
        /// é€Ÿåº¦
        /// </summary>
        [JsonProperty("speed", NullValueHandling = NullValueHandling.Ignore)]
        public double Speed { get; set; }
    }
}
WinFrmUI/Yw.WinFrmUI.Bimface.Core/01-interop/01-interop3d/BimfaceInterop3dContainer.cs
@@ -468,5 +468,36 @@
        #endregion
        #region ä¸šåŠ¡æ°´æµåŠ¨ç”»
        /// <summary>
        /// åŠ è½½æ°´æµåŠ¨ç”»
        /// </summary>
        public async Task LoadFlowEffect(LogicFlowEffect obj)
        {
            if (!_isViewInitialized)
            {
                return;
            }
            await this.webViewControl1.EvaluateScriptAsync("loadFlowEffect", obj);
        }
        /// <summary>
        /// åŠ è½½æ°´æµåŠ¨ç”»åˆ—è¡¨
        /// </summary>
        public async Task LoadFlowEffectList(List<LogicFlowEffect> obj)
        {
            if (!_isViewInitialized)
            {
                return;
            }
            await this.webViewControl1.EvaluateScriptAsync("loadFlowEffectList", obj);
        }
        #endregion
    }
}
WinFrmUI/Yw.WinFrmUI.Bimface.Core/01-interop/01-interop3d/IBimfaceInterop3dContainer.cs
@@ -178,5 +178,19 @@
        #endregion
        #region è‡ªå®šä¹‰æ°´æµåŠ¨ç”»
        /// <summary>
        /// åŠ è½½æ°´æµåŠ¨ç”»
        /// </summary>
        Task LoadFlowEffect(LogicFlowEffect obj);
        /// <summary>
        /// åŠ è½½æ°´æµåŠ¨ç”»åˆ—è¡¨
        /// </summary>
        Task LoadFlowEffectList(List<LogicFlowEffect> obj);
        #endregion
    }
}
WinFrmUI/Yw.WinFrmUI.Bimface.Core/Yw.WinFrmUI.Bimface.Core.csproj
@@ -28,6 +28,7 @@
    <None Remove="bimface\css\Panel.css" />
    <None Remove="bimface\css\Tailwind.css" />
    <None Remove="bimface\html\Interop3d.html" />
    <None Remove="bimface\img\flowEffect.png" />
    <None Remove="bimface\js\Background.js" />
    <None Remove="bimface\js\CameraStatus.js" />
    <None Remove="bimface\js\ComponentsBlink.js" />
@@ -40,9 +41,9 @@
    <None Remove="bimface\js\GetComponents.js" />
    <None Remove="bimface\js\Layer.js" />
    <None Remove="bimface\js\LogicCalcuCustomLabel.js" />
    <None Remove="bimface\js\LogicFlowEffect.js" />
    <None Remove="bimface\js\LogicMarkLeadLabel.js" />
    <None Remove="bimface\js\Panel.js" />
    <None Remove="bimface\js\PipeFlow.js" />
    <None Remove="bimface\js\SelectedComponents.js" />
    <None Remove="bimface\js\WalkThrough.js" />
    <None Remove="bimface\js\Zoom.js" />
@@ -56,6 +57,9 @@
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="bimface\html\Interop3d.html">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="bimface\img\flowEffect.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="bimface\js\Background.js">
@@ -100,7 +104,7 @@
    <Content Include="bimface\js\Panel.js">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="bimface\js\PipeFlow.js">
    <Content Include="bimface\js\LogicFlowEffect.js">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="bimface\js\WalkThrough.js">
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/html/Interop3d.html
@@ -67,9 +67,10 @@
                webAppConfig.domElement = dom4Show;
                // è®¾ç½®å…¨å±€å•位
                webAppConfig.globalUnit = Glodon.Bimface.Common.Units.LengthUnits.Millimeter;
                //取消工具条
                webAppConfig.Toolbars = [];
                // å¼€å¯æè´¨æ›¿æ¢
                webAppConfig.enableReplaceMaterial = true;
                // åˆ›å»ºWebApplication
                var app = new Glodon.Bimface.Application.WebApplication3D(webAppConfig);
                // æ·»åŠ å¾…æ˜¾ç¤ºçš„æ¨¡åž‹
@@ -131,6 +132,7 @@
<script src="../js/ComponentsColor.js"></script>
<script src="../js/LogicMarkLeadLabel.js"></script>
<script src="../js/LogicCalcuCustomLabel.js"></script>
<script src="../js/LogicFlowEffect.js"></script>
<script src="js/CameraStatus.js"></script>
<script src="js/GetComponents.js"></script>
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/img/flowEffect.png
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicFlowEffect.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,147 @@

let _flowAnimationContainer;//水流动画容器
let _flowImgSrc = "https://static.bimface.com/attach/34d0d3aeb2e348aea5f3203b760ca667_flow5.png";//水流材质图片
let _flowImgLocal = "../img/flowEffect.png";//本地水流材质图片
let _flowEffectList = new Set();//水流动画列表
//加载水流动画
function loadFlowEffect(item) {
    unloadFlowMaterial();
    let flowMaterial = createFlowMaterial(item);
    let flowEffect = createFlowEffect(flowMaterial, item);
    flowEffect.play();
    renderFlowEffect();
}
//加载水流动画列表
function loadFlowEffectList(data) {
    unloadFlowMaterial();
    if (data != null && data.length > 0) {
        data.forEach((x, index) => {
            let flowMaterial = createFlowMaterial(x);
            createFlowEffect(flowMaterial, x);
        });
        playFlowEffect();
        renderFlowEffect();
    }
}
//通过id卸载水流材质
function unloadFlowMaterialById(id) {
    if (_flowEffectList.size > 0) {
        let flowEffectId = getFlowEffectId(id);
        let flowEffect = null;
        _flowEffectList.forEach(x => {
            if (x.getId() == flowEffectId) {
                flowEffect = x;
            }
        });
        if (flowEffect != null) {
            //flowEffect.stop();
            _flowEffectList.delete(flowEffect);
            let flowMaterialId = getFlowMaterialId(id);
            initialFlowAnimationContainer();
            let flowMaterial = _flowAnimationContainer.getMaterialById(flowMaterialId)
            if (flowMaterial != null) {
                flowMaterial.clearOverrideComponentsMaterial();
                _flowAnimationContainer.removeMaterialById(flowMaterialId)
            }
        }
    }
}
//卸载水流材质
function unloadFlowMaterial() {
    if (_flowEffectList.size > 0) {
        //_flowEffectList.forEach(x => {
        //    x.stop();
        //});
        _flowEffectList.clear();
        initialFlowAnimationContainer();
        let allMaterialList = _flowAnimationContainer.getAllMaterials();
        if (allMaterialList != null && allMaterialList.length > 0) {
            allMaterialList.foreach(x => {
                x.clearOverrideComponentsMaterial();
            });
        }
        _flowAnimationContainer.clear();
    }
}
//初始化水流动画容器
function initialFlowAnimationContainer() {
    if (_flowAnimationContainer == null) {
        // æž„造水流材质容器
        _flowAnimationContainer = new Glodon.Bimface.Plugins.Material.MaterialContainer();
    }
}
//创建水流材质
function createFlowMaterial(item) {
    initialFlowAnimationContainer();
    // æž„造材质配置
    let flowMaterialConfig = new Glodon.Bimface.Plugins.Material.MaterialConfig();
    flowMaterialConfig.viewer = _viewer;
    flowMaterialConfig.src = _flowImgSrc;
    flowMaterialConfig.rotation = item.rotation;
    flowMaterialConfig.offset = [0, 0];
    flowMaterialConfig.scale = [0.1524, 0.1524];
    flowMaterialConfig.id = getFlowMaterialId(item.id);
    // æž„造材质对象
    let flowMaterial = new Glodon.Bimface.Plugins.Material.Material(flowMaterialConfig);
    _flowAnimationContainer.addMaterial(flowMaterial);
    flowMaterial.overrideComponentsMaterialById([item.id]);//数组
    return flowMaterial;
}
//创建水流动画
function createFlowEffect(material, item) {
    // æž„造水流动画配置
    let flowEffectConfig = new Glodon.Bimface.Plugins.Animation.FlowEffectConfig();
    flowEffectConfig.material = material;
    flowEffectConfig.speed = [item.speed, 0];
    flowEffectConfig.viewer = _viewer;
    flowEffectConfig.id = getFlowEffectId(item.id);
    //构造水流动画
    let flowEffect = new Glodon.Bimface.Plugins.Animation.FlowEffect(flowEffectConfig);
    _flowEffectList.add(flowEffect);
    return flowEffect;
}
//获取水流动画id
function getFlowEffectId(id) {
    return "flow-effect-" + id;
}
//获取水流材质id
function getFlowMaterialId(id) {
    return "flow-material-" + id;
}
//开始水流动画
function playFlowEffect() {
    if (_flowEffectList.size > 0) {
        _flowEffectList.forEach(x => x.play());
    }
}
//停止水流动画
function stopFlowEffect() {
    if (_flowEffectList.size > 0) {
        _flowEffectList.forEach(x => x.stop());
    }
}
//重绘水流动画
function renderFlowEffect() {
    // æ¸²æŸ“三维模型,加载图片资源需要时间,此处设定了500ms的延迟
    setTimeout("_viewer.render()", 500);
}
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/PipeFlow.js
ÎļþÒÑɾ³ý