93 lines
2.0 KiB
C#
93 lines
2.0 KiB
C#
///
|
|
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Output.FileWriters.Basic
|
|
{
|
|
public enum YearFolders
|
|
{
|
|
None,
|
|
TwoDigit,
|
|
FourDigit,
|
|
Count
|
|
}
|
|
|
|
public enum MonthFolders
|
|
{
|
|
None,
|
|
Digit,
|
|
DigitWithLeadingZero,
|
|
Name,
|
|
Count
|
|
}
|
|
|
|
public enum DayFolders
|
|
{
|
|
None,
|
|
Digit,
|
|
DigitWithLeadingZero,
|
|
Count
|
|
}
|
|
|
|
public enum Separator
|
|
{
|
|
None,
|
|
Space,
|
|
Tabulator,
|
|
Comma,
|
|
Semicolon,
|
|
Count
|
|
}
|
|
|
|
public class WriterCfg : ComponentCfgBase, Generic.IComponentCfg
|
|
{
|
|
public IComponent GetComponent(IList<IComponent> components) { return new Writer(this); }
|
|
public IComponentCfgCtrl GetControl() { return new WriterCfgCtrl(); }
|
|
|
|
public string DestinationPath; /// Directory path into which the results will be saved
|
|
public YearFolders YearFolders;
|
|
public MonthFolders MonthFolders;
|
|
public DayFolders DayFolders;
|
|
public Separator Separator;
|
|
public bool EliminateSpaces;
|
|
public string[] SelectedItems;
|
|
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
WriterCfg()
|
|
{
|
|
Name = "FileWriter";
|
|
ParentName = string.Empty;
|
|
DestinationPath = Program.HomeDir + "Results\\";
|
|
YearFolders = YearFolders.FourDigit;
|
|
MonthFolders = MonthFolders.Digit;
|
|
DayFolders = DayFolders.Digit;
|
|
Separator = Separator.None;
|
|
EliminateSpaces = false;
|
|
}
|
|
|
|
public WriterCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Path={1}, Y={2}, M={3}, D={4}, Elim.Spaces={5}, Separator={6}",
|
|
Name,
|
|
DestinationPath,
|
|
YearFolders,
|
|
MonthFolders,
|
|
DayFolders,
|
|
EliminateSpaces,
|
|
Separator);
|
|
}
|
|
}
|
|
}
|