C2025-022-Remove-UCF-2

This commit is contained in:
2025-08-27 12:59:53 -04:00
parent 47a4c62e92
commit 525173bc9f
30 changed files with 1159 additions and 1603 deletions

View File

@@ -126,19 +126,19 @@ namespace VEPROMS.CSLA.Library
XmlNodeList nl = XmlDoc.SelectNodes(xpath);
return nl.Count > 0;
}
private FormatConfig.ReplaceStrData _UCFandOrigReplaceStrData = null;
private FormatConfig.ReplaceStrData _UCFandOrigReplaceStrData = null;
// This will return a complete list of ReplaceWords, combining those in the original plant format
// with the ones added by the user via User Control of Format (UCF)
public FormatConfig.ReplaceStrData UCFandOrigReplaceStrData
{
get
{
if (_UCFandOrigReplaceStrData != null) return _UCFandOrigReplaceStrData;
_UCFandOrigReplaceStrData = GetMergedReplaceList(this);
return _UCFandOrigReplaceStrData;
}
}
private FormatConfig.ReplaceStrData GetMergedReplaceList(PlantFormat OriginalPlantFormat)
public FormatConfig.ReplaceStrData UCFandOrigReplaceStrData
{
get
{
if (_UCFandOrigReplaceStrData != null) return _UCFandOrigReplaceStrData;
_UCFandOrigReplaceStrData = GetMergedReplaceList(this);
return _UCFandOrigReplaceStrData;
}
}
private FormatConfig.ReplaceStrData GetMergedReplaceList(PlantFormat OriginalPlantFormat)
{
// need to compare the original format list with the list as it is stored for working with property grid.
FormatConfig.ReplaceStrData retlist = new FormatConfig.ReplaceStrData(); // merged list
@@ -1579,25 +1579,6 @@ namespace VEPROMS.CSLA.Library
return _PSI == null ? _PSI = new PSI(SelectSingleNode("PSI")) : _PSI;
}
}
private LazyLoad<bool> _CheckOffUCF;
public bool CheckOffUCF
{
get
{
// The following line is used in UCF (User Control of Format).
// This needs to be able to control a change in setting in UCF versus its use:
// - This is a special case since the original format, using the value in BaseAll, is always 'false'. And the value
// should never be set in original volian plant format files, if the additional UCF checkoffs are to be used, this must
// be set in the UCF user interface.
if (PlantFormat.DoingUCFCheckOffs) return PlantFormat.DoingUCFCheckOffsUse;
if (PlantFormat.IgnoreUCF) return LazyLoad(ref _CheckOffUCF, "@CheckOffUCF");
bool? localvalue = null; // comes to here if in edit or print - use any UCF data before going to original format.
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
if (fc != null) localvalue = fc.PlantFormat.FormatData.Flags.CheckOffUCF;
return localvalue ?? LazyLoad(ref _CheckOffUCF, "@CheckOffUCF");
}
}
// specifies the maxiumn length of the procedure title before PROMS considers to wrap the title
// this is used with the {PROCTITLE} PageStyle toekn
@@ -1955,25 +1936,25 @@ namespace VEPROMS.CSLA.Library
// UseCheckOffUCF is false or there is no FormatConfig (UCF) data:
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc==null)
{
_CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"), MyFormat);
// B2019-100: If Ignoring the UCF data, just return the entire list. Also, return entire list if there is no UCF data (fc == null)
if (PlantFormat.IgnoreUCF || fc == null) return _CheckOffList;
// If not ignoring UCF settings, only return those that are active
foreach (FormatConfig.CheckOff co in fc.PlantFormat.FormatData.CheckOffList)
{
foreach (CheckOff coo in _CheckOffList)
{
if ((int)coo.Index == Convert.ToInt32(co.Index) && !(bool)co.Active)
{
_CheckOffList.Remove(coo);
break;
}
}
}
return _CheckOffList;
}
//if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc==null)
//{
// _CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"), MyFormat);
// // B2019-100: If Ignoring the UCF data, just return the entire list. Also, return entire list if there is no UCF data (fc == null)
// if (PlantFormat.IgnoreUCF || fc == null) return _CheckOffList;
// // If not ignoring UCF settings, only return those that are active
// foreach (FormatConfig.CheckOff co in fc.PlantFormat.FormatData.CheckOffList)
// {
// foreach (CheckOff coo in _CheckOffList)
// {
// if ((int)coo.Index == Convert.ToInt32(co.Index) && !(bool)co.Active)
// {
// _CheckOffList.Remove(coo);
// break;
// }
// }
// }
// return _CheckOffList;
//}
// UseCheckOfffUCF is true:
// merge the checkoff list from the current format and the checkoff list from the base format
_CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"), MyFormat);
@@ -2008,26 +1989,26 @@ namespace VEPROMS.CSLA.Library
{
if (_CheckOffHeaderList != null) return _CheckOffHeaderList;
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc == null)
{
_CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat);
// Depending on the IgnoreUCF flag, either return this list with UCF Inactive flags set or return the
// list as is.
if (PlantFormat.IgnoreUCF || fc == null) return _CheckOffHeaderList;
// If not ignoring UCF settings, only return those that are active
foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList)
{
foreach (CheckOffHeader coo in _CheckOffHeaderList)
{
if ((int)coo.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active)
{
_CheckOffHeaderList.Remove(coo);
break;
}
}
}
return _CheckOffHeaderList;
}
//if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc == null)
//{
// _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat);
// // Depending on the IgnoreUCF flag, either return this list with UCF Inactive flags set or return the
// // list as is.
// if (PlantFormat.IgnoreUCF || fc == null) return _CheckOffHeaderList;
// // If not ignoring UCF settings, only return those that are active
// foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList)
// {
// foreach (CheckOffHeader coo in _CheckOffHeaderList)
// {
// if ((int)coo.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active)
// {
// _CheckOffHeaderList.Remove(coo);
// break;
// }
// }
// }
// return _CheckOffHeaderList;
//}
// merge the checkoff header lists from the current format and the list from the base
_CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat);
CheckOffHeaderList retlist2 = new CheckOffHeaderList(SelectNodes("../CheckOffDataUCF/CheckOffHeaderList/CheckOffHeader"), MyFormat);