Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace HeimdallPower.Api.Client.CapacityMonitoring.Facilities;

public record CircuitRatingsResponse
{
/// <summary>
/// A human-readable label identifying the rating returned by this endpoint, independent of the quantity parameter.
/// </summary>
/// <example>Circuit rating</example>
public required string Metric { get; init; }

/// <summary>
/// The unit of the values in the response. Depends on the requested quantity:
/// "Ampere" for current (default), "MVA" for apparent_power.
/// </summary>
/// <example>Ampere</example>
public required string Unit { get; init; }

/// <summary>
/// List of circuit ratings within the requested time range.
/// </summary>
public required List<CircuitRatingDto> CircuitRatings { get; init; }
Comment thread
Prebz98 marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace HeimdallPower.Api.Client.CapacityMonitoring.Lines;

public record HeimdallAarsResponse
{
/// <summary>
/// A human-readable label identifying the rating returned by this endpoint, independent of the quantity parameter.
/// </summary>
/// <example>Heimdall AAR</example>
public required string Metric { get; init; }

/// <summary>
/// The unit of the values in the response. Depends on the requested quantity:
/// "Ampere" for current (default), "MVA" for apparent_power.
/// </summary>
/// <example>Ampere</example>
public required string Unit { get; init; }

/// <summary>
/// List of Heimdall AAR values within the requested time range. May be empty if no data exists for the period.
/// </summary>
public required List<HeimdallAarDto> HeimdallAars { get; init; }
Comment thread
Prebz98 marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace HeimdallPower.Api.Client.CapacityMonitoring.Lines;

public record HeimdallDlrsResponse
{
/// <summary>
/// A human-readable label identifying the rating returned by this endpoint, independent of the quantity parameter.
/// </summary>
/// <example>Heimdall DLR</example>
public required string Metric { get; init; }

/// <summary>
/// The unit of the values in the response. Depends on the requested quantity:
/// "Ampere" for current (default), "MVA" for apparent_power.
/// </summary>
/// <example>Ampere</example>
public required string Unit { get; init; }

/// <summary>
/// List of Heimdall DLR values within the requested time range. May be empty if no data exists for the period.
/// </summary>
public required List<HeimdallDlrDto> HeimdallDlrs { get; init; }
Comment thread
Prebz98 marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace HeimdallPower.Api.Client.CapacityMonitoring;

/// <summary>
/// Controls which physical quantity is returned by a rating endpoint.
/// </summary>
public enum Quantity
{
/// <summary>
/// Values in amperes (default).
/// </summary>
Current,

/// <summary>
/// Values converted to three-phase apparent power in MVA using S = sqrt(3) * V * I / 1,000,000.
/// The line's operational voltage is used when set and positive; otherwise the nominal voltage is used.
/// </summary>
ApparentPower,
}

internal static class QuantityExtensions
{
public static string ToQueryValue(this Quantity quantity) => quantity switch
{
Quantity.ApparentPower => "apparent_power",
_ => "current",
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

namespace HeimdallPower.Api.Client.GridInsights.Lines;

public record ApparentPowersResponse
{
/// <summary>
/// The kind of data this response contains.
/// </summary>
/// <example>Apparent power</example>
public required string Metric { get; init; }

/// <summary>
/// The unit of the values in the response.
/// </summary>
/// <example>MVA</example>
public required string Unit { get; init; }

/// <summary>
/// List of apparent power values within the requested time range. May be empty if no data exists for the period.
/// </summary>
public required IReadOnlyCollection<ApparentPowerDto> ApparentPowers { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

public record ApparentPowerDto
{
/// <summary>
/// Time (in UTC) when the underlying current was measured.
/// </summary>
/// <example>2024-07-01T12:00:00.001Z</example>
public DateTimeOffset Timestamp { get; init; }

/// <summary>
/// The apparent power derived for the line at the given time, in MVA.
/// </summary>
/// <example>156.7</example>
public double Value { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

public record IcingForecastDataPointDto
{
/// <summary>
/// Time (UTC) for this forecast data point.
/// </summary>
/// <example>2024-01-15T08:33:00Z</example>
public DateTimeOffset Timestamp { get; init; }

/// <summary>
/// The forecasted ice weight at this time point.
/// </summary>
public required MeasurementResult IceWeight { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

public record IcingForecastDto
{
/// <summary>
/// The peak ice weight across all span phases and all forecast time points.
/// </summary>
public required MaxIcingForecastDto Max { get; init; }

/// <summary>
/// List of spans on the line with their icing forecast data.
/// </summary>
public required IReadOnlyCollection<SpanIcingForecastDto> Spans { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

public record MaxIcingForecastDto
{
/// <summary>
/// The peak ice weight across all span phases and all forecast time points.
/// </summary>
public required SpanPhaseMeasurementResult IceWeight { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

public record SpanIcingForecastDto
{
/// <summary>
/// The id of the span.
/// </summary>
/// <example>00000000-0000-0000-0000-000000000000</example>
public Guid SpanId { get; init; }

/// <summary>
/// List of span phases (conductors) within this span with their icing forecast.
/// </summary>
public required IReadOnlyCollection<SpanPhaseIcingForecastDto> SpanPhases { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

public record SpanPhaseIcingForecastDto
{
/// <summary>
/// The id of the span phase.
/// </summary>
/// <example>00000000-0000-0000-0000-000000000000</example>
public Guid SpanPhaseId { get; init; }

/// <summary>
/// Forecasted icing data points for this span phase. Covers 72 hours in 30-minute intervals (144 data points).
/// </summary>
public required IReadOnlyCollection<IcingForecastDataPointDto> Forecast { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

namespace HeimdallPower.Api.Client.GridInsights.Lines;

public record IcingForecastResponse
{
/// <summary>
/// The kind of data this response contains.
/// </summary>
/// <example>Icing forecast</example>
public required string Metric { get; init; }

/// <summary>
/// The unit of ice weight measurements. <c>kg/m</c> for metric, <c>lb/ft</c> for imperial.
/// </summary>
/// <example>kg/m</example>
public required string Unit { get; init; }

/// <summary>
/// Icing forecast for the line organized by spans and span phases.
/// </summary>
public required IcingForecastDto Icing { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using HeimdallPower.Api.Client.GridInsights.Lines.Dtos;

namespace HeimdallPower.Api.Client.GridInsights.Lines;

public record LatestApparentPowerResponse
{
/// <summary>
/// The kind of data this response contains.
/// </summary>
/// <example>Apparent power</example>
public required string Metric { get; init; }

/// <summary>
/// The unit of the value in the response.
/// </summary>
/// <example>MVA</example>
public required string Unit { get; init; }

/// <summary>
/// The most recent apparent power measurement for the line.
/// </summary>
public required ApparentPowerDto ApparentPower { get; init; }
}
Loading
Loading