C2025-022-Remove-UCF-2

This commit is contained in:
2025-09-02 16:55:51 -04:00
parent c81079a876
commit 85b08b8c65
5 changed files with 14 additions and 156 deletions

View File

@@ -36,27 +36,14 @@ namespace VEPROMS.CSLA.Library
// User Control of Format allows a PROMS user to make modifications to a very limited set of format settings
// Variables in this region are not set in the format files. They are used only in the C# code
// when IgnoreUCF is true, get the original data, i.e. don't apply any UCF changes to it
// when IgnoreUCF is true, get the original data, i.e.don't apply any UCF changes to it
private static bool _IgnoreUCF = false;
public static bool IgnoreUCF
{
get { return PlantFormat._IgnoreUCF; }
set { PlantFormat._IgnoreUCF = value; }
}
// flags that the User Control of Format setting for using additional UCF checkoffs is active
private static bool _DoingUCFCheckOffs = false;
public static bool DoingUCFCheckOffs
{
get { return PlantFormat._DoingUCFCheckOffs; }
set { PlantFormat._DoingUCFCheckOffs = value; }
}
// flags the value that should be used (true/false) for using additional UCF checkoffs (used with DoingUCFCheckOffs)
private static bool _DoingUCFCheckOffsUse = false;
public static bool DoingUCFCheckOffsUse
{
get { return PlantFormat._DoingUCFCheckOffsUse; }
set { PlantFormat._DoingUCFCheckOffsUse = value; }
}
#endregion //User Control of Format (UCF)
public static FormatConfig GetFormatConfig(IFormatOrFormatInfo format)
{
@@ -1861,53 +1848,9 @@ namespace VEPROMS.CSLA.Library
{
if (_CheckOffList != null) return _CheckOffList;
// Get a list of checkoffs that should be included:
// if !UseCheckOffUCF (Baseall has it as false. User can change setting in UCF to true)
// if !IgnoreUCF, i.e. use UCF changes, return original lists with only active items (Inactive = false)
// if IgnoreUCF, return original lists with all items
// if UseCheckOffUCF is true use the merged lists from current format and baseall.xml and
// do the same processing for IgnoreUCF described above.
// 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;
//}
// 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);
CheckOffList retlist2 = new CheckOffList(SelectNodes("../CheckOffDataUCF/CheckOffList/CheckOff"), MyFormat);
if (retlist2 != null && retlist2.Count > 0) foreach (CheckOff co in retlist2) _CheckOffList.Add(co);
if (PlantFormat.IgnoreUCF) return _CheckOffList;
// if applying UCF, then remove those that are inactive:
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;
}
}
@@ -1923,77 +1866,13 @@ 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;
//}
// 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);
if (retlist2 != null && retlist2.Count > 0) foreach (CheckOffHeader co in retlist2) _CheckOffHeaderList.Add(co);
if (PlantFormat.IgnoreUCF) return _CheckOffHeaderList;
// if applying UCF, then remove those that are inactive.
foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList)
{
foreach (CheckOffHeader cooh in _CheckOffHeaderList)
{
if ((int)cooh.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active)
{
_CheckOffHeaderList.Remove(cooh);
break;
}
}
}
return _CheckOffHeaderList;
}
}
public void CheckOffHeaderListRefresh(bool CheckOffUCF)
{
if (!CheckOffUCF)
{
_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.
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
if (PlantFormat.IgnoreUCF || fc == null) return;
// 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;
}
// if coming from the UCF dialog, then check for the 'ignoreUCF' this will flag whether to only
// merge the checkoff header lists from the current format and the list from the base
CheckOffHeaderList retlist = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat);
CheckOffHeaderList retlist2 = new CheckOffHeaderList(SelectNodes("../CheckOffDataUCF/CheckOffHeaderList/CheckOffHeader"), MyFormat);
if (retlist2 != null && retlist2.Count > 0) foreach (CheckOffHeader co in retlist2) retlist.Add(co);
_CheckOffHeaderList = retlist;
}
// This is used with the {INITIALS} pagelist token and will put the word "INITIALS" at the specified pagelist
// location for the checkoff column header. Used by Calvert Cliffs (BGEOI and BGESTP formats)