C2016-007 and B2016-097 – Update ProcStep data every time (Westinghouse CPS)

This commit is contained in:
John Jenko 2016-04-20 15:47:28 +00:00
parent a118715c77
commit 71927ea398

View File

@ -27,9 +27,9 @@ namespace Volian.Controls.Library
get { return _ProcItem; } get { return _ProcItem; }
set set
{ {
if (_ProcItem == value) return; //if (_ProcItem == value) return; // Jeff (Westinghouse) requested list to be provided every time fixes both C2016-007 and B2016-097
_ProcItem = value; _ProcItem = value;
CreateProcList(); if (ExeType > 0) CreateProcList();
} }
} }
@ -95,7 +95,7 @@ namespace Volian.Controls.Library
_CurrentItem = value; _CurrentItem = value;
SetupCurrentItemValues(); SetupCurrentItemValues();
SetupConfigEdit(); SetupConfigEdit();
if (_ExeType > 0) SendPromsAnnotationData(); if (ExeType > 0) SendPromsAnnotationData();
} }
} }
private int _FromType; private int _FromType;
@ -116,34 +116,43 @@ namespace Volian.Controls.Library
if (ii == null) return null; if (ii == null) return null;
if (ii.ItemAnnotationCount == 0) return null; if (ii.ItemAnnotationCount == 0) return null;
foreach (AnnotationInfo ai in ii.ItemAnnotations) foreach (AnnotationInfo ai in ii.ItemAnnotations)
if (ai.TypeID == _ExeType) return ai; if (ai.TypeID == ExeType) return ai;
return null; return null;
} }
private void SetupConfigEdit() private void SetupConfigEdit()
{ {
if (_ExeType == 0) if (ExeType == 0) ; // initialize ExeType
{
_ExeType = -1;
foreach (AnnotationTypeInfo ati in AnnotationTypeInfoList.Get())
{
if ((ati.Config ?? "") != "")
{
_ExePath = ati.AnnotationTypeConfig.Integration_Executable;
_PipeIn = ati.AnnotationTypeConfig.Integration_PipeIn;
_PipeOut = ati.AnnotationTypeConfig.Integration_PipeOut;
if (_ExePath != "" && _PipeIn != "" && _PipeOut != "")
{
_ExeType = ati.TypeID;
break;
}
}
}
}
} }
private string _ExePath; private string _ExePath;
private string _PipeOut; private string _PipeOut;
private string _PipeIn; private string _PipeIn;
private int _ExeType=0; // Made _ExeType a lazy load to fix Jeff's (Westinghouse) request that ProcStep data be generated every time - fixes both C2016-007 and B2016-097
private int _ExeType = 0;
public int ExeType
{
get
{
if (_ExeType == 0)
{
_ExeType = -1;
foreach (AnnotationTypeInfo ati in AnnotationTypeInfoList.Get())
{
if ((ati.Config ?? "") != "")
{
_ExePath = ati.AnnotationTypeConfig.Integration_Executable;
_PipeIn = ati.AnnotationTypeConfig.Integration_PipeIn;
_PipeOut = ati.AnnotationTypeConfig.Integration_PipeOut;
if (_ExePath != "" && _PipeIn != "" && _PipeOut != "")
{
_ExeType = ati.TypeID;
break;
}
}
}
}
return _ExeType;
}
}
private DisplaySearch _AnnotationSearch; private DisplaySearch _AnnotationSearch;
private AnnotationInfoList _Annotations; private AnnotationInfoList _Annotations;
@ -497,7 +506,7 @@ namespace Volian.Controls.Library
{ {
using(Item myItem = Item.Get(itemID )) using(Item myItem = Item.Get(itemID ))
{ {
using (AnnotationType myType = AnnotationType.Get(_ExeType)) using (AnnotationType myType = AnnotationType.Get(ExeType))
{ {
using (Annotation annotation = Annotation.MakeAnnotation(myItem, myType,null, "New",config)) using (Annotation annotation = Annotation.MakeAnnotation(myItem, myType,null, "New",config))
{ {