diff --git a/VECTO/GUI/MainForm.Designer.vb b/VECTO/GUI/MainForm.Designer.vb index 3919df2b4f99161783d2ad1189c41a17078ae9cb..55d649948fdcd261b9b4a8da6ce35ca1d3c7b7a5 100644 --- a/VECTO/GUI/MainForm.Designer.vb +++ b/VECTO/GUI/MainForm.Designer.vb @@ -49,7 +49,6 @@ Partial Class MainForm Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.BtGENdown = New System.Windows.Forms.Button() Me.BtGENup = New System.Windows.Forms.Button() - Me.LbAutoShDown = New System.Windows.Forms.Label() Me.ChBoxAllGEN = New System.Windows.Forms.CheckBox() Me.LvGEN = New System.Windows.Forms.ListView() Me.ColGENpath = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) @@ -113,6 +112,8 @@ Partial Class MainForm Me.OpenInGraphWindowToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ShowInFolderToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) + Me.btnExportXML = New System.Windows.Forms.Button() + Me.btnImportXML = New System.Windows.Forms.Button() Me.StatusBAR.SuspendLayout() Me.TabControl1.SuspendLayout() Me.TabPageGEN.SuspendLayout() @@ -184,13 +185,14 @@ Partial Class MainForm ' 'TabPageGEN ' + Me.TabPageGEN.Controls.Add(Me.btnImportXML) + Me.TabPageGEN.Controls.Add(Me.btnExportXML) Me.TabPageGEN.Controls.Add(Me.Label6) Me.TabPageGEN.Controls.Add(Me.btStartV3) Me.TabPageGEN.Controls.Add(Me.LbDecl) Me.TabPageGEN.Controls.Add(Me.PictureBox1) Me.TabPageGEN.Controls.Add(Me.BtGENdown) Me.TabPageGEN.Controls.Add(Me.BtGENup) - Me.TabPageGEN.Controls.Add(Me.LbAutoShDown) Me.TabPageGEN.Controls.Add(Me.ChBoxAllGEN) Me.TabPageGEN.Controls.Add(Me.LvGEN) Me.TabPageGEN.Controls.Add(Me.ButtonGENremove) @@ -269,19 +271,6 @@ Partial Class MainForm Me.ToolTip1.SetToolTip(Me.BtGENup, "Move job up one row") Me.BtGENup.UseVisualStyleBackColor = True ' - 'LbAutoShDown - ' - Me.LbAutoShDown.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) - Me.LbAutoShDown.AutoSize = True - Me.LbAutoShDown.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.LbAutoShDown.ForeColor = System.Drawing.Color.Red - Me.LbAutoShDown.Location = New System.Drawing.Point(408, 275) - Me.LbAutoShDown.Name = "LbAutoShDown" - Me.LbAutoShDown.Size = New System.Drawing.Size(225, 13) - Me.LbAutoShDown.TabIndex = 17 - Me.LbAutoShDown.Text = "!!! Automatic Shutdown is activated !!!" - Me.LbAutoShDown.Visible = False - ' 'ChBoxAllGEN ' Me.ChBoxAllGEN.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) @@ -776,6 +765,27 @@ Partial Class MainForm Me.ShowInFolderToolStripMenuItem.Size = New System.Drawing.Size(198, 22) Me.ShowInFolderToolStripMenuItem.Text = "Show in Folder" ' + 'btnExportXML + ' + Me.btnExportXML.Enabled = False + Me.btnExportXML.Location = New System.Drawing.Point(357, 271) + Me.btnExportXML.Name = "btnExportXML" + Me.btnExportXML.Size = New System.Drawing.Size(115, 23) + Me.btnExportXML.TabIndex = 22 + Me.btnExportXML.Text = "Export as XML" + Me.btnExportXML.UseVisualStyleBackColor = True + Me.btnExportXML.Visible = False + ' + 'btnImportXML + ' + Me.btnImportXML.Location = New System.Drawing.Point(489, 271) + Me.btnImportXML.Name = "btnImportXML" + Me.btnImportXML.Size = New System.Drawing.Size(104, 23) + Me.btnImportXML.TabIndex = 23 + Me.btnImportXML.Text = "Import from XML" + Me.btnImportXML.UseVisualStyleBackColor = True + Me.btnImportXML.Visible = False + ' 'MainForm ' Me.AcceptButton = Me.btStartV3 @@ -833,7 +843,6 @@ Partial Class MainForm Friend WithEvents TabPgOptions As TabPage Friend WithEvents ChBoxModOut As CheckBox Friend WithEvents PanelOptAllg As Panel - Friend WithEvents LbAutoShDown As Label Friend WithEvents LvMsg As ListView Friend WithEvents ColumnHeader1 As ColumnHeader Friend WithEvents SplitContainer1 As SplitContainer @@ -899,5 +908,7 @@ Partial Class MainForm Friend WithEvents toolStripSeparator1 As ToolStripSeparator Friend WithEvents HelpToolStripButton As ToolStripButton Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents btnExportXML As System.Windows.Forms.Button + Friend WithEvents btnImportXML As System.Windows.Forms.Button End Class diff --git a/VECTO/GUI/MainForm.vb b/VECTO/GUI/MainForm.vb index 5fd2ee93998ec41c0df9ccf92d2b28306797b68c..2fa0d71d9cc4044ecc0b67ba13c65ef2a65daab6 100644 --- a/VECTO/GUI/MainForm.vb +++ b/VECTO/GUI/MainForm.vb @@ -42,6 +42,7 @@ Imports System.Threading Imports Microsoft.VisualBasic.FileIO Imports TUGraz.VectoCommon.InputData Imports TUGraz.VectoCommon.Models +Imports TUGraz.VectoCommon.OutputData Imports TUGraz.VectoCommon.Utils Imports TUGraz.VectoCore.OutputData Imports TUGraz.VectoCore.OutputData.FileIO @@ -246,6 +247,17 @@ Public Class MainForm 'Set mode (Batch/Standard) ModeUpdate() + DetectPlugins() + + 'Dim exportPlugins As Dictionary(Of String, String) = PluginRegistry.Instance.GetExportPluginList() + Dim exportPlugin As IExportPlugin = PluginRegistry.Instance.GetExportPlugin("TUG.IVT.Vecto.XMLExport") + btnExportXML.Visible = Not exportPlugin Is Nothing + + + Dim importPlugin As IImportPlugin = PluginRegistry.Instance.GetImportPlugin("TUG.IVT.Vecto.XMLImport") + btnImportXML.Visible = Not importPlugin Is Nothing + + #If DEBUG Then Const LicCheck As Boolean = False #Else @@ -315,7 +327,6 @@ Public Class MainForm fwelcome = New WelcomeDialog fwelcome.ShowDialog() End If - 'End If End Sub 'Open file @@ -1949,6 +1960,45 @@ Lb1: Public Message As String Public Link As String End Class + + Private Sub CbExportJob_SelectedIndexChanged(sender As Object, e As EventArgs) + End Sub + + Private Sub btnExportXML_Click(sender As Object, e As EventArgs) Handles btnExportXML.Click + + If LvGEN.SelectedItems.Count < 1 Then + If LvGEN.Items.Count = 1 Then + LvGEN.Items(0).Selected = True + Else + Exit Sub + End If + End If + + Dim f As String = LvGEN.SelectedItems(0).SubItems(0).Text + f = FileRepl(f) + If Not File.Exists(f) Then + MsgBox(f & " not found!") + Return + End If + Try + PluginRegistry.Instance.GetExportPlugin("TUG.IVT.Vecto.XMLExport").ExportJob(JSONInputDataFactory.ReadJsonJob(f)) + Catch ex As Exception + MsgBox("Exporting job failed: " + ex.Message) + End Try + End Sub + + Private Sub LvGEN_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LvGEN.SelectedIndexChanged + btnExportXML.Enabled = (LvGEN.SelectedItems.Count = 1) + End Sub + + Private Sub btnImportXML_Click(sender As Object, e As EventArgs) Handles btnImportXML.Click + Try + Dim jobFile As String = PluginRegistry.Instance.GetImportPlugin("TUG.IVT.Vecto.XMLImport").ImportJob() + AddToJobListView(jobFile) + Catch ex As Exception + MsgBox("Importing job failed: " + ex.Message) + End Try + End Sub End Class diff --git a/VECTO/Input Files/Engine.vb b/VECTO/Input Files/Engine.vb index 8479cbe155d06d663b623b1153833a514525be20..36428639bb5769bfa4c198e09ca0fec644975cde 100644 --- a/VECTO/Input Files/Engine.vb +++ b/VECTO/Input Files/Engine.vb @@ -159,7 +159,15 @@ Public Class Engine Return False End If - Return New JSONFileWriter().SaveEngine(Me, _filePath) + Try + Dim writer As JSONFileWriter = New JSONFileWriter() + writer.SaveEngine(Me, _filePath) + + Catch ex As Exception + MsgBox("Faled to write Engine file: " + ex.Message) + Return False + End Try + Return True End Function diff --git a/VECTO/Input Files/Gearbox.vb b/VECTO/Input Files/Gearbox.vb index f9aaf778a10e9c6cbd4c2b1ea3758b20f9595bfa..128d21118ef9475f31909bb0c0c6dee05ecb7b67 100644 --- a/VECTO/Input Files/Gearbox.vb +++ b/VECTO/Input Files/Gearbox.vb @@ -115,7 +115,14 @@ Public Class Gearbox Return False End If - Return JSONFileWriter.Instance.SaveGearbox(Me, Me, _filePath) + Try + Dim writer As JSONFileWriter = JSONFileWriter.Instance + writer.SaveGearbox(Me, Me, _filePath) + Catch ex As Exception + MsgBox("failed to write Gearbox file: " + ex.Message) + Return False + End Try + Return True End Function @@ -390,7 +397,7 @@ Public Class Gearbox Public ReadOnly Property StartTorqueReserve As Double Implements IGearboxEngineeringInputData.StartTorqueReserve Get - Return TorqueResvStart + Return TorqueResvStart / 100 End Get End Property diff --git a/VECTO/Input Files/VectoJob.vb b/VECTO/Input Files/VectoJob.vb index e2f4d82bc17b3cca6b881d0bf37e51e10c7973fd..4c0f0882d4c63cad5aa4a632b7713d4857f73364 100644 --- a/VECTO/Input Files/VectoJob.vb +++ b/VECTO/Input Files/VectoJob.vb @@ -118,7 +118,14 @@ Public Class VectoJob Return False End If - Return JSONFileWriter.Instance.SaveJob(Me, _sFilePath) + Try + Dim writer As JSONFileWriter = JSONFileWriter.Instance + writer.SaveJob(Me, _sFilePath) + Catch ex As Exception + MsgBox("Failed to save Job file: " + ex.Message) + Return False + End Try + Return True End Function 'This Sub reads those Input-files that do not have their own class, etc. diff --git a/VECTO/Input Files/Vehicle.vb b/VECTO/Input Files/Vehicle.vb index 8d983d9737151747d9654acacf8098477a8320c0..86d76167b1ce8ebc6d9663fe2a1748fe0f5bdc1c 100644 --- a/VECTO/Input Files/Vehicle.vb +++ b/VECTO/Input Files/Vehicle.vb @@ -31,7 +31,6 @@ Public Class Vehicle IAngledriveInputData 'V2 MassMax is now saved in [t] instead of [kg] - Private _filePath As String Private _path As String @@ -203,7 +202,14 @@ Public Class Vehicle Return False End If - Return JSONFileWriter.Instance.SaveVehicle(Me, Me, Me, Me, _filePath) + Try + Dim writer As JSONFileWriter = JSONFileWriter.Instance + writer.SaveVehicle(Me, Me, Me, Me, _filePath) + Catch ex As Exception + MsgBox("Failed to save Vehicle file: " + ex.Message) + Return False + End Try + Return True End Function diff --git a/VECTO/JSONWriter.vb b/VECTO/JSONWriter.vb index 7cabc5ab5db7e3e219dc9313429509710961bafe..e678d8ebb15e56d1dd4f6cc3b149b086413249dc 100644 --- a/VECTO/JSONWriter.vb +++ b/VECTO/JSONWriter.vb @@ -32,24 +32,22 @@ Public Class JSONWriter ''' <param name="path"></param> ''' <returns></returns> ''' <remarks></remarks> - Public Function WriteFile(path As String) As Boolean + Public Sub WriteFile(path As String) Dim file As StreamWriter Dim str As String If Content.Count = 0 Then - Return False + Return End If Try str = JsonConvert.SerializeObject(Content, Formatting.Indented) file = My.Computer.FileSystem.OpenTextFileWriter(path, False) Catch ex As Exception - Return False + Throw End Try file.Write(str) file.Close() - - Return True - End Function + End Sub End Class diff --git a/VECTO/MainModule.vb b/VECTO/MainModule.vb index 86ff56db402c958788ace6fad2b1e1e142bdc64d..71827c1ba0918485a5f5c30d82b20de702fb358e 100644 --- a/VECTO/MainModule.vb +++ b/VECTO/MainModule.vb @@ -10,9 +10,14 @@ ' See the LICENSE.txt for the specific language governing permissions and limitations. Imports System.Collections.Generic Imports System.IO +Imports System.Reflection +Imports System.Runtime.Remoting +Imports TUGraz.VectoCommon.InputData +Imports TUGraz.VectoCommon.OutputData Imports TUGraz.VectoCommon.Utils Imports TUGraz.VectoCore.Models.SimulationComponent.Data Imports TUGraz.VectoCore.Models.SimulationComponent.Data.Engine +Imports VectoAuxiliaries ''' <summary> ''' Main calculation routines. @@ -57,4 +62,52 @@ Module MainModule End If Return filePath End Function + + Public Sub DetectPlugins() + + Dim dllFileNames As String() + Dim Path As String = "." + 'If Directory.Exists(Path) Then + dllFileNames = Directory.GetFiles(Path, "*.dll") + + Dim assemblies As ICollection(Of Assembly) = New List(Of Assembly)(dllFileNames.Length) + For Each dllFile As String In dllFileNames + Dim an As AssemblyName = AssemblyName.GetAssemblyName(dllFile) + Dim assembly As Assembly = assembly.Load(an) + assemblies.Add(assembly) + Next + + Dim exportPluginType As Type = GetType(IExportPlugin) + Dim importPluginType As Type = GetType(IImportPlugin) + Dim exportPluginTypes As ICollection(Of Type) = New List(Of Type) + For Each assembly As Assembly In assemblies + If assembly <> Nothing Then + Dim types As Type() = assembly.GetTypes() + + For Each type As Type In types + If type.IsInterface Or type.IsAbstract Then + Continue For + Else + If type.GetInterface(exportPluginType.FullName) <> Nothing Then + Dim plugin As IExportPlugin = TryCast(Activator.CreateInstance(type), IExportPlugin) + If Not plugin Is Nothing Then + PluginRegistry.Instance.RegisterPlugin(plugin) + End If + End If + If type.GetInterface(importPluginType.FullName) <> Nothing Then + Dim plugin As IImportPlugin = TryCast(Activator.CreateInstance(type), IImportPlugin) + If Not plugin Is Nothing Then + PluginRegistry.Instance.RegisterPlugin(plugin) + End If + End If + End If + Next + End If + Next + + 'End If + + + + End Sub End Module diff --git a/VECTO/OutputData/JSONFileWriter.vb b/VECTO/OutputData/JSONFileWriter.vb index e39037ace9e058e865a820a38a4e861470373103..d32900443c230231a6702a35d857ddb0bb9e96af 100644 --- a/VECTO/OutputData/JSONFileWriter.vb +++ b/VECTO/OutputData/JSONFileWriter.vb @@ -4,9 +4,11 @@ Imports System.Linq Imports Newtonsoft.Json.Linq Imports TUGraz.VectoCommon.InputData Imports TUGraz.VectoCommon.Models +Imports TUGraz.VectoCommon.OutputData Imports TUGraz.VectoCore.Models.Declaration Public Class JSONFileWriter + Implements IOutputFileWriter Public Const EngineFormatVersion As Short = 3 Public Const GearboxFormatVersion As Short = 6 @@ -24,7 +26,8 @@ Public Class JSONFileWriter End Get End Property - Public Function SaveEngine(eng As IEngineEngineeringInputData, filename As String) As Boolean + Public Sub SaveEngine(eng As IEngineEngineeringInputData, filename As String) _ + Implements IOutputFileWriter.SaveEngine Dim json As New JSONWriter 'Header @@ -56,11 +59,11 @@ Public Class JSONFileWriter json.Content = JToken.FromObject(New Dictionary(Of String, Object) From {{"Header", header}, {"Body", body}}) - Return json.WriteFile(filename) - End Function + json.WriteFile(filename) + End Sub - Public Function SaveGearbox(gbx As IGearboxEngineeringInputData, axl As IAxleGearInputData, filename As String) _ - As Boolean + Public Sub SaveGearbox(gbx As IGearboxEngineeringInputData, axl As IAxleGearInputData, filename As String) _ + Implements IOutputFileWriter.SaveGearbox Dim json As New JSONWriter @@ -141,11 +144,12 @@ Public Class JSONFileWriter json.Content = JToken.FromObject(New Dictionary(Of String, Object) From {{"Header", header}, {"Body", body}}) - Return json.WriteFile(filename) - End Function + json.WriteFile(filename) + End Sub - Public Function SaveVehicle(vehicle As IVehicleEngineeringInputData, retarder As IRetarderInputData, - pto As IPTOTransmissionInputData, angledrive As IAngledriveInputData, filename As String) As Boolean + Public Sub SaveVehicle(vehicle As IVehicleEngineeringInputData, retarder As IRetarderInputData, + pto As IPTOTransmissionInputData, angledrive As IAngledriveInputData, filename As String) _ + Implements IOutputFileWriter.SaveVehicle Dim basePath As String = Path.GetDirectoryName(filename) Dim json As New JSONWriter 'Header @@ -229,10 +233,11 @@ Public Class JSONFileWriter } json.Content = JToken.FromObject(New Dictionary(Of String, Object) From {{"Header", header}, {"Body", body}}) - Return json.WriteFile(filename) - End Function + json.WriteFile(filename) + End Sub - Public Function SaveJob(input As IEngineeringInputDataProvider, filename As String) As Boolean + Public Sub SaveJob(input As IEngineeringInputDataProvider, filename As String) _ + Implements IOutputFileWriter.SaveJob Dim json As New JSONWriter Dim basePath As String = Path.GetDirectoryName(filename) 'Header @@ -259,7 +264,7 @@ Public Class JSONFileWriter body.Add("EngineFile", GetRelativePath(input.EngineInputData.Source, basePath)) body.Add("Cycles", job.Cycles.Select(Function(x) GetRelativePath(x.CycleData.Source, Path.GetDirectoryName(filename))).ToArray()) - Return True + Return End If 'Main Files @@ -344,6 +349,11 @@ Public Class JSONFileWriter End If json.Content = JToken.FromObject(New Dictionary(Of String, Object) From {{"Header", header}, {"Body", body}}) - Return json.WriteFile(filename) - End Function + json.WriteFile(filename) + End Sub + + Public Sub ExportJob(input As IEngineeringInputDataProvider, filename As String, separateFiles As Boolean) Implements IOutputFileWriter.ExportJob + Throw New NotImplementedException + End Sub + End Class \ No newline at end of file diff --git a/VECTO/Plugins/PluginRegistry.vb b/VECTO/Plugins/PluginRegistry.vb new file mode 100644 index 0000000000000000000000000000000000000000..81537727aeeddf2193823b7ab30cb1b45e14f518 --- /dev/null +++ b/VECTO/Plugins/PluginRegistry.vb @@ -0,0 +1,40 @@ +Imports System.Collections.Generic +Imports System.Linq +Imports TUGraz.VectoCommon.InputData +Imports TUGraz.VectoCommon.OutputData + +Public Class PluginRegistry + Private Shared _instance As PluginRegistry + + Private _exportPlugins As Dictionary(Of String, IExportPlugin) = New Dictionary(Of String, IExportPlugin)() + Private _importPlugins As Dictionary(Of String, IImportPlugin) = New Dictionary(Of String, IImportPlugin) + + Public Shared ReadOnly Property Instance As PluginRegistry + Get + If _instance Is Nothing Then _instance = New PluginRegistry() + Return _instance + End Get + End Property + + Public Sub RegisterPlugin(ByRef plugin As IExportPlugin) + _exportPlugins.Add(plugin.Key, plugin) + End Sub + + Public Sub RegisterPlugin(ByRef plugin As IImportPlugin) + _importPlugins.Add(plugin.Key, plugin) + End Sub + + Public Function GetExportPlugin(key As String) As IExportPlugin + If Not _exportPlugins.ContainsKey(key) Then Return Nothing + Return _exportPlugins(key) + End Function + + Public Function GetImportPlugin(key As String) As IImportPlugin + If Not _importPlugins.ContainsKey(key) Then Return Nothing + Return _importPlugins(key) + End Function + + 'Public Function GetExportPluginList() As Dictionary(Of String, String) + ' Return _exportPlugins.ToDictionary(Function(x) x.Key, Function(e) e.Value.Name) + 'End Function +End Class \ No newline at end of file diff --git a/VECTO/VECTO.vbproj b/VECTO/VECTO.vbproj index 04df2b627f487bf9a59e29ca285c1b844c9323cc..f7504fa77eddfef7c023fffec4dcf4d1fde98e97 100644 --- a/VECTO/VECTO.vbproj +++ b/VECTO/VECTO.vbproj @@ -256,7 +256,8 @@ <Compile Include="GUI\VectoJobForm.vb"> <SubType>Form</SubType> </Compile> - <Compile Include="OutputData\JSONWriter.vb" /> + <Compile Include="OutputData\JSONFileWriter.vb" /> + <Compile Include="Plugins\PluginRegistry.vb" /> <Compile Include="VECTO_Global.vb" /> <Compile Include="VECTO_Types.vb" /> <Compile Include="GUI\GUI_Subs.vb" /> @@ -906,10 +907,6 @@ <WCFMetadata Include="Service References\" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\VECTOAux\VectoAuxiliaries\VectoAuxiliaries.vbproj"> - <Project>{fdeee460-0b8a-4ef6-8d9e-72f203a50f65}</Project> - <Name>VectoAuxiliaries</Name> - </ProjectReference> <ProjectReference Include="..\VectoCommon\AdvancedAuxiliaryInterfaces\AdvancedAuxiliaryInterfaces.vbproj"> <Project>{b4b9bd2f-fd8f-4bb8-82fa-e2154d2c7fbd}</Project> <Name>AdvancedAuxiliaryInterfaces</Name> diff --git a/VectoCommon/VectoCommon/InputData/IImportPlugin.cs b/VectoCommon/VectoCommon/InputData/IImportPlugin.cs new file mode 100644 index 0000000000000000000000000000000000000000..715c3cda57e07729764d5d9dd5e0eec5b1228692 --- /dev/null +++ b/VectoCommon/VectoCommon/InputData/IImportPlugin.cs @@ -0,0 +1,11 @@ +namespace TUGraz.VectoCommon.InputData +{ + public interface IImportPlugin + { + string Key { get; } + + string Name { get; } + + string ImportJob(); + } +} \ No newline at end of file diff --git a/VectoCommon/VectoCommon/OutputData/IExportPlugin.cs b/VectoCommon/VectoCommon/OutputData/IExportPlugin.cs new file mode 100644 index 0000000000000000000000000000000000000000..3ee1c4b0626d4984922ae9ae40f833c3d93e6fd3 --- /dev/null +++ b/VectoCommon/VectoCommon/OutputData/IExportPlugin.cs @@ -0,0 +1,13 @@ +using TUGraz.VectoCommon.InputData; + +namespace TUGraz.VectoCommon.OutputData +{ + public interface IExportPlugin + { + string Key { get; } + + string Name { get; } + + void ExportJob(IInputDataProvider data); + } +} \ No newline at end of file diff --git a/VectoCommon/VectoCommon/OutputData/IOutputFileWriter.cs b/VectoCommon/VectoCommon/OutputData/IOutputFileWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..fd4415e672de1db5fca41dea477d6665365ea97e --- /dev/null +++ b/VectoCommon/VectoCommon/OutputData/IOutputFileWriter.cs @@ -0,0 +1,19 @@ +using System; +using TUGraz.VectoCommon.InputData; + +namespace TUGraz.VectoCommon.OutputData +{ + public interface IOutputFileWriter + { + void SaveEngine(IEngineEngineeringInputData eng, string filename); + + void SaveGearbox(IGearboxEngineeringInputData gbx, IAxleGearInputData axl, string filename); + + void SaveVehicle(IVehicleEngineeringInputData vehicle, IRetarderInputData retarder, + IPTOTransmissionInputData pto, IAngledriveInputData angledrive, string filename); + + void SaveJob(IEngineeringInputDataProvider input, string filename); + + void ExportJob(IEngineeringInputDataProvider input, string filename, bool separateFiles); + } +} \ No newline at end of file diff --git a/VectoCommon/VectoCommon/OutputData/IOutputPlugin.cs b/VectoCommon/VectoCommon/OutputData/IOutputPlugin.cs new file mode 100644 index 0000000000000000000000000000000000000000..893a4c00dadbfe1bf7d44525a7b99f53b34639e0 --- /dev/null +++ b/VectoCommon/VectoCommon/OutputData/IOutputPlugin.cs @@ -0,0 +1,11 @@ +namespace TUGraz.VectoCommon.OutputData +{ + public interface IOutputPlugin + { + string Key { get; } + + string Name { get; } + + IOutputFileWriter Instance { get; } + } +} \ No newline at end of file diff --git a/VectoCommon/VectoCommon/VectoCommon.csproj b/VectoCommon/VectoCommon/VectoCommon.csproj index b0036079b3dc1a950d06f3706d3bd738774d2e81..84a2fd5306c270c613928dd404a9c0fabb8ce265 100644 --- a/VectoCommon/VectoCommon/VectoCommon.csproj +++ b/VectoCommon/VectoCommon/VectoCommon.csproj @@ -45,6 +45,7 @@ </ItemGroup> <ItemGroup> <Compile Include="InputData\DataSourceType.cs" /> + <Compile Include="InputData\IImportPlugin.cs" /> <Compile Include="InputData\TableData.cs"> <SubType>Component</SubType> </Compile> @@ -68,6 +69,9 @@ <Compile Include="Models\OperatingPoint.cs" /> <Compile Include="Models\RetarderType.cs" /> <Compile Include="Models\VehicleCategory.cs" /> + <Compile Include="OutputData\IExportPlugin.cs" /> + <Compile Include="OutputData\IOutputFileWriter.cs" /> + <Compile Include="OutputData\IOutputPlugin.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Utils\DoubleExtensionMethods.cs" /> <Compile Include="Utils\EnumerableExtensionMethods.cs" />