27 Commits
v0.1 ... v0.3

Author SHA1 Message Date
Florian Kaiser
15472d43ee Merge pull request #23 from H4CK3R-01/app-source-code
App source code
2022-05-05 18:32:37 +02:00
f6f7fd7d05 Check length of IEnumerable 2022-05-05 18:19:42 +02:00
Cyber-Luke
efb98dc541 Create readme.md 2022-04-29 16:46:25 +02:00
Cyber-Luke
3fc4b4a09e Delete MOD.003 Runtime 2022-04-29 16:45:57 +02:00
Cyber-Luke
13f83cb4bc Create MOD.003 Runtime 2022-04-29 16:45:44 +02:00
Cyber-Luke
cdbc2684d7 Add files via upload 2022-04-29 16:43:59 +02:00
Cyber-Luke
09c8c7ce78 Create readme.md 2022-04-29 16:43:27 +02:00
Cyber-Luke
13024c77e1 Add files via upload 2022-04-29 15:59:47 +02:00
Cyber-Luke
a75070edc3 Create readme.md 2022-04-29 15:57:49 +02:00
Cyber-Luke
def947cef3 Delete PROJECT/MODS directory 2022-04-29 15:56:08 +02:00
Cyber-Luke
a0256bc505 Create readme.md 2022-04-29 15:54:48 +02:00
Cyber-Luke
b85a540ec2 Add files via upload 2022-04-29 13:19:06 +02:00
Rripped
17af206a67 Small PM Corrections 2022-04-28 09:59:01 +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
malte.horst
47d2ba67fc added STR 2022-04-24 11:46:10 +02:00
malte.horst
3a06c1e90a added STP and STR 2022-04-24 11:45:23 +02:00
mhorst00
f3f5dbae3a Add files via upload 2022-04-24 11:39:10 +02:00
mhorst00
5b5f9acbef Delete TINF20C_STP_Team_1.pdf 2022-04-24 11:37:58 +02:00
mhorst00
9873362105 Add files via upload 2022-04-24 11:37:21 +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
Rripped
cfc90dd9ea added STP 0.1 2022-03-11 11:27:04 +01:00
Rripped
b36a8fc4ca Delete STP directory 2022-03-11 11:26:32 +01:00
Rripped
fdcd7a0d6a Create README.md 2022-03-11 11:26:07 +01:00
Rripped
76a6455c0e Added STP 0.1 2022-03-11 11:25:13 +01:00
Rripped
7b308b9283 Create README.md 2022-03-11 11:24:31 +01:00
20 changed files with 97 additions and 96 deletions

View File

@@ -0,0 +1 @@
MOD.001 Graphical User Interface (GUI)

View File

@@ -0,0 +1 @@
MOD.002 Controller

View File

@@ -0,0 +1 @@
MOD.003 Runtime

Binary file not shown.

Binary file not shown.

1
PROJECT/STP/README.md Normal file
View File

@@ -0,0 +1 @@
Link to Wiki: [Systemtestplan]()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

@@ -55,8 +55,9 @@ namespace Aml.Editor.Plugin
this.automationComponentLibraryv100FullCAEX3BETAToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.electricConnectorLibraryv100ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.industrialSensorLibraryv100ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.advancedModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.caexVersionFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpButton = new System.Windows.Forms.ToolStripDropDownButton();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.manualToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -293,7 +294,7 @@ namespace Aml.Editor.Plugin
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileButton,
this.librariesSplitButton,
this.viewToolStripMenuItem,
this.optionsToolStripMenuItem,
this.helpButton,
this.vendorNameTextBox,
this.filePathLabel,
@@ -441,21 +442,29 @@ namespace Aml.Editor.Plugin
this.industrialSensorLibraryv100ToolStripMenuItem.Text = "IndustrialSensorLibrary_v1_0_0";
this.industrialSensorLibraryv100ToolStripMenuItem.Click += new System.EventHandler(this.industrialSensorLibraryv100ToolStripMenuItem_Click);
//
// viewToolStripMenuItem
// optionsToolStripMenuItem
//
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.advancedModeToolStripMenuItem});
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 23);
this.viewToolStripMenuItem.Text = "View";
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.advancedModeToolStripMenuItem,
this.caexVersionFileToolStripMenuItem});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 23);
this.optionsToolStripMenuItem.Text = "Options";
//
// advancedModeToolStripMenuItem
//
this.advancedModeToolStripMenuItem.Name = "advancedModeToolStripMenuItem";
this.advancedModeToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
this.advancedModeToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
this.advancedModeToolStripMenuItem.Text = "Advanced Mode";
this.advancedModeToolStripMenuItem.Click += new System.EventHandler(this.advancedModeToolStripMenuItem_Click);
//
// caexVersionFileToolStripMenuItem
//
this.caexVersionFileToolStripMenuItem.Name = "caexVersionFileToolStripMenuItem";
this.caexVersionFileToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
this.caexVersionFileToolStripMenuItem.Text = "Use CAEX 2.15 File";
this.caexVersionFileToolStripMenuItem.Click += new System.EventHandler(this.caexVersionFileToolStripMenuItem_Click);
//
// helpButton
//
this.helpButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -2674,7 +2683,8 @@ namespace Aml.Editor.Plugin
private System.Windows.Forms.TextBox genericDataDescriptionTxtBx;
private System.Windows.Forms.ToolStrip toolStrip5;
private System.Windows.Forms.ToolStripLabel genericDataHeaderLabel;
private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem advancedModeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem caexVersionFileToolStripMenuItem;
}
}

View File

@@ -29,6 +29,7 @@ namespace Aml.Editor.Plugin
private object _row;
private bool isEditing = false;
private bool expertMode = false;
private bool useCaex2_15 = false;
private OpenFileDialog openFileDialog = new OpenFileDialog();
private List<string> AllInterfaces = new List<string>();
@@ -1591,10 +1592,11 @@ namespace Aml.Editor.Plugin
try
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "AML Files( *.amlx )| *.amlx;";
saveFileDialog.FileName = vendorNameTextBox.Text + "-" + deviceNameTextBox.Text + "-V.1.0-" + DateTime.Now.Date.ToShortDateString();
SaveFileDialog saveFileDialog = new SaveFileDialog
{
Filter = "AML Files( *.amlx )| *.amlx;",
FileName = vendorNameTextBox.Text + "-" + deviceNameTextBox.Text + "-V.1.0-" + DateTime.Now.Date.ToShortDateString()
};
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
@@ -1603,11 +1605,10 @@ namespace Aml.Editor.Plugin
device.environment = Path.GetDirectoryName(saveFileDialog.FileName);
device.fileName = saveFileDialog.FileName;
// storing user defined values of Attachebles data grid view in to list
// Pass the device to the controller
string result1 = mWController.CreateDeviceOnClick(device, isEditing);
string result1 = mWController.CreateDeviceOnClick(device, isEditing, useCaex2_15);
//clear();
@@ -1730,7 +1731,7 @@ namespace Aml.Editor.Plugin
// storing user defined values of Attachebles data grid view in to list
// Pass the device to the controller
string result1 = mWController.CreateDeviceOnClick(device, isEditing);
string result1 = mWController.CreateDeviceOnClick(device, isEditing, useCaex2_15);
@@ -1760,6 +1761,7 @@ namespace Aml.Editor.Plugin
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
isEditing = false;
clear();
@@ -1821,12 +1823,14 @@ namespace Aml.Editor.Plugin
private void manualToolStripMenuItem_Click(object sender, EventArgs e)
{
string search = "https://github.com/DekaAthlos/TINF19C-ModellingWizard/wiki/6.-User-Manual";
string search = "https://github.com/H4CK3R-01/TINF20C_ModellingWizard_Devices/wiki/6.-User-Manual";
System.Diagnostics.Process.Start(search);
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
isEditing = true;
searchAMLComponentFile.DictionaryofElectricalConnectorType = new Dictionary<string, List<List<ClassOfListsFromReferencefile>>>();
searchAMLComponentFile.DictioanryofElectricalConnectorPinType = new Dictionary<string, List<List<ClassOfListsFromReferencefile>>>();
@@ -4579,5 +4583,21 @@ namespace Aml.Editor.Plugin
}
catch (Exception) { }
}
private void caexVersionFileToolStripMenuItem_Click(object sender, EventArgs e)
{
// Switch mode
useCaex2_15 = !useCaex2_15;
// Change text
if (useCaex2_15)
{
this.caexVersionFileToolStripMenuItem.Text = "Use CAEX 3.0 File";
}
else
{
this.caexVersionFileToolStripMenuItem.Text = "Use CAEX 2.15 File";
}
}
}
}

View File

@@ -131,7 +131,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD6
DAAAAk1TRnQBSQFMAgEBAwEAAVABBAFQAQQBHAEAARwBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DAAAAk1TRnQBSQFMAgEBAwEAAZgBBAGYAQQBHAEAARwBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABcAMAARwDAAEBAQABCAUAAUABDBgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
@@ -344,7 +344,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABC
DQAAAk1TRnQBSQFMAgEBAwEAAVABBAFQAQQBHAEAARwBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DQAAAk1TRnQBSQFMAgEBAwEAAZgBBAGYAQQBHAEAARwBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABcAMAARwDAAEBAQABCAUAAUABDBgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
@@ -417,7 +417,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC4
CQAAAk1TRnQBSQFMAgEBAgEAAUgBBAFIAQQBGQEAARkBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CQAAAk1TRnQBSQFMAgEBAgEAAZABBAGQAQQBGQEAARkBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABZAMAARkDAAEBAQABCAUAAcQBCRgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
@@ -472,7 +472,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAA
CAAAAk1TRnQBSQFMAwEBAAFQAQQBUAEEARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
CAAAAk1TRnQBSQFMAwEBAAGYAQQBmAEEARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm

View File

@@ -56,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

View File

@@ -55,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();
@@ -107,27 +90,26 @@ 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);
@@ -152,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);
@@ -168,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;
@@ -285,8 +258,6 @@ namespace Aml.Editor.Plugin
SRC.RefRoleClassPath = item.SupportesRoleClassType;
}
}
}
@@ -327,8 +298,7 @@ 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
@@ -458,9 +428,6 @@ namespace Aml.Editor.Plugin
electricalConnectorType.RefBaseClassPath = item.RefBaseClassPath;
}
}
}
@@ -474,9 +441,6 @@ namespace Aml.Editor.Plugin
electricalConnectorPinName = Regex.Replace(electricalConnectorPinName, @"\{.*?\}", "");
electricalConnectorPinName = electricalConnectorPinName.Replace(electricalConnectorTypeName, "");
if (initialnumberbetweenparanthesisofElectricalConnectorType == initialnumberbetweenparanthesisElectricalConnectorPins)
{
electricalConnectorPins = electricalConnectorType.ExternalInterface.Append(electricalConnectorPinName);
@@ -625,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;
}
@@ -894,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)
@@ -945,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)
@@ -999,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);

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>

View File

@@ -9,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("")]