This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1 @@
12

View File

@@ -0,0 +1 @@
12

View File

@@ -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("MODSensorFile")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MODSensorFile")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[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("345d5cdb-1d15-4190-ae68-658206b43e67")]
// 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")]

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MODSensorFile
{
public class SensorFile
{
public List<MODSensor> Sensors = new List<MODSensor>();
public SensorFile() { }
public SensorFile(string filename)
{
var lines = File.ReadAllLines(filename).ToList();
foreach (var line in lines)
{
var parameters = line.Split(' ').ToList();
parameters.RemoveAll(p => string.IsNullOrWhiteSpace(p));
var sensor = new MODSensor();
int i = 0;
sensor.PhysicalChannel = int.Parse(parameters[i++]);
sensor.SensorName = parameters[i++];
sensor.SensorSerial = parameters[i++];
sensor.SignalReverse = int.Parse(parameters[i++]);
sensor.CFCClass = int.Parse(parameters[i++]);
sensor.PhysicalProperty = char.Parse(parameters[i++]);
sensor.EngineeringUnits = parameters[i++];
sensor.Sensibility = float.Parse(parameters[i++]);
sensor.FullScale = float.Parse(parameters[i++]);
sensor.ExcitationVoltage = float.Parse(parameters[i++]);
sensor.Type = int.Parse(parameters[i++]);
sensor.ExpectedDallasID = parameters[i++];
sensor.RemoveOffset = int.Parse(parameters[i++]);
Sensors.Add(sensor);
}
}
}
}

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{345D5CDB-1D15-4190-AE68-658206B43E67}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MODSensorFile</RootNamespace>
<AssemblyName>MODSensorFile</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</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>
<PlatformTarget>x64</PlatformTarget>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<NoWarn>1591</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</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.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MODSensor.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SensorFile.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,86 @@
namespace MODSensorFile
{
public class MODSensor
{
/// <summary>
/// Sensor Record ID; 3 digit ID code
/// </summary>
public int PhysicalChannel { get; set; }
/// <summary>
/// Name of the sensor
/// </summary>
public string SensorName { get; set; }
/// <summary>
/// Alpha-numeric Serial Number of the sensor
/// </summary>
public string SensorSerial { get; set; }
/// <summary>
/// Polarity - positive polarity = 0, inverse polarity = 1
/// </summary>
public int SignalReverse { get; set; }
/// <summary>
/// SAE J211 Channel Frequency Class for the sensor
/// </summary>
public int CFCClass { get; set; }
/// <summary>
/// Physical Property?
/// </summary>
public char PhysicalProperty { get; set; }
/// <summary>
/// EU for the sensor
/// </summary>
public string EngineeringUnits { get; set; }
/// <summary>
/// Sensor Sensitivity
/// </summary>
public float Sensibility { get; set; }
/// <summary>
/// Full scale EU range (+/-, for example 1000, means +1000/-1000)
/// </summary>
public float FullScale { get; set; }
/// <summary>
/// Excitation Voltage for the sensor
/// </summary>
public float ExcitationVoltage { get; set; }
/// <summary>
/// Type: 0=full bridge, 1=half bridge, 2=voltage
/// </summary>
public int Type { get; set; }
/// <summary>
/// The Dallas ID for the sensor
/// </summary>
public string ExpectedDallasID { get; set; }
/// <summary>
/// Remove offset (normally half of pretrigger)
/// </summary>
public int RemoveOffset { get; set; }
public enum Polarity
{
Normal = 0,
Inverse = 1,
}
public bool IsInverted()
{
return SignalReverse == (int)Polarity.Inverse;
}
public enum SensorType
{
FullBridge = 0,
HalfBridge = 1,
Voltage = 2,
}
public SensorType GetSensorType()
{
return (SensorType)Type;
}
public enum OffsetRemoval
{
None = 0,
Remove = 1,
}
public OffsetRemoval GetOffsetRemoval()
{
return (OffsetRemoval)RemoveOffset;
}
}
}

Binary file not shown.

View File