Skip to content

Commit

Permalink
Updated LiveEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
cBashTN committed Jun 19, 2024
1 parent 3421178 commit 7c137d8
Show file tree
Hide file tree
Showing 21 changed files with 130 additions and 72 deletions.
15 changes: 5 additions & 10 deletions LiveEditor/LiveEditor.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.8" PrivateAssets="all" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Radzen.Blazor" Version="3.20.12" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Source\KellerAg.Shared.IoT.Converters\KellerAg.Shared.IoT.Converters.csproj" />
</ItemGroup>

<ItemGroup>
<Content Update="wwwroot\assets\css\software.css">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
Expand Down Expand Up @@ -167,5 +163,4 @@
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>

</Project>
</Project>
31 changes: 31 additions & 0 deletions LiveEditor/LiveEditor.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.34825.169
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveEditor", "LiveEditor.csproj", "{E021DF21-424E-4EAB-9A16-46E8E8427835}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KellerAg.Shared.IoT.Converters", "..\Source\KellerAg.Shared.IoT.Converters\KellerAg.Shared.IoT.Converters.csproj", "{CC6C14E1-D554-4683-AD50-12FBE9298B37}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E021DF21-424E-4EAB-9A16-46E8E8427835}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E021DF21-424E-4EAB-9A16-46E8E8427835}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E021DF21-424E-4EAB-9A16-46E8E8427835}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E021DF21-424E-4EAB-9A16-46E8E8427835}.Release|Any CPU.Build.0 = Release|Any CPU
{CC6C14E1-D554-4683-AD50-12FBE9298B37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC6C14E1-D554-4683-AD50-12FBE9298B37}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC6C14E1-D554-4683-AD50-12FBE9298B37}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC6C14E1-D554-4683-AD50-12FBE9298B37}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3AAA0EB0-A674-410B-8F0C-7C66F51885A5}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion LiveEditor/Pages/HowTo.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<li><a href="https://keller-druck.com/en/downloads?id=X35LDeWEgkPdjekTAzEn6b#results">Communication protocol for ARC1 LoRaWAN</a></li>
</ul>
<p>
The <em>KellerAg.Shared.IoT.Converters</em> are an example implementation of said communication protocols and used by KELLER&#39;s <a href="www.kolibricloud.ch">KOLIBRI Cloud</a>.
The <em>KellerAg.Shared.IoT.Converters</em> are an example implementation of said communication protocols and used by KELLER&#39;s <a href="www.pressuresuite.com">PressureSuite Cloud</a>.
<br/>
<img width="1200" src="https://github.com/KELLERAGfuerDruckmesstechnik/KellerAg.Shared.IoT.Converters/blob/master/Readme.Overview.png?raw=true" alt="overview">
</p>
Expand Down
40 changes: 25 additions & 15 deletions LiveEditor/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:46275",
"sslPort": 44369
}
},
"profiles": {
"LiveEditor": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7210;http://localhost:5210",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"dotnetRunMessages": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7210;http://localhost:5210"
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
},
"WSL": {
"commandName": "WSL2",
"launchBrowser": true,
"launchUrl": "https://localhost:7210",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "https://localhost:7210;http://localhost:5210"
},
"distributionName": ""
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:46275",
"sslPort": 44369
}
}
}
}
2 changes: 1 addition & 1 deletion LiveEditor/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="top-row pl-4 navbar navbar-dark">
<a class="navbar-brand" href="">KOLIBRI Converter</a>
<a class="navbar-brand" href="">PressureSuite Converter</a>
<button class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1;net8.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="6.2.1" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Version>3.24.0</Version>
<Company>KELLER Druckmesstechnik AG</Company>
<Authors>KELLER Druckmesstechnik AG</Authors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Version>3.24.0</Version>
<Company>KELLER Druckmesstechnik AG</Company>
<Authors>Sebastian Mojado</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<Version>6.2.1</Version>
</PackageReference>
<PackageReference Include="FluentAssertions">
<Version>5.10.3</Version>
<Version>6.12.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.core">
<Version>2.4.2</Version>
<Version>2.8.1</Version>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio">
<Version>2.4.5</Version>
<Version>2.8.1</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<!-- The identifier that must be unique within the hosting gallery -->
<PackageId>KellerAg.Cloud.GsmCommunicationToJson</PackageId>
<!-- The package version number that is used when resolving dependencies -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="6.2.1" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public void WhenGivenAValidTTNJson_ThenConvertedValuesMustBeCorrect()
result.HasErrors.Should().BeFalse();
result.BusinessObjectRoot.DeviceInformation.ProductLine = ProductLineName.ARC1_LoRa;
result.BusinessObjectRoot.LoRaData.RSSI = -42; //not the weaker -61
result.BusinessObjectRoot.LoRaData.Time.Should().BeCloseTo((new DateTime(2017, 10, 30, 11, 18, 25, DateTimeKind.Utc)).AddMilliseconds(511.3805));
var dt = new DateTime(2017, 10, 30, 11, 18, 25, DateTimeKind.Utc).AddMilliseconds(511.3805);
result.BusinessObjectRoot.LoRaData.Time.Should().BeCloseTo(dt, TimeSpan.FromSeconds(1));
result.BusinessObjectRoot.LoRaData.Measurements[3] = 0.9713000059127808f;
result.BusinessObjectRoot.LoRaData.DeviceConnectionType.Should().Be(5);
}
Expand Down Expand Up @@ -111,7 +112,8 @@ public void WhenGivenAValidActilityWithDeviceInformationJson_ThenDeviceInformati
result.BusinessObjectRoot.DeviceInformation.BatteryCapacity.Should().Be(99);
result.BusinessObjectRoot.DeviceInformation.MeasuredBatteryVoltage.Should().BeInRange(4.93593f, 4.93594f);
result.BusinessObjectRoot.DeviceInformation.DeviceIdAndClass.Should().Be("19.00");
result.BusinessObjectRoot.DeviceInformation.DeviceLocalDateTime.Should().BeCloseTo(new DateTime(2019, 11, 01, 16, 45, 36));
var dt = new DateTime(2019, 11, 01, 16, 45, 36);
result.BusinessObjectRoot.DeviceInformation.DeviceLocalDateTime.Should().BeCloseTo(dt, TimeSpan.FromSeconds(1));
result.BusinessObjectRoot.DeviceInformation.MeasuredHumidity.Should().Be(40);
result.BusinessObjectRoot.DeviceInformation.DeviceSerialNumber.Should().Be(28);
result.BusinessObjectRoot.DeviceInformation.GsmModuleSoftwareVersion.Should().Be("19.45");
Expand Down Expand Up @@ -141,7 +143,8 @@ public void WhenGivenAnValidLoriotJson_ThenNoErrorsAreReported()
ConversionResult result = _testee.Convert(TestMeasurementMessageLoriot);
result.HasErrors.Should().BeFalse();
result.BusinessObjectRoot.LoRaData.RSSI.Should().Be(-101);
result.BusinessObjectRoot.LoRaData.Time.Should().BeCloseTo(new DateTime(2018, 04, 05, 14, 26, 5, DateTimeKind.Utc).AddMilliseconds(141));
var dt = new DateTime(2018, 04, 05, 14, 26, 5, DateTimeKind.Utc).AddMilliseconds(141);
result.BusinessObjectRoot.LoRaData.Time.Should().BeCloseTo(dt, TimeSpan.FromSeconds(1));
result.BusinessObjectRoot.LoRaData.Measurements[7].Should().Be(0.96485f);
result.BusinessObjectRoot.LoRaData.DeviceConnectionType.Should().Be(5);

Expand Down
2 changes: 1 addition & 1 deletion Source/JsonToBusinessObjects/JsonToBusinessObjects.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<!-- The identifier that must be unique within the hosting gallery -->
<PackageId>KellerAg.Cloud.JsonToBusinessObjects</PackageId>
<!-- The package version number that is used when resolving dependencies -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void WhenGivenAValidPayloadWithNaNFloats_ThenValuesShouldBeCorrect()
{
var extractedInformation = PayloadConverter.ConvertFromActility("010501d37fc000007fc000007fc000003f76c8b441bb33333920ac08", 1);

extractedInformation.FunctionCode.Should().Be(1);
extractedInformation.FunctionCode.Should().Be(FunctionCodeId.MeasurementMessage);
extractedInformation.DecodedPayload.Length.Should().NotBe(0);
extractedInformation.Measurements.Count.Should().Be(6);
extractedInformation.Measurements.ToArray()[3].Value.Should().Be(0.964f);
Expand Down Expand Up @@ -52,7 +52,7 @@ public void WhenGivenAValidTTNPayload_ThenValuesShouldBeCorrect()
{
var extractedInformation = PayloadConverter.ConvertFromTheThingNetwork("AQswAD93JxNBu1wp",(int)FunctionCodeId.MeasurementMessage);

extractedInformation.FunctionCode.Should().Be(1);
extractedInformation.FunctionCode.Should().Be(FunctionCodeId.MeasurementMessage);
extractedInformation.DecodedPayload.Length.Should().NotBe(0);
extractedInformation.Measurements.Count.Should().Be(2);

Expand Down Expand Up @@ -101,7 +101,7 @@ public void WhenGivenAValidTTNPayloadWithPort4_ThenDeviceInformationShouldBeCorr
extractedInformation.Info.BatteryCapacity.Should().Be(99);
extractedInformation.Info.BatteryVoltage.Should().BeInRange(4.93593f, 4.93594f);
extractedInformation.Info.DeviceClassGroupText.Should().Be("19.00");
extractedInformation.Info.DeviceLocalDateTime.Should().BeCloseTo(new DateTime(2019, 11, 01, 16, 45, 36));
extractedInformation.Info.DeviceLocalDateTime.Should().BeCloseTo(new DateTime(2019, 11, 01, 16, 45, 36), TimeSpan.FromMinutes(1));
extractedInformation.Info.HumidityPercentage.Should().Be(40);
extractedInformation.Info.SerialNumber.Should().Be(28);
extractedInformation.Info.SwVersionText.Should().Be("19.45");
Expand All @@ -117,7 +117,7 @@ public void WhenGivenAPayloadWithMeasurements_ThenValuesShouldBeCorrect()
{
var extractedInformation = PayloadConverter.ConvertFromActility("010300D3BF7595F03C5C91304249C7C03F79081C42477AE1", 1);

extractedInformation.FunctionCode.Should().Be(1);
extractedInformation.FunctionCode.Should().Be(FunctionCodeId.MeasurementMessage);

extractedInformation.Measurements.Count.Should().Be(5);
extractedInformation.Measurements.ToArray()[0].Value.Should().Be(-0.9593191f);
Expand Down Expand Up @@ -156,7 +156,7 @@ public void WhenGivenAPayloadWithInformationMessage_ThenValuesShouldBeCorrect()
extractedInformation.Info.BatteryCapacity.Should().Be(99);
extractedInformation.Info.BatteryVoltage.Should().BeInRange(4.7719f, 4.77191f);
extractedInformation.Info.DeviceClassGroupText.Should().Be("19.00");
extractedInformation.Info.DeviceLocalDateTime.Should().BeCloseTo(new DateTime(2019, 12, 01, 17, 06, 50));
extractedInformation.Info.DeviceLocalDateTime.Should().BeCloseTo(new DateTime(2019, 12, 01, 17, 06, 50),TimeSpan.FromMinutes(1));
extractedInformation.Info.HumidityPercentage.Should().Be(29);
extractedInformation.Info.SerialNumber.Should().Be(100);
extractedInformation.Info.SwVersionText.Should().Be("19.47");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Company>KELLER Druckmesstechnik AG</Company>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://docs.kolibricloud.ch/sending-technology/converter-library</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static DeviceSettings CreateConfiguration(
UniqueSerialNumber = string.IsNullOrEmpty(deviceSerialNumber) ? "unknown": deviceSerialNumber,
//DESCRIPTION -> See Device.Note

//LockTimerOnlyCheck / Bit 3 -> This is for write. WHICH MUST BE ALWAYS TRUE IN KOLIBRI
//LockTimerOnlyCheck / Bit 3 -> This is for write. WHICH MUST BE ALWAYS TRUE IN PressureSuite
//Val110Fu3031Index20? (Reserve)
//Val109Fu3031Index19? (Reserve)

Expand Down Expand Up @@ -88,7 +88,7 @@ public static DeviceSettings CreateConfiguration(
MeasurementSmsText = textEmailSmsLocSettings?.SmsText1Measure,
MeasurementSendMailAfterX = measurementSettings?.SendMailAfterXMeasurements,
MeasurementSendSmsAfterX = measurementSettings?.SendSmsAfterXMeasurements,
MeasurementSendFtpAfterX = measurementSettings2?.SendToFtpAfterXCollectedMeasurements, //Let's not do this anymore in KOLIBRI
MeasurementSendFtpAfterX = measurementSettings2?.SendToFtpAfterXCollectedMeasurements, //Let's not do this anymore in PressureSuite

GprsAPN = gprsSettings?.GprsAPN,
GprsID = gprsSettings?.GprsID,
Expand Down
Loading

0 comments on commit 7c137d8

Please sign in to comment.