Added titles to message boxes used during the check of the RO.fst B2017-125
Add LoadingFigures to save status of loading the figures during Update RO Values B2017-125 Added checks to see if the RO Figures need loaded B2017-125 Added checks to see if the RO Figures need loaded and set the status during the loading figures part of updating RO values B2017-125 Make the progress bar text visible B2017-125 Added titles to message boxes used during the check of the RO.fst and make the progress bar text visible B2017-125
This commit is contained in:
@@ -87,6 +87,29 @@ namespace VEPROMS.CSLA.Library
|
||||
if (att == null) return string.Empty;
|
||||
return att.InnerText;
|
||||
}
|
||||
// B2017-125 put info in the config as to the status of loading RO Figures during the Update RO Values
|
||||
// This will help us determine if the Update RO Values was terminated during the loading of the RO Figures
|
||||
public bool ROfstLoadingFigures
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DocVersionAssociations == null || DocVersionAssociationCount == 0) return true; // no ROs associated this will turn off the update ROs button
|
||||
if (ROLoadingFigures(DocVersionAssociations[0]) == string.Empty) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// B2017-125 return the loading figures status
|
||||
private string ROLoadingFigures(DocVersionAssociation dva)
|
||||
{
|
||||
XmlDocument xd = new XmlDocument();
|
||||
if (dva.Config == null || dva.Config.Length == 0) return string.Empty;
|
||||
xd.LoadXml(dva.Config);
|
||||
XmlNode xn = xd.DocumentElement.SelectSingleNode("//ROUpdate");
|
||||
if (xn == null) return string.Empty;
|
||||
XmlAttribute att = xn.Attributes["LoadingFigures"];
|
||||
if (att == null) return string.Empty;
|
||||
return att.InnerText;
|
||||
}
|
||||
#region VersionType
|
||||
public VersionTypeEnum eVersionType
|
||||
{
|
||||
@@ -270,6 +293,12 @@ namespace VEPROMS.CSLA.Library
|
||||
AssociationConfig ac = new AssociationConfig(associationInfo);
|
||||
return ac.ROUpdate_LastCompleted;
|
||||
}
|
||||
// B2017-125 return the loading figures status
|
||||
private string ROLoadingFigures(AssociationInfo associationInfo)
|
||||
{
|
||||
AssociationConfig ac = new AssociationConfig(associationInfo);
|
||||
return ac.ROUpdate_LoadingFigures;
|
||||
}
|
||||
#region SearchPaths
|
||||
public string _SearchDVPath;
|
||||
public string SearchDVPath
|
||||
|
@@ -306,7 +306,7 @@ namespace VEPROMS.CSLA.Library
|
||||
public static ROFst RefreshROFst(RODbInfo rdi, DocVersionAssociation dva, DocVersion docver, ROFstInfo origROFst, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus)
|
||||
{
|
||||
ROFst rofst = null;
|
||||
if (docver.NewerRoFst)
|
||||
if (docver.ROfstLoadingFigures || docver.NewerRoFst) // B2017-125 see if loading figures was completed
|
||||
{
|
||||
// only load the RO.fst
|
||||
Volian.Base.Library.VlnSettings.DoUpdateRO = false;
|
||||
@@ -339,13 +339,21 @@ namespace VEPROMS.CSLA.Library
|
||||
// this witll tell us if the RO Update was completed, interrupted, or just needs done and whether to make the Update ROs button available
|
||||
private static void SetAssociationLastCompleted(DocVersion docver, string value)
|
||||
{
|
||||
//Association asc = dva.MyAssociation;
|
||||
string cfg = docver.DocVersionAssociations[0].Config;
|
||||
AssociationConfig ac = new AssociationConfig((cfg== null || cfg.Length == 0) ? "<Config />" : cfg);
|
||||
ac.ROUpdate_LastCompleted = value;
|
||||
docver.DocVersionAssociations[0].Config = ac.ToString();
|
||||
docver.Save();
|
||||
}
|
||||
// Place the status of loading the RO Figures when updating RO Values
|
||||
private static void SetAssociationROFiguresLoading(DocVersion docver, string value)
|
||||
{
|
||||
string cfg = docver.DocVersionAssociations[0].Config;
|
||||
AssociationConfig ac = new AssociationConfig((cfg== null || cfg.Length == 0) ? "<Config />" : cfg);
|
||||
ac.ROUpdate_LoadingFigures = value;
|
||||
docver.DocVersionAssociations[0].Config = ac.ToString();
|
||||
docver.Save();
|
||||
}
|
||||
/// <summary>
|
||||
/// Updates an ro.fst into a sql database.
|
||||
/// </summary>
|
||||
@@ -368,11 +376,18 @@ namespace VEPROMS.CSLA.Library
|
||||
if (rofst != null)
|
||||
{
|
||||
// Get a list of figures which have changed content (DTS)
|
||||
List<string> changedFigures = GetChangedFigureROIDs(origROFst, ROFstInfo.GetJustROFst(rofst.ROFstID),DocVersionInfo.Get(docver.VersionID), myProgressBarRefresh);
|
||||
List<string> MyChangedFigureROIDs = null;
|
||||
if (docver.ROfstLoadingFigures) // B2017-125 see if loading figures was completed
|
||||
{
|
||||
ROFSTLookup myLookup = ROFstInfo.GetJustROFst(rofst.ROFstID).GetROFSTLookup(DocVersionInfo.Get(docver.VersionID));
|
||||
MyChangedFigureROIDs = UpdateROFigures(rdi, myProgressBarRefresh, rofst, RODb.GetJustRoDb(rdi.RODbID), myLookup, docver);
|
||||
}
|
||||
else
|
||||
MyChangedFigureROIDs = GetChangedFigureROIDs(origROFst, ROFstInfo.GetJustROFst(rofst.ROFstID), DocVersionInfo.Get(docver.VersionID), myProgressBarRefresh);
|
||||
docver.DocVersionAssociations[0].MyROFst = rofst;
|
||||
docver.Save();
|
||||
SetAssociationLastCompleted(docver, string.Empty);
|
||||
if (!Volian.Base.Library.VlnSettings.GetCommandFlag("NOUPDATERO") && Volian.Base.Library.VlnSettings.DoUpdateRO)
|
||||
UpdateROValuesText(origROFst, rofst, DocVersionInfo.Get(docver.VersionID),myProgressBarRefresh,changedFigures);
|
||||
UpdateROValuesText(origROFst, rofst, DocVersionInfo.Get(docver.VersionID), myProgressBarRefresh, MyChangedFigureROIDs);
|
||||
return rofst;
|
||||
}
|
||||
|
||||
@@ -387,33 +402,11 @@ namespace VEPROMS.CSLA.Library
|
||||
// Hook this into the current docversion by replacing the rofstid field in the doc version
|
||||
// association object:
|
||||
dva.MyROFst = rofst;
|
||||
docver.Save();
|
||||
SetAssociationROFiguresLoading(docver, "Started"); // B2017-125 flag was we are loading the RO figures
|
||||
//docver.Save();
|
||||
ROFSTLookup myLookup = ROFstInfo.GetJustROFst(rofst.ROFstID).GetROFSTLookup(DocVersionInfo.Get(docver.VersionID));
|
||||
// Keep a list of ROIDs for Images that have changed.
|
||||
List<string> MyChangedFigureROIDs = new List<string>();
|
||||
// Now load any images in... type 8 - integrated graphics ro type
|
||||
using (ROImageInfoList myROImages = ROImageInfoList.GetByRODbIDNoData(rdi.RODbID))
|
||||
{
|
||||
Dictionary<string, int> myExistingROImages = BuildROImagesList(myROImages);
|
||||
List<int> myUnChangedROImages = new List<int>();
|
||||
List<string> myAddedROImages = new List<string>();
|
||||
using (ROFstInfo rfi = ROFstInfo.Get(rofst.ROFstID))
|
||||
{
|
||||
for (int i = 0; i < myLookup.myHdr.myDbs.Length; i++)
|
||||
{
|
||||
// walk through the rofst 'database' searching for all nodes that are integrated graphics, type 8:
|
||||
if (myLookup.myHdr.myDbs[i].children != null)
|
||||
{
|
||||
int cnt = rfi.CountRoFstGraphics(myLookup.myHdr.myDbs[i].children); // get the total number of RO figures
|
||||
int curCnt = 0;
|
||||
rfi.MigrateRoFstGraphics(rdi, myLookup.myHdr.myDbs[i].children, rodb, rofst, myExistingROImages, myUnChangedROImages, myAddedROImages, MyChangedFigureROIDs,myProgressBarRefresh,cnt,ref curCnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add references for existing RO Images to the Figure table (Figure table relates ro.fst with its images)
|
||||
if (myUnChangedROImages.Count > 0)
|
||||
using (FigureInfoList fil = FigureInfoList.AddByROFstIDImageIDs(rofst.ROFstID, buildImageIDString(myUnChangedROImages))) ;
|
||||
}
|
||||
List<string> MyChangedFigureROIDs = UpdateROFigures(rdi, myProgressBarRefresh, rofst, rodb, myLookup,docver);
|
||||
// Now update the usages: compare old to new rofsts and update usages accordingly, i.e. modified
|
||||
// values, deleted ros, etc.
|
||||
if (!Volian.Base.Library.VlnSettings.GetCommandFlag("NOUPDATERO") && Volian.Base.Library.VlnSettings.DoUpdateRO)
|
||||
@@ -421,6 +414,36 @@ namespace VEPROMS.CSLA.Library
|
||||
return rofst;
|
||||
}
|
||||
}
|
||||
|
||||
private static List<string> UpdateROFigures(RODbInfo rdi, ROFstInfoProgressBarRefresh myProgressBarRefresh, ROFst rofst, RODb rodb, ROFSTLookup myLookup, DocVersion docVer)
|
||||
{
|
||||
List<string> MyChangedFigureROIDs = new List<string>();
|
||||
// Now load any images in... type 8 - integrated graphics ro type
|
||||
using (ROImageInfoList myROImages = ROImageInfoList.GetByRODbIDNoData(rdi.RODbID))
|
||||
{
|
||||
Dictionary<string, int> myExistingROImages = BuildROImagesList(myROImages);
|
||||
List<int> myUnChangedROImages = new List<int>();
|
||||
List<string> myAddedROImages = new List<string>();
|
||||
using (ROFstInfo rfi = ROFstInfo.Get(rofst.ROFstID))
|
||||
{
|
||||
for (int i = 0; i < myLookup.myHdr.myDbs.Length; i++)
|
||||
{
|
||||
// walk through the rofst 'database' searching for all nodes that are integrated graphics, type 8:
|
||||
if (myLookup.myHdr.myDbs[i].children != null)
|
||||
{
|
||||
int cnt = rfi.CountRoFstGraphics(myLookup.myHdr.myDbs[i].children); // get the total number of RO figures
|
||||
int curCnt = 0;
|
||||
rfi.MigrateRoFstGraphics(rdi, myLookup.myHdr.myDbs[i].children, rodb, rofst, myExistingROImages, myUnChangedROImages, myAddedROImages, MyChangedFigureROIDs, myProgressBarRefresh, cnt, ref curCnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add references for existing RO Images to the Figure table (Figure table relates ro.fst with its images)
|
||||
if (myUnChangedROImages.Count > 0)
|
||||
using (FigureInfoList fil = FigureInfoList.AddByROFstIDImageIDs(rofst.ROFstID, buildImageIDString(myUnChangedROImages))) ;
|
||||
}
|
||||
SetAssociationROFiguresLoading(docVer, string.Empty); // B2017-125 loading RO Figures is completed
|
||||
return MyChangedFigureROIDs;
|
||||
}
|
||||
/// <summary>
|
||||
/// Get a list of ROIDs for figures that have changed content. This is only used when the contents of a figure
|
||||
/// is changed without changing the filename.
|
||||
|
Reference in New Issue
Block a user