Edit/Print tabs for Callaway Backgrounds
This commit is contained in:
parent
cc188ce98f
commit
4b7c3ee5d8
@ -2431,6 +2431,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
int stepType = (int)(MyContent.Type % 10000);
|
int stepType = (int)(MyContent.Type % 10000);
|
||||||
string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint;
|
string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint;
|
||||||
|
string tbformate = null; // need this for background documents, to generate tab for editing.
|
||||||
|
|
||||||
|
if (((ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) &&
|
||||||
|
((IsHigh && FormatStepData.PageBreakOnStep) || (IsRNOPart && MyHLS.FormatStepData.PageBreakOnStep)))
|
||||||
|
tbformate = IsRNOPart ? MyHLS.FormatStepData.TabData.RNOIdentEdit : FormatStepData.TabData.IdentEdit;
|
||||||
|
|
||||||
if (ActiveFormat.Name.ToUpper() == "WCNCKL" || ActiveFormat.Name.ToUpper() == "WSTCKL")
|
if (ActiveFormat.Name.ToUpper() == "WCNCKL" || ActiveFormat.Name.ToUpper() == "WSTCKL")
|
||||||
{
|
{
|
||||||
tbformat = FormatStepData.TabData.IdentEdit;
|
tbformat = FormatStepData.TabData.IdentEdit;
|
||||||
@ -2445,8 +2451,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tbformat = tbformat.TrimStart(" ".ToCharArray());
|
tbformat = tbformat.TrimStart(" ".ToCharArray());
|
||||||
}
|
}
|
||||||
if (tbformat.Contains("{LNK Step Num}"))
|
if (tbformat.Contains("{LNK Step Num}"))
|
||||||
tbformat = tbformat.Replace("{LNK Step Num}", "STEP " + Ordinal.ToString() + ":");
|
tbformat = tbformat.Replace("{LNK Step Num}", Ordinal.ToString().PadLeft(2));
|
||||||
|
if (tbformate != null && tbformate.Contains("{LNK Step Num}"))
|
||||||
|
tbformate = tbformate.Replace("{LNK Step Num}", Ordinal.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// rno gets parent tab
|
// rno gets parent tab
|
||||||
if (IsRNOPart && FormatStepData.NumberSubs)
|
if (IsRNOPart && FormatStepData.NumberSubs)
|
||||||
{
|
{
|
||||||
@ -2594,6 +2603,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string tmpsectpref = SectionPrefix(tbformat) ?? string.Empty;
|
string tmpsectpref = SectionPrefix(tbformat) ?? string.Empty;
|
||||||
if (ActiveSection.MyTab.CleanText != null && ActiveSection.MyTab.CleanText != "" && tmpsectpref != string.Empty) trimTabStart = true;
|
if (ActiveSection.MyTab.CleanText != null && ActiveSection.MyTab.CleanText != "" && tmpsectpref != string.Empty) trimTabStart = true;
|
||||||
tbformat = tbformat.Replace("{Section Prefix}", SectionPrefix(tbformat));
|
tbformat = tbformat.Replace("{Section Prefix}", SectionPrefix(tbformat));
|
||||||
|
if (tbformate != null) tbformate = tbformate.Replace("{Section Prefix}", SectionPrefix(tbformate));
|
||||||
}
|
}
|
||||||
|
|
||||||
int ordinal = Ordinal;
|
int ordinal = Ordinal;
|
||||||
@ -2606,6 +2616,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tbformat = tbformat.Replace("{roman}", roman.ToLower());
|
tbformat = tbformat.Replace("{roman}", roman.ToLower());
|
||||||
tbformat = tbformat.Replace("{ROMAN}", roman);
|
tbformat = tbformat.Replace("{ROMAN}", roman);
|
||||||
tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2, '0') : ordinal.ToString().PadLeft(2));
|
tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2, '0') : ordinal.ToString().PadLeft(2));
|
||||||
|
if (tbformate != null) tbformate = tbformate.Replace("{numeric}", trimTabStart ? ordinal.ToString() : FormatStepData.AtLeastTwoDigits ? ordinal.ToString().PadLeft(2, '0') : ordinal.ToString().PadLeft(2));
|
||||||
tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString());
|
tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString());
|
||||||
if (tbformat.Contains("{asterisk}"))
|
if (tbformat.Contains("{asterisk}"))
|
||||||
{
|
{
|
||||||
@ -2668,12 +2679,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// also see if there is the 'pagelist' string in this tab:
|
// also see if there is the 'pagelist' string in this tab:
|
||||||
HighLevelStepTabPageList = FormatStepData.TabData.IdentAltPrint.Substring(0, indxnewtab) + tbformat;
|
HighLevelStepTabPageList = FormatStepData.TabData.IdentAltPrint.Substring(0, indxnewtab) + tbformat;
|
||||||
_MyTab.AltPrintTab = newtab;
|
_MyTab.AltPrintTab = newtab;
|
||||||
|
if (tbformate != null && tbformate != "") tbformat = tbformate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_MyTab.Text = tbformat;
|
_MyTab.Text = tbformat;
|
||||||
_MyTab.CleanText = cltext != null ? cltext : tbformat;
|
_MyTab.CleanText = cltext != null ? cltext : tbformat;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool InCaution()
|
private bool InCaution()
|
||||||
{
|
{
|
||||||
// walk up until procedure level and if finding a caution type, return true, otherwise false.
|
// walk up until procedure level and if finding a caution type, return true, otherwise false.
|
||||||
@ -3131,34 +3142,28 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region UseSmartTemplate
|
#region UseSmartTemplate
|
||||||
public int GetSmartTemplateIndex()
|
public int GetSmartTemplateTopLevelIndx()
|
||||||
{
|
{
|
||||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
||||||
int indx = 0;
|
ItemInfo tmp = this;
|
||||||
// find the starting template in the list for the high level step type:
|
while (!tmp.IsSection)
|
||||||
int highType = (int)MyHLS.MyContent.Type - 20001;
|
{
|
||||||
|
if (formatData.TopTemplateTypes.ContainsKey((int)tmp.MyContent.Type - 20001)) return formatData.TopTemplateTypes[(int)tmp.MyContent.Type - 20001];
|
||||||
|
tmp = tmp.MyParent;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
public int GetSmartTemplateIndex(int topIndx, int curStepType)
|
||||||
|
{
|
||||||
|
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
||||||
|
int indx = topIndx;
|
||||||
|
int curType = curStepType - 20001;
|
||||||
while (indx < formatData.Templates.Count)
|
while (indx < formatData.Templates.Count)
|
||||||
{
|
{
|
||||||
// level of 0 starts a new group.
|
// now see if we're on the topType, if so, look under this one
|
||||||
if (formatData.Templates[indx].level == 0)
|
// for the step type that we're on. If found return the index of it.
|
||||||
{
|
if (formatData.Templates[indx].type == curType) return indx;
|
||||||
indx++;
|
indx++;
|
||||||
// now see if we're on the high level step type, if so, look under this one
|
|
||||||
// for the step type that we're on. If found return the index of it.
|
|
||||||
if (formatData.Templates[indx].type == highType)
|
|
||||||
{
|
|
||||||
if (MyHLS.ItemID == ItemID) return indx; // I'm on the HLS, return it.
|
|
||||||
indx++;
|
|
||||||
while (indx < formatData.Templates.Count && formatData.Templates[indx].level != 0)
|
|
||||||
{
|
|
||||||
if (formatData.Templates[indx].type == MyContent.Type - 20001)
|
|
||||||
return indx;
|
|
||||||
indx++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
indx++;
|
|
||||||
}
|
}
|
||||||
return -1; // didn't find this step type in the template width override list.
|
return -1; // didn't find this step type in the template width override list.
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user