This commit is contained in:
ig 2023-10-02 14:56:38 +02:00
parent 526dd2a47f
commit b7cda31b58
13 changed files with 21 additions and 32 deletions

View File

@ -15,10 +15,10 @@ public class Installation : TreeNode
public Double Lat { get; set; } public Double Lat { get; set; }
public Double Long { get; set; } public Double Long { get; set; }
public String S3Region { get; set; } = ""; public String S3Region { get; set; } = "";
public String S3Provider { get; set; } = ""; public String S3Provider { get; set; } = "";
public String S3WriteKey { get; set; } = ""; public String S3WriteKey { get; set; } = "";
public String S3Key { get; set; } = ""; public String S3Key { get; set; } = "";
public String S3WriteSecret { get; set; } = ""; public String S3WriteSecret { get; set; } = "";
public String S3Secret { get; set; } = ""; public String S3Secret { get; set; } = "";
} }

View File

@ -260,9 +260,9 @@ public static class Topology
.Apply(TextBlock.AlignLeft) .Apply(TextBlock.AlignLeft)
.TitleBox("AC/DC"); .TitleBox("AC/DC");
var gridFlow = Flow.Horizontal(h); var dcFlow = Flow.Horizontal(h);
return TextBlock.AlignCenterVertical(inverterBox, gridFlow); return TextBlock.AlignCenterVertical(inverterBox, dcFlow);
} }
@ -397,7 +397,7 @@ public static class Topology
return TextBlock.AlignLeft("no battery").Box(); return TextBlock.AlignLeft("no battery").Box();
var voltage = bat.Dc.Voltage.ToDisplayString(); var voltage = bat.Dc.Voltage.ToDisplayString();
var soc = bat.Devices.Any() ? bat.Devices.Average(b => b.Soc).Percent().ToDisplayString() : "0"; var soc = bat.Devices.Any() ? bat.Devices.Average(b => b.Soc).Percent().ToDisplayString() : "0"; // TODO
var current = bat.Dc.Current.ToDisplayString(); var current = bat.Dc.Current.ToDisplayString();
var busCurrent = bat.Devices.Any() ? bat.Devices.Sum(b => b.BusCurrent).A().ToDisplayString() : "0"; var busCurrent = bat.Devices.Any() ? bat.Devices.Sum(b => b.BusCurrent).A().ToDisplayString() : "0";
var temp = bat.Temperature.ToDisplayString(); var temp = bat.Temperature.ToDisplayString();

View File

@ -1,12 +1,8 @@
using CliWrap; using CliWrap;
using CliWrap.Buffered;
using HandlebarsDotNet; using HandlebarsDotNet;
using InnovEnergy.App.VrmGrabber.Database; using InnovEnergy.App.VrmGrabber.Database;
using InnovEnergy.App.VrmGrabber.DataTypes;
using InnovEnergy.Lib.Utils; using InnovEnergy.Lib.Utils;
using InnovEnergy.Lib.Victron.VictronVRM;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using FILE=System.IO.File;
using VrmInstallation = InnovEnergy.Lib.Victron.VictronVRM.Installation; using VrmInstallation = InnovEnergy.Lib.Victron.VictronVRM.Installation;
namespace InnovEnergy.App.VrmGrabber; namespace InnovEnergy.App.VrmGrabber;

View File

@ -1,4 +1,3 @@
using InnovEnergy.Lib.Victron.VictronVRM;
using SQLite; using SQLite;
namespace InnovEnergy.App.VrmGrabber.DataTypes; namespace InnovEnergy.App.VrmGrabber.DataTypes;

View File

@ -1,6 +1,5 @@
using InnovEnergy.App.VrmGrabber.DataTypes; using InnovEnergy.App.VrmGrabber.DataTypes;
namespace InnovEnergy.App.VrmGrabber.Database; namespace InnovEnergy.App.VrmGrabber.Database;

View File

@ -7,7 +7,6 @@ using CliWrap.Buffered;
using InnovEnergy.App.RemoteSupportConsole; using InnovEnergy.App.RemoteSupportConsole;
using InnovEnergy.Lib.Utils; using InnovEnergy.Lib.Utils;
using InnovEnergy.Lib.Victron.VictronVRM; using InnovEnergy.Lib.Victron.VictronVRM;
using Newtonsoft.Json;
using SQLite; using SQLite;
using static System.Text.Json.JsonSerializer; using static System.Text.Json.JsonSerializer;
using static InnovEnergy.App.VrmGrabber.Database.Systemd; using static InnovEnergy.App.VrmGrabber.Database.Systemd;

View File

@ -1,6 +1,5 @@
using InnovEnergy.App.VrmGrabber.DataTypes; using InnovEnergy.App.VrmGrabber.DataTypes;
namespace InnovEnergy.App.VrmGrabber.Database; namespace InnovEnergy.App.VrmGrabber.Database;

View File

@ -71,8 +71,8 @@ public static class TypeToSignature
private static Signature? ParseTerminalSignature(Type type) private static Signature? ParseTerminalSignature(Type type)
{ {
return Signature return Signature
.Terminals .Terminals
.FirstOrDefault(s => s.Type.IsAssignableFrom(type)); .FirstOrDefault(s => s.Type.IsAssignableFrom(type));
} }
private static IReadOnlyList<Type> GetStructElements(Type type) private static IReadOnlyList<Type> GetStructElements(Type type)

View File

@ -16,7 +16,7 @@ public class ArraySignature : ContainerTypeSignature
var list = (IList) Activator.CreateInstance(listType)!; var list = (IList) Activator.CreateInstance(listType)!;
var length = reader.ReadInt32(); var length = reader.ReadInt32();
var end = reader.BytesRead + length; var end = reader.BytesRead + length;
while (reader.BytesRead < end) while (reader.BytesRead < end)
{ {
//reader.AlignForComposite(); // NOT ALIGNED! //reader.AlignForComposite(); // NOT ALIGNED!

View File

@ -2,7 +2,4 @@ namespace InnovEnergy.Lib.Protocols.DBus.Protocol.DataTypes.Signatures.Specializ
public abstract class BasicTypeSignature : Signature public abstract class BasicTypeSignature : Signature
{ {
} }

View File

@ -176,11 +176,11 @@ public readonly struct Message
var raw = reader.ReadSegment((Int32)payloadLength); var raw = reader.ReadSegment((Int32)payloadLength);
var br = new DBusBufferReader(raw, reader.SwapEndian);
if (signature.IsEmpty) if (signature.IsEmpty)
return (raw.ToArray(), true); // no signature, but data available. should probably not happen. return (raw.ToArray(), true); // no signature, but data available. should probably not happen.
var br = new DBusBufferReader(raw, reader.SwapEndian);
// try // try
// { // {
return (signature.Read(br), false); return (signature.Read(br), false);

View File

@ -5,7 +5,7 @@ using InnovEnergy.Lib.Protocols.DBus.Protocol.Header;
namespace InnovEnergy.Lib.Protocols.DBus.Protocol; namespace InnovEnergy.Lib.Protocols.DBus.Protocol;
using HeaderType = ValueTuple<Byte, Byte, Byte, Byte, UInt32, UInt32, IReadOnlyList<(Byte, Variant)>>; using HeaderType = ValueTuple<Byte, Byte, Byte, Byte, UInt32, UInt32, IReadOnlyList<(Byte, Variant)>>;
public static class Replies public static class Replies
{ {
@ -53,11 +53,11 @@ public static class Replies
HeaderType header = HeaderType header =
( (
(Byte)Env.Endianness, (Byte) Env.Endianness,
(Byte)MessageType.MethodReturn, (Byte) MessageType.MethodReturn,
(Byte)HeaderFlags.NoReplyExpected, (Byte) HeaderFlags.NoReplyExpected,
Message.ProtocolVersion, Message.ProtocolVersion,
(UInt32)signature.MeasureSize(payload), (UInt32) signature.MeasureSize(payload),
SerialSource.Next(), SerialSource.Next(),
fields fields
); );