diff --git a/DeclarationCycleZip/App.config b/DeclarationCycleZip/App.config new file mode 100644 index 0000000000000000000000000000000000000000..8e15646352ec1d9a84bbc6504ef6b46e16bf7823 --- /dev/null +++ b/DeclarationCycleZip/App.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> + </startup> +</configuration> \ No newline at end of file diff --git a/DeclarationCycleZip/DeclarationCycleZip.csproj b/DeclarationCycleZip/DeclarationCycleZip.csproj new file mode 100644 index 0000000000000000000000000000000000000000..c500389f35e032763cfd2f8130daf9471e36f946 --- /dev/null +++ b/DeclarationCycleZip/DeclarationCycleZip.csproj @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>DeclarationCycleZip</RootNamespace> + <AssemblyName>DeclarationCycleZip</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <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' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\VectoCore\VectoCore.csproj"> + <Project>{CD36938A-ADD9-4C65-96DA-B397CDEEA90A}</Project> + <Name>VectoCore</Name> + </ProjectReference> + </ItemGroup> + <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 diff --git a/DeclarationCycleZip/Program.cs b/DeclarationCycleZip/Program.cs new file mode 100644 index 0000000000000000000000000000000000000000..8bde138eeb923f7ae2b331c580aeaeb3f5db8284 --- /dev/null +++ b/DeclarationCycleZip/Program.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TUGraz.VectoCore.FileIO.Reader; +using TUGraz.VectoCore.Utils; + +namespace DeclarationCycleZip +{ + internal class Program + { + private static void Main(string[] args) + { + var cycleData = DrivingCycleDataReader.ReadFromFileDistanceBased(args[0]); + + var table = new DataTable(); + table.Columns.Add("<s>"); + table.Columns.Add("<v>"); + table.Columns.Add("<grad>"); + table.Columns.Add("<stop>"); + + var lastDistance = cycleData.Entries.First().Distance - 1.SI<Meter>(); + foreach (var x in cycleData.Entries) { + if (x.Distance.IsEqual(lastDistance)) { + continue; + } + var row = table.NewRow(); + row["<s>"] = x.Distance.Value(); + row["<v>"] = x.VehicleTargetSpeed.ConvertTo().Kilo.Meter.Per.Hour.Value(); + row["<grad>"] = x.RoadGradientPercent; + row["<stop>"] = x.StoppingTime.Value(); + table.Rows.Add(row); + lastDistance = x.Distance; + } + + VectoCSVFile.Write(Path.GetFileName(args[0]), table); + } + } +} \ No newline at end of file diff --git a/DeclarationCycleZip/Properties/AssemblyInfo.cs b/DeclarationCycleZip/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..dd38692ea994635699e3b17918ad6852186f2958 --- /dev/null +++ b/DeclarationCycleZip/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("DeclarationCycleZip")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DeclarationCycleZip")] +[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("b8f01491-78a5-4d78-a575-3e6d1eed6e7e")] + +// 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/VECTO.sln b/VECTO.sln index 7e771ed2e31991ea785c702ca81736843d73efab..c32622f88209bd4ae31c369a69dd717f2f67a833 100644 --- a/VECTO.sln +++ b/VECTO.sln @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VectoConsole", "VectoConsol EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphDrawer", "GraphDrawer\GraphDrawer.csproj", "{6589CAEC-ECC9-4BCC-9699-DE3F22BBCBD4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeclarationCycleZip", "DeclarationCycleZip\DeclarationCycleZip.csproj", "{2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -83,6 +85,14 @@ Global {6589CAEC-ECC9-4BCC-9699-DE3F22BBCBD4}.Release|Any CPU.Build.0 = Release|Any CPU {6589CAEC-ECC9-4BCC-9699-DE3F22BBCBD4}.Release|x64.ActiveCfg = Release|Any CPU {6589CAEC-ECC9-4BCC-9699-DE3F22BBCBD4}.Release|x86.ActiveCfg = Release|Any CPU + {2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}.Debug|x64.ActiveCfg = Debug|Any CPU + {2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}.Debug|x86.ActiveCfg = Debug|Any CPU + {2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}.Release|Any CPU.Build.0 = Release|Any CPU + {2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}.Release|x64.ActiveCfg = Release|Any CPU + {2320CD6F-FE7B-4341-A9BB-3ABCA7EF18F6}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE