Files
HC_APTBS/Services/IConfigurationService.cs
LucianoDev 4964806de1 feat: move test buttons to right panel, add user auth dialog for reports
Move Start/Stop/Report buttons from the middle panel to the top of
TestPanelView (automated tests section), matching the old application
layout. Remove inline Operator/Client text fields — operator identity
now comes from a UserCheckDialog (username/password) shown before the
existing ReportDialog. Add credential storage to ConfigurationService.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 16:41:20 +02:00

78 lines
3.9 KiB
C#

using System.Collections.Generic;
using HC_APTBS.Models;
namespace HC_APTBS.Services
{
/// <summary>
/// Provides read/write access to persisted application configuration.
/// Configuration files live under <c>%UserProfile%\.HC_APTBS\config\</c>.
/// </summary>
public interface IConfigurationService
{
// ── Settings ──────────────────────────────────────────────────────────────
/// <summary>Application-wide settings (temperature limits, PID, refresh rates, etc.).</summary>
AppSettings Settings { get; }
/// <summary>Persists <see cref="Settings"/> to <c>config.xml</c>.</summary>
void SaveSettings();
// ── Bench configuration ───────────────────────────────────────────────────
/// <summary>
/// Current bench CAN parameter map and relay definitions.
/// Loaded from <c>bench.xml</c> on first access.
/// </summary>
BenchConfiguration Bench { get; }
/// <summary>Persists <see cref="Bench"/> to <c>bench.xml</c>.</summary>
void SaveBench();
// ── Pump database ─────────────────────────────────────────────────────────
/// <summary>Returns all known pump IDs from the pump database.</summary>
IReadOnlyList<string> GetPumpIds();
/// <summary>
/// Loads the full <see cref="PumpDefinition"/> for the pump with the given ID,
/// including its CAN parameter map and test list.
/// </summary>
PumpDefinition? LoadPump(string pumpId);
/// <summary>Persists a pump definition back to the database.</summary>
void SavePump(PumpDefinition pump);
// ── Clients ───────────────────────────────────────────────────────────────
/// <summary>Sorted client name → contact info dictionary.</summary>
SortedDictionary<string, string> Clients { get; }
/// <summary>Persists the client list to <c>clients.xml</c>.</summary>
void SaveClients();
// ── Pump status definitions ───────────────────────────────────────────────
/// <summary>
/// Loads the <see cref="PumpStatusDefinition"/> for the given status ID.
/// Definitions are cached after first load. Returns null if the ID is not found.
/// </summary>
PumpStatusDefinition? LoadPumpStatus(int statusId);
// ── Sensors ───────────────────────────────────────────────────────────────
/// <summary>Saves updated sensor calibration data to <c>sensors.xml</c>.</summary>
void SaveSensors();
// ── Users ─────────────────────────────────────────────────────────────────
/// <summary>Validates a username/password pair against stored credentials.</summary>
bool ValidateUser(string username, string password);
/// <summary>Returns all stored user credentials as a dictionary.</summary>
IReadOnlyDictionary<string, string> GetUsers();
/// <summary>Replaces all stored user credentials and persists them.</summary>
void UpdateUsers(Dictionary<string, string> users);
}
}