lixiaojun
2024-09-27 e27f124a62d94b565979dc710830107ff241eb83
新增参数
已修改7个文件
已添加1个文件
306 ■■■■ 文件已修改
Hydro/Yw.Hydro.Core/ParseHelper.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/00-core/AssetsMatchingParasHelper.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/Yw.WinFrmUI.Bimface.Core.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/css/Tailwind.css 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/html/Interop3d.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/CustomLabels.js 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydro/Yw.Hydro.Core/ParseHelper.cs
@@ -361,6 +361,21 @@
                }
            }
            //曲线
            if (model.Curves != null && model.Curves.Count > 0)
            {
                foreach (var curve in model.Curves)
                {
                    var curveModel = new Yw.EPAnet.Curve();
                    curveModel.Id = curve.Code;
                    curveModel.Name = curve.Name;
                    curveModel.CurveType = curve.CurveType;
                    curveModel.CurveData = curve.CurveData?.Select(x => new CurvePoint(x.X, x.Y)).ToList();
                    netWork.Curves.Add(curveModel);
                }
            }
            #endregion
WinFrmUI/HStation.WinFrmUI.Xhs.Core/00-core/AssetsMatchingParasHelper.cs
@@ -1,4 +1,5 @@
using StackExchange.Profiling.Internal;
using NPOI.SS.Formula.Functions;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -13,7 +14,9 @@
    public class AssetsMatchingParasHelper
    {
        //创建资产自动匹配ViewModel
        /// <summary>
        /// åˆ›å»ºèµ„产自动匹配ViewModel
        /// </summary>
        public static AssetsMatchingViewModel Create(Yw.Model.HydroModelInfo hydroInfo)
        {
            var input = new AssetsMatchingViewModel();
@@ -108,6 +111,26 @@
            return input;
        }
        /// <summary>
        /// åˆ›å»ºæ³µè‡ªåŠ¨åŒ¹é…ViewModel
        /// </summary>
        public static PumpMatchingViewModel CreatePump(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPumpInfo pumpInfo)
        {
            var input = new PumpMatchingViewModel();
            input.ID = pumpInfo.ID;
            input.Code = pumpInfo.Code;
            input.Name = pumpInfo.Name;
            input.DbLocked = pumpInfo.DbLocked;
            input.ModelType = pumpInfo.ModelType;
            input.DbId = pumpInfo.DbId;
            input.CurveDbId = hydroInfo.Curves?.Find(t => t.Code == pumpInfo.CurveQH)?.DbId;
            input.RatedP = pumpInfo.RatedP;
            input.RatedH = pumpInfo.RatedH;
            input.RatedN = pumpInfo.RatedN;
            input.RatedQ = pumpInfo.RatedQ;
            return input;
        }
        //应用资产自动匹配ViewModel
        public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, AssetsMatchingViewModel output)
        {
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs
@@ -186,24 +186,25 @@
                return true;
            }
            //feedBackMsg?.Invoke("正在进行产品匹配...", Color.Black);
            //hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroId);
            //var matchingParas = AssetsMatchingParasHelper.Create(hydroInfo);
            //if (await AssetsMatchingHelper.Matching(matchingParas))
            //{
            //    if (AssetsMatchingParasHelper.Apply(hydroInfo, matchingParas))
            //    {
            //        feedBackMsg?.Invoke("产品匹配成功。。。", Color.Green);
            //    }
            //    else
            //    {
            //        feedBackMsg?.Invoke("产品匹配失败!!!", Color.Red);
            //    }
            //}
            //else
            //{
            //    feedBackMsg?.Invoke("产品匹配失败!!!", Color.Red);
            //}
            feedBackMsg?.Invoke("正在进行产品匹配...", Color.Black);
            hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroId);
            var matchingParas = AssetsMatchingParasHelper.Create(hydroInfo);
            if (await AssetsMatchingHelper.Matching(matchingParas))
            {
                if (AssetsMatchingParasHelper.Apply(hydroInfo, matchingParas))
                {
                    feedBackMsg?.Invoke("产品匹配成功。。。", Color.Green);
                }
                else
                {
                    feedBackMsg?.Invoke("产品匹配失败!!!", Color.Red);
                }
            }
            else
            {
                feedBackMsg?.Invoke("产品匹配失败!!!", Color.Red);
            }
            hydroId = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.Save(hydroInfo);
            feedBackMsg?.Invoke("水力结构文件解析成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 30);
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs
@@ -105,19 +105,14 @@
                        {
                            return false;
                        }
                        var vmPump = propViewModel as HydroPumpPropertyViewModel;
                        var modelType = vmPump.ModelType;
                        var dbId = vmPump.DbId;
                        var curveDbId = string.Empty;
                        if (!string.IsNullOrEmpty(vmPump.CurveQH))
                        {
                            var curveQh = hydroInfo.Curves?.Find(x => x.Code == vmPump.CurveQH);
                            curveDbId = curveQh?.DbId;
                        }
                        var pumpInfo = hydroInfo.Pumps?.Find(x => x.Code == propViewModel.Code);
                        var input = AssetsMatchingParasHelper.CreatePump(hydroInfo, pumpInfo);
                        var dlg = new PumpMainCurveChoiceDlg();
                        // dlg.SetBindingData();
                        dlg.SetBindingData(input);
                        dlg.ReloadDataEvent += (rhs) =>
                        {
                        };
                        dlg.ShowDialog();
                        return true;
WinFrmUI/Yw.WinFrmUI.Bimface.Core/Yw.WinFrmUI.Bimface.Core.csproj
@@ -26,6 +26,7 @@
  <ItemGroup>
    <None Remove="bimface\css\Panel.css" />
    <None Remove="bimface\css\Tailwind.css" />
    <None Remove="bimface\html\Interop3d.html" />
    <None Remove="bimface\js\Background.js" />
    <None Remove="bimface\js\CameraStatus.js" />
@@ -48,6 +49,9 @@
    <Content Include="bimface\css\Panel.css">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="bimface\css\Tailwind.css">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="bimface\html\Interop3d.html">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/css/Tailwind.css
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1.5px;
}
.space-x-8 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 8px;
}
.p-x-8 {
    --offset: 8px;
    padding-left: var(--offset);
    padding-right: var(--offset);
}
/* flex å¸ƒå±€
--------------------------------------------------------- */
.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.justify-start {
    justify-content: flex-start;
}
.justify-end {
    justify-content: flex-end;
}
.justify-center {
    justify-content: center;
}
.justify-between {
    justify-content: space-between;
}
.justify-around {
    justify-content: space-around;
}
.items-start {
    align-items: flex-start;
}
.items-end {
    align-items: flex-end;
}
.items-center {
    align-items: center;
}
/* åœ†è§’
--------------------------------------------------------- */
.rounded-none {
    border-radius: 0px;
}
.rounded-sm {
    border-radius: 0.125rem;
    /* 2px */
}
.rounded {
    border-radius: 0.25rem;
    /* 4px */
}
.rounded-md {
    border-radius: 0.375rem;
    /* 6px */
}
.rounded-lg {
    border-radius: 0.5rem;
    /* 8px */
}
.rounded-xl {
    border-radius: 0.75rem;
    /* 12px */
}
.rounded-2xl {
    border-radius: 1rem;
    /* 16px */
}
.rounded-3xl {
    border-radius: 1.5rem;
    /* 24px */
}
.rounded-full {
    border-radius: 9999px;
}
.w-fit {
    width: fit-content;
}
.text-nowrap {
    text-wrap: nowrap;
}
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/html/Interop3d.html
@@ -27,13 +27,14 @@
            flex: 1;
        }
    </style>
    <link href="css/Panel.css" rel="stylesheet" />
    <link href="../css/Tailwind.css" rel="stylesheet" />
    <!-- å¼•用BIMFACE的JavaScript显示组件库 -->
    <script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js" charset="utf-8"></script>
    <script type="text/javascript" src="https://spump.oss-cn-shanghai.aliyuncs.com/assets/jq/jquery-3.3.1.min.js"></script>
</head>
<body>
    <div class='main'>
        <h1>ceshi</h1>
        <div class='model' id="domId"></div>
    </div>
WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/CustomLabels.js
@@ -21,29 +21,29 @@
}
//添加自定义标签项
function addCustomLabelItem(item) {
    let content = document.createElement('div');
    content.style.width = '110px';
    content.style.height = 'auto';
    content.style.border = 'solid';
    content.style.borderColor = '#FFFFFF';
    content.style.padding = '2px';
    content.style.borderWidth = '1px';
    content.style.borderRadius = '3px';
    content.style.background = '#32D3A6';
    content.innerHTML = getTdHtml(item.data);
    content.style.color = '#FFFFFF';
    content.style.fontSize = '10px';
    //content.style.textAlign = 'center';
    content.style.lineHeight = '14px';
    let config = new Glodon.Bimface.Plugins.Drawable.CustomItemConfig();
    config.content = content;
    config.viewer = _viewer;
    config.opacity = 1;
    config.worldPosition = _modeler.getBoundingBoxById(item.id).min;
    let customLabelItem = new Glodon.Bimface.Plugins.Drawable.CustomItem(config);
    _drawableContainer.addItem(customLabelItem);
}
//function addCustomLabelItem(item) {
//    let content = document.createElement('div');
//    content.style.width = '110px';
//    content.style.height = 'auto';
//    content.style.border = 'solid';
//    content.style.borderColor = '#FFFFFF';
//    content.style.padding = '2px';
//    content.style.borderWidth = '1px';
//    content.style.borderRadius = '3px';
//    content.style.background = '#32D3A6';
//    content.innerHTML = getTdHtml(item.data);
//    content.style.color = '#FFFFFF';
//    content.style.fontSize = '10px';
//    //content.style.textAlign = 'center';
//    content.style.lineHeight = '14px';
//    let config = new Glodon.Bimface.Plugins.Drawable.CustomItemConfig();
//    config.content = content;
//    config.viewer = _viewer;
//    config.opacity = 1;
//    config.worldPosition = _modeler.getBoundingBoxById(item.id).min;
//    let customLabelItem = new Glodon.Bimface.Plugins.Drawable.CustomItem(config);
//    _drawableContainer.addItem(customLabelItem);
//}
//清除自定义标签
@@ -55,17 +55,53 @@
}
//获取数据内容html
//function getTdHtml(data) {
//    if (data == null || data.length < 1) {
//        return '';
//    }
//    let html = '<table>';
//    data.forEach(d => {
//        html += '<tr><td style="width:50px">' + d.name + '</td><td style="width:40px">' + d.value + '</td><td>' + d.unit + '</td></tr>'
//    });
//    return html += '</table>';
//}
//添加自定义标签项
function addCustomLabelItem(item) {
    let content = document.createElement('div');
    content.className = 'w-fit rounded-md space-y-1.5 text-nowrap flex flex-col';
    content.style.color = 'white';
    content.style.backgroundColor = '#32d3a6';
    content.style.padding = '5px';
    content.innerHTML = getTdHtml(item.data);
    let config = new Glodon.Bimface.Plugins.Drawable.CustomItemConfig();
    config.content = content;
    config.viewer = _viewer;
    config.opacity = 1;
    config.worldPosition = _modeler.getBoundingBoxById(item.id).min;
    let customLabelItem = new Glodon.Bimface.Plugins.Drawable.CustomItem(config);
    _drawableContainer.addItem(customLabelItem);
}
//获取数据内容html
function getTdHtml(data) {
    if (data == null || data.length < 1) {
        return '';
    }
    let html = '<table>';
    data.forEach(d => {
        html += '<tr><td style="width:50px">' + d.name + '</td><td style="width:40px">' + d.value + '</td><td>' + d.unit + '</td></tr>'
    let html = '';
    data.forEach((d) => {
        html += `
        <div class="flex justify-between  items-center">
        <span>${d.name}</span>
        <span class="p-x-8">${d.value}</span>
        <span>${d.unit}</span>
        </div>`;
    });
    return html += '</table>';
    return html;
}