Diff of /trunk/mqttsparkplug/mqttsparkplug/SparkplugB/Function Blocks/FB_RemoteEdge/FB_RemoteEdge/ProcessNBIRTH/svnobj [r809] .. [r810]  Maximize  Restore

Switch to side-by-side view

--- a/trunk/mqttsparkplug/mqttsparkplug/SparkplugB/Function Blocks/FB_RemoteEdge/FB_RemoteEdge/ProcessNBIRTH/svnobj
+++ b/trunk/mqttsparkplug/mqttsparkplug/SparkplugB/Function Blocks/FB_RemoteEdge/FB_RemoteEdge/ProcessNBIRTH/svnobj
@@ -1,6 +1,7 @@
-Gx_l;!0…jüos+˜Æ¬Ìm`’*aSystem.StringL{f8a58466-d7f6-439f-bbb8-d4600e41d099}ImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocumentL{f3878285-8e4f-490b-bb1b-9acbb7eb04db}TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}	Id
+Gx_l”@!0…jüoÑ/-ûÚR›°
+F•System.StringL{f8a58466-d7f6-439f-bbb8-d4600e41d099}ImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocumentL{f3878285-8e4f-490b-bb1b-9acbb7eb04db}TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}	Id
 longTagText
B// 1. pMessage is already decoded¦// 2. For each metric already in the edge try to find it in the NBIRTH.MetricList, ^      // Not Found? => set to Status.NotBirthed.	  // Found? => nothingj_Metrics.ItterateRestart(HasNext => existingHasNext);0WHILE existingHasNext DOª	_Metrics.ItterateNext(itfElement => itfExistingElement, HasNext => existingHasNext);<	MetricFoundInxBIRTH := FALSE;€	IF __QUERYINTERFACE(itfExistingElement, itfExistingMetric) THENV		pMessage.GetFirstMetric( name => newName,N								 MetricValid => newMetricValid,@								 HasNext => newHasNext);ž		MetricFoundInxBIRTH := newMetricValid AND (newName = itfExistingMetric.Name);		b		WHILE newHasNext AND NOT MetricFoundInxBIRTH DOX			pMessage.GetNextMetric(  name => newName,P									 MetricValid => newMetricValid,B									 HasNext => newHasNext);  			MetricFoundInxBIRTH := newMetricValid AND (newName = itfExistingMetric.Name);!		END_WHILE"	END_IF#@	IF NOT MetricFoundInxBIRTH THEN$l		itfExistingMetric.Status := MetricStatus.NotBirthed;%END_WHILE&~// 3. For each metric in the NBIRTH, try to find it in the edge'H  // Found? ==> metric.ProcessxBIRTH(n  // NotFound ==> getblank Metric, metric.ProcessxBIRTH)RpMessage.GetFirstMetric( name => newName,*\	                     datatype => newdatatype,+B						 timestamp => newtimestamp,,@						 valueString => newString,-<						 valueLreal => newLreal,.8						 valueReal => newreal,/@						 valueVarInt => newVarInt,0J						 MetricValid => newMetricValid,1<						 HasNext => newHasNext);22                         3LTHIS^.GetMetricbyName( DeviceId:= "", 4Z                       MetricName:= newName, 5f                       Metric=> itfExistingMetric, 6N                       GetTimestamp=> ,7f                       xError=> MetricNotExisting, 8D                       eError=> );9.                       :2IF MetricNotExisting THEN;2	// get one and update it<j	IF __QUERYPOINTER(itfPrimaryHost, pPrimaryHost) THEN=Ì		AllocdMetric REF= pPrimaryHost^.allocMetric(itfMetricOwner := THIS^.itfRemoteEoN, eError => eError);>B		IF eError = ERROR.NO_ERROR THEN?X            itfAllocdMetric := AllocdMetric;@\            Update( Metric := itfAllocdMetric,AH                    Name := newName,BX                    DataType := newdatatype,Cj                    Status := MetricStatus.ONLINE_OK,D\                    Timestamp := newtimestamp,ER                    String_ := newString,FP                    LReal_ :=  newLreal,GJ                    Real_ := newreal,HV                    VarInt :=  newVarInt );I(                    J		END_IFKELSELJ	// update one as it allready excistsMP    Update( Metric := itfExistingMetric,N8            Name := newName,OH            DataType := newdatatype,PZ            Status := MetricStatus.ONLINE_OK,QL            Timestamp := newtimestamp,RB            String_ := newString,S@            LReal_ :=  newLreal,T:            Real_ := newreal,UF            VarInt :=  newVarInt );VEND_IFW^WHILE newHasNext AND NOT MetricFoundInxBIRTH DOXR	pMessage.GetNextMetric( name => newName,Yh                            datatype => newdatatype,Zl                            timestamp => newtimestamp,[j                            valueString => newString,\f                            valueLreal => newLreal,]b                            valueReal => newreal,^j                            valueVarInt => newVarInt,_t                            MetricValid => newMetricValid,`f                            HasNext => newHasNext);a8                            bP	THIS^.GetMetricbyName( DeviceId := "", cd                           MetricName := newName, dp                           Metric => itfExistingMetric, eV                           GetTimestamp=> ,f`						   xError=> MetricNotExisting, eError=> );g6                           h4	IF MetricNotExisting THENi4		// get one and update itjl		IF __QUERYPOINTER(itfPrimaryHost, pPrimaryHost) THENkÎ			AllocdMetric REF= pPrimaryHost^.allocMetric(itfMetricOwner := THIS^.itfRemoteEoN, eError => eError);lD			IF eError = ERROR.NO_ERROR THENm			END_IFn
-	ELSEo		//update onepX        Update( Metric := itfExistingMetric,q@                Name := newName,rP                DataType := newdatatype,sb                Status := MetricStatus.ONLINE_OK,tT                Timestamp := newtimestamp,uJ                String_ := newString,vH                LReal_ :=  newLreal,wB                Real_ := newreal,xN                VarInt :=  newVarInt );y                 zInterface{L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}|(METHOD ProcessNBIRTH}VAR_INPUT~D    itfPrimaryHost : IPrimaryHost;END_VAR€VAR_IN_OUT‚    pMessage : FB_PayloadSimpleDecoder; // already decoded please‚VAR_OUTPUTƒ$    xError : BOOL;„&    eError : Error;…VAR†8	existingHasNext     : BOOL;‡@	itfExistingElement  : IElement;ˆJ	itfExistingMetric   : IRemoteMetric;‰8	MetricNotExisting   : BOOL;Š	‹8	newHasNext          : BOOL;Œ8	newMetricValid      : BOOL;8	MetricFoundInxBIRTH : BOOL;Ž>	newName             : WSTRING;L	newdatatype         : MetricDataType;D	newtimestamp        : T_DateTime;‘Œ	newString           : WSTRING(gc_sparkplug.supported_string_lengths);’:	newLreal            : LREAL;“8	newreal             : REAL;”J	newVarInt           : DecodedVarInt;•b	pPrimaryHost        : POINTER TO FB_PrimaryHost;–h	AllocdMetric        : REFERENCE TO FB_RemoteMetric;—d	pExistingMetric     : POINTER TO FB_RemoteMetric;˜    ™P    itfAllocdMetric     : IRemoteMetric;ÐÐÐE€ÐÐ	
+	ELSEo		//update onepX        Update( Metric := itfExistingMetric,q@                Name := newName,rP                DataType := newdatatype,sb                Status := MetricStatus.ONLINE_OK,tT                Timestamp := newtimestamp,uJ                String_ := newString,vH                LReal_ :=  newLreal,wB                Real_ := newreal,xN                VarInt :=  newVarInt );y                 z/// Set all Device metric to offline and each device.isQualityOK = FALSE{v_devices.ItterateRestart(hasnext => existingHasNextDevice);|<WHILE existingHasNextDevice DO}¼    _devices.ItterateNext(itfElement => itfExistingElement, hasnext => existingHasNextDevice);~†    IF __QUERYINTERFACE(itfExistingElement, itfExistingDevice) THENZ        itfExistingDevice.QualityOK := FALSE;€²        itfExistingDevice.setAllMetricsStatus( NewStatus := MetricStatus.DeviceOffline );    END_IF ‚InterfaceƒL{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}„(METHOD ProcessNBIRTH…VAR_INPUT†D    itfPrimaryHost : IPrimaryHost;‡END_VARˆVAR_IN_OUT‰‚    pMessage : FB_PayloadSimpleDecoder; // already decoded pleaseŠVAR_OUTPUT‹$    xError : BOOL;Œ&    eError : Error;VARŽ8	existingHasNext     : BOOL;@	itfExistingElement  : IElement;J	itfExistingMetric   : IRemoteMetric;‘8	MetricNotExisting   : BOOL;’	“8	newHasNext          : BOOL;”8	newMetricValid      : BOOL;•8	MetricFoundInxBIRTH : BOOL;–>	newName             : WSTRING;—L	newdatatype         : MetricDataType;˜D	newtimestamp        : T_DateTime;™Œ	newString           : WSTRING(gc_sparkplug.supported_string_lengths);š:	newLreal            : LREAL;›8	newreal             : REAL;œJ	newVarInt           : DecodedVarInt;b	pPrimaryHost        : POINTER TO FB_PrimaryHost;žh	AllocdMetric        : REFERENCE TO FB_RemoteMetric;Ÿd	pExistingMetric     : POINTER TO FB_RemoteMetric;     ¡P    itfAllocdMetric     : IRemoteMetric;¢B    existingHasNextDevice : BOOL;£T    itfExistingDevice     : IRemoteDevice;ÐÐÐE‰ÐÐ	
 ­YÚÐ-
ÐÐ	
 ­ZÚÐ-ÐÐ	
 ­[ÚÐ-ÐÐ	
@@ -128,38 +129,50 @@
 ­fÚÐ-yÐÐ	
 ­"ÚÐ-"ÐÐ	
 ­#ÚÐ-%ÐÐ	
-­ÚÐ-Ðz{ÐE"ÐÐ	
-­NÚÐ-|ÐÐ	
-­OÚÐ-}ÐÐ	
-­PÚÐ-~ÐÐ	
-­QÚÐ-ÐÐ	
-­RÚÐ-€ÐÐ	
-­SÚÐ-ÐÐ	
-­TÚÐ-ÐÐ	
-­UÚÐ-‚ÐÐ	
-­VÚÐ-ƒÐÐ	
-­WÚÐ-„ÐÐ	
-­XÚÐ-ÐÐ	
-­YÚÐ-…ÐÐ	
-­ZÚÐ-†ÐÐ	
-­[ÚÐ-‡ÐÐ	
-­†ÚÐ-ˆÐÐ	
-­¬ÚÐ-‰ÐÐ	
-­\ÚÐ-ŠÐÐ	
-­]ÚÐ-‹ÐÐ	
-­^ÚÐ-ŒÐÐ	
-­¨ÚÐ-ÐÐ	
-­_ÚÐ-ŽÐÐ	
-­¢ÚÐ-ÐÐ	
-­£ÚÐ-ÐÐ	
-­©ÚÐ-‘ÐÐ	
-­ªÚÐ-’ÐÐ	
-­§ÚÐ-“ÐÐ	
-­¤ÚÐ-”ÐÐ	
-­³ÚÐ-ŠÐÐ	
-­´ÚÐ-•ÐÐ	
-­·ÚÐ-–ÐÐ	
-­ËÚÐ-—ÐÐ	
-­YÚÐ-˜ÐÐ	
-­ZÚÐ-™ÐÐ	
-­ÚÐ-
\ No newline at end of file
+­hÚÐ-ÐÐ	
+­iÚÐ-zÐÐ	
+­jÚÐ-{ÐÐ	
+­kÚÐ-|ÐÐ	
+­lÚÐ-}ÐÐ	
+­mÚÐ-~ÐÐ	
+­nÚÐ-ÐÐ	
+­oÚÐ-€ÐÐ	
+­pÚÐ-ÐÐ	
+­ÚÐ-%ЂƒÐE%ÐÐ	
+­NÚÐ-„ÐÐ	
+­OÚÐ-…ÐÐ	
+­PÚÐ-†ÐÐ	
+­QÚÐ-‡ÐÐ	
+­RÚÐ-ˆÐÐ	
+­SÚÐ-‰ÐÐ	
+­TÚÐ-‡ÐÐ	
+­UÚÐ-ŠÐÐ	
+­VÚÐ-‹ÐÐ	
+­WÚÐ-ŒÐÐ	
+­XÚÐ-‡ÐÐ	
+­YÚÐ-ÐÐ	
+­ZÚÐ-ŽÐÐ	
+­[ÚÐ-ÐÐ	
+­†ÚÐ-ÐÐ	
+­¬ÚÐ-‘ÐÐ	
+­\ÚÐ-’ÐÐ	
+­]ÚÐ-“ÐÐ	
+­^ÚÐ-”ÐÐ	
+­¨ÚÐ-•ÐÐ	
+­_ÚÐ-–ÐÐ	
+­¢ÚÐ-—ÐÐ	
+­£ÚÐ-˜ÐÐ	
+­©ÚÐ-™ÐÐ	
+­ªÚÐ-šÐÐ	
+­§ÚÐ-›ÐÐ	
+­¤ÚÐ-œÐÐ	
+­³ÚÐ-’ÐÐ	
+­´ÚÐ-ÐÐ	
+­·ÚÐ-žÐÐ	
+­ËÚÐ-ŸÐÐ	
+­YÚÐ- ÐÐ	
+­ZÚÐ-¡ÐÐ	
+­qÚÐ- ÐÐ	
+­rÚÐ-¢ÐÐ	
+­sÚÐ-£ÐÐ	
+­ÚÐ-‡
\ No newline at end of file