Compare commits

..

17 Commits

Author SHA1 Message Date
002ff9c9a0 Removed header tabs 2022-05-08 21:03:25 +02:00
e59b4113dc Small bug fix 2022-05-06 08:34:22 +02:00
f6f7fd7d05 Check length of IEnumerable 2022-05-05 18:19:42 +02:00
c4183f1b95 Improve GUI 2022-04-26 11:45:03 +02:00
be82e509a0 Some improvements
Use specific CAEX file version
Update assembly information
Code cleanup
2022-04-25 23:58:30 +02:00
5bef6aa1db Updated license and some text parts in about window
Fixes #9
2022-04-09 22:06:10 +02:00
fa9e5d1dab Changed manual link 2022-04-08 22:12:36 +02:00
666b9a7cba Fixed issues
Added missing functions
Cleaned up code
2022-04-07 11:44:51 +02:00
696b81e436 Fixed Drag&Drop
Fixed delete button
2022-04-07 09:33:56 +02:00
1251cb5a72 Cleaned up code 2022-04-07 08:37:54 +02:00
39c0720683 Implemented Advanced mode to show/hide some fields in data grids 2022-04-07 08:31:06 +02:00
d9e0e6295b Fixed split layout 2022-04-07 08:15:46 +02:00
69a74d9f74 Fixed loading amlx files without crashing 2022-04-01 10:43:18 +02:00
d9419df191 Fixed open and save files 2022-03-26 21:03:02 +01:00
Florian Kaiser
f4642870e6
Update README.md 2022-03-12 17:44:14 +01:00
c6c8336230 Improved scaling. Doesn't work completely but much better than before 2022-03-12 09:53:18 +01:00
ea815e3b1f Improved menu bar 2022-03-12 09:07:27 +01:00
28 changed files with 1454 additions and 2283 deletions

View File

@ -30,7 +30,7 @@ namespace App
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.deviceDescription1 = new Aml.Editor.Plugin.DeviceDescription();
this.deviceDescription1 = new Aml.Editor.Plugin.DeviceDescription(new Aml.Editor.Plugin.MWController());
this.SuspendLayout();
//
// deviceDescription1
@ -41,11 +41,10 @@ namespace App
this.deviceDescription1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.deviceDescription1.Location = new System.Drawing.Point(0, 0);
this.deviceDescription1.Margin = new System.Windows.Forms.Padding(0);
this.deviceDescription1.MaximumSize = new System.Drawing.Size(1750, 866);
this.deviceDescription1.MinimumSize = new System.Drawing.Size(1750, 866);
this.deviceDescription1.Name = "deviceDescription1";
this.deviceDescription1.Size = new System.Drawing.Size(1750, 866);
this.deviceDescription1.Size = new System.Drawing.Size(884, 461);
this.deviceDescription1.TabIndex = 0;
this.deviceDescription1.Load += new System.EventHandler(this.deviceDescription1_Load);
//
// Form1
//

View File

@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace App
@ -16,5 +9,10 @@ namespace App
{
InitializeComponent();
}
private void deviceDescription1_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace App

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Aml.Engine" version="1.5.8" targetFramework="net472" />
<package id="System.IO.FileSystem.AccessControl" version="5.0.0" targetFramework="net472" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.IO.Packaging" version="5.0.0" targetFramework="net472" />
<package id="System.Security.AccessControl" version="5.0.0" targetFramework="net472" />
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net472" />
</packages>

BIN
SOURCE/Plugin/AML.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -45,13 +45,13 @@
<ScrollViewer>
<StackPanel MinWidth="200">
<TextBlock Margin="10,5" Style="{StaticResource Heading2}">
<Run Text="About the Modelling Wizard for Devices PlugIn!" />
<Run Text="About the Modelling Wizard for Devices Application!" />
</TextBlock>
<StackPanel Orientation="Horizontal">
<TextBlock
Width="400"
Margin="10,5"
Text="This Modelling Wizard for Devices PlugIn can be used to create or modify Devices and Interfaces. It can also be used to import IODD and GSDML Files which will be converted to an AMLX Package."
Text="This Modelling Wizard for Devices standalone application can be used to create or modify Devices and Interfaces. It can also be used to import IODD and GSDML Files which will be converted to an AMLX Package."
TextWrapping="Wrap" />
</StackPanel>
@ -90,9 +90,16 @@
<TextBlock Margin="15,0,0,0">
<Run FontWeight="Bold" Text="DHBW Stuttgart" />
</TextBlock>
<TextBlock Margin="15,0,0,0">
<Run Text="and" />
</TextBlock>
<TextBlock FontWeight="Bold" Margin="15,5,0,0" Text="TINF20C" />
<TextBlock Margin="15,0,0,0">
<Run FontWeight="Bold" Text="DHBW Stuttgart" />
</TextBlock>
<TextBlock Margin="15,5,0,10" Text="This Plugin was created as a group project in the class &quot;Software Engineering&quot;" />
<TextBlock Margin="15,5,0,10" Text="Later this plugin was developed as a sample tool that create vendor independent &#x0a;automation component, and included as part of Master Thesis &quot;" />
<TextBlock Margin="15,5,0,10" Text="Later this plugin was developed as a sample tool that create vendor independent &#x0a;automation component, and included as part of Master Thesis" />
<Border Margin="0,2,0,2" BorderThickness="0,2,0,0">
@ -110,8 +117,13 @@
<TextBlock
Margin="10,5,0,8"
Text="The MIT License (MIT)&#x0a;Copyright (c) 2021 TINF19C DHBW Stuttgart&#x0a;&#x0a;Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ('the Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: &#x0a;&#x0a; The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
Text="This project is licensed under the GPL 3.0 license"
TextWrapping="Wrap" />
<TextBlock
Margin="10,5,0,8"
TextWrapping="Wrap">
Visit our <Hyperlink NavigateUri="https://github.com/H4CK3R-01/TINF20C_ModellingWizard_Devices/blob/main/LICENSE" RequestNavigate="Hyperlink_RequestNavigate">GitHub-Repository</Hyperlink> to learn more about this.
</TextBlock>
<Border Margin="0,2,0,2" BorderThickness="0,2,0,0">
@ -124,7 +136,7 @@
</Border>
<TextBlock Margin="10,5,0,0" FontWeight="Bold">
© TINF19C DHBW Stuttgart 2021
© TINF20C DHBW Stuttgart 2022
<!-- Copyright symbol -->
</TextBlock>
@ -136,13 +148,9 @@
Name="TextBlock2WithHyperlink"
Margin="10,5,0,0"
TextWrapping="Wrap">
Visit <Hyperlink NavigateUri="https://github.com/DekaAthlos/TINF19C-ModellingWizard" RequestNavigate="Hyperlink_RequestNavigate">ModellingWizard</Hyperlink>
Visit <Hyperlink NavigateUri="https://github.com/H4CK3R-01/TINF20C_ModellingWizard_Devices" RequestNavigate="Hyperlink_RequestNavigate">ModellingWizard</Hyperlink>
on GitHub to get more informations about this project.</TextBlock>
</StackPanel>
<Border BorderBrush="Gray" BorderThickness="0,0,0,0" Width="491" Height="45">

View File

@ -1,7 +1,6 @@

using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
namespace Aml.Editor.Plugin
@ -18,7 +17,7 @@ namespace Aml.Editor.Plugin
var assembly = Assembly.GetCallingAssembly();
txtVersion.Text = "Version "+ assembly.GetName().Version.ToString();
txtVersion.Text = "Version " + assembly.GetName().Version.ToString();
}

View File

@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Aml.Editor.Plugin.Properties;
using System.IO;
using Aml.Editor.Plugin.Properties;
using System;
using System.Drawing;
using System.Web;
using System.Net;
using System.IO;
using System.Windows.Forms;
namespace Aml.Editor.Plugin
{
@ -31,7 +25,7 @@ namespace Aml.Editor.Plugin
}
// Method for window size maximum and minimum
public void WindowSizeChanger(Panel panelNumber,Button buttonNumber)
public void WindowSizeChanger(Panel panelNumber, Button buttonNumber)
{
PanelNumber = panelNumber;
ButtonNumber = buttonNumber;
@ -99,14 +93,14 @@ namespace Aml.Editor.Plugin
string mainUrl = "https://cdd.iec.ch/CDD/IEC62683/iec62683.nsf/PropertiesAllVersions/0112-2---62683%23";
string lastUrl = "?OpenDocument";
string midUrl = btnText.Substring(15);
string finalUrl = mainUrl +midUrl+ lastUrl;
string finalUrl = mainUrl + midUrl + lastUrl;
System.Diagnostics.Process.Start(finalUrl);
}
// Open Dialog Box related method that takes parmeters of textbox name and the picture box number.
public void OpenFileDialog(TextBox textboxName,PictureBox pictureBoxNumber)
public void OpenFileDialog(TextBox textboxName, PictureBox pictureBoxNumber)
{
TextboxName = textboxName;
PictureboxNumber = pictureBoxNumber;
@ -136,7 +130,7 @@ namespace Aml.Editor.Plugin
}
// this method dispaly all hidden buttons with the Refsemantic Id in them.
public void DispalySemanticBtn(Button refSemanticBtn, DataGridView dataGrids,string word)
public void DispalySemanticBtn(Button refSemanticBtn, DataGridView dataGrids, string word)
{
words = word;
DisplayBtn = refSemanticBtn;

View File

@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Windows.Forms;
using System.Drawing;
using System.Windows.Forms;
namespace Aml.Editor.Plugin
{
@ -27,7 +24,7 @@ namespace Aml.Editor.Plugin
return AMLAttributeParameters;
}
public void CreateDataTableWithColumns( DataTable dataRowName, DataGridView dataGridViewName,
public void CreateDataTableWithColumns(DataTable dataRowName, DataGridView dataGridViewName,
KeyValuePair<string, List<List<ClassOfListsFromReferencefile>>> pair)
{
KeyValuePair<string, List<List<ClassOfListsFromReferencefile>>> Pair = pair;

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aml.Editor.Plugin
namespace Aml.Editor.Plugin
{
class ClassOfListsFromDataGridViews
{

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aml.Engine.AmlObjects;
using Aml.Engine.CAEX;
using Aml.Engine.CAEX;
namespace Aml.Editor.Plugin
{
@ -61,8 +55,8 @@ namespace Aml.Editor.Plugin
public override string ToString()
{
return "ClassOfListsFromReferencefile("+Name+"="+Value+"="+Default+"="+Unit+"="+Reference+"="
+Description+"="+CopyRight+"="+Semantic+"="+AttributePath+ "=" + RefBaseClassPath + "=" + ID
return "ClassOfListsFromReferencefile(" + Name + "=" + Value + "=" + Default + "=" + Unit + "=" + Reference + "="
+ Description + "=" + CopyRight + "=" + Semantic + "=" + AttributePath + "=" + RefBaseClassPath + "=" + ID
+ "=" + ReferencedClassName + "=" + RefSemanticList + "=" + SupportesRoleClassType + "=" + DataType + ")";
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -123,54 +123,6 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>265, 17</value>
</metadata>
<metadata name="toolStrip5.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>273, 146</value>
</metadata>
<metadata name="deleteRoleClassesButton.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 80</value>
</metadata>
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1330, 103</value>
</metadata>
<metadata name="toolStrip24.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1066, 103</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn24.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn25.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn26.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn27.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn28.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn29.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn24.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn25.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn26.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn27.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn28.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn29.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="imageList2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>278, 103</value>
</metadata>
@ -179,7 +131,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD6
DAAAAk1TRnQBSQFMAgEBAwEAAcgBAwHIAQMBHAEAARwBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DAAAAk1TRnQBSQFMAgEBAwEAAaABBAGgAQQBHAEAARwBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABcAMAARwDAAEBAQABCAUAAUABDBgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
@ -252,23 +204,8 @@
<metadata name="dataGridViewCheckBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn31.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn32.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="loadfromLibrary.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="loadFromComponentFile.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewCheckBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="deleteRoleClassesButton.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 80</value>
<value>853, 146</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="deleteRoleClassButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -286,24 +223,27 @@
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="dataGridViewTextBoxColumn17.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="dataGridViewTextBoxColumn24.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn18.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="dataGridViewTextBoxColumn25.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn19.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="dataGridViewTextBoxColumn26.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn20.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="dataGridViewTextBoxColumn27.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn21.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="dataGridViewTextBoxColumn28.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn22.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="dataGridViewTextBoxColumn29.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="toolStrip5.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1038, 146</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn17.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -322,20 +262,8 @@
<metadata name="dataGridViewTextBoxColumn22.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SerialNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SelectedClassorInterface.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="libraryFile.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="componentFile.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewCheckBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1330, 103</value>
</metadata>
<metadata name="SerialNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
@ -370,18 +298,6 @@
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="toolStrip19.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1179, 60</value>
</metadata>
<metadata name="ElementName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FilePath.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Add.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ElementName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -412,9 +328,6 @@
<metadata name="toolStrip13.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>729, 60</value>
</metadata>
<metadata name="toolStrip13.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>729, 60</value>
</metadata>
<data name="addRole.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
@ -423,12 +336,6 @@
RgtnViTyCJEC4UCoEdfIj94AAAAASUVORK5CYII=
</value>
</data>
<metadata name="toolStrip7.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1311, 60</value>
</metadata>
<metadata name="toolStrip9.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1435, 60</value>
</metadata>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>149, 103</value>
</metadata>
@ -437,7 +344,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABC
DQAAAk1TRnQBSQFMAgEBAwEAAcgBAwHIAQMBHAEAARwBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DQAAAk1TRnQBSQFMAgEBAwEAAaABBAGgAQQBHAEAARwBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABcAMAARwDAAEBAQABCAUAAUABDBgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
@ -510,7 +417,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC4
CQAAAk1TRnQBSQFMAgEBAgEAAcABAwHAAQMBGQEAARkBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CQAAAk1TRnQBSQFMAgEBAgEAAZgBBAGYAQQBGQEAARkBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABZAMAARkDAAEBAQABCAUAAcQBCRgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
@ -565,7 +472,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAA
CAAAAk1TRnQBSQFMAwEBAAHIAQMByAEDARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
CAAAAk1TRnQBSQFMAwEBAAGgAQQBoAEEARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm

View File

@ -28,12 +28,9 @@ namespace Aml.Editor.Plugin
/// <summary>
/// Init the controller and reload all amlx devices
/// </summary>
/// <param name="modellingWizard"></param>
public MWController(ModellingWizard modellingWizard)
public MWController()
{
this.modellingWizard = modellingWizard;
mWData = new MWData(this);
}
/// <summary>
@ -59,14 +56,14 @@ namespace Aml.Editor.Plugin
/// <param name="newDevice"></param>
/// <param name="isEdit"></param>
/// <returns></returns>
public String CreateDeviceOnClick(MWDevice newDevice, bool isEdit)
public String CreateDeviceOnClick(MWDevice newDevice, bool isEdit, bool useCaex2_15)
{
string result = "";
if (newDevice.deviceName != null && newDevice.vendorName != null)
{
// create the device
result = mWData.CreateDevice(newDevice, isEdit);
result = mWData.CreateDevice(newDevice, isEdit, useCaex2_15);
}
// update the device list
@ -101,6 +98,7 @@ namespace Aml.Editor.Plugin
/// <param name="targetGUI">the GUI Type to display</param>
public void ChangeGui(MWGUIType targetGUI)
{
// TODO modellingWizard is null
switch (targetGUI)
{

View File

@ -7,7 +7,6 @@ using System.IO.Packaging;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace Aml.Editor.Plugin
{
@ -56,49 +55,32 @@ namespace Aml.Editor.Plugin
/// <param name="device">The device which will be created</param>
/// <param name="isEdit">true if an amlx file get update, false if a new file will be created</param>
/// <returns></returns>
public string CreateDevice(MWDevice device, bool isEdit)
public string CreateDevice(MWDevice device, bool isEdit, bool useCaex2_15)
{
CAEXDocument document = null;
CAEXDocument document;
AutomationMLContainer amlx = null;
// Init final .amlx Filepath
//first of all create a folder on "Vendor Name"
string vendorCompanyName = device.vendorName;
string amlFilePath;
string fileName = device.fileName;
if (fileName.Contains(".amlx"))
{
amlFilePath = System.IO.Path.Combine(device.filepath, fileName);
}
else
{
amlFilePath = System.IO.Path.Combine(device.filepath, fileName + ".amlx");
}
amlFilePath = fileName.Contains(".amlx") ? Path.Combine(device.filepath, fileName) : Path.Combine(device.filepath, fileName + ".amlx");
FileInfo file = new FileInfo(amlFilePath);
// Create directory if it's not existing
file.Directory.Create();
// Init CAEX Document
if (isEdit)
{
// Load the amlx file
amlx = new AutomationMLContainer(amlFilePath, FileMode.Open);
amlx = new AutomationMLContainer(amlFilePath, FileMode.OpenOrCreate);
IEnumerable<PackagePart> rootParts = amlx.GetPartsByRelationShipType(AutomationMLContainer.RelationshipType.Root);
// We expect the aml to only have one root part
if (rootParts.First() != null)
if (rootParts.Count() != 0 && rootParts.First() != null)
{
PackagePart part = rootParts.First();
@ -108,30 +90,29 @@ namespace Aml.Editor.Plugin
else
{
// the amlx contains no aml file
document = CAEXDocument.New_CAEXDocument();
if (useCaex2_15) document = CAEXDocument.New_CAEXDocument(CAEXDocument.CAEXSchema.CAEX2_15);
else document = CAEXDocument.New_CAEXDocument(CAEXDocument.CAEXSchema.CAEX3_0);
}
}
else
{
// create a new CAEX document
document = CAEXDocument.New_CAEXDocument();
if (useCaex2_15) document = CAEXDocument.New_CAEXDocument(CAEXDocument.CAEXSchema.CAEX2_15);
else document = CAEXDocument.New_CAEXDocument(CAEXDocument.CAEXSchema.CAEX3_0);
try
{
amlx = new AutomationMLContainer(amlFilePath, FileMode.Create);
amlx = new AutomationMLContainer(amlFilePath, FileMode.OpenOrCreate);
}
catch (Exception)
{
Console.WriteLine("Failed to create AutomationMLContainer object");
}
}
// Init the default Libs
AutomationMLBaseRoleClassLibType.RoleClassLib(document) ;
AutomationMLInterfaceClassLibType.InterfaceClassLib(document) ;
AutomationMLBaseRoleClassLibType.RoleClassLib(document);
AutomationMLInterfaceClassLibType.InterfaceClassLib(document);
var structureRoleFamilyType = AutomationMLBaseRoleClassLibType.RoleClassLib(document).Structure;
@ -153,15 +134,9 @@ namespace Aml.Editor.Plugin
}
else
{
Boolean myBool;
Boolean.TryParse(eachparameter.AddToFile, out myBool);
if (myBool == true)
{
}
Uri eachUri = null;
AttachablesDataGridViewParameters par = new AttachablesDataGridViewParameters();
eachUri = createPictureRef(eachparameter.FilePath, eachparameter.ElementName.ToString(), "ExternalDataConnector", systemUnitClass);
@ -169,14 +144,11 @@ namespace Aml.Editor.Plugin
par.FilePath = eachparameter.FilePath;
device.listWithURIConvertedToString.Add(par);
}
}
foreach (var pair in device.DictionaryForRoleClassofComponent)
{
Match numberfromElectricalConnectorType = Regex.Match(pair.Key.ToString(), @"\((\d+)\)");
string initialnumberbetweenparanthesisofElectricalConnectorType =
numberfromElectricalConnectorType.Groups[1].Value;
@ -286,8 +258,6 @@ namespace Aml.Editor.Plugin
SRC.RefRoleClassPath = item.SupportesRoleClassType;
}
}
}
@ -328,15 +298,14 @@ namespace Aml.Editor.Plugin
foundSysClassLib = true;
}
}
if (!foundSysClassLib)
systemUnitClass = document.CAEXFile.SystemUnitClassLib.Append("ComponentSystemUnitClassLib").SystemUnitClass.Append(device.deviceName);
if (!foundSysClassLib) systemUnitClass = document.CAEXFile.SystemUnitClassLib.Append("ComponentSystemUnitClassLib").SystemUnitClass.Append(device.deviceName);
}
// Create the internalElement Interfaces
if (device.vendorName != null)
{
InternalElementType electricalInterface = null;
RoleRequirementsType roleRequirements = null ;
RoleRequirementsType roleRequirements = null;
foreach (var internalElement in systemUnitClass.InternalElement)
{
if (internalElement.Name.Equals("Interfaces"))
@ -459,9 +428,6 @@ namespace Aml.Editor.Plugin
electricalConnectorType.RefBaseClassPath = item.RefBaseClassPath;
}
}
}
@ -473,10 +439,7 @@ namespace Aml.Editor.Plugin
string electricalConnectorPinName = Regex.Replace(pairofList.Key.ToString(), @"\(.*?\)", "");
electricalConnectorPinName = Regex.Replace(electricalConnectorPinName, @"\{.*?\}", "");
electricalConnectorPinName = electricalConnectorPinName.Replace(electricalConnectorTypeName,"");
electricalConnectorPinName = electricalConnectorPinName.Replace(electricalConnectorTypeName, "");
if (initialnumberbetweenparanthesisofElectricalConnectorType == initialnumberbetweenparanthesisElectricalConnectorPins)
{
@ -626,14 +589,7 @@ namespace Aml.Editor.Plugin
amlx.Save();
amlx.Close();
if (isEdit)
{
return "Sucessfully updated device!\nFilepath " + amlFilePath;
}
else
{
return "Device description file created!\nFilepath " + amlFilePath;
}
return isEdit ? "Sucessfully updated device!\nFilepath " + amlFilePath : "Device description file created!\nFilepath " + amlFilePath;
}
@ -895,7 +851,7 @@ namespace Aml.Editor.Plugin
// Load Libary .dll
Assembly assembly = Assembly.Load("Iodd2AmlConverter.Library");
Assembly assembly = Assembly.Load(File.ReadAllBytes("Dd2Aml.Lib.dll"));
Type conversionHandler = null;
// Iterate over all Types in the Libary and get the ConversionHandler Type
foreach (Type type in assembly.ExportedTypes)
@ -946,7 +902,7 @@ namespace Aml.Editor.Plugin
// If it is, then it's calling the Convert Function
// Gsd2Aml.Lib.Converter.Convert(string inputFilepath, bool strictValidation)
Assembly assembly = Assembly.Load("Gsd2Aml.Lib");
Assembly assembly = Assembly.Load(File.ReadAllBytes("Gsd2Aml.Lib.dll"));
Type conversionHandler = null;
// Iterate over all Types in the Libary and get the ConversionHandler Type
foreach (Type type in assembly.ExportedTypes)
@ -1000,6 +956,7 @@ namespace Aml.Editor.Plugin
byte[] bytearray = System.Text.Encoding.Unicode.GetBytes(caex);
CAEXDocument document = CAEXDocument.LoadFromBinary(bytearray);
// create the amlx file
string name = Path.GetFileNameWithoutExtension(filename);
@ -1045,7 +1002,7 @@ namespace Aml.Editor.Plugin
// Just as an interface
}
public void copyFiles(string sourceFilePath, string destinationFilePath )
public void copyFiles(string sourceFilePath, string destinationFilePath)
{
string sourFile = Path.GetFileName(sourceFilePath);
string destFile = Path.Combine(destinationFilePath, sourFile);

View File

@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aml.Editor.Plugin
{
// this class initialize the parameters exclusively for the "Device Identofication", "DataGridViews in "Generic Data Tab" AND "Field Attachables Tab""
public class MWDevice: MWData.MWObject
public class MWDevice : MWData.MWObject
{
public string environment { get; set; }
public string fileName { get; set; }
@ -103,7 +100,7 @@ namespace Aml.Editor.Plugin
}
public ElectricalParameters(string connector, string connectorCode, string connectorType,string pins,string lis)
public ElectricalParameters(string connector, string connectorCode, string connectorType, string pins, string lis)
{
this.Connector = connector;
@ -124,7 +121,7 @@ namespace Aml.Editor.Plugin
public override string ToString()
{
return "ElectricalParameters(" + Connector + "=" + ConnectorCode + "=" + ConnectorType + "="+Pins+")";
return "ElectricalParameters(" + Connector + "=" + ConnectorCode + "=" + ConnectorType + "=" + Pins + ")";
}
}
@ -152,7 +149,7 @@ namespace Aml.Editor.Plugin
}
public override string ToString()
{
return "ElectricalParametersInElectricalDataDataGridView("+ ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")";
return "ElectricalParametersInElectricalDataDataGridView(" + ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")";
}
}
@ -168,7 +165,7 @@ namespace Aml.Editor.Plugin
{
}
public PinParametersInPinInfoDataGridView(string pinNumber,string referenceID, string attribute, string values, string units)
public PinParametersInPinInfoDataGridView(string pinNumber, string referenceID, string attribute, string values, string units)
{
this.PinNumber = pinNumber;
this.ReferenceID = referenceID;
@ -179,7 +176,7 @@ namespace Aml.Editor.Plugin
}
public override string ToString()
{
return "PinParametersInPinInfoDataGridView(" +PinNumber+"="+ ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")";
return "PinParametersInPinInfoDataGridView(" + PinNumber + "=" + ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")";
}
}
@ -202,7 +199,7 @@ namespace Aml.Editor.Plugin
}
public override string ToString()
{
return "AttachablesDataGridViewParameters(" + ElementName + "=" + FilePath +"="+ AddToFile + ")";
return "AttachablesDataGridViewParameters(" + ElementName + "=" + FilePath + "=" + AddToFile + ")";
}
}

View File

@ -32,7 +32,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\TINF20C_ModellingWizard_Devices\SOURCE\bin\Release\</OutputPath>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@ -179,6 +179,7 @@
<ItemGroup>
<EmbeddedResource Include="DeviceDescription.resx">
<DependentUpon>DeviceDescription.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
@ -230,15 +231,6 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<COMReference Include="Microsoft.Vbe.Interop.Forms">
<Guid>{0D452EE1-E08F-101A-852E-02608C4D0BB4}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>

View File

@ -28,7 +28,7 @@ namespace Aml.Editor.Plugin
public ModellingWizard()
{
mWController = new MWController(this);
mWController = new MWController();
// Defines the Command list, which will contain user commands, which a user can select
// via the PlugIn Menu.

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
@ -10,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("DHBW-Stuttgart")]
[assembly: AssemblyProduct("ModellingWizard")]
[assembly: AssemblyCopyright("Copyright © DHBW-Stuttgart TINF19C")]
[assembly: AssemblyCopyright("Copyright © DHBW-Stuttgart TINF20C")]
[assembly: AssemblyTrademark("ModellingWizard")]
[assembly: AssemblyCulture("")]

View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Aml.Editor.Plugin.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>

214
SOURCE/Plugin/README.md Normal file
View File

@ -0,0 +1,214 @@
# Gsd2Aml.Lib
Welcome to the Gsd2Aml.Lib! This library was developed as a student project by (in alphabetical order)
1. Nico Dietz
2. Steffen Gerdes
3. Constantin Ruhdorfer
4. Jonas Komarek
5. Phuc Quang Vu
6. Michael Weidmann
at [Cooperate State University Stuttgart](https://www.dhbw-stuttgart.de/home/).
This project is distributed via:
1. [GitHub](https://github.com/TINF17C/GSD2AML-Converter)
2. [NuGet](https://www.nuget.org/packages/Gsd2Aml.Lib)
We can be found as a [GitHub Team](https://github.com/orgs/TINF17C/teams/gsd2aml).
## About this project
This library converts a Profinet (PN-)GSD file to AutomationML.
The library can either
1. return a string containing the AutomatonML content.
2. convert the GSD file to an .aml file and package that, including all its dependencies, into an .amlx package. This process uses the [AML.Engine](https://www.nuget.org/packages/Aml.Engine).
## Contributing to this project
Contributions are always welcome!
If you want to contribute feel free to fork this repo and later perform a pull request.
## File structure
The relevant files and folders are listed here.
### Logging/
Contains the logging service.
### Models/
Contains the classes representing AML and GSD.
Also contains the used XSD files.
### Properties/
Contains the assembly info.
### Compressor.cs
Contains all the logic that is required to:
1. Create a temporary folder
2. Find files and copy them to this folder
3. Uses the AML.Engine to build the .amlx package
### Converter.cs
Contains all the logic that traverses the GSD file and uses the rulesset file to translate the GSD file to AML.
### Util.cs
Contains the utility functionality.
### gsd2aml.xml
This is the rulesset file.
Please have a look below.
## GSD2AML Rules
The rules for conversion are written in XML and are listed here.
### Tables of Content
1. [Structure](#structure)
2. [References](#references)
3. [Reference Types](#reference_types)
4. [GUID](#guid)
5. [The Rule Element](#rule_element)
### <a name="structure"></a>Structure
This section will explain the structure of a gsd2aml rulesset file.
The gsd2aml file will consist of one, and only one, element, the `<Body>`. Each seperate rule shall be direct child of this element.
A rule must start with the GSD element, which is to be replaced. It must have a child `<Replacement>` describing the corresponding XML-structure of the AML replacement.
```xml
<ProfileBody>
<Replacement>
<SystemUnitClassLib Name="ComponentSystemUnitClassLib">
<Version>1.0.0</Version>
</SystemUnitClassLib>
</Replacement>
</ProfileBody>
```
Additionally a rule can also have any number of `<Reference>` childs. References will be explained in the following section.
### <a name="references"></a>References
#### <a name="references-normal_references"></a>Normal Reference
It may not be possible to replace a GSD element with a static replacements. Let's look at this example:
```xml
<SubslotItem SubslotNumber="32768" TextId="TOK_Subslot_8000" />
```
This element has a attribute "SubslotNumber". In order to transform this element to AML the attribute "SubslotNumber" should be converted into an `Attribute`, `<Value>` pair.
```xml
<ExternalInterface Name="" ID="">
<Attribute Name="SubslotNumber" AttributeDataType="xs:integer">
<Value></Value>
</Attribute>
</ExternalInterface>
```
Unfortunately the converter itself cannot figure out where this information is located. A referece, signaled by a `$` followed by an identifier like `$1`, is necessary.
The conversion rule for "SubslotItem" may look like this:
```xml
<SubslotItem>
<Replacement>
<ExternalInterface Name="" ID="">
<Attribute Name="SubslotNumber" AttriubteDataType="xs:integer">
<Value>$1<Value>
</Attribute>
</ExternalInterface>
</Replacement>
<Reference Ref="$1">
<ISO15745Profile.ProfileBody.ApplicationProcess.DeviceAccessPointList.DeviceAccessPointItem.SlotList.SlotItem SubslotNumber="" />
</Reference>
</SubslotItem>
```
Every reference within the replacement element shall have a corresponding reference element. This element must have the attribute `Ref=""` with the identifier. There are different [types](#reference_types) of references. These will be explained later. The content of the reference shall be a the location of the referenced value. A reference only has one child. The child is the full qualified path to the referenced element in a point sepearted list without whitespace.
The element shall have one attribute, which shall be the same attribute that is being referenced. If the attribute exists, its value will be the return value.
#### <a name="references-true_references"></a>True Reference
You may have noticed that the example above never resolved the GSD attribute TextId of the "SubslotItem" element. This is because the TextId attribute in itself is also a reference within the GSD file and as such must be handled differently. To differentiate this case from a normal reference, it shall be named "true reference".
A true reference within an GSD file will always reference another element within a "List", that has the attribute `ID` or other identifying attribute like `TextId`.
These references must be handled differently by the GSD2AML Converter. The converter will know of the different "reference lists" (such as `ExternalTextList`) and their location within the GSD. The converter merely needs to know which list to look in and the corresponding id. Therefore each list will receive its own "type" which can be used as an attribute of the reference element. The other way around, this means that the converter __cannot__ handle true references of lists that the converter does not know.
Consider the example from above. `TextId=TOK_Subslot_8000` signifies that this attribute references an element within a text list with the id `TOK_Subslot_8000`.
```xml
<SubslotItem>
<Replacement>
<ExternalInterface Name="$1" ID="GUID" RefBaseClassPath="physicalEndPoint/SubSlot">
<Attribute Name="SubslotNumber" AttributeDataType="xs:integer">
<Value>$2</Value>
</Attribute>
</ExternalInterface>
</Replacement>
<Reference Ref="$1" Type="TextRef">
<ISO15745Profile.ProfileBody.ApplicationProcess.DeviceAccessPointList.DeviceAccessPointItem.SlotList.SlotItem TextId="" />
</Reference>
<Reference Ref="$2">
<ISO15745Profile.ProfileBody.ApplicationProcess.DeviceAccessPointList.DeviceAccessPointItem.SlotList.SlotItem SubslotNumber="" />
</Reference>
</SubslotItem>
```
The type `TextRef` will tell the converter to search under `ExternalTextList/PrimaryLanguage`. The content of a true reference is the location of the corresponding id.
Other languages will be ignored.
### <a name="reference_types"></a>Reference Types
This section will list the different reference types and their uses.
#### <a name="reference_types-Normal-Ref></a>Normal Ref
No type is specified. The refernced value will be used.
#### <a name="reference_types-TextRef"></a>TextRef
A `TextRef` is a true reference. Within the GSD it will reference an element within `<ExternalTextList>`. As the name suggest it will only return a single text. It will only over use the `<PrimaryLanguage>`. The location of the reference __id__ used in the GSD will be given as content of the reference.
#### <a name="reference_types-graphicref"></a>GraphicRef
A `GraphicRef` is a true reference. Within the GSD it will reference an element within `GraphicsList`. The location of the reference __id__ used in the GSD will be given as content of the reference.
#### <a name="special_reference_types"></a>RelGsdFilePath
`RelGsdFilePath` returns a relative path to the original GSD file.
### <a name="guid"></a>GUID
Every time the converters reads the string `GUID`, it will be replaced with a real GUID.
### <a name="rule_element"></a> The Rule Element
In order to maintain modularity while also providing a way to define the structure of the result aml in terms of parent-child relationships, a `<Rule></Rule>` element is introduced.
The content of the `<Rule></Rule>` tag shall be a full a string consisting of the relative path from the parent rule element to the GSD element, which should be placed here.
That path shall a rule of its own and a child of the `<Body>` element.
Example:
```xml
<InternalElement CAEXObject.Name="LogicalInterface" CAEXObject.ID="GUID">
<SystemUnitClassType.InternalElement>
<Rule>
ProfileBody.ApplicationProcess.DeviceAccessPointList.DeviceAccessPointItem.SystemDefinedSubmoduleList.InterfaceSubmoduleItem
</Rule>
</SystemUnitClassType.InternalElement>
</InternalElement>
<ProfileBody.ApplicationProcess.DeviceAccessPointList.DeviceAccessPointItem.SystemDefinedSubmoduleList.InterfaceSubmoduleItem>
...
</ProfileBody.ApplicationProcess.DeviceAccessPointList.DeviceAccessPointItem.SystemDefinedSubmoduleList.InterfaceSubmoduleItem>
```

View File

@ -1,9 +1,6 @@
using System;
using Aml.Engine.CAEX;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aml.Engine.CAEX;
namespace Aml.Editor.Plugin
{
@ -30,7 +27,7 @@ namespace Aml.Editor.Plugin
foreach (var attribute in externalInterface.Attribute)
{
StoreEachAttributeValueInListOfExternalIterface(i, attributelist, attribute, externalInterface);
CkeckForNestedAttributesOfExternalIterface(i,attribute, externalInterface);
CkeckForNestedAttributesOfExternalIterface(i, attribute, externalInterface);
}
@ -43,7 +40,7 @@ namespace Aml.Editor.Plugin
list.Add(sublist);
try
{
if (DictionaryofElectricalConnectorType.ContainsKey( "("+i+")"+ externalInterface.Name.ToString()+ "{" + "Class:" + " " + externalInterface.BaseClass + "}"))
if (DictionaryofElectricalConnectorType.ContainsKey("(" + i + ")" + externalInterface.Name.ToString() + "{" + "Class:" + " " + externalInterface.BaseClass + "}"))
{
DictionaryofElectricalConnectorType["(" + i + ")" + externalInterface.Name.ToString()
+ "{" + "Class:" + " " + externalInterface.BaseClass + "}"].AddRange(list);
@ -73,7 +70,7 @@ namespace Aml.Editor.Plugin
foreach (var attributeinattribute in attributeType.Attribute)
{
StoreEachAttributeValueInListOfExternalIterface(i, attributelist, attributeinattribute, attributeType, externalInterface);
CkeckForNestedAttributesOfExternalIterface(i,attributeinattribute, externalInterface);
CkeckForNestedAttributesOfExternalIterface(i, attributeinattribute, externalInterface);
}
@ -369,7 +366,7 @@ namespace Aml.Editor.Plugin
list.Add(sublist);
try
{
if (DictionaryofRolesforAutomationComponenet.ContainsKey("(" + i + ")" + supportedRoleClass.RoleReference.ToString() ))
if (DictionaryofRolesforAutomationComponenet.ContainsKey("(" + i + ")" + supportedRoleClass.RoleReference.ToString()))
{
DictionaryofRolesforAutomationComponenet["(" + i + ")" + supportedRoleClass.RoleReference.ToString()].AddRange(list);
}

View File

@ -1,18 +1,8 @@
using System;
using Aml.Engine.CAEX;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
using Aml.Engine.AmlObjects;
using Aml.Engine.CAEX;
using System.IO;
using System.IO.Packaging;
using System.Xml;
using System.Collections;
using System.IO.Compression;
using Aml.Editor.Plugin.Contracts;
namespace Aml.Editor.Plugin
{
@ -191,7 +181,7 @@ namespace Aml.Editor.Plugin
list.Add(sublist);
try
{
if (DictionaryForInterfaceClassInstancesAttributes.ContainsKey(classType.Name.ToString()+"{"+ "Class:" + " " +classType.ReferencedClassName+"}"))
if (DictionaryForInterfaceClassInstancesAttributes.ContainsKey(classType.Name.ToString() + "{" + "Class:" + " " + classType.ReferencedClassName + "}"))
{
DictionaryForInterfaceClassInstancesAttributes[classType.Name.ToString() + "{" + "Class:" + " " + classType.ReferencedClassName + "}"].AddRange(list);
}
@ -1775,7 +1765,7 @@ namespace Aml.Editor.Plugin
foreach (var externalinterfaces in item.ExternalInterface)
{
TreeNode externalinterafcenode;
if (externalinterfaces.BaseClass != null && externalinterfaces.BaseClass.ToString() != externalinterfaces.Name.ToString() )
if (externalinterfaces.BaseClass != null && externalinterfaces.BaseClass.ToString() != externalinterfaces.Name.ToString())
{
referencedClassName = externalinterfaces.BaseClass.ToString();
externalinterafcenode = newnode.Nodes.Add(externalinterfaces.ToString(), externalinterfaces.ToString() + "{" + "Class:" + " " + referencedClassName + "}", 2);
@ -1835,7 +1825,7 @@ namespace Aml.Editor.Plugin
foreach (var externalinterfaces in item.ExternalInterface)
{
TreeNode externalinterafcenode;
if (externalinterfaces.BaseClass!= null)
if (externalinterfaces.BaseClass != null)
{
referencedclassName = externalinterfaces.BaseClass.ToString();
@ -1852,7 +1842,7 @@ namespace Aml.Editor.Plugin
}
PrintExternalInterfaceNodes(document,externalinterafcenode, externalinterfaces, classType);
PrintExternalInterfaceNodes(document, externalinterafcenode, externalinterfaces, classType);
}
}
@ -1865,7 +1855,7 @@ namespace Aml.Editor.Plugin
/// </summary>
/// <param name="oParentNode"></param>
/// <param name="classType"></param>
public void PrintExternalInterfaceNodes(CAEXDocument document,TreeNode oParentNode, ExternalInterfaceType classType, InterfaceFamilyType InterafceclassType)
public void PrintExternalInterfaceNodes(CAEXDocument document, TreeNode oParentNode, ExternalInterfaceType classType, InterfaceFamilyType InterafceclassType)
{
if (classType.ExternalInterface.Exists)
{
@ -1873,7 +1863,7 @@ namespace Aml.Editor.Plugin
foreach (var item in classType.ExternalInterface)
{
TreeNode newnode;
if (item.BaseClass!= null)
if (item.BaseClass != null)
{
referencedClassName = item.BaseClass.ToString();
newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString() + "{" + "Class:" + " " + referencedClassName + "}", 2);
@ -1883,7 +1873,7 @@ namespace Aml.Editor.Plugin
}
else
{
newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString() , 2);
newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString(), 2);
newnode.ForeColor = SystemColors.GrayText;
}

View File

@ -10,3 +10,5 @@ Um Änderungen an der Anwendung vorzunehmen muss zuerst Visual Studio 2019 insta
In Visual Studio 2019 muss dann die Datei `Application.sln` aus dem `Application`-Ordner geöffnet werden.
In der Projektmappen-Ansicht ist dann zum einen die Applikation als auch das Plugin (ModellingWizard) zu sehen.
Um die Anwendung kompilieren zu können, muss über den NuGet-Paketmanager eventuel noch das `AML.Engine`-Paket in der Version 1.5.8 installiert werden.