B2018-002 Handle Range Transitions for Invalid Transitions
Add a prefix to transitions converted to text which were invalid B2018-002 Add counters for invalid transitions converted to text. Added a method to convert invalid transitions to text B2018-002 Cleanup debug B2018-002 Changed the panel so that it only requires a default section if the default is not set and it is required B2018-010 Logic fixed to display the Requires Default tooltip only when it is required. B2018-002 Fix invalid transitions when a step is activated. B2018-002 Don't fail when you open a step with an invalid transition. B2018-002 Display Transition Refresh Statistics
This commit is contained in:
@@ -590,9 +590,11 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
TranCheckCount = 0;
|
||||
TranFixCount = 0;
|
||||
TranConvertCount = 0;// B2018-002 - Invalid Transitions - Initialize Transition Conversion Count
|
||||
}
|
||||
public static int TranCheckCount = 0;
|
||||
public static int TranFixCount = 0;
|
||||
public static int TranConvertCount = 0;// B2018-002 - Invalid Transitions - Declare Transition Conversion Count
|
||||
internal static TransitionInfoList TransitionsToDisconnected;
|
||||
internal static TransitionInfoList TransitionsToNonEditable;
|
||||
internal static void MyRefreshTransitions(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
||||
@@ -621,7 +623,9 @@ namespace VEPROMS.CSLA.Library
|
||||
//foreach (ItemInfo ii in myItems)
|
||||
MyRefreshTransitions(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo, tranLookup);
|
||||
}
|
||||
if (itemInfo.MyContent.ContentTransitionCount > 0)
|
||||
// B2018-002 - Invalid Transitions - Convert Invalid Transitions to Text
|
||||
// An invalid transition is a transition embedded in the content text that does not match the transition table record.
|
||||
if(ConvertInvalidTransitionsToText(itemInfo))
|
||||
{
|
||||
itemInfo.ResetOrdinal();
|
||||
foreach (TransitionInfo traninfo in itemInfo.MyContent.ContentTransitions)
|
||||
@@ -661,14 +665,14 @@ namespace VEPROMS.CSLA.Library
|
||||
if (itemInfo.MyProcedure.ItemID != traninfo.MyItemToID.MyProcedure.ItemID) //different proc
|
||||
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format
|
||||
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix
|
||||
{
|
||||
forceConvertToText = true;
|
||||
TranFixCount++;
|
||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to External Procedure using Internal Format");
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
content.FixTransitionText(traninfo, true);
|
||||
content.Save();
|
||||
}
|
||||
{
|
||||
forceConvertToText = true;
|
||||
TranFixCount++;
|
||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to External Procedure using Internal Format");
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
content.FixTransitionText(traninfo, true);
|
||||
content.Save();
|
||||
}
|
||||
}
|
||||
if (!forceConvertToText)
|
||||
{
|
||||
@@ -676,14 +680,14 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format
|
||||
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix
|
||||
{
|
||||
forceConvertToText = true;
|
||||
TranFixCount++;
|
||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Outside Procedure using Internal Format");
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
content.FixTransitionText(traninfo, true);
|
||||
content.Save();
|
||||
}
|
||||
{
|
||||
forceConvertToText = true;
|
||||
TranFixCount++;
|
||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Outside Procedure using Internal Format");
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
content.FixTransitionText(traninfo, true);
|
||||
content.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!forceConvertToText)
|
||||
@@ -693,7 +697,7 @@ namespace VEPROMS.CSLA.Library
|
||||
string newText = itemInfo.MyContent.Text;
|
||||
// B2017-165 added check of newValue (special case for old 16-bit transition that was not fixed by the customer)
|
||||
string newValue = traninfo.ResolvePathTo(itemInfo.ActiveFormat, itemInfo, traninfo.TranType, traninfo.MyItemToID, traninfo.MyItemRangeID);
|
||||
if (newText != oldText|| newValue == "?")
|
||||
if (newText != oldText || newValue == "?")
|
||||
{
|
||||
TranFixCount++;
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
@@ -704,6 +708,42 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
// // B2018-002 - Invalid Transitions - Method to check for invalid transitions and convert them to text
|
||||
public static bool ConvertInvalidTransitionsToText(ItemInfo itemInfo)
|
||||
{
|
||||
bool retval = true;
|
||||
MatchCollection mc = Regex.Matches(itemInfo.MyContent.Text, @"\#Link\:Transition");
|
||||
if (itemInfo.MyContent.ContentTransitionCount <= 0 || mc.Count > itemInfo.MyContent.ContentTransitionCount)
|
||||
{
|
||||
retval = false;
|
||||
if (itemInfo.MyContent.Text.Contains("Link:Transition"))
|
||||
{
|
||||
//Console.WriteLine("\"TranCount\"\t\"{0}\"\t{1}\t{2}\t{3}", itemInfo.ShortPath, itemInfo.ItemID, mc.Count, itemInfo.MyContent.ContentTransitionCount);
|
||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||
//if (itemInfo.InList(616031, 615898, 5516866))
|
||||
// Console.WriteLine("here");
|
||||
if (itemInfo.MyContent.ContentTransitions != null)
|
||||
foreach (TransitionInfo ct in itemInfo.MyContent.ContentTransitions)
|
||||
Transition.Delete(ct.TransitionID);
|
||||
itemInfo.MyContent.RefreshContentTransitions();
|
||||
//if (content.Text.Contains("Link:TransitionRange"))
|
||||
// Console.WriteLine("Here");
|
||||
while (content.Text.Contains("Link:Transition"))
|
||||
{
|
||||
TranCheckCount++;
|
||||
TranConvertCount++;
|
||||
if (content.FixTransitionText(null, true))
|
||||
{
|
||||
ContentInfo.OnStaticContentInfoChange(itemInfo, new StaticContentInfoEventArgs("", "", ""));
|
||||
if (itemInfo.MyContent.MyGrid != null)
|
||||
content.ConvertTransitionToTextInGrid(null, null);
|
||||
content.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
//private static bool IsTransitionToDisconnected(TransitionInfo ti)
|
||||
//{
|
||||
// foreach (TransitionInfo til in TransitionsToDisconnected)
|
||||
|
Reference in New Issue
Block a user