mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-09 09:45:06 +00:00
Adds RuntimeInfo class to InfoConfig and populates values when CotijaController class calls RegisterSystemToServer()
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -19,7 +21,10 @@ namespace PepperDash.Essentials.Core.Config
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonProperty("version")]
|
||||
public string Version { get; set; }
|
||||
public string Version { get; set; }
|
||||
|
||||
[JsonProperty("runtimeInfo")]
|
||||
public RuntimeInfo RuntimeInfo { get; set; }
|
||||
|
||||
[JsonProperty("comment")]
|
||||
public string Comment { get; set; }
|
||||
@@ -30,7 +35,34 @@ namespace PepperDash.Essentials.Core.Config
|
||||
Date = DateTime.Now;
|
||||
Type = "";
|
||||
Version = "";
|
||||
Comment = "";
|
||||
Comment = "";
|
||||
|
||||
RuntimeInfo = new RuntimeInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Represents runtime information about the program/processor
|
||||
/// </summary>
|
||||
public class RuntimeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the running application
|
||||
/// </summary>
|
||||
[JsonProperty("appName")]
|
||||
public string AppName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Assembly version of the running application
|
||||
/// </summary>
|
||||
[JsonProperty("assemblyVersion")]
|
||||
public string AssemblyVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The OS Version of the processor (Firmware Version)
|
||||
/// </summary>
|
||||
[JsonProperty("osVersion")]
|
||||
public string OsVersion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ namespace PepperDash.Essentials
|
||||
[JsonProperty("template_url")]
|
||||
public string TemplateUrl { get; set; }
|
||||
|
||||
|
||||
//public CotijaConfig Cotija { get; private set; }
|
||||
|
||||
public string SystemUuid
|
||||
|
||||
@@ -99,6 +99,10 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using Crestron.SimplSharp.CrestronWebSocketClient;
|
||||
using Crestron.SimplSharpPro;
|
||||
@@ -208,6 +209,11 @@ namespace PepperDash.Essentials
|
||||
try
|
||||
{
|
||||
var confObject = ConfigReader.ConfigObject;
|
||||
confObject.Info.RuntimeInfo.AppName = Assembly.GetExecutingAssembly().GetName().Name;
|
||||
var version = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
confObject.Info.RuntimeInfo.AssemblyVersion = string.Format("v{0}.{1}.{2}", version.Major, version.Minor, version.Build);
|
||||
confObject.Info.RuntimeInfo.OsVersion = Crestron.SimplSharp.CrestronEnvironment.OSVersion.Firmware;
|
||||
|
||||
string postBody = JsonConvert.SerializeObject(confObject);
|
||||
SystemUuid = confObject.SystemUuid;
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user