enable debug data
This commit is contained in:
parent
571e1951bb
commit
2f0b3f6228
@ -5,11 +5,12 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|||||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
builder.RootComponents.Add<App>("#app");
|
builder.RootComponents.Add<App>("#app");
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||||
builder.Services.AddScoped(_ => new HttpClient
|
builder.Services.AddScoped(
|
||||||
{
|
_ => new HttpClient
|
||||||
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress),
|
{
|
||||||
Timeout = TimeSpan.FromSeconds(3)
|
BaseAddress = new(builder.HostEnvironment.BaseAddress),
|
||||||
});
|
Timeout = TimeSpan.FromSeconds(3)
|
||||||
|
});
|
||||||
_ = InverterMon.Client.Pages.Index.StartStatusStreaming(builder.HostEnvironment.BaseAddress);
|
_ = InverterMon.Client.Pages.Index.StartStatusStreaming(builder.HostEnvironment.BaseAddress);
|
||||||
_ = InverterMon.Client.Pages.BMS.StartStatusStreaming(builder.HostEnvironment.BaseAddress);
|
_ = InverterMon.Client.Pages.BMS.StartStatusStreaming(builder.HostEnvironment.BaseAddress);
|
||||||
await builder.Build().RunAsync();
|
await builder.Build().RunAsync();
|
||||||
@ -128,7 +128,7 @@ public class JkBms
|
|||||||
Status.PackVoltage = 25.6f;
|
Status.PackVoltage = 25.6f;
|
||||||
Status.IsCharging = true;
|
Status.IsCharging = true;
|
||||||
Status.AvgCurrentAmps = 21.444f;
|
Status.AvgCurrentAmps = 21.444f;
|
||||||
Status.CapacityPct = 90;
|
Status.CapacityPct = 50;
|
||||||
Status.PackCapacity = 320;
|
Status.PackCapacity = 320;
|
||||||
Status.PackNominalVoltage = 51.2f;
|
Status.PackNominalVoltage = 51.2f;
|
||||||
Status.IsWarning = false;
|
Status.IsWarning = false;
|
||||||
|
|||||||
@ -31,28 +31,27 @@ public class Endpoint : EndpointWithoutRequest<object>
|
|||||||
{
|
{
|
||||||
while (!c.IsCancellationRequested && !AppLife.ApplicationStopping.IsCancellationRequested)
|
while (!c.IsCancellationRequested && !AppLife.ApplicationStopping.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
// if (Env.IsDevelopment())
|
if (Env.IsDevelopment())
|
||||||
// {
|
{
|
||||||
// var status = new InverterStatus
|
var status = new InverterStatus
|
||||||
// {
|
{
|
||||||
// OutputVoltage = Random.Shared.Next(240),
|
OutputVoltage = Random.Shared.Next(240),
|
||||||
// LoadWatts = Random.Shared.Next(3500),
|
LoadWatts = Random.Shared.Next(3500),
|
||||||
// LoadPercentage = Random.Shared.Next(100),
|
LoadPercentage = Random.Shared.Next(100),
|
||||||
// BatteryVoltage = Random.Shared.Next(24),
|
BatteryVoltage = Random.Shared.Next(24),
|
||||||
// BatteryChargeCurrent = Random.Shared.Next(20),
|
BatteryChargeCurrent = Random.Shared.Next(20),
|
||||||
// BatteryDischargeCurrent = Random.Shared.Next(300),
|
BatteryDischargeCurrent = Random.Shared.Next(300),
|
||||||
// HeatSinkTemperature = Random.Shared.Next(300),
|
PVInputCurrent = Random.Shared.Next(300),
|
||||||
// PVInputCurrent = Random.Shared.Next(300),
|
PVInputVoltage = Random.Shared.Next(300),
|
||||||
// PVInputVoltage = Random.Shared.Next(300),
|
PVInputWatt = Random.Shared.Next(1000),
|
||||||
// PVInputWatt = Random.Shared.Next(1000),
|
PV_MaxCapacity = 1000,
|
||||||
// PV_MaxCapacity = 1000,
|
BatteryCapacity = 100
|
||||||
// BatteryCapacity = 100
|
};
|
||||||
// };
|
|
||||||
//
|
yield return status;
|
||||||
// yield return status;
|
}
|
||||||
// }
|
else
|
||||||
// else
|
yield return Inverter.Status;
|
||||||
yield return Inverter.Status;
|
|
||||||
|
|
||||||
await Task.Delay(2000, c);
|
await Task.Delay(2000, c);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,25 +17,25 @@ public class Endpoint : EndpointWithoutRequest<CurrentSettings>
|
|||||||
|
|
||||||
public override async Task HandleAsync(CancellationToken c)
|
public override async Task HandleAsync(CancellationToken c)
|
||||||
{
|
{
|
||||||
// if (Env.IsDevelopment())
|
if (Env.IsDevelopment())
|
||||||
// {
|
{
|
||||||
// var res = new CurrentSettings
|
var res = new CurrentSettings
|
||||||
// {
|
{
|
||||||
// BackToBatteryVoltage = 48.1,
|
BackToBatteryVoltage = 48.1,
|
||||||
// BackToGridVoltage = 48.2,
|
BackToGridVoltage = 48.2,
|
||||||
// FloatChargeVoltage = 48.3,
|
FloatChargeVoltage = 48.3,
|
||||||
// ChargePriority = ChargePriority.OnlySolar,
|
ChargePriority = ChargePriority.OnlySolar,
|
||||||
// DischargeCuttOffVoltage = 48.4,
|
DischargeCuttOffVoltage = 48.4,
|
||||||
// BulkChargeVoltage = 48.5,
|
BulkChargeVoltage = 48.5,
|
||||||
// MaxACChargeCurrent = 10,
|
MaxACChargeCurrent = 10,
|
||||||
// MaxCombinedChargeCurrent = 20,
|
MaxCombinedChargeCurrent = 20,
|
||||||
// OutputPriority = OutputPriority.SolarFirst,
|
OutputPriority = OutputPriority.SolarFirst,
|
||||||
// SystemSpec = UserSettings.ToSystemSpec()
|
SystemSpec = UserSettings.ToSystemSpec()
|
||||||
// };
|
};
|
||||||
// await SendAsync(res, cancellation: c);
|
await SendAsync(res, cancellation: c);
|
||||||
//
|
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@ -23,12 +23,11 @@ bld.Services
|
|||||||
.AddSingleton<FelicitySolarInverter>()
|
.AddSingleton<FelicitySolarInverter>()
|
||||||
.AddSingleton<JkBms>();
|
.AddSingleton<JkBms>();
|
||||||
|
|
||||||
// if (!bld.Environment.IsDevelopment())
|
if (!bld.Environment.IsDevelopment())
|
||||||
// {
|
{
|
||||||
bld.Services
|
bld.Services
|
||||||
.AddHostedService<StatusRetriever>();
|
.AddHostedService<StatusRetriever>();
|
||||||
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
bld.Services.AddFastEndpoints(o => o.SourceGeneratorDiscoveredTypes = DiscoveredTypes.All);
|
bld.Services.AddFastEndpoints(o => o.SourceGeneratorDiscoveredTypes = DiscoveredTypes.All);
|
||||||
|
|
||||||
|
|||||||
@ -69,14 +69,12 @@ public class BMSStatus
|
|||||||
|
|
||||||
public string GetTimeString()
|
public string GetTimeString()
|
||||||
{
|
{
|
||||||
var currentTime = DateTime.UtcNow
|
var currentTime = DateTime.UtcNow.AddHours(5).AddMinutes(30); //only supports IST time zone :-(
|
||||||
.AddHours(5).AddMinutes(30); //only supports IST time zone :-(
|
|
||||||
|
|
||||||
var futureTime = currentTime.AddHours(TimeHrs).AddMinutes(TimeMins);
|
var futureTime = currentTime.AddHours(TimeHrs).AddMinutes(TimeMins);
|
||||||
|
|
||||||
if (futureTime.Date == currentTime.Date)
|
return futureTime.ToString(
|
||||||
return futureTime.ToString("h:mm tt");
|
futureTime.Date == currentTime.Date
|
||||||
|
? "h:mm tt"
|
||||||
return futureTime.ToString("dddd h:mm tt");
|
: "dddd h:mm tt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,3 +1,3 @@
|
|||||||
## changelog
|
## changelog
|
||||||
|
|
||||||
- add source generator for reflection data
|
- initial release
|
||||||
Loading…
Reference in New Issue
Block a user