81 lines
1.7 KiB
C#
81 lines
1.7 KiB
C#
///
|
|
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
|
///
|
|
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];
|
|
public 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 LogFolderPath; /// Directory path into which the results will be saved
|
|
public bool YearFolders;
|
|
public bool MonthFolders;
|
|
public bool DayFolders;
|
|
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
DatabaseCfg()
|
|
{
|
|
Name = "Sensus-Oracle-DB";
|
|
ParentName = string.Empty;
|
|
TestBenchId = 1;
|
|
DBUsed = DBUsed.Test;
|
|
Baujahr = 2015;
|
|
LogFolderPath = Program.HomeDir + "Logs\\";
|
|
YearFolders = true;
|
|
MonthFolders = true;
|
|
DayFolders = false;
|
|
}
|
|
|
|
public DatabaseCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("BenchId={0}, DBUsed={1}, Baujahr={2}, Logs={3}, Y={4}, M={5}, D={6}",
|
|
TestBenchId,
|
|
DBUsed,
|
|
Baujahr,
|
|
LogFolderPath,
|
|
YearFolders,
|
|
MonthFolders,
|
|
DayFolders);
|
|
}
|
|
}
|
|
}
|