Cleaned up code

This commit is contained in:
Administrator 2022-04-07 08:37:54 +02:00
parent 39c0720683
commit 1251cb5a72
16 changed files with 230 additions and 282 deletions

View File

@ -1,11 +1,4 @@
using System; 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; using System.Windows.Forms;
namespace App namespace App

View File

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

View File

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

View File

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

View File

@ -1,11 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data; using System.Data;
using System.Windows.Forms;
using System.Drawing; using System.Drawing;
using System.Windows.Forms;
namespace Aml.Editor.Plugin namespace Aml.Editor.Plugin
{ {
@ -27,7 +24,7 @@ namespace Aml.Editor.Plugin
return AMLAttributeParameters; 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)
{ {
KeyValuePair<string, List<List<ClassOfListsFromReferencefile>>> Pair = pair; KeyValuePair<string, List<List<ClassOfListsFromReferencefile>>> Pair = pair;

View File

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

View File

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

View File

@ -8,7 +8,6 @@ using System.IO;
using System.IO.Packaging; using System.IO.Packaging;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using Aml.Engine.AmlObjects.Extensions;
/// <summary> /// <summary>

View File

@ -7,7 +7,6 @@ using System.IO.Packaging;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace Aml.Editor.Plugin namespace Aml.Editor.Plugin
{ {
@ -130,8 +129,8 @@ namespace Aml.Editor.Plugin
// Init the default Libs // Init the default Libs
AutomationMLBaseRoleClassLibType.RoleClassLib(document) ; AutomationMLBaseRoleClassLibType.RoleClassLib(document);
AutomationMLInterfaceClassLibType.InterfaceClassLib(document) ; AutomationMLInterfaceClassLibType.InterfaceClassLib(document);
var structureRoleFamilyType = AutomationMLBaseRoleClassLibType.RoleClassLib(document).Structure; var structureRoleFamilyType = AutomationMLBaseRoleClassLibType.RoleClassLib(document).Structure;
@ -336,7 +335,7 @@ namespace Aml.Editor.Plugin
if (device.vendorName != null) if (device.vendorName != null)
{ {
InternalElementType electricalInterface = null; InternalElementType electricalInterface = null;
RoleRequirementsType roleRequirements = null ; RoleRequirementsType roleRequirements = null;
foreach (var internalElement in systemUnitClass.InternalElement) foreach (var internalElement in systemUnitClass.InternalElement)
{ {
if (internalElement.Name.Equals("Interfaces")) if (internalElement.Name.Equals("Interfaces"))
@ -473,7 +472,7 @@ namespace Aml.Editor.Plugin
string electricalConnectorPinName = Regex.Replace(pairofList.Key.ToString(), @"\(.*?\)", ""); string electricalConnectorPinName = Regex.Replace(pairofList.Key.ToString(), @"\(.*?\)", "");
electricalConnectorPinName = Regex.Replace(electricalConnectorPinName, @"\{.*?\}", ""); electricalConnectorPinName = Regex.Replace(electricalConnectorPinName, @"\{.*?\}", "");
electricalConnectorPinName = electricalConnectorPinName.Replace(electricalConnectorTypeName,""); electricalConnectorPinName = electricalConnectorPinName.Replace(electricalConnectorTypeName, "");
@ -1045,7 +1044,7 @@ namespace Aml.Editor.Plugin
// Just as an interface // Just as an interface
} }
public void copyFiles(string sourceFilePath, string destinationFilePath ) public void copyFiles(string sourceFilePath, string destinationFilePath)
{ {
string sourFile = Path.GetFileName(sourceFilePath); string sourFile = Path.GetFileName(sourceFilePath);
string destFile = Path.Combine(destinationFilePath, sourFile); string destFile = Path.Combine(destinationFilePath, sourFile);

View File

@ -1,13 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aml.Editor.Plugin namespace Aml.Editor.Plugin
{ {
// this class initialize the parameters exclusively for the "Device Identofication", "DataGridViews in "Generic Data Tab" AND "Field Attachables Tab"" // 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 environment { get; set; }
public string fileName { 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; this.Connector = connector;
@ -124,7 +121,7 @@ namespace Aml.Editor.Plugin
public override string ToString() 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() 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.PinNumber = pinNumber;
this.ReferenceID = referenceID; this.ReferenceID = referenceID;
@ -179,7 +176,7 @@ namespace Aml.Editor.Plugin
} }
public override string ToString() 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() public override string ToString()
{ {
return "AttachablesDataGridViewParameters(" + ElementName + "=" + FilePath +"="+ AddToFile + ")"; return "AttachablesDataGridViewParameters(" + ElementName + "=" + FilePath + "=" + AddToFile + ")";
} }
} }

View File

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

View File

@ -1,9 +1,6 @@
using System; using Aml.Engine.CAEX;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aml.Engine.CAEX;
namespace Aml.Editor.Plugin namespace Aml.Editor.Plugin
{ {
@ -30,7 +27,7 @@ namespace Aml.Editor.Plugin
foreach (var attribute in externalInterface.Attribute) foreach (var attribute in externalInterface.Attribute)
{ {
StoreEachAttributeValueInListOfExternalIterface(i, attributelist, attribute, externalInterface); StoreEachAttributeValueInListOfExternalIterface(i, attributelist, attribute, externalInterface);
CkeckForNestedAttributesOfExternalIterface(i,attribute, externalInterface); CkeckForNestedAttributesOfExternalIterface(i, attribute, externalInterface);
} }
@ -43,7 +40,7 @@ namespace Aml.Editor.Plugin
list.Add(sublist); list.Add(sublist);
try 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() DictionaryofElectricalConnectorType["(" + i + ")" + externalInterface.Name.ToString()
+ "{" + "Class:" + " " + externalInterface.BaseClass + "}"].AddRange(list); + "{" + "Class:" + " " + externalInterface.BaseClass + "}"].AddRange(list);
@ -73,7 +70,7 @@ namespace Aml.Editor.Plugin
foreach (var attributeinattribute in attributeType.Attribute) foreach (var attributeinattribute in attributeType.Attribute)
{ {
StoreEachAttributeValueInListOfExternalIterface(i, attributelist, attributeinattribute, attributeType, externalInterface); 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); list.Add(sublist);
try try
{ {
if (DictionaryofRolesforAutomationComponenet.ContainsKey("(" + i + ")" + supportedRoleClass.RoleReference.ToString() )) if (DictionaryofRolesforAutomationComponenet.ContainsKey("(" + i + ")" + supportedRoleClass.RoleReference.ToString()))
{ {
DictionaryofRolesforAutomationComponenet["(" + i + ")" + supportedRoleClass.RoleReference.ToString()].AddRange(list); 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; 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 namespace Aml.Editor.Plugin
{ {
@ -191,7 +181,7 @@ namespace Aml.Editor.Plugin
list.Add(sublist); list.Add(sublist);
try 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); DictionaryForInterfaceClassInstancesAttributes[classType.Name.ToString() + "{" + "Class:" + " " + classType.ReferencedClassName + "}"].AddRange(list);
} }
@ -1775,7 +1765,7 @@ namespace Aml.Editor.Plugin
foreach (var externalinterfaces in item.ExternalInterface) foreach (var externalinterfaces in item.ExternalInterface)
{ {
TreeNode externalinterafcenode; 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(); referencedClassName = externalinterfaces.BaseClass.ToString();
externalinterafcenode = newnode.Nodes.Add(externalinterfaces.ToString(), externalinterfaces.ToString() + "{" + "Class:" + " " + referencedClassName + "}", 2); 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) foreach (var externalinterfaces in item.ExternalInterface)
{ {
TreeNode externalinterafcenode; TreeNode externalinterafcenode;
if (externalinterfaces.BaseClass!= null) if (externalinterfaces.BaseClass != null)
{ {
referencedclassName = externalinterfaces.BaseClass.ToString(); 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> /// </summary>
/// <param name="oParentNode"></param> /// <param name="oParentNode"></param>
/// <param name="classType"></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) if (classType.ExternalInterface.Exists)
{ {
@ -1873,7 +1863,7 @@ namespace Aml.Editor.Plugin
foreach (var item in classType.ExternalInterface) foreach (var item in classType.ExternalInterface)
{ {
TreeNode newnode; TreeNode newnode;
if (item.BaseClass!= null) if (item.BaseClass != null)
{ {
referencedClassName = item.BaseClass.ToString(); referencedClassName = item.BaseClass.ToString();
newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString() + "{" + "Class:" + " " + referencedClassName + "}", 2); newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString() + "{" + "Class:" + " " + referencedClassName + "}", 2);
@ -1883,7 +1873,7 @@ namespace Aml.Editor.Plugin
} }
else else
{ {
newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString() , 2); newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString(), 2);
newnode.ForeColor = SystemColors.GrayText; newnode.ForeColor = SystemColors.GrayText;
} }