diff --git a/VECTO.sln b/VECTO.sln index 8b2bfc1eddac7358c08da4672dacbf15d31356e2..b2b3ae1189b597830fc1fb9aa40bd9a5822a74dc 100644 --- a/VECTO.sln +++ b/VECTO.sln @@ -7,6 +7,10 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VECTO", "VECTO\VECTO.vbproj EndProject Project("{F088123C-0E9E-452A-89E6-6BA2F21D5CAC}") = "VectoCoreArchitecture", "VectoCoreArchitecture\VectoCoreArchitecture.modelproj", "{165DA769-0FC8-44A7-87D6-58D037E765AB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VectoCore", "VectoCore\VectoCore.csproj", "{CD36938A-ADD9-4C65-96DA-B397CDEEA90A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VectoCoreTest", "VectoCoreTest\VectoCoreTest.csproj", "{6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -29,6 +33,18 @@ Global {165DA769-0FC8-44A7-87D6-58D037E765AB}.Release|Any CPU.ActiveCfg = Release|Any CPU {165DA769-0FC8-44A7-87D6-58D037E765AB}.Release|Any CPU.Build.0 = Release|Any CPU {165DA769-0FC8-44A7-87D6-58D037E765AB}.Release|x86.ActiveCfg = Release|Any CPU + {CD36938A-ADD9-4C65-96DA-B397CDEEA90A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD36938A-ADD9-4C65-96DA-B397CDEEA90A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD36938A-ADD9-4C65-96DA-B397CDEEA90A}.Debug|x86.ActiveCfg = Debug|Any CPU + {CD36938A-ADD9-4C65-96DA-B397CDEEA90A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD36938A-ADD9-4C65-96DA-B397CDEEA90A}.Release|Any CPU.Build.0 = Release|Any CPU + {CD36938A-ADD9-4C65-96DA-B397CDEEA90A}.Release|x86.ActiveCfg = Release|Any CPU + {6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}.Debug|x86.ActiveCfg = Debug|Any CPU + {6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}.Release|Any CPU.Build.0 = Release|Any CPU + {6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs b/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs index 7b593fe382e759e0f3c94905538004348c31d6cb..604c64ba009dfd6312f80a8caf3f0bdae9e7b957 100644 --- a/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs +++ b/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs @@ -4,12 +4,35 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using TUGraz.VectoCore.Models.Connector.Ports.Impl; +using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { public class CombustionEngineData : SimulationComponentData { - private InPort InPort{ get; set; } + /// <summary> + /// Engine description (e.g., mode, type, etc. + /// </summary> + public String ModelName { get; protected set; } + + /// <summary> + /// Engine displacement [ccm] + /// </summary> + public double Displacement { get; protected set; } + public double IdleSpeed { get; protected set; } + + public double RatedSpeed { get; protected set; } + + public double Inertia { get; protected set; } + + public double MaxPower { get; set; } + + public FuelConsumptionMap ConsumptionMap { get; protected set; } + + public FullLoadCurve FullLoadCurve(uint gear) + { + throw new NotImplementedException("get FullLoadCurve for gear"); + } } } diff --git a/VectoCore/Models/SimulationComponent/Data/Engine/FuelConsumptionMap.cs b/VectoCore/Models/SimulationComponent/Data/Engine/FuelConsumptionMap.cs new file mode 100644 index 0000000000000000000000000000000000000000..f74e8ce777e4bf507582a9447ddc5fac7f0e3480 --- /dev/null +++ b/VectoCore/Models/SimulationComponent/Data/Engine/FuelConsumptionMap.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Engine +{ + public class FuelConsumptionMap + { + } +} diff --git a/VectoCore/Models/SimulationComponent/Data/Engine/FullLoadCurve.cs b/VectoCore/Models/SimulationComponent/Data/Engine/FullLoadCurve.cs new file mode 100644 index 0000000000000000000000000000000000000000..42e96b8bc04e17088b27c0a0deefe56b33789773 --- /dev/null +++ b/VectoCore/Models/SimulationComponent/Data/Engine/FullLoadCurve.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Engine +{ + public class FullLoadCurve + { + } +} diff --git a/VectoCore/VectoCore.csproj b/VectoCore/VectoCore.csproj index af086211d010426d231f12effcc85763a777d1a9..3202d72eceb770b754aec54527205b86e03566af 100644 --- a/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore.csproj @@ -40,6 +40,10 @@ <HintPath>..\packages\Common.Logging.NLog31.3.0.0\lib\net40\Common.Logging.NLog31.dll</HintPath> <Private>True</Private> </Reference> + <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> <Reference Include="NLog"> <HintPath>..\packages\NLog.3.1.0.0\lib\net45\NLog.dll</HintPath> </Reference> @@ -60,6 +64,8 @@ <Compile Include="Models\Connector\Ports\Impl\TnOutPort.cs" /> <Compile Include="Models\Connector\Ports\ITnPort.cs" /> <Compile Include="Models\SimulationComponent\Data\CombustionEngineData.cs" /> + <Compile Include="Models\SimulationComponent\Data\Engine\FuelConsumptionMap.cs" /> + <Compile Include="Models\SimulationComponent\Data\Engine\FullLoadCurve.cs" /> <Compile Include="Models\SimulationComponent\ICombustionEngine.cs" /> <Compile Include="Models\SimulationComponent\Impl\CombustionEngine.cs" /> <Compile Include="Models\SimulationComponent\Impl\Wheels.cs" /> diff --git a/VectoCore/packages.config b/VectoCore/packages.config index e88b3407bfd5b442f23c6bf97438258b77ff3682..8cb64e159edec02c4b6d19bf674981c8477c26d6 100644 --- a/VectoCore/packages.config +++ b/VectoCore/packages.config @@ -3,5 +3,6 @@ <package id="Common.Logging" version="3.0.0" targetFramework="net45" /> <package id="Common.Logging.Core" version="3.0.0" targetFramework="net45" /> <package id="Common.Logging.NLog31" version="3.0.0" targetFramework="net45" /> + <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" /> <package id="NLog" version="3.1.0.0" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/VectoCoreTest/CombustionEngineTest.cs b/VectoCoreTest/CombustionEngineTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..2497ee174c48f02eea06d1a20bd9b5f101864d8e --- /dev/null +++ b/VectoCoreTest/CombustionEngineTest.cs @@ -0,0 +1,22 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using TUGraz.VectoCore.Models.SimulationComponent.Impl; +using TUGraz.VectoCore.Models.SimulationComponent.Data; + +namespace VectoCoreTest +{ + [TestClass] + public class CombustionEngineTest + { + [TestMethod] + public void TestMethod1() + { + var engineData = new CombustionEngineData(); + var engine = new CombustionEngine(engineData); + + // var port = engine.OutPort(); + Assert.IsNotNull(engine); + } + } +} diff --git a/VectoCoreTest/Properties/AssemblyInfo.cs b/VectoCoreTest/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..14f3dcef01186776f65911e566f9f08ce7444c2d --- /dev/null +++ b/VectoCoreTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VectoCoreTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VectoCoreTest")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("292ab9c6-e15b-44b5-8145-e655e38b9ac3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VectoCoreTest/VectoCoreTest.csproj b/VectoCoreTest/VectoCoreTest.csproj new file mode 100644 index 0000000000000000000000000000000000000000..faace054139399ce76b0d6d6159a9ad4afc198cf --- /dev/null +++ b/VectoCoreTest/VectoCoreTest.csproj @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>VectoCoreTest</RootNamespace> + <AssemblyName>VectoCoreTest</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> + <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> + <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> + <IsCodedUITest>False</IsCodedUITest> + <TestProjectType>UnitTest</TestProjectType> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <Choose> + <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> + </ItemGroup> + </When> + <Otherwise> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /> + </ItemGroup> + </Otherwise> + </Choose> + <ItemGroup> + <Compile Include="CombustionEngineTest.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\VectoCore\VectoCore.csproj"> + <Project>{cd36938a-add9-4c65-96da-b397cdeea90a}</Project> + <Name>VectoCore</Name> + </ProjectReference> + </ItemGroup> + <Choose> + <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + </ItemGroup> + </When> + </Choose> + <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file