96 lines
3.4 KiB
C#
96 lines
3.4 KiB
C#
///
|
|
/// Copyright (c) 2023 Sensus Slovensko a.s.
|
|
///
|
|
using System.Collections.Generic;
|
|
using Common;
|
|
|
|
namespace TBF.Rig.DataEntry
|
|
{
|
|
///
|
|
/// Ac = Action
|
|
///
|
|
public enum Ac
|
|
{
|
|
[Description("Clear")] Clear, /// Clear when the form is open, save on OK
|
|
[Description("Last from history")] HistoryLast,
|
|
[Description("Load")] Load, /// Load from water meters when the form is open, save on OK
|
|
[Description("Load (readonly)")] LoadReadOnly, /// Load from water meters when the form is open, prevent changes, do not save
|
|
Count,
|
|
}
|
|
|
|
///
|
|
/// Ct = Content
|
|
///
|
|
public enum Ct
|
|
{
|
|
[Description("None")] None,
|
|
[Description("Serial nr.")] SerialNr,
|
|
[Description("Serial nr. aux")] SerialNrAux,
|
|
[Description("Radio address")] RadioAddress,
|
|
[Description("Year of calibration")] YearOfCalibration,
|
|
[Description("Start state")] StartState,
|
|
[Description("End state")] EndState,
|
|
[Description("Archive path")] ArchivePath,
|
|
[Description("WM Order")] WmOrder,
|
|
[Description("Batch order")] BatchOrder,
|
|
[Description("Batch and WM order")] BatchAndWmOrder,
|
|
[Description("WM Remark")] WmRemark,
|
|
[Description("Batch remark")] BatchRemark,
|
|
[Description("Batch and WM remark")] BatchAndWmRemark,
|
|
#if ORACLE_DB
|
|
[Description("Prefix")] Prefix,
|
|
[Description("Suffix")] Suffix,
|
|
#endif
|
|
Count
|
|
}
|
|
|
|
public class DEItem
|
|
{
|
|
public readonly Ct Content;
|
|
public readonly string Caption;
|
|
public readonly Ac Action;
|
|
public readonly int Width;
|
|
|
|
public DEItem(Ct content, string caption, Ac action, int width)
|
|
{
|
|
Content = content;
|
|
Caption = caption;
|
|
Action = action;
|
|
Width = width;
|
|
}
|
|
|
|
|
|
static IList<DEItem> items = new List<DEItem>();
|
|
///
|
|
public static void ClearItems() { items.Clear(); }
|
|
public static void AddItem(DEItem item) { items.Add(item); }
|
|
public static void AddItem(Ct content, string caption, Ac action, int width)
|
|
{
|
|
items.Add(new DEItem(content, caption, action, width));
|
|
}
|
|
public static IList<DEItem> GetItems() { return items; }
|
|
|
|
|
|
static IList<DEItem> columns = new List<DEItem>();
|
|
///
|
|
public static void ClearColumns() { columns.Clear(); }
|
|
public static void AddColumn(DEItem column) { columns.Add(column); }
|
|
public static void AddColumn(Ct content, string caption, Ac action, int width)
|
|
{
|
|
columns.Add(new DEItem(content, caption, action, width));
|
|
}
|
|
public static IList<DEItem> GetColumns() { return columns; }
|
|
|
|
|
|
static IList<DEItem> summaryColumns = new List<DEItem>();
|
|
///
|
|
public static void ClearSummaryColumns() { summaryColumns.Clear(); }
|
|
public static void AddSummaryColumn(DEItem column) { summaryColumns.Add(column); }
|
|
public static void AddSummaryColumn(Ct content, string caption, Ac action, int width)
|
|
{
|
|
summaryColumns.Add(new DEItem(content, caption, action, width));
|
|
}
|
|
public static IList<DEItem> GetSummaryColumns() { return summaryColumns; }
|
|
}
|
|
}
|