Commit Graph

38 Commits

Author SHA1 Message Date
lihanbo c6d5b7883a 105040
添加 MultiWireCoreDataModel 支持及自定义滚动功能

在 `DBHelper.cs` 中初始化 `MultiWireCoreDataModel` 表,并在 `MultiWireCoreDataModel.cs` 中定义其属性。更新项目文件以包含新模型和自定义的 `MyScrollViewer`,重写鼠标滚动事件以改善用户体验。修改 `MultiCoreWireDataModel` 属性,添加新的绝缘相关字段,并在视图模型中实现数据加载和保存逻辑。更新 XAML 文件以使用新的滚动控件。
2025-05-06 11:06:39 +08:00
lihanbo 27cd690bc6 105040
增强多芯线数据模型的灵活性和可扩展性

在 `MultiCoreWireDataModel.cs` 中添加多个新属性以扩展数据模型。删除 `MultiCoreWireLecModel` 类并用 `MultiCoreWireExcelModel` 替换,更新相关引用。修改 `MultiCoreWireTerminalModel.cs` 中 `TerminalStripLength` 属性的类型。更新项目文件以包含新的映射类 `ConnectorHeatShrinkMapping.cs` 和 `WireHeatShrinkMapping.cs`。调整数据绑定和视图模型以适应新的数据结构,确保数据处理逻辑的一致性。
2025-05-05 09:06:42 +08:00
lihanbo aafcacaeb5 105040 Update
更新连接物属性,优化 UI 和数据处理

在 `MultiCoreWireLecDBModel.cs` 中,更新连接物的型号和数量属性,移除后连接物型号,增加后连接物型号和数量属性。
在 `MultiCoreWireDataModel.cs` 中,添加引脚编号属性。
在 `MultiCoreWireLecModel.cs` 中,更新前后连接物的型号和数量属性,移除前端子和后端子的型号属性。
在 `MultiCoreWireWindow.xaml` 中,添加新的 UI 元素以显示连接物数量,并更新数据绑定。
在 `MultiCoreWireWindow.xaml.cs` 中,添加对新属性的处理逻辑。
在 `MultiCoreWireLayoutHelperViewModel.cs` 中,更新服务定义方式,移除不必要的属性。
在 `MultiCoreWireViewModel.cs` 中,添加新属性以支持连接物数量,并更新相关逻辑。
在 `MultiCoreWirePluginEntry.cs` 中,更新窗口显示逻辑,确保登录后正确显示窗口。
新增 `ScrollSynchronizer.cs` 文件,提供同步滚动功能。
2025-04-29 14:32:35 +08:00
lihanbo 4df7a23796 105040 Update 完善多芯线选型功能 2025-04-25 16:25:45 +08:00
lihanbo 2572dd0ea6 105040 Update 优化多芯线线材选型功能 2025-04-24 14:22:46 +08:00
lihanbo 4212086da1 105040 Update 完善多芯线线材选型 2025-04-22 14:33:49 +08:00
lihanbo 89a5aa21a2 105040 Update 完善多芯线选型界面 2025-04-11 17:07:03 +08:00
lihanbo d1c511cece 105040 Update 添加多芯线选型界面 2025-04-11 09:02:48 +08:00
lihanbo 2fa8f8f8aa 105040 Update 增加多芯线功能入口 2025-04-10 10:20:53 +08:00
lihanbo c3a6219321 105040 Add 对接PLM,增加登录功能,记录用户信息 2025-04-07 16:18:05 +08:00
lihanbo c316b6dd32 105040 Update 按功能区分文件夹 2025-04-07 09:36:44 +08:00
lihanbo be5a470e90 105040 Update to 1.0.0.31 2025-03-28 16:51:36 +08:00
lihanbo 9f2b30979a 105040 Update to 1.0.0.28
更新版本信息并添加 Release_EPLAN_2024 配置

在 `AssemblyInfo.cs` 中将版本更新至 "1.0.0.28"。
为 `Sinvo.EplanHpD.Plugin.Service.csproj` 和 `Sinvo.EplanHpD.Plugin.Test.csproj` 添加了 `Release_EPLAN_2024` 配置的属性组。
在 `Sinvo.EplanHpD.Plugin.WPFUI.csproj` 中支持 `x64` 和 `x86` 平台的输出路径。
简化了 `CableLectotypeUserControl.xaml.cs` 中的 `using` 语句。
更新了 `CableLectotypeViewModel.cs` 中 `CableTypes` 属性的返回逻辑,并添加了异常处理。
在解决方案文件中添加了 `Release_EPLAN_2024` 配置支持。
更新了 `DesignPluginEntry.cs` 中窗口标题以显示版本号和文档名称。
2025-02-21 09:53:36 +08:00
lihanbo 1fc8ba3603 105040 Update 如果电机型号没有直通线信息,默认强制指定为一种
更新版本号到1.0.0.27
2025-02-19 13:40:49 +08:00
lihanbo 9e3e71a4ca 105040 Update 更新安川电机逻辑,750W以下功率不生成前段线
更新程序集版本,添加新方法和类

更新了 `AssemblyInfo.cs` 文件中的程序集版本号至 `1.0.0.26`。
在 `MotorLectotypeService.cs` 文件中添加了 `SetLineDone` 方法。
在 `Sinvo.EplanHpD.Plugin.WPFUI.csproj` 文件中添加了 `MotorPowerModel.cs` 文件的编译包含项。
在 `MotorExcelHelper.cs` 文件中添加了 `GetMotorPower` 方法,用于获取电机功率。
在 `CableLectotypeViewModel.cs` 文件中进行了多处修改,包括修正逻辑、初始化 `LectotypeList`、根据电机功率决定前段线、排序并重新设置序号。
在 `Sinvo.EplanHpD.Plugin.csproj` 文件中更新了多个配置的输出路径。
添加了 `MotorPowerModel.cs` 文件,定义了 `MotorPowerModel` 类,用于表示电机功率。
2025-02-14 15:40:43 +08:00
lihanbo d7f61b0db3 105040 Update 增加第三种直通线选择,可选择的线材种类数量由配置表决定
增加 CableTypeThree 属性及相关处理

在 CableLectotype.cs 文件中增加了 CableTypeThree 属性,并设置了 SugarColumn(IsNullable = true)。
在 MotorLectotypeService.cs 文件中增加了对 CableTypeThree 属性的处理。
在 Sinvo.EplanHpD.Plugin.WPFUI.csproj 文件中增加了对 MotorPassthroughCable.cs 文件的编译包含。
在 MotorExcelHelper.cs 文件中增加了 GetPassthroughCableCount 方法。
在 CableLectotypeUserControl.xaml 文件中修改了 hc:SimpleStackPanel 的 Visibility 绑定属性。
在 CableLectotypeUserControl.xaml.cs 文件中增加了对 EPLAN.Harness.Core.Interfaces 的引用,并在 CableLectotypeViewModel 类中增加了一个实例。
在 CableLectotypeViewModel.cs 文件中增加了对 CableTypeThree 属性的处理,并增加了 _passthroughCableCount 和 IsEnableThreeCableType 属性及其相关逻辑。
在 MotorPassthroughCable.cs 文件中增加了 MotorPassthroughCable 类,用于表示电机直通线数量。
2025-02-14 09:22:11 +08:00
lihanbo d302676e5e 105040 增加编译标识,分开插件菜单 2025-02-10 11:38:43 +08:00
lihanbo 860ce040ed 105040 Update 关闭窗口时增加提示,未保存电机数据是否丢弃
添加未保存警告窗口及其相关视图模型和消息类

增加了 `LectotypeMessage.cs` 文件:
- 定义了 `LectotypeMessage` 类,继承自 `ValueChangedMessage<Dictionary<string,string>>`。

增加了 `NotSavedWarningViewModel.cs` 文件:
- 定义了 `NotSavedWarningViewModel` 类,实现了 `INotifyPropertyChanged` 和 `IDialogResultable<bool>` 接口。
- 包含 `PropertyChanged` 事件、`OnChange` 方法、`NotSavedLectotypeList` 属性、`Result` 和 `CloseAction` 属性及 `Close` 方法。

增加了 `NotSavedWarningWindow.xaml` 文件:
- 定义了未保存警告窗口的 UI,包括 `Border`、`Grid`、`StackPanel`、`TextBlock`、`ListBox` 和两个按钮。

增加了 `NotSavedWarningWindow.xaml.cs` 文件:
- 定义了 `NotSavedWarningWindow` 类,包含 `ViewModel` 字段、构造函数及按钮点击事件处理方法。
2025-01-23 17:06:34 +08:00
lihanbo 2e3eb98583 105040 Update 增加注释 2025-01-20 15:55:43 +08:00
SINVO\yangshunli 6bed559bfe 105067 add线材两端管脚信息窗口 2025-01-15 09:40:04 +08:00
lihanbo 3da2dd39bf 105040 Update 伺服电机线材抓取增加安川逻辑 2025-01-10 14:41:51 +08:00
lihanbo ec7916db1d 105040 Update 增加DLL引用;不再复制引用DLL到目标路径 2024-12-23 12:05:54 +08:00
lihanbo 19e04eb3ed 105040 优化与完善功能实现
重构和功能增强

删除了无用的注释和文件,添加了新的属性和方法,调整了窗口布局和视图模型引用。具体更改包括:
- 删除 `MotorModel.cs` 中 `_motorPower` 的 `inheritdoc` 注释。
- `ScanCableModel.cs` 中添加 `Id` 属性及其私有字段 `_id`。
- 更新 `Sinvo.EplanHpD.Plugin.WPFUI.csproj`,删除 `Utils\DrawPDFHelper.cs` 和 `Utils\MessageSend.cs` 的编译引用,添加 `ViewModel\LayoutHelperViewModel.cs` 的编译引用,并添加 `KissStudio.DotNetDetour` 包的引用。
- 删除 `DrawPDFHelper.cs` 和 `MessageSend.cs` 文件内容。
- `LayoutHelperWindow.xaml` 中增加 `viewmodel` 命名空间引用,调整窗口高度和最小高度,设置 `d:DataContext`,并在窗口加载时调用 `GlowWindow_Loaded` 方法,修改部分 `TextBlock` 和 `ListView` 的内容绑定。
- `LayoutHelperWindow.xaml.cs` 中添加 `LayoutHelperViewModel` 的引用,并在构造函数中初始化 `viewModel`,设置 `DataContext`,在 `OnInit` 方法中调用 `GetMotorCables`,添加 `GlowWindow_Loaded`、`PrevBtn_Click` 和 `NextBtn_Click` 方法。
- `LectotypeWindow.xaml.cs` 中修改 `StartLayoutBtn_Click` 方法,传递 `motorIds` 给 `LayoutHelperWindow` 的构造函数。
- `ScannerViewModel.cs` 中添加 `Id` 属性的赋值,修改 `PerformSearch` 方法以根据 `Imprint` 进行搜索,添加 `ToSourceById` 方法用于根据 `occId` 定位线缆。
- 在 `DesignPluginEntry.cs`、`PluginEntry.cs` 和 `ScanPluginEntry.cs` 中添加 `Sinvo.EplanHpD.Plugin.WPFUI.Extension` 的引用。
- 新增 `LayoutHelperViewModel.cs` 文件,定义 `LayoutHelperViewModel` 类及其相关属性和方法,用于处理电机和线缆的选择和切换逻辑。
2024-12-10 17:02:58 +08:00
lihanbo 3bab55aff6 105040 Rename CableLectotypeWindow -> CableLectotypeUserControl 2024-12-05 14:38:54 +08:00
lihanbo bfb9d9b880 105040 Clear code 2024-12-05 14:37:31 +08:00
lihanbo 01ce9d436a 105040 增加布线助手窗口 2024-12-04 14:21:35 +08:00
lihanbo 2740456d41 105040 增加数据库保存,优化界面 2024-12-03 11:50:36 +08:00
lihanbo 870faf37a9 105040 优化电机线材选型页面 2024-12-02 11:02:52 +08:00
lihanbo 6818840420 105040 测试版本,增加功能与优化,调整了数据源 2024-11-26 10:34:31 +08:00
lihanbo ed490f4315 重构项目结构并添加新功能
将项目输出类型从 `Library` 更改为 `Exe`,并设置 `StartupObject` 为 `Sinvo.EplanHpD.Plugin.WPFUI.TestWindow`。删除了 `LectotypeWindow.xaml.cs` 的编译项,并添加了 `View\LectotypeWindow.xaml.cs`、`View\MainWindow.xaml.cs` 和 `View\CableLectotypeWindow.xaml.cs` 的编译项。添加了 `Utils\BaseAppExt.cs` 的编译项。

将 `MainWindow.xaml` 和 `TestWindow.xaml` 的页面项移动到 `View` 文件夹下,并添加了 `CableLectotypeWindow.xaml` 的页面项。在项目文件中添加了 `Common` 文件夹。在 `TestWindow.xaml.cs` 中添加了 `Main` 方法,并在其中显示 `CableLectotypeWindow`。

在 `Theme.xaml` 中添加了一个 `DataGrid` 的样式。添加了 `CableLectotypeWindow.xaml` 和 `CableLectotypeWindow.xaml.cs` 文件,定义了一个新的窗口。在 `LectotypeWindow.xaml` 中添加了一个按钮和 `DataGrid` 的上下文菜单,并在 `LectotypeWindow.xaml.cs` 中添加了多个事件处理方法。

在 `MainWindow.xaml.cs` 中修改了 `Dispatcher` 的调用方式。在 `DesignPluginEntry.cs` 中添加了 `EPLAN.Harness.AppCore` 的引用,并设置了窗口的所有者。在 `Sinvo.EplanHpD.Plugin.csproj` 中添加了 `EPLAN.Harness.AppCore` 的引用。
2024-11-19 12:11:29 +08:00
lihanbo 37172cc58a 105040 Update 伺服电机线缆抓取增加PDF查看,BOM查看,优化界面 2024-11-15 15:04:45 +08:00
lihanbo a0f401aad6 105040 多芯线数据抓取优化,导出、右键跳转、图纸与BOM查看 2024-11-14 19:22:25 +08:00
lihanbo 1d394780a7 105040 从3D中抓取多芯线数据 2024-11-13 13:39:06 +08:00
lihanbo 143b0c3660 改进电缆数据处理和检查逻辑,更新版本号
在 `CheckTest.cs` 文件中,添加了多个测试方法,包括 `DPETerminalCheckTest`、`DPETerminalCrossSectionCheckTest` 和 `TerminalCheckTest`,用于检查不同端子的测试逻辑。
在 `AssemblyInfo.cs` 文件中,更新了程序集版本号和文件版本号。
在 `StuffTest.cs` 文件中,注释掉了一些断言语句,并添加了一个新的测试方法 `StuffedNameTubeTest`,用于测试号码管处理逻辑。
在 `LectotypeWindow.xaml` 文件中,添加了 `util` 命名空间引用,并定义了多个 `ControlTemplate` 模板和一个 `LectotypeLengthDataTemplateSelector` 模板选择器,用于根据线材类型选择不同的显示模板。同时,将 `DataGrid` 控件替换为 `ListView` 控件,并添加了上下文菜单和样式触发器。
在 `LectotypeWindow.xaml.cs` 文件中,添加了 `ToSourceMenuItem_Click` 方法,用于处理上下文菜单项的点击事件。
在 `MainWindow.xaml.cs` 文件中,重构了 `AddToDesignerSelectSet` 方法,添加了异常处理逻辑。
在 `Sinvo.EplanHpD.Plugin.WPFUI.csproj` 文件中,添加了 `LectotypeLengthDataTemplateSelector.cs` 文件的编译项。
在 `ExcelHelper.cs` 文件中,修改了 `GetWireTerminalMappingTable` 方法的过滤逻辑。
新增了 `LectotypeLengthDataTemplateSelector.cs` 文件,定义了 `LectotypeLengthDataTemplateSelector` 类,用于根据线材类型选择不同的数据模板。

在 `LectotypeViewModel.cs` 文件中:
  * 添加了对 `EPLAN.Harness.ProjectCore.Occurrences` 命名空间的引用。
  * 添加了 `StuffedWires` 属性及其对应的私有字段 `_stuffedWires`。
  * 在 `LoadData` 方法中,添加了对 `StuffData` 方法的调用,并将结果赋值给 `Wires`。
  * 添加了 `StuffData` 方法,用于整理和合并电缆数据。
  * 在 `ToSource` 方法中,添加了根据电缆名称获取设计器并设置可见性的逻辑。
  * 修改了 `CableType` 的默认值从 "位置类型" 改为 "未知类型"。

在 `MainViewModel.Check.cs` 文件中:
  * 添加了 `CheckDPETerminals` 方法,用于检查地排端子。
  * 修改了 `CheckTerminals` 方法,移除了对 `D-PE` 前缀的特殊处理逻辑。
  * 修改了 `GetD_PECanUsedTerminal` 方法,注释掉了获取不包含前缀的端子的逻辑。

在 `DesignPluginEntry.cs` 文件中:
  * 注释掉了 `DesignPluginEntry` 类实现的 `IHpDPlugin` 接口。

在 `AssemblyInfo.cs` 文件中:
  * 更新了程序集版本号,从 `1.0.0.6` 更新到 `1.0.0.14`。
2024-11-08 08:34:20 +08:00
lihanbo 65970751b3 更新多个文件,添加新功能和修复bug
在 `CheckTest.cs` 文件中,添加了三个新的测试方法:`CheckWireErpNrTest`、`ChecImprintTest` 和 `CheckSizeTest`。
在 `AssemblyInfo.cs` 文件中,将程序集版本和文件版本从 `1.0.0.5` 更新为 `1.0.0.6`。
在 `StuffTest.cs` 文件中,添加了一个新的断言 `Assert.IsTrue(result.Where(it => it.Imprint == "EC5L3").First().WireColor == "BK");`。
在 `LectotypeWindow.xaml` 文件中,添加了一个新的 `Window` 定义,包括资源字典、按钮和 `TabControl` 控件。
在 `LectotypeWindow.xaml.cs` 文件中,添加了 `LectotypeWindow` 类的定义和相关的事件处理方法。
在 `MainWindow.xaml` 文件中,移除了旧的样式定义,添加了新的资源字典引用,并更新了 `GroupBox` 为 `hc:Card` 控件,调整了按钮样式和 `DataGrid` 的样式。
在 `MainWindow.xaml` 文件中,更新了 `DataGrid` 的 `RowStyle` 和 `CellStyle`,并添加了新的触发器和样式设置。
在 `MainWindow.xaml` 文件中,更新了检查配置项的布局,使用 `hc:Card` 控件替换了 `GroupBox`,并调整了文本块的样式和布局。
在 `MainWindow.xaml.cs` 文件中:
  * 在 `MainWindow` 类中添加了对 `model.IsError` 的检查,如果为 `true`,则将 `model.IsIgnore` 设置为 `true`。
  * 在 `Copy_Click` 方法中添加了 `try-catch` 块来捕获异常,并在捕获到异常时显示错误消息。
  * 在 `GoToSource_Click` 方法中添加了 `try-catch` 块来捕获异常,并在捕获到异常时显示错误消息。
  * 将 `Array.Empty<object>()` 替换为 `[]`。
在 `CheckedModel.cs` 文件中:
  * 注释掉了 `SetProperty` 方法中对 `Equals` 方法的检查。
在 `LectotypeModel.cs` 文件中:
  * 新增了 `LectotypeModel` 类,包含多个属性和相应的 `OnPropertyChanged` 调用。
在 `LineSegmentModel.cs` 文件中:
  * 新增了 `LineSegmentModel` 类,包含 `LineAxisNo`、`LineType` 和 `LineParagraph` 属性。
在 `AssemblyInfo.cs` 文件中:
  * 更新了程序集版本号,从 `1.0.0.5` 更新到 `1.0.0.6`。
在 `Sinvo.EplanHpD.Plugin.WPFUI.csproj` 文件中:
  * 添加了对 `EPLAN.Harness.MathLib` 的引用。
  * 添加了 `LectotypeWindow.xaml` 和 `TestWindow.xaml` 及其对应的代码文件。
  * 添加了 `HandyControl` 包的引用。
在 `TestWindow.xaml` 文件中:
  * 新增了 `TestWindow` 窗口的 XAML 定义,包含一个 `DataGrid` 控件。
在 `TestWindow.xaml.cs` 文件中:
  * 新增了 `TestWindow` 类,包含加载数据的方法。
在 `ExcelHelper.cs` 文件中:
  * 修改了 `GetWireTerminalMappingTable` 方法,使其在 `Prefix` 为 `null` 时也能匹配。
  * 新增了 `GetWireInfo` 方法,用于获取线材信息。
在 `LectotypeViewModel.cs` 文件中:
  * 新增了 `LectotypeViewModel` 类,包含加载数据的方法和多个辅助方法。
在 `MainViewModel.Check.cs` 文件中:
  * 在 `ValidateItem` 方法中添加了对 `CheckWireErpNr` 方法的调用。
  * 新增了 `CheckWireErpNr` 方法,用于检查线材料号。
  * 在 `CheckNumberTube` 方法中添加了对 `item.Imprint` 是否为空的检查。

将 `data.AsParallel().WithDegreeOfParallelism(8).ForAll(entry =>` 修改为 `data.Where(it => it.OrigOcc == "OccWire" && !(it?.Properties["WireName"]?.GetDisplayValue()?.StartsWith("导线") ?? false)).AsParallel().WithDegreeOfParallelism(1).ForAll(entry =>`,以过滤出 `OrigOcc` 为 "OccWire" 且 `WireName` 不以 "导线" 开头的数据,并将并行度设置为 1。
将 `data.FrontTerminalModel = item.ConnectorFrom.Contains(":") ? item.ConnectorFrom.Split(':')[0] : item.ConnectorFrom;` 修改为 `data.FrontTerminalModel = item.ConnectorFrom?.Contains(":") ?? false ? item.ConnectorFrom.Split(':')[0] : item.ConnectorFrom ?? "";`,以处理 `ConnectorFrom` 可能为 null 的情况。
将 `data.RearTerminalModel = item.ConnectorTo.Contains(":") ? item.ConnectorTo.Split(':')[0] : item.ConnectorTo;` 修改为 `data.RearTerminalModel = item.ConnectorTo?.Contains(":") ?? false ? item.ConnectorTo.Split(':')[0] : item.ConnectorTo ?? "";`,以处理 `ConnectorTo` 可能为 null 的情况。
删除了 `if (insulationModels.Any()) { data.Insulation = insulationModels.First(); }` 语句块,简化了代码逻辑。
更新了 `GetWireColorCode` 方法中的注释,将原来的注释替换为更简洁的版本。
2024-11-07 12:14:44 +08:00
lihanbo d5e61f5ac2 105040 右键菜单列表增加 转至源 选项,直接打开3D模型并跳转选中到对应的线 2024-10-29 10:23:27 +08:00
lihanbo 5bcbacffd3 105040 Clean code 2024-10-26 14:40:46 +08:00
lihanbo faa4bbf20d 添加项目文件。 2024-10-24 18:01:26 +08:00