private void AddCallbackUpdateAttributeValues(HLAattributeHandleValuePair[] handleValuePairList, long objectInstanceHandle, byte[] userSuppliedTag, long federateHandle, long interactionIndex, ILogicalTime time) { if (parent.State != null) { Lrc.ReflectAttributeValuesExtCallback callback = new Lrc.ReflectAttributeValuesExtCallback(this.parent.FederateAmbassador, time, federateHandle, interactionIndex, new XRTIObjectInstanceHandle(objectInstanceHandle), handleValuePairList, userSuppliedTag); parent.lrc.AddCallback(callback); } }
protected void ProcessHLAupdateAttributeValuesMetafederation(HLAupdateAttributeValuesMessage msg) { Lrc.ReflectAttributeValuesExtCallback callback = new Lrc.ReflectAttributeValuesExtCallback(this.parent.MetaFederateAmbassador, new XRTIObjectInstanceHandle(msg.ObjectInstanceHandle), msg.AttributeHandleValuePairList, msg.UserSuppliedTag); callback.Call(); ObjectInstanceDescriptor oid = parent.descriptorManager.GetObjectInstanceDescriptor(new XRTIObjectInstanceHandle(msg.ObjectInstanceHandle)); ObjectClassDescriptor ocd = parent.descriptorManager.GetObjectClassDescriptor("Sxtafederate"); bool timePropertyFound = false; if (oid.ClassHandle.Equals(ocd.Handle)) { if (msg.AttributeHandleValuePairList.Length > 0) { for (int i = 0; i < msg.AttributeHandleValuePairList.Length && !timePropertyFound; i++) { HLAattributeHandleValuePair pair = msg.AttributeHandleValuePairList[i]; string propertyName = ocd.GetAttributeDescriptor(new XRTIAttributeHandle(pair.AttributeHandle)).Name; if (propertyName.Equals("HLAlogicalTime") || propertyName.Equals("HLAlookahead") || propertyName.Equals("HLApendingTime") || propertyName.Equals("HLALITS") || propertyName.Equals("HLAtimeManagerState") || propertyName.Equals("HLAtimeConstrained") || propertyName.Equals("HLAtimeRegulating")) { timePropertyFound = true; } } if (timePropertyFound) { parent.UpdateFederate(); } } } }
private void AddCallbackUpdateAttributeValues(HLAattributeHandleValuePair[] handleValuePairList, long objectInstanceHandle, byte[] userSuppliedTag, long federateHandle, long interactionIndex, ILogicalTime time) { if (parent.State != null) { Lrc.ReflectAttributeValuesExtCallback callback = new Lrc.ReflectAttributeValuesExtCallback(this.parent.FederateAmbassador, time, federateHandle, interactionIndex, new XRTIObjectInstanceHandle(objectInstanceHandle), handleValuePairList, userSuppliedTag); parent.lrc.AddCallback(callback); } }
protected void ProcessHLAupdateAttributeValuesMetafederation(HLAupdateAttributeValuesMessage msg) { Lrc.ReflectAttributeValuesExtCallback callback = new Lrc.ReflectAttributeValuesExtCallback(this.parent.MetaFederateAmbassador, new XRTIObjectInstanceHandle(msg.ObjectInstanceHandle), msg.AttributeHandleValuePairList, msg.UserSuppliedTag); callback.Call(); ObjectInstanceDescriptor oid = parent.descriptorManager.GetObjectInstanceDescriptor(new XRTIObjectInstanceHandle(msg.ObjectInstanceHandle)); ObjectClassDescriptor ocd = parent.descriptorManager.GetObjectClassDescriptor("Sxtafederate"); bool timePropertyFound = false; if (oid.ClassHandle.Equals(ocd.Handle)) { if (msg.AttributeHandleValuePairList.Length > 0) { for (int i = 0; i < msg.AttributeHandleValuePairList.Length && !timePropertyFound; i++) { HLAattributeHandleValuePair pair = msg.AttributeHandleValuePairList[i]; string propertyName = ocd.GetAttributeDescriptor(new XRTIAttributeHandle(pair.AttributeHandle)).Name; if (propertyName.Equals("HLAlogicalTime") || propertyName.Equals("HLAlookahead") || propertyName.Equals("HLApendingTime") || propertyName.Equals("HLALITS") || propertyName.Equals("HLAtimeManagerState") || propertyName.Equals("HLAtimeConstrained") || propertyName.Equals("HLAtimeRegulating")) { timePropertyFound = true; } } if (timePropertyFound) { parent.UpdateFederate(); } } } }