Solucionar problemas de projetos com upgrade

Se você encontrar problemas em projetos com upgrade, considere as diretrizes a seguir.

Projetos com upgrade para 1.6.0 ou posterior

Se você fizer upgrade de um projeto anterior a 1.6.0 para 1.6.0 ou posterior, certifique-se de substituir propriedades antigas sem suporte por novas propriedades no NetLogics:
Propriedades a serem substituídas
Propriedades antigas
Novas propriedades
uint[] ParentArrayIndex
ElementAccess ParentElementAccess
IUAVariable ParentArrayIndexVariable
IUAVariable ParentElementAccessVariable
Considere o exemplo a seguir:
[ExportMethod] public void ChangeParentScalarIndex() { IUAVariable arrayVar = Project.Current.GetVariable("Model/ArrayVar"); DynamicLink myDynamicLink = arrayVar.Children.Get<DynamicLink>("DynamicLink"); //-------------------- 1.4.X IMPLEMENTATION -------------------- //Accessing parent array index in FactoryTalk Optix version lower than 1.6.0. //You can use monodimensional and multidimensional arrays. uint[] myArrayIndex = { 3 }; myDynamicLink.ParentArrayIndex = myArrayIndex; //You can only use the `ParentScalarIndex` property with a monodimensional array. //The following simplifies the access to the parent array index with a scalar value. //The following implementation is equivalent to the previous implementation. myDynamicLink.ParentScalarIndex = 3; //------------------------------------------------------------ //-------------------- 1.6.X IMPLEMENTATION -------------------- //Accessing parent array index in FactoryTalk Optix version 1.6.0 and higher. //Create an `ElementAccess` wrapper structure that exposes `ArrayIndexes` and `FieldIndexes`. //Use `ArrayIndexes` for arrays; Use `FieldIndexes` for structures. //Manage the access to an array or structure with `ParentElementAccess`. ElementAccess myElementAccessStructure = new ElementAccess(myArrayIndex); myDynamicLink.ParentElementAccess = myElementAccessStructure; //------------------------------------------------------------ }
DICA: Se erros sobre propriedades obsoletas em scripts ou widgets aparecerem no relatório de upgrade, remova os scripts ou widgets afetados do projeto e adicione os scripts ou widgets novamente. Para obter mais informações, consulte Bibliotecas.
Dê sua opinião
Tem dúvidas ou comentários sobre esta documentação? Por favor, envie seu comentário aqui.
Normal