Open Enhanced Document from Procedure or Procedure from Enhanced Document

Added new feature to keep Background Document and Deviation Documents in Sync as the user moves through the procedure.
Support ReadOnly steps for Enhanced Documents linked steps.
This commit is contained in:
Rich
2015-09-12 15:47:44 +00:00
parent 551b71e525
commit a87decdbe3
3 changed files with 173 additions and 75 deletions

View File

@@ -48,6 +48,12 @@ namespace Volian.Controls.Library
}
public partial class DisplayTabControl : UserControl
{
public event ItemSelectedChangedEvent OpenEnhancedDocument;
public void OnOpenEnhancedDocument(ItemSelectedChangedEventArgs args)
{
if (OpenEnhancedDocument != null)
OpenEnhancedDocument(this, args);
}
public event DisplayTabControlStatusEvent StatusChanged;
public void ONStatusChanged(object Sender, DisplayTabControlStatusEventArgs args)
{
@@ -92,8 +98,18 @@ namespace Volian.Controls.Library
public Dictionary<int, string> ItemsChangeIds = null;
private ItemInfo _MyItemInfo = null;
private EditItem _MyEditItem = null;
public EditItem MyEditItem
{
get { return _MyEditItem; }
set { _MyEditItem = value; }
}
private StepRTB _MyStepRTB = null;
private bool _RibbonExpanded=true;
public StepRTB MyStepRTB
{
get { return _MyStepRTB; }
}
public bool RibbonExpanded
{
get { return _RibbonExpanded; }
@@ -453,11 +469,11 @@ namespace Volian.Controls.Library
break;
case ItemInfo.EAddpingPart.Replace:
EditItem ei = edtitm.PasteReplace(copyStartID);
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
{
edtitm.Dispose();
MyCopyStep = ei.MyItemInfo;
}
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
{
edtitm.Dispose();
MyCopyStep = ei.MyItemInfo;
}
break;
default:
return false; ;
@@ -807,6 +823,22 @@ namespace Volian.Controls.Library
/// </summary>
/// <param name="myItemInfo"></param>
/// <returns></returns>
public bool IsItemInfoProcedureOpen(ItemInfo ii)
{
ItemInfo proc = ii.MyProcedure; // Find procedure Item
if (dicEnhancedDocuments.ContainsKey(ii.MyProcedure.MyDocVersion))
{
frmEnhanced frm = dicEnhancedDocuments[ii.MyProcedure.MyDocVersion];
string key = "Item - " + proc.ItemID.ToString();
if (frm.MyDisplayTabClntrol._MyDisplayTabItems.ContainsKey(key))
return true;
}
// return true;
//return false;
return false;
}
public Dictionary<DocVersionInfo, frmEnhanced> dicEnhancedDocuments = new Dictionary<DocVersionInfo, frmEnhanced>();
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo)
{
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
@@ -840,9 +872,19 @@ namespace Volian.Controls.Library
}
Application.DoEvents();
pg.SelectedItemInfo = myItemInfo; // Select the item
//StepConfig sc = new StepConfig(myItemInfo.MyContent.Config);
//if (sc.Step_SourceToBackground != null || sc.Step_SourceToDeviation != null)
// pg.MyStepTabPanel.MyStepTabRibbon.btnEnhancedDocSync.Visible = true;
//else
// pg.MyStepTabPanel.MyStepTabRibbon.btnEnhancedDocSync.Visible = false;
return pg;
}
private bool _SyncEnhancedDocuments;
public bool SyncEnhancedDocuments
{
get { return _SyncEnhancedDocuments; }
set { _SyncEnhancedDocuments = value; }
}
public void HandleChangeId(ItemInfo myItemInfo, DisplayTabItem pg)
{
if (myItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds)
@@ -855,8 +897,8 @@ namespace Volian.Controls.Library
{
if (!Volian.Base.Library.VlnSettings.GetCommandFlag("NOCHGID"))
{
dlgChgId dlgCI = new dlgChgId(this); //, null);
dlgCI.ShowDialog(this);
dlgChgId dlgCI = new dlgChgId(this); //, null);
dlgCI.ShowDialog(this);
}
ItemsChangeIds.Add(myItemInfo.MyProcedure.ItemID, ChgId);
SetChangeId(ChgId, pg, myItemInfo);