Working folder (phase 1): CSV/raw/step/step_finali all used to live split across two different implicit locations (CSV in the "repo root" found by walking up for CLAUDE.md, raw/step next to the input distinta file) with neither shown to the user. That repo-root lookup also silently breaks once the app runs as a standalone published exe on a machine with no repo/ CLAUDE.md at all. Replaced both with one explicit "cartella di lavoro", auto-suggested (last used, remembered the same way as the DB path) and changeable from phase 1, with no dependency on any repo marker file. Rename: CadSearchGui was the working name from before the app had a product identity; renamed folders, csproj files, namespace and the AppData settings folder to PrepStep throughout, matching the exe name already in use. Product-facing name stays "Cevolani StepPrep". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
62 lines
2.5 KiB
C#
62 lines
2.5 KiB
C#
namespace PrepStep;
|
|
|
|
/// <summary>Mostra, per ogni assieme della distinta base, se tutti i suoi componenti
|
|
/// (ricorsivamente fino ai PRT) sono presenti nell'indice (v) o mancano (x).</summary>
|
|
public class ReportCompletezzaForm : Form
|
|
{
|
|
public ReportCompletezzaForm(List<(string Componente, string Descrizione, bool? Completo)> righe)
|
|
{
|
|
int completi = righe.Count(r => r.Completo == true);
|
|
int incompleti = righe.Count(r => r.Completo == false);
|
|
int nonTrovati = righe.Count(r => r.Completo is null);
|
|
|
|
Text = "Completezza assiemi";
|
|
ClientSize = new Size(720, 440);
|
|
StartPosition = FormStartPosition.CenterParent;
|
|
Font = new Font("Segoe UI", 9.5f);
|
|
|
|
var lblInfo = new Label
|
|
{
|
|
Dock = DockStyle.Top,
|
|
AutoSize = true,
|
|
Padding = new Padding(12, 8, 12, 8),
|
|
Text = $"{completi} completi, {incompleti} incompleti, {nonTrovati} non trovati nell'indice "
|
|
+ $"su {righe.Count} componenti. Nota: la scansione dei .asm è euristica, qualche "
|
|
+ "falso 'incompleto' è possibile.",
|
|
};
|
|
|
|
var grid = new DataGridView
|
|
{
|
|
Dock = DockStyle.Fill,
|
|
ReadOnly = true,
|
|
AllowUserToAddRows = false,
|
|
AllowUserToDeleteRows = false,
|
|
RowHeadersVisible = false,
|
|
SelectionMode = DataGridViewSelectionMode.FullRowSelect,
|
|
AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill,
|
|
};
|
|
grid.Columns.Add("componente", "Componente");
|
|
grid.Columns.Add("descrizione", "Descrizione");
|
|
grid.Columns.Add("completo", "Completo");
|
|
grid.Columns["componente"]!.FillWeight = 20;
|
|
grid.Columns["descrizione"]!.FillWeight = 55;
|
|
grid.Columns["completo"]!.FillWeight = 25;
|
|
|
|
foreach (var (componente, descrizione, completo) in righe.OrderBy(r => r.Completo).ThenBy(r => r.Componente))
|
|
{
|
|
string testo = completo switch { true => "✓", false => "✗", null => "?" };
|
|
int i = grid.Rows.Add(componente, descrizione, testo);
|
|
grid.Rows[i].DefaultCellStyle.ForeColor = completo switch
|
|
{
|
|
true => Color.DarkGreen,
|
|
false => Color.DarkRed,
|
|
null => Color.Gray,
|
|
};
|
|
grid.Rows[i].Cells["completo"].Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
|
}
|
|
|
|
Controls.Add(grid);
|
|
Controls.Add(lblInfo);
|
|
}
|
|
}
|