Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Select Git revision
  • aafe09c12a8e888179aeca2d3c1136705cbb2ef3
  • stable default
  • feat-fchv-bus
  • fix-h2-ice-bus
  • powertrains-multiple-axles
  • amdm3/develop
  • issue-1039
  • amdm3/main
  • test/nuget_publish
  • IEPC-experiments
  • amdm2/main
  • amdm2/develop
  • aptngearbox-not-auto
  • playground
  • official/main
  • official/develop
  • issue-templates
  • pdf-reports
  • HEV-timeruns-dev
  • timerun-empower-hybrids
  • timerun-pwheel-hybrids
  • Release/v5.0.3
  • Release/v5.0.1
  • Release/5.0.0-RC
  • Nuget/v0.11.4-DEV
  • Release/v0.11.4-DEV
  • Release/4.3.4-DEV
  • Release/4.3.3
  • Release/4.3.2-RC
  • Release/v4.3.0-DEV
  • Release/4.2.7
  • XMLConverterTool/4.2.6.0
  • Release/4.2.6-RC
  • Release/v4.2.5
  • Release/v4.2.3
  • Release/v4.2.2.3539-RC
  • Release/v4.2.1.3469
  • Release/v0.11.2.3456-DEV
  • Release/v4.2.0.3448-RC
  • Release/v4.1.3.3415
  • Release/v4.1.1.3413
41 results

ResultFileHelper.cs

Blame
  • Forked from VECTO / VECTO Sim
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    CombustionEngineData.cs 13.21 KiB
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Runtime.InteropServices;
    using Newtonsoft.Json;
    using TUGraz.VectoCore.Exceptions;
    using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine;
    
    namespace TUGraz.VectoCore.Models.SimulationComponent.Data
    {
        /// <summary>
        /// Represents the CombustionEngineData. Fileformat: .veng
        /// </summary>
        /// <code>
        /// {
        ///  "Header": {
        ///    "CreatedBy": " ()",
        ///    "Date": "3/4/2015 12:26:24 PM",
        ///    "AppVersion": "2.0.4-beta3",
        ///    "FileVersion": 2
        ///  },
        ///  "Body": {
        ///    "SavedInDeclMode": false,
        ///    "ModelName": "Generic 24t Coach",
        ///    "Displacement": 12730.0,
        ///    "IdlingSpeed": 560.0,
        ///    "Inertia": 3.8,
        ///    "FullLoadCurves": [
        ///      {
        ///        "Path": "24t Coach.vfld",
        ///        "Gears": "0 - 99"
        ///      }
        ///    ],
        ///    "FuelMap": "24t Coach.vmap",
        ///    "WHTC-Urban": 0.0,
        ///    "WHTC-Rural": 0.0,
        ///    "WHTC-Motorway": 0.0
        ///  }
        /// }
        /// </code>
        public class CombustionEngineData : SimulationComponentData
        {
            /// <summary>
            /// A class which represents the json data format for serializing and deserializing the EngineData files.
            /// </summary>
            public class Data
            {
                public class DataHeader
                {
                    [JsonProperty(Required = Required.Always)]
                    public string CreatedBy;
    
                    [JsonProperty(Required = Required.Always)]
                    public DateTime Date;
    
                    [JsonProperty(Required = Required.Always)]
                    public string AppVersion;
    
                    [JsonProperty(Required = Required.Always)]
                    public double FileVersion;
    
                    protected bool Equals(DataHeader other)
                    {
                        return string.Equals(CreatedBy, other.CreatedBy) && Date.Equals(other.Date) && string.Equals(AppVersion, other.AppVersion) && FileVersion.Equals(other.FileVersion);
                    }
    
                    public override bool Equals(object obj)
                    {
                        if (ReferenceEquals(null, obj)) return false;