diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml
index dff982c..b824984 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml
@@ -98,7 +98,22 @@
-
+
+
+
+
+
+
+
+
diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml.cs
index 89f9649..8fbe4bb 100644
--- a/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml.cs
+++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/LayoutHelperWindow.xaml.cs
@@ -1,5 +1,12 @@
-using EPLAN.Harness.API;
+using EPLAN.Harness.Actuator.Commands.Designer;
+using EPLAN.Harness.API;
+using EPLAN.Harness.AppCore.Controls;
+using EPLAN.Harness.Core;
+using EPLAN.Harness.Core.Commands;
+using EPLAN.Harness.Core.Common;
using EPLAN.Harness.Core.Controls;
+using EPLAN.Harness.Core.UIFactory;
+using EPLAN.Harness.Primitives.ActionControls;
using EPLAN.Harness.ProjectCore;
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
using HandyControl.Controls;
@@ -40,6 +47,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
{
GetCurrentDoc();
_currentFlexDesigner.SelectSet.SelectionChanged += SelectSet_SelectionChanged;
+
GetMotorCables();
}
@@ -94,8 +102,66 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
if(viewModel != null && viewModel.SelectedLine != null)
{
var text = $"{viewModel.SelectedLine.AxisNo}-{viewModel.SelectedLine.CurrentLine}";
- Clipboard.SetDataObject(text);
+ SetToClipboard(text);
}
}
+
+ private void TextBox_GotFocus(object sender, RoutedEventArgs e)
+ {
+ if (sender is System.Windows.Controls.TextBox box)
+ {
+ SetToClipboard(box.Text);
+ box.SelectAll();
+ }
+ }
+ private void SetToClipboard(string text)
+ {
+ try
+ {
+ Clipboard.SetDataObject(text);
+ Growl.SuccessGlobal("复制成功!");
+ }
+ catch (Exception ex)
+ {
+ FlexMessageBox.Error(ex.Message);
+ }
+ }
+ protected CmdRunEnv _cmdEnvironment = CmdRunEnv.Designer;
+ private void InsertCableBtn_Click(object sender, RoutedEventArgs e)
+ {
+ if(sender is Button btn)
+ {
+ if(!string.IsNullOrEmpty(btn.Tag?.ToString() ?? ""))
+ {
+ string cableModelNo = btn.Tag?.ToString();
+ SetToClipboard(cableModelNo);
+
+ var Commander = new CommandInvoker();
+
+ //this._organizer as FlexDesigner,
+ //this._bookmarks.ItemList,
+ //this.GetConectWireFrm(),
+ //this.GetForkedCableControl(OccCablesSubpartGraph.SIDE.Left),
+ //this._cmdEnvironment
+ var cmdD3DPlaceCableForkedAH = new CmdD3DPlaceCableForkedAH(
+ _currentFlexDesigner,
+ new EPLAN.Harness.Core.Common.BookmarkList(),
+ GetConectWireFrm(),
+ this.GetForkedCableControl(OccCablesSubpartGraph.SIDE.Left),
+ _cmdEnvironment);
+ Commander.ExecuteCommand(cmdD3DPlaceCableForkedAH);
+
+ }
+ }
+ }
+ private CmdD3DPlaceCableBase.IfrmConnectWires GetConectWireFrm()
+ {
+ return _currentFlexDesigner.CurrentView.UserControlFactory_Create(UIObject.frm_Designer_ConnectCableWires, Array.Empty