nonstatic WarningStat
This commit is contained in:
@@ -15,6 +15,7 @@ namespace BoerseDataConvert
|
||||
private TagsTable tagsTable;
|
||||
private static string address;
|
||||
private static XmlWriter writer;
|
||||
private static WarningStat warning;
|
||||
public RecordController(string adr,string fileName, string tags)
|
||||
{
|
||||
count = 1;
|
||||
@@ -28,15 +29,15 @@ namespace BoerseDataConvert
|
||||
writer.WriteStartDocument();
|
||||
writer.WriteStartElement("table");
|
||||
writer.WriteAttributeString("name", null, cur_fileName);
|
||||
WarningStat.Refresh(fileName);
|
||||
warning= new WarningStat(fileName);
|
||||
}
|
||||
public static void NextFile(string fileName)
|
||||
{
|
||||
writer.WriteEndElement();
|
||||
writer.WriteEndDocument();
|
||||
writer.Close();
|
||||
WarningStat.PrintWarnigs();
|
||||
WarningStat.Refresh(fileName);
|
||||
warning.PrintWarnigs();
|
||||
warning = new WarningStat(fileName);
|
||||
cur_fileName = fileName.Split('.').First();
|
||||
count = 1;
|
||||
Console.WriteLine(cur_fileName + " start");
|
||||
@@ -67,11 +68,11 @@ namespace BoerseDataConvert
|
||||
writer.WriteEndElement();
|
||||
writer.WriteEndDocument();
|
||||
writer.Close();
|
||||
WarningStat.PrintWarnigs();
|
||||
warning.PrintWarnigs();
|
||||
}
|
||||
private string CheckTagValue(int tag, string value)
|
||||
{
|
||||
if (tagsTable.CheckInvalidTag(tag)) WarningStat.Add(tag);
|
||||
if (tagsTable.CheckInvalidTag(tag)) warning.Add(tag);
|
||||
string tagname = tagsTable.GetTagName(tag);
|
||||
if (value == "") return tagname;
|
||||
if (value != "NULL" && !tagsTable.HaveValueRanges(tag)) //Checks if the tag have not a value ranges
|
||||
|
||||
@@ -6,22 +6,16 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace BoerseDataConvert
|
||||
{
|
||||
public static class WarningStat
|
||||
public class WarningStat
|
||||
{
|
||||
private static Dictionary<int, int> tableWarnings = tableWarnings = new Dictionary<int, int>();
|
||||
private static string curFile;
|
||||
public static void Refresh(string fileName)
|
||||
private Dictionary<int, int> tableWarnings;
|
||||
private string curFile;
|
||||
public WarningStat(string fileName)
|
||||
{
|
||||
curFile = fileName;
|
||||
tableWarnings = new Dictionary<int, int>();
|
||||
}
|
||||
/*
|
||||
type "inv" - Ivalid tag
|
||||
type "long" - too long string value
|
||||
type "notnum" - is not in a valid format for number
|
||||
type "range" - Value not in range
|
||||
*/
|
||||
public static void Add(int tag)//
|
||||
public void Add(int tag)
|
||||
{
|
||||
if (tableWarnings.ContainsKey(tag))
|
||||
{
|
||||
@@ -32,7 +26,7 @@ namespace BoerseDataConvert
|
||||
tableWarnings.Add(tag, 1);
|
||||
}
|
||||
}
|
||||
public static void PrintWarnigs()
|
||||
public void PrintWarnigs()
|
||||
{
|
||||
if (tableWarnings.Count == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user