2022-03-11 16:13:30 +00:00
using System ;
using System.Collections.Generic ;
namespace Aml.Editor.Plugin
{
// this class initialize the parameters exclusively for the "Device Identofication", "DataGridViews in "Generic Data Tab" AND "Field Attachables Tab""
2022-04-07 06:37:54 +00:00
public class MWDevice : MWData . MWObject
2022-03-11 16:13:30 +00:00
{
public string environment { get ; set ; }
public string fileName { get ; set ; }
public string filepath { get ; set ; }
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
public string vendorName { get ; set ; }
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
public string deviceName { get ; set ; }
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
// Can contain letters:
public List < DataGridParameters > dataGridParametersLists { get ; set ; }
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
//Properties for Electrical Interface
public List < ElectricalParameters > ElectricalInterfaces { get ; set ; }
public List < List < ElectricalParameters > > ElectricalInterfaceInstances { get ; set ; }
//List of property for parameters in Attachables Data Grid View
public List < AttachablesDataGridViewParameters > dataGridAttachablesParametrsList { get ; set ; }
public List < AttachablesDataGridViewParameters > listWithURIConvertedToString { get ; set ; }
//List of parameters from Electrical Interface Datagrid View in "Inter" tab
public List < ElectricalInterfaceParameters > listofElectricalInterfaceParameters { get ; set ; }
// In this Dictionary Every list generated from the Electrical Interface is Added and can be retrived by the key KEY = "InterfaceClass+Externalinterface" strings
public Dictionary < string , List < ElectricalInterfaceParameters > > DictofElectricalInterfaceParameters { get ; set ; }
// These are the Dictionary properties that store Electrical Interfaces Instances
// This Dictionary Property Stores the "Parent Interface Class Attributes" as Values and "Interface Number + InterfaceName" as Key
public Dictionary < string , List < List < ClassOfListsFromReferencefile > > > DictionaryForInterfaceClassesInElectricalInterfaces { get ; set ; }
// This Dictioanry Property Stores "Child ExternalInterfaces attributes under ParentClass" as Values
// and "InterfaceNumbwer + ParentClassName + ExternalInterface Name" as Key
public Dictionary < string , List < List < ClassOfListsFromReferencefile > > > DictionaryForExternalInterfacesUnderInterfaceClassInElectricalInterfaces { get ; set ; }
// These are the Dictionary properties that store Electrical Interfaces Instances
// This Dictionary Property Stores the "Parent Interface Class Attributes" as Values and "Interface Number + InterfaceName" as Key
public Dictionary < string , List < List < ClassOfListsFromReferencefile > > > DictionaryForRoleClassofComponent { get ; set ; }
// This Dictioanry Property Stores "Child ExternalInterfaces attributes under ParentClass" as Values
// and "InterfaceNumbwer + ParentClassName + ExternalInterface Name" as Key
public Dictionary < string , List < List < ClassOfListsFromReferencefile > > > DictionaryForExternalInterfacesUnderRoleClassofComponent { get ; set ; }
}
// This class helps to carry parameters in "identification data table to AutomationML"
public class DataGridParameters
{
public string RefSemantics { get ; set ; }
public string Attributes { get ; set ; }
public string Values { get ; set ; }
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
public DataGridParameters ( ) { }
public DataGridParameters ( string refSemantic , string attributes , string value )
{
2022-04-07 06:37:54 +00:00
this . RefSemantics = refSemantic ;
2022-03-11 16:13:30 +00:00
this . Attributes = attributes ;
this . Values = value ;
}
public override string ToString ( )
{
return "DataGridParameters(" + RefSemantics + "=" + Attributes + "=" + Values + ")" ;
}
}
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
/// <summary>
/// /The following classes are parameter holders for Electrical Interfaces
/// </summary>
public class ElectricalParameters
{
public string Connector { get ; set ; }
public string ConnectorCode { get ; set ; }
public string ConnectorType { get ; set ; }
public string Pins { get ; set ; }
public List < ElectricalParametersInElectricalDataDataGridView > listofElectricalDataDataGridViewParameters { get ; set ; }
public List < PinParametersInPinInfoDataGridView > listOfPinInfoDataGridViewParameters { get ; set ; }
//public string ReferenceID { get; set; }
//public string Attributes { get; set; }
//public string Values { get; set; }
//public string Units { get; set; }
2022-04-07 06:37:54 +00:00
public ElectricalParameters ( )
2022-03-11 16:13:30 +00:00
{
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
}
2022-04-07 06:37:54 +00:00
public ElectricalParameters ( string connector , string connectorCode , string connectorType , string pins , string lis )
2022-03-11 16:13:30 +00:00
{
this . Connector = connector ;
this . ConnectorCode = connectorCode ;
this . ConnectorType = connectorType ;
this . Pins = pins ;
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
}
//public ElectricalParameters(string referenceID, string attribute, string values, string units, string pins)
//{
// this.ReferenceID = referenceID;
// this.Attributes = attribute;
// this.Values = values;
// this.Units = units;
// this.Pins = pins;
//}
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
public override string ToString ( )
{
2022-04-07 06:37:54 +00:00
return "ElectricalParameters(" + Connector + "=" + ConnectorCode + "=" + ConnectorType + "=" + Pins + ")" ;
2022-03-11 16:13:30 +00:00
}
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
}
//This Class is responsible to hold the parameters in "ElectricalDataDataGrid View"
public class ElectricalParametersInElectricalDataDataGridView
{
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
public string ReferenceID { get ; set ; }
public string Attributes { get ; set ; }
public string Values { get ; set ; }
public string Units { get ; set ; }
public ElectricalParametersInElectricalDataDataGridView ( )
{
}
public ElectricalParametersInElectricalDataDataGridView ( string referenceID , string attribute , string values , string units )
{
this . ReferenceID = referenceID ;
this . Attributes = attribute ;
this . Values = values ;
this . Units = units ;
2022-04-07 06:37:54 +00:00
2022-03-11 16:13:30 +00:00
}
public override string ToString ( )
{
2022-04-07 06:37:54 +00:00
return "ElectricalParametersInElectricalDataDataGridView(" + ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")" ;
2022-03-11 16:13:30 +00:00
}
}
public class PinParametersInPinInfoDataGridView
{
public string PinNumber { get ; set ; }
public string ReferenceID { get ; set ; }
public string Attributes { get ; set ; }
public string Values { get ; set ; }
public string Units { get ; set ; }
public PinParametersInPinInfoDataGridView ( )
{
}
2022-04-07 06:37:54 +00:00
public PinParametersInPinInfoDataGridView ( string pinNumber , string referenceID , string attribute , string values , string units )
2022-03-11 16:13:30 +00:00
{
this . PinNumber = pinNumber ;
this . ReferenceID = referenceID ;
this . Attributes = attribute ;
this . Values = values ;
this . Units = units ;
}
public override string ToString ( )
{
2022-04-07 06:37:54 +00:00
return "PinParametersInPinInfoDataGridView(" + PinNumber + "=" + ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")" ;
2022-03-11 16:13:30 +00:00
}
}
// this class is responsible to load every parameter in "attachablesInfoDataGridView" into a list.
public class AttachablesDataGridViewParameters
{
public string ElementName { get ; set ; }
public string FilePath { get ; set ; }
2022-04-07 06:37:54 +00:00
public string AddToFile { get ; set ; }
2022-03-11 16:13:30 +00:00
public AttachablesDataGridViewParameters ( )
{
}
public AttachablesDataGridViewParameters ( string elementName , string filePath , bool addToFile )
{
this . ElementName = elementName ;
this . FilePath = filePath ;
this . AddToFile = Convert . ToString ( addToFile ) ;
}
public override string ToString ( )
{
2022-04-07 06:37:54 +00:00
return "AttachablesDataGridViewParameters(" + ElementName + "=" + FilePath + "=" + AddToFile + ")" ;
2022-03-11 16:13:30 +00:00
}
}
public class ElectricalInterfaceParameters
{
public string AttributeName { get ; set ; }
public string Values { get ; set ; }
public string Default { get ; set ; }
public string Units { get ; set ; }
public string DataType { get ; set ; }
public string Semantic { get ; set ; }
public string Reference { get ; set ; }
public string Description { get ; set ; }
public string CopyRight { get ; set ; }
public string AttributePath { get ; set ; }
//public List<ClassOfListsFromReferencefile> listofparameters { get; set; }
public ElectricalInterfaceParameters ( )
{
//listofparameters = new List<ClassOfListsFromReferencefile>();
}
public ElectricalInterfaceParameters ( string name , string value ,
string _default , string unit ,
string reference , string description , string copyRight , string semantic , string attributePath )
: this ( )
{
this . AttributeName = name ;
this . Values = value ;
this . Default = _default ;
this . Units = unit ;
this . Reference = reference ;
this . Description = description ;
this . CopyRight = copyRight ;
this . Semantic = semantic ;
this . AttributePath = attributePath ;
}
public override string ToString ( )
{
return "ClassOfListsFromReferencefile(" + AttributeName + "=" + Values + "=" + Default + "=" + Units + "=" + Reference + "="
+ Description + "=" + CopyRight + "=" + Semantic + "=" + AttributePath + ")" ;
}
}
}