SPDFileTranslator 3.0.1
See the version list below for details.
dotnet add package SPDFileTranslator --version 3.0.1
NuGet\Install-Package SPDFileTranslator -Version 3.0.1
<PackageReference Include="SPDFileTranslator" Version="3.0.1" />
paket add SPDFileTranslator --version 3.0.1
#r "nuget: SPDFileTranslator, 3.0.1"
// Install SPDFileTranslator as a Cake Addin #addin nuget:?package=SPDFileTranslator&version=3.0.1 // Install SPDFileTranslator as a Cake Tool #tool nuget:?package=SPDFileTranslator&version=3.0.1
To implement the package use the following instructions.
Please note that to handle the exceptions, you will need to add a global exception handler (or similar) to your project and prefereably implement ILogger to track any exceptions.
Implementing the SPD file translator
string inputFile = "C:\\35860011.SPD";
SPDData spdData = new SPDTranslatorImplementation(inputFile);
await spdData.ReadSPDDataAsync();
This will return the translated data and you can do what you need to with it.
Implementing Grouping
The groupings are for use in charting and reporting, they are not saved in any way. Saving groupings can be achieved in your application.
Please take note of the Enum below.
public enum SPDReadingValuesGroupingTypeEnum
{
Minutes = 1,
FifteenMinutes = 2,
ThirtyMinutes = 3,
Hourly = 4,
Daily = 5,
}
From the SPDData model get the serial number as follows:
int serialNumber = spdData.SPDHeaderValues.SPDSerialNumber;
Use the required enum value and the device serial number to create the required grouping.
SPDDataGroupingsImplementation grouping = new SPDDataGroupingsImplementation(spdData.ReadingValues, serialNumber);
var group = grouping.GroupCurrentByPhaseByTime(SPDReadingValuesGroupingTypeEnum.Minutes);
Saving the Data
To save the data you can save it as XML, JSON or CSV.
This will write the SPDData values and will not write the groupings.
WARNING! The XML and JSON files can be very large up to 200MB so it is reccomended these are processed once as the memeory usage is significant.
The invalid character check has been turned off for the XML file creation. There is a check in code to remove non XML characters, but there maybe some charaters such as null terminations which are not caught, so please check for additional invalid characters in your processing.
string outputRoot = "C:\\SPCData";
SPDTranslatorImplementationSaveFiles saveFiles = new SPDTranslatorImplementationSaveFiles(spdData, outputRoot);
await saveFiles.SaveCsvDataAsync();
await saveFiles.SaveJsonDataAsyn();
await saveFiles.SaveXMLDataAsync();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- CsvHelper (>= 31.0.2)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
4.0.1 | 66 | 11/8/2024 |
4.0.0 | 72 | 10/29/2024 |
3.0.27 | 101 | 8/30/2024 |
3.0.26 | 91 | 8/29/2024 |
3.0.25 | 111 | 8/28/2024 |
3.0.24 | 89 | 8/28/2024 |
3.0.23 | 93 | 8/28/2024 |
3.0.22 | 131 | 8/28/2024 |
3.0.21 | 111 | 8/27/2024 |
3.0.20 | 95 | 8/27/2024 |
3.0.19 | 105 | 8/27/2024 |
3.0.18 | 94 | 8/27/2024 |
3.0.17 | 105 | 8/27/2024 |
3.0.16 | 98 | 8/27/2024 |
3.0.15 | 95 | 8/27/2024 |
3.0.14 | 93 | 8/27/2024 |
3.0.13 | 122 | 8/27/2024 |
3.0.12 | 100 | 7/10/2024 |
3.0.11 | 63 | 7/4/2024 |
3.0.10 | 102 | 7/4/2024 |
3.0.9 | 112 | 7/4/2024 |
3.0.8 | 104 | 7/3/2024 |
3.0.7 | 101 | 6/28/2024 |
3.0.6 | 98 | 6/25/2024 |
3.0.5 | 99 | 6/25/2024 |
3.0.4 | 86 | 6/21/2024 |
3.0.3 | 106 | 6/18/2024 |
3.0.2 | 111 | 6/17/2024 |
3.0.1 | 114 | 6/17/2024 |
3.0.0 | 103 | 6/17/2024 |
2.1.2 | 117 | 6/1/2024 |
2.1.1 | 106 | 4/24/2024 |
Fixed XML ICollection bug