重构项目结构并添加新功能
将项目输出类型从 `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` 的引用。
This commit is contained in:
parent
04045b01e3
commit
ed490f4315
|
|
@ -5,7 +5,7 @@
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{2DBCD22A-650D-4797-9908-9C4D5D6665FE}</ProjectGuid>
|
<ProjectGuid>{2DBCD22A-650D-4797-9908-9C4D5D6665FE}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>Sinvo.EplanHpD.Plugin.WPFUI</RootNamespace>
|
<RootNamespace>Sinvo.EplanHpD.Plugin.WPFUI</RootNamespace>
|
||||||
<AssemblyName>Sinvo.EplanHpD.Plugin.WPFUI</AssemblyName>
|
<AssemblyName>Sinvo.EplanHpD.Plugin.WPFUI</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject />
|
<StartupObject>Sinvo.EplanHpD.Plugin.WPFUI.TestWindow</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
@ -134,9 +134,6 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Commands\UICommand.cs" />
|
<Compile Include="Commands\UICommand.cs" />
|
||||||
<Compile Include="LectotypeWindow.xaml.cs">
|
|
||||||
<DependentUpon>LectotypeWindow.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Models\CheckedModel.cs" />
|
<Compile Include="Models\CheckedModel.cs" />
|
||||||
<Compile Include="Models\ConfigItemModel.cs" />
|
<Compile Include="Models\ConfigItemModel.cs" />
|
||||||
<Compile Include="Models\ExcelModel.cs" />
|
<Compile Include="Models\ExcelModel.cs" />
|
||||||
|
|
@ -154,6 +151,7 @@
|
||||||
<DependentUpon>TestWindow.xaml</DependentUpon>
|
<DependentUpon>TestWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Utils\ApplicationExt.cs" />
|
<Compile Include="Utils\ApplicationExt.cs" />
|
||||||
|
<Compile Include="Utils\BaseAppExt.cs" />
|
||||||
<Compile Include="Utils\CheckedModelExt.cs" />
|
<Compile Include="Utils\CheckedModelExt.cs" />
|
||||||
<Compile Include="Utils\Consts.cs" />
|
<Compile Include="Utils\Consts.cs" />
|
||||||
<Compile Include="Utils\DataGridType.cs" />
|
<Compile Include="Utils\DataGridType.cs" />
|
||||||
|
|
@ -170,17 +168,14 @@
|
||||||
<Compile Include="ViewModel\LectotypeViewModel.cs" />
|
<Compile Include="ViewModel\LectotypeViewModel.cs" />
|
||||||
<Compile Include="ViewModel\MainViewModel.Check.cs" />
|
<Compile Include="ViewModel\MainViewModel.Check.cs" />
|
||||||
<Compile Include="ViewModel\MainViewModel.cs" />
|
<Compile Include="ViewModel\MainViewModel.cs" />
|
||||||
<Page Include="LectotypeWindow.xaml">
|
<Compile Include="View\CableLectotypeWindow.xaml.cs">
|
||||||
<SubType>Designer</SubType>
|
<DependentUpon>CableLectotypeWindow.xaml</DependentUpon>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
</Compile>
|
||||||
</Page>
|
<Compile Include="View\LectotypeWindow.xaml.cs">
|
||||||
<Page Include="MainWindow.xaml">
|
<DependentUpon>LectotypeWindow.xaml</DependentUpon>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
</Compile>
|
||||||
<SubType>Designer</SubType>
|
<Compile Include="View\MainWindow.xaml.cs">
|
||||||
</Page>
|
|
||||||
<Compile Include="MainWindow.xaml.cs">
|
|
||||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
</Compile>
|
||||||
<Page Include="TestWindow.xaml">
|
<Page Include="TestWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|
@ -190,6 +185,18 @@
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="View\CableLectotypeWindow.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="View\LectotypeWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="View\MainWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
|
@ -239,5 +246,8 @@
|
||||||
<Version>8.0.6</Version>
|
<Version>8.0.6</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Common\" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using EPLAN.Harness.ProjectCore;
|
using EPLAN.Harness.ProjectCore;
|
||||||
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
||||||
|
using Sinvo.EplanHpD.Plugin.WPFUI.View;
|
||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
|
|
@ -34,5 +36,13 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
||||||
|
|
||||||
testDataGrid.ItemsSource = wires;
|
testDataGrid.ItemsSource = wires;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[STAThread]
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
var window = new CableLectotypeWindow();
|
||||||
|
window.ShowDialog();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,7 @@
|
||||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
|
||||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
<Style BasedOn="{StaticResource DataGridBaseStyle}" TargetType="DataGrid">
|
||||||
|
<Setter Property="RowHeight" Value="NaN" />
|
||||||
|
</Style>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
@ -0,0 +1,144 @@
|
||||||
|
<Window
|
||||||
|
x:Class="Sinvo.EplanHpD.Plugin.WPFUI.View.CableLectotypeWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
xmlns:local="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.View"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
Title="CableLectotypeWindow"
|
||||||
|
Width="800"
|
||||||
|
Height="450"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Window.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Window.Resources>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="60" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="300" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<hc:Card
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Effect="{DynamicResource EffectShadow2}">
|
||||||
|
<hc:SimpleStackPanel Orientation="Vertical">
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<hc:TextBox
|
||||||
|
Width="140"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
hc:TitleElement.Title="电机型号"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
<hc:TextBox
|
||||||
|
Width="140"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
hc:TitleElement.Title="电机功率"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<hc:TextBox
|
||||||
|
Width="140"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
hc:TitleElement.Title="电机型号"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
<hc:TextBox
|
||||||
|
Width="140"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
hc:TitleElement.Title="电机功率"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel Orientation="Vertical">
|
||||||
|
<hc:TextBox
|
||||||
|
Width="240"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
hc:TitleElement.Title="电机型号"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
<hc:TextBox
|
||||||
|
Width="240"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
hc:TitleElement.Title="电机功率"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel Orientation="Vertical">
|
||||||
|
<hc:TextBox
|
||||||
|
Width="240"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
hc:TitleElement.Title="电机型号"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
<hc:TextBox
|
||||||
|
Width="240"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
hc:TitleElement.Title="电机型号"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<hc:TextBox
|
||||||
|
Width="140"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
hc:TitleElement.Title="电机型号"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
<hc:TextBox
|
||||||
|
Width="140"
|
||||||
|
Height="30"
|
||||||
|
Margin="5,0,0,0"
|
||||||
|
hc:TitleElement.Title="电机功率"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
hc:TitleElement.VerticalAlignment="Center"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</hc:Card>
|
||||||
|
<hc:SimpleStackPanel
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="20"
|
||||||
|
Text="Hello World!" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:Card Grid.Row="0" Grid.Column="1">
|
||||||
|
<ListView />
|
||||||
|
</hc:Card>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CableLectotypeWindow.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class CableLectotypeWindow : Window
|
||||||
|
{
|
||||||
|
public CableLectotypeWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
d:DataContext="{d:DesignInstance Type=viewmodel:LectotypeViewModel}"
|
d:DataContext="{d:DesignInstance Type=viewmodel:LectotypeViewModel}"
|
||||||
Closed="Window_Closed"
|
Closed="Window_Closed"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
|
Topmost="False"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
|
|
@ -150,6 +151,12 @@
|
||||||
Click="ExportExcelBtn_Click"
|
Click="ExportExcelBtn_Click"
|
||||||
Content="导出下单表"
|
Content="导出下单表"
|
||||||
Style="{StaticResource ButtonPrimary}" />
|
Style="{StaticResource ButtonPrimary}" />
|
||||||
|
<Button
|
||||||
|
x:Name="EnableSelectSetBtn"
|
||||||
|
Margin="5"
|
||||||
|
Click="EnableSelectSetBtn_Click"
|
||||||
|
Content="启用选择监听"
|
||||||
|
Style="{StaticResource ButtonPrimary}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
</hc:Card>
|
</hc:Card>
|
||||||
<TabControl Grid.Row="1" FontSize="14">
|
<TabControl Grid.Row="1" FontSize="14">
|
||||||
|
|
@ -403,7 +410,14 @@
|
||||||
x:Name="MotorDataGrid"
|
x:Name="MotorDataGrid"
|
||||||
AutoGenerateColumns="False"
|
AutoGenerateColumns="False"
|
||||||
IsReadOnly="False"
|
IsReadOnly="False"
|
||||||
ItemsSource="{Binding Motors}">
|
ItemsSource="{Binding Motors}"
|
||||||
|
RowHeight="NaN">
|
||||||
|
<DataGrid.ContextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Click="MotorDataGridToMotorSourceMenuItem_Click" Header="在3D中查看(转至电机)" />
|
||||||
|
<MenuItem Click="MotorDataGridToCableLectotype_Click" Header="根据此电机开始选择线材" />
|
||||||
|
</ContextMenu>
|
||||||
|
</DataGrid.ContextMenu>
|
||||||
<DataGrid.Resources>
|
<DataGrid.Resources>
|
||||||
<Style BasedOn="{StaticResource DataGridCellStyle}" TargetType="DataGridCell">
|
<Style BasedOn="{StaticResource DataGridCellStyle}" TargetType="DataGridCell">
|
||||||
<Setter Property="Height" Value="Auto" />
|
<Setter Property="Height" Value="Auto" />
|
||||||
|
|
@ -448,8 +462,6 @@
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
|
|
@ -4,6 +4,7 @@ using Microsoft.Win32;
|
||||||
using Microsoft.WindowsAPICodePack.Dialogs;
|
using Microsoft.WindowsAPICodePack.Dialogs;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||||
|
using Sinvo.EplanHpD.Plugin.WPFUI.View;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel;
|
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
@ -36,6 +37,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
||||||
//DrawPDFHelper.CacheAllPdfToMemory();
|
//DrawPDFHelper.CacheAllPdfToMemory();
|
||||||
MotorExcelHelper.Instance.ReadDataToStream();
|
MotorExcelHelper.Instance.ReadDataToStream();
|
||||||
LoadData();
|
LoadData();
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (System.Exception ex)
|
catch (System.Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -311,20 +313,51 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
||||||
var selectItem = LettotypeListView.SelectedItem;
|
var selectItem = LettotypeListView.SelectedItem;
|
||||||
if (selectItem is LectotypeLineModel model)
|
if (selectItem is LectotypeLineModel model)
|
||||||
{
|
{
|
||||||
var motorModelStr = model.Motor?.MotorModelStr;
|
var motorModelPartId = model.Motor?.OccPartId;
|
||||||
|
|
||||||
var cableName = model.IsComplexLine ? model.CableName.Split('/')[1] : model.CableName;
|
var cableName = model.IsComplexLine ? model.CableName.Split('/')[1] : model.CableName;
|
||||||
if (string.IsNullOrEmpty(motorModelStr))
|
if (string.IsNullOrEmpty(motorModelPartId))
|
||||||
{
|
{
|
||||||
FlexMessageBox.ShowText(FlexMessageBox.Type.INFO, "未获取到电机名称");
|
FlexMessageBox.ShowText(FlexMessageBox.Type.INFO, "未获取到电机名称");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
ViewModel.ToMotorSource(motorModelStr, cableName);
|
ViewModel.ToMotorSource(motorModelPartId, cableName);
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EnableSelectSetBtn_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MotorDataGridToMotorSourceMenuItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var selectItem = MotorDataGrid.SelectedItem;
|
||||||
|
if (selectItem is MotorModel model)
|
||||||
|
{
|
||||||
|
var motorModelPartId = model.OccPartId;
|
||||||
|
|
||||||
|
//var cableName = model.IsComplexLine ? model.CableName.Split('/')[1] : model.CableName;
|
||||||
|
if (string.IsNullOrEmpty(motorModelPartId))
|
||||||
|
{
|
||||||
|
FlexMessageBox.ShowText(FlexMessageBox.Type.INFO, "未获取到电机名称");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
ViewModel.ToMotorSource(motorModelPartId, null);
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MotorDataGridToCableLectotype_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
new CableLectotypeWindow().Show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -74,7 +74,6 @@
|
||||||
ContentTemplate="{StaticResource LoadingMask}" />
|
ContentTemplate="{StaticResource LoadingMask}" />
|
||||||
<Grid Grid.Row="0">
|
<Grid Grid.Row="0">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
|
||||||
<hc:Card
|
<hc:Card
|
||||||
MinWidth="200"
|
MinWidth="200"
|
||||||
Margin="8"
|
Margin="8"
|
||||||
|
|
@ -147,7 +147,7 @@ public partial class MainWindow : System.Windows.Window
|
||||||
{
|
{
|
||||||
Growl.Register("Message", GrowlParent);
|
Growl.Register("Message", GrowlParent);
|
||||||
LoadingMask.Visibility = Visibility.Visible;
|
LoadingMask.Visibility = Visibility.Visible;
|
||||||
this.Dispatcher.BeginInvoke(async delegate ()
|
await this.Dispatcher.BeginInvoke(async delegate ()
|
||||||
{
|
{
|
||||||
ExcelHelper.CheckAndGetCache(true);
|
ExcelHelper.CheckAndGetCache(true);
|
||||||
await LoadDataAsync(datas, reportColumns);
|
await LoadDataAsync(datas, reportColumns);
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using EPLAN.Harness.API;
|
using EPLAN.Harness.API;
|
||||||
using EPLAN.Harness.API.Plugins.Core;
|
using EPLAN.Harness.API.Plugins.Core;
|
||||||
|
using EPLAN.Harness.AppCore;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI;
|
using Sinvo.EplanHpD.Plugin.WPFUI;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -45,8 +46,6 @@ namespace Sinvo.EplanHpD.Plugin
|
||||||
|
|
||||||
public string ToolbarText => "伺服电机线缆抓取";
|
public string ToolbarText => "伺服电机线缆抓取";
|
||||||
|
|
||||||
public string ToolbarTooltip => "伺服电机线缆抓取";
|
|
||||||
|
|
||||||
public HpDModule Module => HpDModule.WorkSpace;
|
public HpDModule Module => HpDModule.WorkSpace;
|
||||||
|
|
||||||
public void Execute(HpdApi api)
|
public void Execute(HpdApi api)
|
||||||
|
|
@ -54,6 +53,9 @@ namespace Sinvo.EplanHpD.Plugin
|
||||||
var doc = api.CurrentProject.GetActiveDocument();
|
var doc = api.CurrentProject.GetActiveDocument();
|
||||||
var window = new LectotypeWindow(doc.ID);
|
var window = new LectotypeWindow(doc.ID);
|
||||||
ElementHost.EnableModelessKeyboardInterop(window);
|
ElementHost.EnableModelessKeyboardInterop(window);
|
||||||
|
var mainApp = BaseApp.ActiveApplication;
|
||||||
|
var helper = new System.Windows.Interop.WindowInteropHelper(window);
|
||||||
|
helper.Owner = mainApp.Handle;
|
||||||
window.Show();
|
window.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,10 @@
|
||||||
<Reference Include="EPLAN.Harness.API.Plugins.Core">
|
<Reference Include="EPLAN.Harness.API.Plugins.Core">
|
||||||
<HintPath>RefDLL\EPLAN.Harness.API.Plugins.Core.dll</HintPath>
|
<HintPath>RefDLL\EPLAN.Harness.API.Plugins.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="EPLAN.Harness.AppCore, Version=2.9.2.903, Culture=neutral, PublicKeyToken=57aaa27e22f7b107, processorArchitecture=AMD64">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>RefDLL\EPLAN.Harness.AppCore.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="EPLAN.Harness.Common, Version=2.9.2.903, Culture=neutral, PublicKeyToken=57aaa27e22f7b107" />
|
<Reference Include="EPLAN.Harness.Common, Version=2.9.2.903, Culture=neutral, PublicKeyToken=57aaa27e22f7b107" />
|
||||||
<Reference Include="EPLAN.Harness.Core, Version=2.9.2.903, Culture=neutral, PublicKeyToken=57aaa27e22f7b107, processorArchitecture=AMD64">
|
<Reference Include="EPLAN.Harness.Core, Version=2.9.2.903, Culture=neutral, PublicKeyToken=57aaa27e22f7b107, processorArchitecture=AMD64">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue