Added code to support processing Calvert Cliffs data regarding node names

Added code to support processing BG&E data regarding node names
Added code to correct 16-bit applicability conversion to 32-bit applicability
This commit is contained in:
Rich
2014-03-04 02:03:08 +00:00
parent 156d4b32ba
commit 8810301dde
2 changed files with 94 additions and 21 deletions

View File

@@ -612,21 +612,22 @@ namespace DataLoader
if (cont != null)
{
// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
if (cont.ContentParts.Contains(2))
{
foreach (ContentPart part in cont.ContentParts)
{
if (part.FromType == 2)
{
Item ii = Item.Get(part.ItemID);
ii.MyContent.ContentParts.Add(2, secitem);
ii.Save();
break;
}
}
}
else
cont.ContentParts.Add(2, secitem);
AddPartRecursive(cont, 2, secitem);
//if (cont.ContentParts.Contains(2))
//{
// foreach (ContentPart part in cont.ContentParts)
// {
// if (part.FromType == 2)
// {
// Item ii = Item.Get(part.ItemID);
// ii.MyContent.ContentParts.Add(2, secitem);
// ii.Save();
// break;
// }
// }
//}
//else
// cont.ContentParts.Add(2, secitem);
if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
cont.Save();
@@ -669,7 +670,7 @@ namespace DataLoader
// 5 = RNO
// 6 = step
// 7 = table
//isautogen = false; //needed for bge
if (!isautogen)
{
// Process the Data Table - First look for High Level Steps
@@ -700,13 +701,48 @@ namespace DataLoader
return secitem;
}
private void AddPartRecursive(Content cont, int fromType, Item secitem)
{
if (cont.ContentParts.Contains(fromType))
{
foreach (ContentPart part in cont.ContentParts)
{
if (part.FromType == fromType)
{
Item ii = Item.Get(part.ItemID);
AddPartRecursive(ii.MyContent, fromType, secitem);
ii.Save();
break;
}
}
}
else
cont.ContentParts.Add(fromType, secitem);
}
private static Dictionary<string, string> ApplesToOranges;
private static void ResetApplesToOranges()
{
ApplesToOranges = new Dictionary<string, string>();
}
private string AddApplicability(string recnum)
{
//if (recnum == "00002491")
// System.Threading.Thread.Sleep(1000);
if (!MyProcAPL.ContainsKey(recnum))
return null;
string apple = MyProcAPL[recnum];
return LookupOrange(apple);
}
private string LookupOrange(string apple)
{
if (!ApplesToOranges.ContainsKey(apple))
{
ApplesToOranges.Add(apple, AddApplicability1(apple));
Console.WriteLine("Apple: '{0}' - Orange: '{1}'", apple, ApplesToOranges[apple]);
}
return ApplesToOranges[apple];
}
private string AddApplicability1(string apple)
{
if (apple == "40000000")
return "0";
UInt32 mask = 0;
@@ -714,9 +750,11 @@ namespace DataLoader
mask |= (uint)(1 << (i - 1));
UInt32 val = UInt32.Parse(apple, System.Globalization.NumberStyles.HexNumber);
//UInt32 val = UInt32.Parse(apple);
val &= mask;
if (val == 0)
return null;
val &= mask;
if (val == 0)
return "0";
if (val == mask)
return null;
int j = 1;
@@ -733,7 +771,6 @@ namespace DataLoader
val = val >> 1;
}
return sb.ToString();
}
private void LoadSection(DataSet ds, OleDbDataAdapter da, string FileName)
{