Configuration now uses JSON. Fixed command line parsing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using IniParser.Model;
|
||||
using System;
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
|
||||
namespace Barsik
|
||||
@@ -12,14 +12,14 @@ namespace Barsik
|
||||
{
|
||||
const string CORE_STR = "Core{0} Temp:";
|
||||
|
||||
public SensorsMonitoringUnit(SectionData config, RegistersContainer registers) : base(config, registers)
|
||||
public SensorsMonitoringUnit(JsonElement config, RegistersContainer registers) : base(config, registers)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
int cores = int.Parse(config.Keys["Cores"]);
|
||||
var multiplier = float.Parse(config.Keys["Multiplier"]);
|
||||
int cores = config.GetProperty("Cores").GetInt32();
|
||||
var multiplier = config.GetProperty("Multiplier").GetDouble();
|
||||
while (true)
|
||||
{
|
||||
System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo("sensors");
|
||||
|
||||
Reference in New Issue
Block a user