/// /// Copyright (c) 2015-2017 Sensus Metering Systems /// using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using TBF.BenchControl.Generic; namespace TBF.BenchControl.DB.SensusOracle { public enum DBUsed { None, Production, Test, Quality, Count } public enum Separator { None, Space, Tabulator, Comma, Semicolon, Count } public class DatabaseCfg : ComponentCfgBase, Generic.IComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(DatabaseCfg) })[0]; protected override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl() { return new DatabaseCfgCtrl(); } public int TestBenchId; public DBUsed DBUsed; public int Baujahr; /// Written to the database public string DestinationPath; /// Directory path into which the results will be saved public string LogFolderPath; /// Directory path into which the results will be saved public bool YearFolders; public bool MonthFolders; public bool DayFolders; public Separator Separator; public bool EliminateSpaces; /// Private parameterless constructor invoked by all other (public) constructors DatabaseCfg() { Name = "Sensus-Oracle-DB"; ParentName = string.Empty; TestBenchId = 1; DBUsed = DBUsed.Test; Baujahr = 2015; DestinationPath = Program.HomeDir + "Results\\"; LogFolderPath = Program.HomeDir + "Logs\\"; YearFolders = true; MonthFolders = true; DayFolders = false; Separator = Separator.None; EliminateSpaces = false; } public DatabaseCfg(IComponentFactory factory) : this() { this.Factory = factory; } public string ToString(int i) { return string.Format("Name={0}, BenchId={1}, DBUsed={2}, Baujahr={3}, Results={4}, Logs={5}, Y={6}, M={7}, D={8}, Elim.spaces={9}, Separator={10}", Name, TestBenchId, DBUsed, Baujahr, DestinationPath, LogFolderPath, YearFolders, MonthFolders, DayFolders, EliminateSpaces, Separator); } } }