Reset Selected Slave after processing

Added and Commented-out some debug output
Use GetTranslatedROValue to get the correct RO value when text is restored
Fix logic to attempt to use existing DocVersionInfo rather than creating a new instance
Base lookup on ROFSTID and Selected Slave
This commit is contained in:
Rich 2014-03-12 22:01:55 +00:00
parent 1581653387
commit e8453b8648
6 changed files with 32 additions and 24 deletions

View File

@ -659,6 +659,7 @@ namespace VEPROMS
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked); frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked);
frmStatus.ShowDialog(); frmStatus.ShowDialog();
MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
this.Close(); this.Close();
ShowDebugFiles(); ShowDebugFiles();
} }

View File

@ -857,7 +857,16 @@ namespace VEPROMS.CSLA.Library
public int SelectedSlave public int SelectedSlave
{ {
get { return _SelectedSlave; } get { return _SelectedSlave; }
set { _SelectedSlave = value; }//Volian.Base.Library.vlnStackTrace.ShowStackLocal("SelectedSlave = {0}", _SelectedSlave.ToString()); } set
{
if (_SelectedSlave == value) return;
_SelectedSlave = value;
// if(_DocVersion != null)
// Volian.Base.Library.vlnStackTrace.ShowStackLocal("SelectedSlave {0} = {1}", _DocVersion.MyDocVersionUnique, _SelectedSlave.ToString());
// else
// Volian.Base.Library.vlnStackTrace.ShowStackLocal("SelectedSlaveInfo {0} = {1}", _DocVersionInfo.MyDocVersionInfoUnique, _SelectedSlave.ToString());
}
} }
[Category("Unit")] [Category("Unit")]
[DisplayName("Unit Number")] [DisplayName("Unit Number")]

View File

@ -1611,14 +1611,8 @@ namespace VEPROMS.CSLA.Library
foreach (ContentRoUsage ro in cont.ContentRoUsages) foreach (ContentRoUsage ro in cont.ContentRoUsages)
{ {
RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID); RoUsageInfo rou = RoUsageInfo.Get(ro.ROUsageID);
ROFSTLookup.rochild rocc = mylookup.GetRoChild12(rou.ROID); string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
if (rocc.value == null) ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID);
rocc = mylookup.GetRoChild(rou.ROID);
string myvalue = rocc.value;
//if (myvalue == null)
//{
// myvalue = rocc.children[0].value;
//}
int mytype = rocc.type; int mytype = rocc.type;
cont.FixContentText(rou, myvalue, mytype, null); cont.FixContentText(rou, myvalue, mytype, null);
} }
@ -1810,14 +1804,8 @@ namespace VEPROMS.CSLA.Library
ROFSTLookup mylookup = myrofst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion); ROFSTLookup mylookup = myrofst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion);
foreach(RoUsageInfo rou in tmp.ContentRoUsages) foreach(RoUsageInfo rou in tmp.ContentRoUsages)
{ {
ROFSTLookup.rochild rocc = mylookup.GetRoChild12(rou.ROID); string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ContentItems[0].ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
if (rocc.value == null) ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID);
rocc = mylookup.GetRoChild(rou.ROID);
string myvalue = rocc.value;
//if (myvalue == null)
//{
// myvalue = rocc.children[0].value;
//}
int mytype = rocc.type; int mytype = rocc.type;
ctmp.FixContentText(rou, myvalue, mytype, null); ctmp.FixContentText(rou, myvalue, mytype, null);
} }

View File

@ -624,6 +624,7 @@ namespace VEPROMS.CSLA.Library
{ {
} }
} }
DocVersionConfig.SelectedSlave = 0;
} }
return _UnitNames; return _UnitNames;
} }

View File

@ -4733,9 +4733,17 @@ namespace VEPROMS.CSLA.Library
ProcedureInfo tmp = DataPortal.Fetch<ProcedureInfo>(new ItemAndChildrenByUnitCriteria(args.ProcID, 0, args.UnitID)); ProcedureInfo tmp = DataPortal.Fetch<ProcedureInfo>(new ItemAndChildrenByUnitCriteria(args.ProcID, 0, args.UnitID));
if (tmp.MyDocVersion != null) if (tmp.MyDocVersion != null)
{ {
tmp.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitID; if (tmp.MyDocVersion.VersionID == args.MyDocVersion.VersionID)
(tmp.MyConfig as ProcedureConfig).SelectedSlave = args.UnitID; {
ItemInfo.SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion); (tmp.MyConfig as ProcedureConfig).SelectedSlave = args.UnitID;
ItemInfo.SetParentSectionAndDocVersion(tmp, args.MyDocVersion, null, tmp, args.MyDocVersion);
}
else
{
tmp.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitID;
(tmp.MyConfig as ProcedureConfig).SelectedSlave = args.UnitID;
ItemInfo.SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion);
}
} }
return tmp; return tmp;
} }

View File

@ -170,12 +170,13 @@ namespace VEPROMS.CSLA.Library
// return _ROFSTLookup; // return _ROFSTLookup;
// } // }
//} //}
private Dictionary<int, ROFSTLookup> dicLookups = new Dictionary<int, ROFSTLookup>(); private Dictionary<string, ROFSTLookup> dicLookups = new Dictionary<string, ROFSTLookup>();
public ROFSTLookup GetROFSTLookup(DocVersionInfo dvi) public ROFSTLookup GetROFSTLookup(DocVersionInfo dvi)
{ {
if (!dicLookups.ContainsKey(dvi.VersionID)) string key = string.Format("{0}.{1}",dvi.DocVersionAssociations[0].ROFstID,dvi.DocVersionConfig.SelectedSlave);
dicLookups.Add(dvi.VersionID, new ROFSTLookup(this, dvi)); if (!dicLookups.ContainsKey(key))
return dicLookups[dvi.VersionID]; dicLookups.Add(key, new ROFSTLookup(this, dvi));
return dicLookups[key];
} }
#endregion #endregion
#region AppSupport #region AppSupport