105040 Clear code
This commit is contained in:
parent
7bcddb1702
commit
bfb9d9b880
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
using EPLAN.Harness.Core.Platform;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
@ -6,14 +8,14 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Converter
|
||||
{
|
||||
public class ConnectionTypeConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var flag = (ConnectionType)value;
|
||||
if (!Enum.IsDefined(typeof(ConnectionType), flag))
|
||||
if (!System.Enum.IsDefined(typeof(ConnectionType), flag))
|
||||
{
|
||||
return false;
|
||||
}
|
|
@ -1,15 +1,17 @@
|
|||
using System;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Enum;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Converter
|
||||
{
|
||||
public class FlagEnumConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var flag = (WireFlagType)value;
|
||||
if (!Enum.IsDefined(typeof(WireFlagType), flag))
|
||||
if (!System.Enum.IsDefined(typeof(WireFlagType), flag))
|
||||
{
|
||||
return false;
|
||||
}
|
|
@ -1,15 +1,17 @@
|
|||
using System;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Enum;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Converter
|
||||
{
|
||||
public class NameTypeConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var flag = (ExportFileNameType)value;
|
||||
if (!Enum.IsDefined(typeof(ExportFileNameType), flag))
|
||||
if (!System.Enum.IsDefined(typeof(ExportFileNameType), flag))
|
||||
{
|
||||
return false;
|
||||
}
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Enum
|
||||
{
|
||||
public enum ConnectionType
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Enum
|
||||
{
|
||||
public enum DataGridType
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Enum
|
||||
{
|
||||
public enum ExportFileNameType
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using System.ComponentModel;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Enum
|
||||
{
|
||||
public enum WireFlagType
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension
|
||||
{
|
||||
public static class ApplicationExt
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using EPLAN.Harness.AppCore;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension
|
||||
{
|
||||
public static class BaseAppExt
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension
|
||||
{
|
||||
public static class CheckedModelExt
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using EPLAN.Harness.Core.Props.Collections;
|
||||
using System.Linq;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension
|
||||
{
|
||||
public static class PropertyListExt
|
||||
{
|
|
@ -3,7 +3,7 @@ using System.Reflection;
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Selector
|
||||
{
|
||||
internal class LectotypeLengthDataTemplateSelector : DataTemplateSelector
|
||||
{
|
|
@ -136,6 +136,17 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Common\CommonMessage.cs" />
|
||||
<Compile Include="Converter\ConnectionTypeConverter.cs" />
|
||||
<Compile Include="Converter\FlagEnumConverter.cs" />
|
||||
<Compile Include="Converter\NameTypeConverter.cs" />
|
||||
<Compile Include="Enum\ConnectionType.cs" />
|
||||
<Compile Include="Enum\DataGridType.cs" />
|
||||
<Compile Include="Enum\ExportFileNameType.cs" />
|
||||
<Compile Include="Enum\WireFlagType.cs" />
|
||||
<Compile Include="Extension\ApplicationExt.cs" />
|
||||
<Compile Include="Extension\BaseAppExt.cs" />
|
||||
<Compile Include="Extension\CheckedModelExt.cs" />
|
||||
<Compile Include="Extension\PropertyListExt.cs" />
|
||||
<Compile Include="Models\CheckedModel.cs" />
|
||||
<Compile Include="Models\ConfigItemModel.cs" />
|
||||
<Compile Include="Models\ExcelModel.cs" />
|
||||
|
@ -150,28 +161,17 @@
|
|||
<Compile Include="Models\ScanCableModel.cs" />
|
||||
<Compile Include="Models\StuffedDataModel.cs" />
|
||||
<Compile Include="Models\TerminalModel.cs" />
|
||||
<Compile Include="Selector\LectotypeLengthDataTemplateSelector.cs" />
|
||||
<Compile Include="TestWindow.xaml.cs">
|
||||
<DependentUpon>TestWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utils\ApplicationExt.cs" />
|
||||
<Compile Include="Utils\BaseAppExt.cs" />
|
||||
<Compile Include="Utils\CheckedModelExt.cs" />
|
||||
<Compile Include="Utils\ConnectionType.cs" />
|
||||
<Compile Include="Utils\ConnectionTypeConverter.cs" />
|
||||
<Compile Include="Utils\Consts.cs" />
|
||||
<Compile Include="Utils\DataGridType.cs" />
|
||||
<Compile Include="Utils\DrawPDFHelper.cs" />
|
||||
<Compile Include="Utils\ExcelHelper.cs" />
|
||||
<Compile Include="Utils\ExportFileNameType.cs" />
|
||||
<Compile Include="Utils\FlagEnumConverter.cs" />
|
||||
<Compile Include="Utils\LambdaComparer.cs" />
|
||||
<Compile Include="Utils\LectotypeLengthDataTemplateSelector.cs" />
|
||||
<Compile Include="Utils\LectotypeManager.cs" />
|
||||
<Compile Include="Utils\MessageSend.cs" />
|
||||
<Compile Include="Utils\MotorExcelHelper.cs" />
|
||||
<Compile Include="Utils\NameTypeConverter.cs" />
|
||||
<Compile Include="Utils\PropertyListExt.cs" />
|
||||
<Compile Include="Utils\WireFlagType.cs" />
|
||||
<Compile Include="ViewModel\CableLectotypeViewModel.cs" />
|
||||
<Compile Include="ViewModel\LectotypeViewModel.cs" />
|
||||
<Compile Include="ViewModel\MainViewModel.Check.cs" />
|
||||
|
|
|
@ -14,7 +14,6 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
|||
{
|
||||
public static class LectotypeManager
|
||||
{
|
||||
public static MotorModel Motor;
|
||||
|
||||
|
||||
public class LectotypeViewModelFactory
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
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:converter="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Converter"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:enum="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Enum"
|
||||
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"
|
||||
xmlns:util="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Utils"
|
||||
xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
|
||||
Height="750"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:CableLectotypeViewModel}"
|
||||
|
@ -19,7 +20,7 @@
|
|||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<util:ConnectionTypeConverter x:Key="ConnectionTypeConverter" />
|
||||
<converter:ConnectionTypeConverter x:Key="ConnectionTypeConverter" />
|
||||
<DataTemplate x:Key="LoadingMask">
|
||||
<Grid Background="#ccd7d7d7">
|
||||
<!--<hc:WaveProgressBar HorizontalAlignment="Center" VerticalAlignment="Center" />-->
|
||||
|
@ -102,8 +103,8 @@
|
|||
VerticalAlignment="Center"
|
||||
Text="线材链接方式:" />
|
||||
<hc:ButtonGroup Width="263" Style="{StaticResource ButtonGroupSolid}">
|
||||
<RadioButton Content="直通" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static util:ConnectionType.Passthrough}}" />
|
||||
<RadioButton Content="全段" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static util:ConnectionType.FullParagraph}}" />
|
||||
<RadioButton Content="直通" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static enum:ConnectionType.Passthrough}}" />
|
||||
<RadioButton Content="全段" IsChecked="{Binding CableConnectionType, Converter={StaticResource ConnectionTypeConverter}, ConverterParameter={x:Static enum:ConnectionType.FullParagraph}}" />
|
||||
</hc:ButtonGroup>
|
||||
</hc:SimpleStackPanel>
|
||||
<hc:SimpleStackPanel Margin="0,10,0,0" Orientation="Horizontal">
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
using System;
|
||||
using EPLAN.Harness.API;
|
||||
using EPLAN.Harness.Core.Controls;
|
||||
using EPLAN.Harness.ProjectCore;
|
||||
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -17,11 +22,58 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
|||
/// <summary>
|
||||
/// LayoutHelperWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LayoutHelperWindow : Window
|
||||
public partial class LayoutHelperWindow
|
||||
{
|
||||
private FlexDesigner _currentFlexDesigner;
|
||||
public LayoutHelperWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
OnInit();
|
||||
}
|
||||
private void OnInit()
|
||||
{
|
||||
GetCurrentDoc();
|
||||
_currentFlexDesigner.SelectSet.SelectionChanged += SelectSet_SelectionChanged;
|
||||
|
||||
}
|
||||
|
||||
private void SelectSet_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (sender is OccSelectSet selectSet)
|
||||
{
|
||||
var item = selectSet.SelectedItem;
|
||||
if (item is OccSubPart part)
|
||||
{
|
||||
Debug.WriteLine($"Select part -> {part.Name} / {part.ID}");
|
||||
if (part.Parents != null)
|
||||
{
|
||||
Debug.WriteLine($"Select part parent -> {part.Parents.First()?.Name} / {part.Parents.First()?.ID}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void GetCurrentDoc()
|
||||
{
|
||||
try
|
||||
{
|
||||
HpdApi api = HpdApi.GetInstance();
|
||||
var currentDocId = api.CurrentProject.GetActiveDocument()?.ID;
|
||||
var designer = SelfControler<FlexBaseOrganizer>.FindInstance(currentDocId) as FlexDesigner;
|
||||
if (designer != null)
|
||||
{
|
||||
_currentFlexDesigner = designer;
|
||||
}
|
||||
else
|
||||
{
|
||||
FlexMessageBox.Warning("未找到当前打开的工作区,请先打开工作区");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FlexMessageBox.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
xmlns:local="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pdf="clr-namespace:PdfiumViewer;assembly=PdfiumViewer"
|
||||
xmlns:selecter="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Selector"
|
||||
xmlns:util="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Utils"
|
||||
xmlns:view="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.View"
|
||||
xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
|
||||
|
@ -66,28 +67,28 @@
|
|||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
<util:LectotypeLengthDataTemplateSelector x:Key="LectotypeLengthDataTemplateSelector">
|
||||
<util:LectotypeLengthDataTemplateSelector.DefaultTemplate>
|
||||
<selecter:LectotypeLengthDataTemplateSelector x:Key="LectotypeLengthDataTemplateSelector">
|
||||
<selecter:LectotypeLengthDataTemplateSelector.DefaultTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl Template="{StaticResource DefaultTemplate}" />
|
||||
</DataTemplate>
|
||||
</util:LectotypeLengthDataTemplateSelector.DefaultTemplate>
|
||||
<util:LectotypeLengthDataTemplateSelector.PowerLineTemplate>
|
||||
</selecter:LectotypeLengthDataTemplateSelector.DefaultTemplate>
|
||||
<selecter:LectotypeLengthDataTemplateSelector.PowerLineTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl Template="{StaticResource PowerLineTemplate}" />
|
||||
</DataTemplate>
|
||||
</util:LectotypeLengthDataTemplateSelector.PowerLineTemplate>
|
||||
<util:LectotypeLengthDataTemplateSelector.EncoderLineTemplate>
|
||||
</selecter:LectotypeLengthDataTemplateSelector.PowerLineTemplate>
|
||||
<selecter:LectotypeLengthDataTemplateSelector.EncoderLineTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl Template="{StaticResource EncoderLineTemplate}" />
|
||||
</DataTemplate>
|
||||
</util:LectotypeLengthDataTemplateSelector.EncoderLineTemplate>
|
||||
<util:LectotypeLengthDataTemplateSelector.ComplexLineTemplate>
|
||||
</selecter:LectotypeLengthDataTemplateSelector.EncoderLineTemplate>
|
||||
<selecter:LectotypeLengthDataTemplateSelector.ComplexLineTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl Template="{StaticResource ComplexLineTemplate}" />
|
||||
</DataTemplate>
|
||||
</util:LectotypeLengthDataTemplateSelector.ComplexLineTemplate>
|
||||
</util:LectotypeLengthDataTemplateSelector>
|
||||
</selecter:LectotypeLengthDataTemplateSelector.ComplexLineTemplate>
|
||||
</selecter:LectotypeLengthDataTemplateSelector>
|
||||
<DataTemplate x:Key="LoadingMask">
|
||||
<Grid Background="#66424242">
|
||||
<StackPanel
|
||||
|
@ -163,12 +164,12 @@
|
|||
Click="ExportExcelBtn_Click"
|
||||
Content="导出下单表"
|
||||
Style="{StaticResource ButtonPrimary}" />
|
||||
<Button
|
||||
<!--<Button
|
||||
x:Name="EnableSelectSetBtn"
|
||||
Margin="5"
|
||||
Click="EnableSelectSetBtn_Click"
|
||||
Content="启用选择监听"
|
||||
Style="{StaticResource ButtonPrimary}" />
|
||||
Style="{StaticResource ButtonPrimary}" />-->
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
hc:IconElement.Geometry="{StaticResource DialogBoxLauncherGeometry}"
|
||||
|
@ -487,11 +488,8 @@
|
|||
<CheckBox
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Checked="CheckBox_Checked"
|
||||
Click="CheckBox_Click"
|
||||
IsChecked="{Binding IsFlexibility, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="False"
|
||||
Unchecked="CheckBox_Unchecked" />
|
||||
IsEnabled="False" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
|
|
@ -8,6 +8,7 @@ using HandyControl.Controls;
|
|||
using Microsoft.Win32;
|
||||
using Microsoft.WindowsAPICodePack.Dialogs;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Common;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Extension;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.View;
|
||||
|
@ -43,7 +44,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
|||
|
||||
WeakReferenceMessenger.Default.Register<CommonMessage>("RowDetailsVisibility", (sender, message) =>
|
||||
{
|
||||
if (Enum.IsDefined(typeof(DataGridRowDetailsVisibilityMode), message.Value))
|
||||
if (System.Enum.IsDefined(typeof(DataGridRowDetailsVisibilityMode), message.Value))
|
||||
{
|
||||
ViewModel.RowDetailsVisibility = (DataGridRowDetailsVisibilityMode)message.Value;
|
||||
}
|
||||
|
@ -176,19 +177,6 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
|||
MotorExcelHelper.Instance.CloseStream();
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ViewDrawingButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
@ -350,25 +338,6 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
|||
//}
|
||||
}
|
||||
}
|
||||
private void EnableSelectSetBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//LibrarySystem.PartBrowser.GetPart((new List<CategoryType>() { CategoryType.Cable }).ToQueryFilter(), "123");
|
||||
}
|
||||
|
||||
private void MotorDataGridToMotorSourceMenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void MotorDataGridToCableLectotype_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//if (MotorDataGrid.SelectedItem != null)
|
||||
//{
|
||||
// var window = new CableLectotypeWindow(MotorDataGrid.SelectedItem as MotorModel);
|
||||
// ElementHost.EnableModelessKeyboardInterop(window);
|
||||
// window.Show();
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
private void ListView_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||
{
|
||||
|
@ -378,19 +347,6 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
|||
(sender as ListView).RaiseEvent(eventArg);
|
||||
}
|
||||
|
||||
private void SelectedLectotype_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void MotorListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (LectotypeManager.Motor?.OccPartId != (MotorListView.SelectedItem as MotorModel)?.OccPartId)
|
||||
{
|
||||
Debug.WriteLine($"MotorListView_SelectionChanged {LectotypeManager.Motor.MotorModelStr} => {LectotypeManager.Motor.OccPartId}");
|
||||
}
|
||||
}
|
||||
|
||||
private void MotorListViewToMotorSourceMenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var selectItem = MotorListView.SelectedItem;
|
||||
|
@ -412,10 +368,6 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
|||
}
|
||||
}
|
||||
|
||||
private void MotorListViewToCableLectotype_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void StartLayoutBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
@ -427,5 +379,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
|
|||
window.Show();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
x:Class="Sinvo.EplanHpD.Plugin.WPFUI.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converter="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Converter"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:enum="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Enum"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:util="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.Utils"
|
||||
|
@ -26,8 +28,8 @@
|
|||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<util:FlagEnumConverter x:Key="FlagEnumConverter" />
|
||||
<util:NameTypeConverter x:Key="NameTypeConverter" />
|
||||
<converter:FlagEnumConverter x:Key="FlagEnumConverter" />
|
||||
<converter:NameTypeConverter x:Key="NameTypeConverter" />
|
||||
<DataTemplate x:Key="LoadingMask">
|
||||
<Grid Background="#66424242">
|
||||
<StackPanel
|
||||
|
@ -451,18 +453,18 @@
|
|||
Content="使用项目编号作为文件名"
|
||||
FontSize="14"
|
||||
GroupName="ExportFileName"
|
||||
IsChecked="{Binding NameType, Converter={StaticResource NameTypeConverter}, ConverterParameter={x:Static util:ExportFileNameType.ProjectNo}}" />
|
||||
IsChecked="{Binding NameType, Converter={StaticResource NameTypeConverter}, ConverterParameter={x:Static enum:ExportFileNameType.ProjectNo}}" />
|
||||
<RadioButton
|
||||
HorizontalAlignment="Left"
|
||||
Content="使用机构号&机构名作为文件名"
|
||||
FontSize="14"
|
||||
GroupName="ExportFileName"
|
||||
IsChecked="{Binding NameType, Converter={StaticResource NameTypeConverter}, ConverterParameter={x:Static util:ExportFileNameType.Mechanism}}" />
|
||||
IsChecked="{Binding NameType, Converter={StaticResource NameTypeConverter}, ConverterParameter={x:Static enum:ExportFileNameType.Mechanism}}" />
|
||||
<RadioButton
|
||||
HorizontalAlignment="Left"
|
||||
FontSize="14"
|
||||
GroupName="ExportFileName"
|
||||
IsChecked="{Binding NameType, Converter={StaticResource NameTypeConverter}, ConverterParameter={x:Static util:ExportFileNameType.Custom}}">
|
||||
IsChecked="{Binding NameType, Converter={StaticResource NameTypeConverter}, ConverterParameter={x:Static enum:ExportFileNameType.Custom}}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="自定义:" />
|
||||
<hc:TextBox Width="200" Text="{Binding CustomFileName}" />
|
||||
|
@ -529,19 +531,19 @@
|
|||
Content="L1/L2/L3/PE"
|
||||
FontSize="14"
|
||||
GroupName="Insulation"
|
||||
IsChecked="{Binding FlagType, Converter={StaticResource FlagEnumConverter}, ConverterParameter={x:Static util:WireFlagType.Dual}}" />
|
||||
IsChecked="{Binding FlagType, Converter={StaticResource FlagEnumConverter}, ConverterParameter={x:Static enum:WireFlagType.Dual}}" />
|
||||
<RadioButton
|
||||
HorizontalAlignment="Left"
|
||||
Content="R/S/T/PE"
|
||||
FontSize="14"
|
||||
GroupName="Insulation"
|
||||
IsChecked="{Binding FlagType, Converter={StaticResource FlagEnumConverter}, ConverterParameter={x:Static util:WireFlagType.Single}}" />
|
||||
IsChecked="{Binding FlagType, Converter={StaticResource FlagEnumConverter}, ConverterParameter={x:Static enum:WireFlagType.Single}}" />
|
||||
<RadioButton
|
||||
HorizontalAlignment="Left"
|
||||
Content="L1/R/L2/S/L3/T/PE"
|
||||
FontSize="14"
|
||||
GroupName="Insulation"
|
||||
IsChecked="{Binding FlagType, Converter={StaticResource FlagEnumConverter}, ConverterParameter={x:Static util:WireFlagType.Mix}}" />
|
||||
IsChecked="{Binding FlagType, Converter={StaticResource FlagEnumConverter}, ConverterParameter={x:Static enum:WireFlagType.Mix}}" />
|
||||
</StackPanel>
|
||||
</hc:Card>
|
||||
<hc:Card Margin="8" FontSize="14">
|
||||
|
|
|
@ -12,6 +12,8 @@ using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
|||
using EPLAN.Harness.ProjectCore.Report;
|
||||
using HandyControl.Controls;
|
||||
using Microsoft.Win32;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Enum;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Extension;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using HandyControl.Controls;
|
||||
using Sinvo.EplanHpD.Plugin.Service;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Enum;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using System;
|
||||
|
|
|
@ -5,6 +5,7 @@ using EPLAN.Harness.Core.Utils;
|
|||
using EPLAN.Harness.ProjectCore;
|
||||
using EPLAN.Harness.ProjectCore.Occurrences;
|
||||
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Extension;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using System;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Enum;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using EPLAN.Harness.Core.Controls;
|
||||
using EPLAN.Harness.Core.Settings;
|
||||
using EPLAN.Harness.ProjectCore.Report;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Enum;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||
using System;
|
||||
|
@ -217,18 +218,18 @@ public partial class MainViewModel : INotifyPropertyChanged
|
|||
private void LoadSavedUISettings()
|
||||
{
|
||||
var savedFlagType = FormUISettings.Instance.GetValue("FlagType") ?? WireFlagType.Dual;
|
||||
if (Enum.IsDefined(typeof(WireFlagType), savedFlagType))
|
||||
if (System.Enum.IsDefined(typeof(WireFlagType), savedFlagType))
|
||||
{
|
||||
FlagType = (WireFlagType)Enum.Parse(typeof(WireFlagType), savedFlagType.ToString());
|
||||
FlagType = (WireFlagType)System.Enum.Parse(typeof(WireFlagType), savedFlagType.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
FlagType = WireFlagType.Dual;
|
||||
}
|
||||
var savedNameType = FormUISettings.Instance.GetValue("NameType") ?? ExportFileNameType.Mechanism;
|
||||
if (Enum.IsDefined(typeof(ExportFileNameType), savedNameType))
|
||||
if (System.Enum.IsDefined(typeof(ExportFileNameType), savedNameType))
|
||||
{
|
||||
NameType = (ExportFileNameType)Enum.Parse(typeof(ExportFileNameType), savedNameType.ToString());
|
||||
NameType = (ExportFileNameType)System.Enum.Parse(typeof(ExportFileNameType), savedNameType.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue