55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
using EPLAN.Harness.ProjectCore;
|
||
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
||
using Sinvo.EplanHpD.Plugin.WPFUI.View;
|
||
using System;
|
||
using System.Linq;
|
||
using System.Windows;
|
||
|
||
namespace Sinvo.EplanHpD.Plugin.WPFUI
|
||
{
|
||
/// <summary>
|
||
/// TestWindow.xaml 的交互逻辑
|
||
/// </summary>
|
||
public partial class TestWindow : Window
|
||
{
|
||
private string _docId;
|
||
public TestWindow(string docID)
|
||
{
|
||
InitializeComponent();
|
||
_docId = docID;
|
||
}
|
||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||
{
|
||
LoadData();
|
||
}
|
||
|
||
public void LoadData()
|
||
{
|
||
if (string.IsNullOrEmpty(_docId))
|
||
{
|
||
return;
|
||
}
|
||
var doc = FlexProject.CurrentProject.GetDesigners().FirstOrDefault(designer => designer.ID == _docId);
|
||
//var data = doc.GetOccurrencesByName("w_00901");
|
||
var wires = doc.GetOrganizerOccurrences(doc.ID, typeof(OccWire));
|
||
|
||
testDataGrid.ItemsSource = wires;
|
||
}
|
||
|
||
[STAThread]
|
||
public static void Main()
|
||
{
|
||
var window = new CableLectotypeWindow(new Models.MotorModel
|
||
{
|
||
AxisNo = "MRJ001",
|
||
MotorPower = "1000W(220V)",
|
||
MotorModelStr = "HK-KT103WJK",
|
||
MotorSerie = "HK-KT"
|
||
});
|
||
window.ShowDialog();
|
||
|
||
}
|
||
}
|
||
}
|