Professional OPC
Development Tools

logos

CreateItemSource: mappingContext.ParentMapping is null

More
12 May 2015 12:06 #3127 by miron
Ok. I added code to tests that value is null and know is good.

Please Log in or Create an account to join the conversation.

More
05 May 2015 14:04 #3073 by support
I am not aware of a change in this area between the versions you mentioned. Are you sure the same code behaved differently before?

Are you saying that the ParentMapping is always null? (it is OK for it to be null when there is, indeed, no parent).

Best regards

Please Log in or Create an account to join the conversation.

More
05 May 2015 12:55 #3072 by miron
I have updated QuickOPC 5.32 --> 5.34.

And I have problem baceous mappingContext.ParentMapping is null.

 protected override DAItemSource CreateItemSource(DAMappingContext mappingContext,
            DAMemberMappingDefinition memberMappingDefinition)
        {
         var mappingParent = mappingContext.ParentMapping; 
            if (mappingParent != null)
            {
 
                var mappingTarget = (OpcLabs.BaseLib.LiveMapping.ObjectMemberMappingTarget)mappingParent.MappingTarget;
                var t = mappingTarget.MemberInfo.DeclaringType.GenericTypeArguments[0];
 
                /*var t =
                    ((((OpcLabs.BaseLib.LiveMapping.ObjectMemberMappingTarget)
                        (mappingParent.MappingTarget))
                        .MemberInfo).DeclaringType).GenericTypeArguments[0];*/
 
                memberMappingDefinition.ItemAttribute.ItemType = t;
            }
}

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.176 seconds

      

 Recommend this on Google