EPLAN_PROD_Plugin/Sinvo.EplanHpD.Plugin.WPFUI/TestWindow.xaml.cs

58 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 = "1000W220V",
// MotorModelStr = "HK-KT103WJK",
// MotorSerie = "HK-KT"
//});
//window.ShowDialog();
var window = new ScannerWindow();
window.ShowDialog();
}
}
}