B2017-079, B2017-053, B2017-049, improved the speed and logic of updating ROs. The Refresh ROs logic is now merged into the Update ROs logic. Also annotations are added when ROs are updated. The Refresh ROs options were removed from the tool list.
Better feedback when updating RO values, also save list of updated ROs in text file in Documents\VEPROMS Save the date/time of the last successfully completed RO Values Update Add annotations for updated RO values, better logic in updating RO figures so they are needlessly updated, better logic in determining if an RO needs to be updated Logic to save the date/time of the last successfully completed RO Update Better logic to determine if an RO value needs updated.
This commit is contained in:
@@ -544,12 +544,26 @@ namespace VEPROMS.CSLA.Library
|
||||
data = part1 + part2 + part3 + part4 + part5;
|
||||
return data;
|
||||
}
|
||||
public string FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo, bool saveAnnotation)
|
||||
{
|
||||
return FixContentText(rousg, value, rotype, origROFstInfo, null, "", saveAnnotation);
|
||||
}
|
||||
public string FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo)
|
||||
{
|
||||
return FixContentText(rousg, value, rotype, origROFstInfo, null, "");
|
||||
string filenameonly = null;
|
||||
if (Text != null && Text.Length > 0)
|
||||
{
|
||||
if (ContentItems[0].MyItem.MyItemInfo.IsFigure)
|
||||
filenameonly = value.Substring(0, value.IndexOf("\n"));
|
||||
}
|
||||
return FixContentText(rousg, value, rotype, origROFstInfo, filenameonly, "", false);
|
||||
}
|
||||
// B2017-060 added roidFrmImportStep to pass in a ROID to use when rousg is null (import procedure uses this)
|
||||
public string FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo, string fileNameOnly, string roidFrmImportStep)
|
||||
{
|
||||
return FixContentText(rousg, value, rotype, origROFstInfo, fileNameOnly, roidFrmImportStep, false);
|
||||
}
|
||||
public string FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo, string fileNameOnly, string roidFrmImportStep, bool saveAnnotation)
|
||||
{
|
||||
string retval = null;
|
||||
if (value == "?")
|
||||
@@ -584,10 +598,20 @@ namespace VEPROMS.CSLA.Library
|
||||
myLength += m.Groups[3].Length;
|
||||
}
|
||||
string gg = Text.Substring(myIndex,myLength);
|
||||
if ((gg.Replace(@"\'b0", @"\'B0") != newvalue.Replace(@"\'b0", @"\'B0")) && ((fileNameOnly == null) || (gg != fileNameOnly)))
|
||||
if (((fileNameOnly == null) && (MakeConsistentFormat(gg) != MakeConsistentFormat(newvalue))) || ((fileNameOnly != null) && !(gg.Replace(@"\u8209?", "-").StartsWith(fileNameOnly) && newvalue.Replace(@"\u8209?", "-").StartsWith(fileNameOnly))))
|
||||
{
|
||||
retval = gg;
|
||||
Text = Text.Substring(0, myIndex) + newvalue + Text.Substring(myIndex + myLength);
|
||||
if (!saveAnnotation)
|
||||
{
|
||||
using (Item myitem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153
|
||||
{
|
||||
myitem.DisposeOfContent = false; // don't dispose of the contents may be needed if more than one RO needs processed - part of B2017-060
|
||||
// B2016-225 (follow through) added more descriptive Annotation Type when RO is converted to text
|
||||
Annotation.MakeAnnotation(myitem, AnnotationType.GetByNameOrCreate("Verification Required"), "",
|
||||
string.Format("Referenced Object (Change in RO Values: Old value = {0}, New value = {1}) Changed", FixValue(gg), FixValue(newvalue)), null);
|
||||
}
|
||||
}
|
||||
break; // Text has been processed
|
||||
}
|
||||
}
|
||||
@@ -665,6 +689,16 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
public static string MakeConsistentFormat(string gg)
|
||||
{
|
||||
// replace degree, bullet dash, hardspace
|
||||
return ROFSTLookup.ConvertFortranFormatToScienctificNotation(gg).Replace("`", @"\'B0").Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ").Replace(@"\'a0", " ").Replace(@"\'A0", " ");
|
||||
}
|
||||
private string FixValue(string str)
|
||||
{
|
||||
return str.Replace(@"\u8209?", "-").Replace(@"\u160?", " "); //dash and hard space
|
||||
}
|
||||
}
|
||||
public delegate void StaticContentInfoEvent(object sender, StaticContentInfoEventArgs args);
|
||||
public class StaticContentInfoEventArgs
|
||||
@@ -894,6 +928,9 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public void FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo, ItemInfo ii) // string newvalue)
|
||||
{
|
||||
string fileNameOnly = null;
|
||||
if (ii.IsFigure && Text != null && Text.Length > 0)
|
||||
fileNameOnly = value.Substring(0,value.IndexOf("\n")).Replace(@"\u8209?","-"); // check only the file name of the RO figure
|
||||
string newvalue = value;
|
||||
newvalue = newvalue.Replace("{", @"\{").Replace("}", @"\}");
|
||||
string findLink = @"<START\].*?\[END>";
|
||||
@@ -914,9 +951,12 @@ namespace VEPROMS.CSLA.Library
|
||||
myLength += m.Groups[3].Length;
|
||||
}
|
||||
string gg = Text.Substring(myIndex, myLength);
|
||||
if ((gg.Replace(@"\'b0", @"\'B0") != newvalue.Replace(@"\'b0", @"\'B0")))
|
||||
{
|
||||
_Text = Text.Substring(0, myIndex) + newvalue + _Text.Substring(myIndex + myLength);
|
||||
if (((fileNameOnly == null) && (Content.MakeConsistentFormat(gg) != Content.MakeConsistentFormat(newvalue))) || ((fileNameOnly != null) && !(gg.Replace(@"\u8209?", "-").StartsWith(fileNameOnly) && newvalue.Replace(@"\u8209?", "-").StartsWith(fileNameOnly))))
|
||||
{
|
||||
// Debug - jsj 5-19-2017 - left in for initial check-in
|
||||
//string gg_org = gg;
|
||||
//string newval_org = newvalue;
|
||||
_Text = Text.Substring(0, myIndex) + newvalue + _Text.Substring(myIndex + myLength);
|
||||
if (newvalue == "?")
|
||||
{
|
||||
gg = ItemInfo.ConvertToDisplayText(gg);
|
||||
@@ -932,6 +972,10 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
gg = ItemInfo.ConvertToDisplayText(gg);
|
||||
newvalue = ItemInfo.ConvertToDisplayText(newvalue);
|
||||
// Debug - jsj 5-19-2017 - left in for initial check-in
|
||||
//string xx_gg = gg_org.Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
||||
//string xx_nv = newval_org.Replace(@"\'b0", @"\'B0").Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
||||
//Console.WriteLine(xx_gg.CompareTo(xx_nv));
|
||||
OnStaticContentInfoChange(ii, new StaticContentInfoEventArgs(gg, newvalue, "RO"));
|
||||
break; // Text has been processed
|
||||
}
|
||||
|
Reference in New Issue
Block a user