diff --git a/Sinvo.EplanHpD.Plugin.Service/PluginServices.cs b/Sinvo.EplanHpD.Plugin.Service/PluginServices.cs
index 045f5df..c0ad9d2 100644
--- a/Sinvo.EplanHpD.Plugin.Service/PluginServices.cs
+++ b/Sinvo.EplanHpD.Plugin.Service/PluginServices.cs
@@ -10,12 +10,8 @@ namespace Sinvo.EplanHpD.Plugin.Service
{
public class PluginServices
{
- public static UserInfo user;
-#if DEBUG
+ public static UserInfo user;
public static bool IsLogin => user != null && !string.IsNullOrEmpty(user.GUID) && DynaServerClient.GetClient().IsLoginExpired();
-#else
-
- public static bool IsLogin => true;
-#endif
+
}
}
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireLecModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireLecModel.cs
index ec59cd1..2f769ab 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireLecModel.cs
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireLecModel.cs
@@ -1,4 +1,5 @@
-using MiniExcelLibs.Attributes;
+using Microsoft.WindowsAPICodePack.ApplicationServices;
+using MiniExcelLibs.Attributes;
using Sinvo.EplanHpD.Plugin.WPFUI.Models.MultiCoreWire;
using System;
using System.Collections.Generic;
@@ -422,7 +423,23 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
}
}
-
+ private bool _layouted;
+ ///
+ /// 是否已布线
+ ///
+ [ExcelColumn(Ignore = true)]
+ public bool Layouted
+ {
+ get
+ {
+ return _layouted;
+ }
+ set
+ {
+ _layouted = value;
+ OnPropertyChanged(nameof(Layouted));
+ }
+ }
[ExcelColumn(Ignore = true)]
public List TerminalModels
{
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Service/MultiCoreWireService.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Service/MultiCoreWireService.cs
index 8cfe7de..c7328c7 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/Service/MultiCoreWireService.cs
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/Service/MultiCoreWireService.cs
@@ -96,5 +96,27 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Service
throw;
}
}
+ internal void UpdateWireIsLayout(string id)
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ return;
+ }
+ var db = DBHelper.DB;
+ try
+ {
+ db.BeginTran();
+ db.Updateable()
+ .Where(it => it.Id == id)
+ .SetColumns(it => it.Layouted == true)
+ .ExecuteCommand();
+ db.CommitTran();
+ }
+ catch (Exception)
+ {
+ db.RollbackTran();
+ throw;
+ }
+ }
}
}
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj
index b7d1bb5..0631070 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj
@@ -283,6 +283,7 @@
+
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Utils/MapperUtil.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Utils/MapperUtil.cs
new file mode 100644
index 0000000..dd2f5cb
--- /dev/null
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/Utils/MapperUtil.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
+{
+ public class MapperUtil
+ {
+ public static T MapFor(S sourceObj)
+ {
+ if (sourceObj == null)
+ return default(T);
+ var destObj = Activator.CreateInstance();
+ var sourceType = sourceObj.GetType();
+ var destType = typeof(T);
+ foreach (var prop in destType.GetProperties())
+ {
+ var sourceProp = sourceType.GetProperty(prop.Name);
+ if (sourceProp != null && prop.CanWrite)
+ {
+ var value = sourceProp.GetValue(sourceObj);
+ prop.SetValue(destObj, value);
+ }
+ }
+ return destObj;
+ }
+ }
+}
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml
index 1045605..edc6546 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml
@@ -12,14 +12,14 @@
Width="450"
Height="260"
MinWidth="450"
- MinHeight="260"
+ MinHeight="360"
d:DataContext="{d:DesignInstance Type=multicorewireviewmodel:MultiCoreWireLayoutHelperViewModel}"
ActiveGlowColor="{DynamicResource PrimaryColor}"
Background="White"
FontSize="14"
Left="1460"
Loaded="GlowWindow_Loaded"
- Top="770"
+ Top="700"
WindowStartupLocation="Manual"
mc:Ignorable="d">
@@ -46,22 +46,46 @@
FontSize="16"
FontWeight="Bold"
Foreground="#c92d28"
- Text="触摸屏" />
+ Text="{Binding ApplicationScenario}" />
-
-
-
-
-
-
-
+ hc:GridViewAttach.ColumnHeaderHeight="10"
+ ItemsSource="{Binding LecWires}"
+ Style="{StaticResource ListView.Small}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml.cs
index f2cca93..73d5533 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml.cs
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml.cs
@@ -1,4 +1,5 @@
-using HandyControl.Controls;
+using EPLAN.Harness.Core.Controls;
+using HandyControl.Controls;
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel;
using System;
using System.Collections.Generic;
@@ -32,17 +33,40 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View.MultiCoreWire.LayoutHelper
private void GlowWindow_Loaded(object sender, RoutedEventArgs e)
{
-
+ ViewModel.Init();
}
private void NextBtn_Click(object sender, RoutedEventArgs e)
{
-
+ ViewModel.Next();
}
private void PrevBtn_Click(object sender, RoutedEventArgs e)
{
+ ViewModel.Prev();
}
+
+ private void TextBox_GotFocus(object sender, RoutedEventArgs e)
+ {
+ if(sender is System.Windows.Controls.TextBox box)
+ {
+ box.SelectAll();
+ CopyToClipboard(box.Text);
+ }
+ }
+
+ private void CopyToClipboard(string content)
+ {
+ try
+ {
+ Clipboard.SetDataObject(content);
+ Growl.SuccessGlobal("复制成功!");
+ }
+ catch (Exception ex)
+ {
+ FlexMessageBox.Error(ex.Message);
+ }
+ }
}
}
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml
index c5631f0..b18c852 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml
@@ -20,6 +20,7 @@
+ M68.191078 915.462005l161.384597 0L229.575676 431.30719 68.191078 431.30719 68.191078 915.462005zM955.808922 471.653083c0-44.582381-36.109406-80.69281-80.69281-80.69281L620.329241 390.960273 658.859789 206.578915c0.807389-4.034896 1.412163-8.271384 1.412163-12.709463 0-16.743336-6.859221-31.873941-17.752316-42.767036l-42.968627-42.565445L333.871043 374.216937c-14.524808 14.7264-23.602557 34.899858-23.602557 57.090253l0 403.462005c0 44.582381 36.109406 80.69281 80.69281 80.69281l363.116111 0c33.487695 0 62.133106-20.37505 74.236771-49.222051l121.643478-284.441261c3.63069-9.279341 5.850242-19.164478 5.850242-29.452799L955.807898 475.083206l-0.403183-0.403183L955.808922 471.653083z
@@ -43,6 +44,7 @@