a/branches/FeatureBranches/PrimaryHost/SparkplugB/Function Blocks/FB_RemoteEdge/FB_RemoteEdge/ProcessNBIRTH/svnobj b/branches/FeatureBranches/PrimaryHost/SparkplugB/Function Blocks/FB_RemoteEdge/FB_RemoteEdge/ProcessNBIRTH/svnobj
1
Gx_l;!0jü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
1
Gx_l”@!0…jüoÑ/-ûÚR›°
2
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
2
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
3
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
3
    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€ÐÐ 
4
    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‰ÐÐ 
4
­YÚÐ-
ÐÐ  
5
­YÚÐ-
ÐÐ  
5
­ZÚÐ-ÐÐ  
6
­ZÚÐ-ÐÐ  
6
­[ÚÐ-ÐÐ  
7
­[ÚÐ-ÐÐ  
7
­\ÚÐ-ÐÐ  
8
­\ÚÐ-ÐÐ  
8
­]ÚÐ-ÐÐ  
9
­]ÚÐ-ÐÐ  
...
...
126
­WÚÐ-wÐÐ  
127
­WÚÐ-wÐÐ  
127
­MÚÐ-xÐÐ  
128
­MÚÐ-xÐÐ  
128
­fÚÐ-yÐÐ  
129
­fÚÐ-yÐÐ  
129
­"ÚÐ-"ÐÐ  
130
­"ÚÐ-"ÐÐ  
130
­#ÚÐ-%ÐÐ  
131
­#ÚÐ-%ÐÐ  
131
­ÚÐ-Ðz{ÐE"ÐÐ    
132
­hÚÐ-ÐÐ  
133
­iÚÐ-zÐÐ  
134
­jÚÐ-{ÐÐ  
135
­kÚÐ-|ÐÐ  
136
­lÚÐ-}ÐÐ  
137
­mÚÐ-~ÐÐ  
138
­nÚÐ-ÐÐ  
139
­oÚÐ-€ÐÐ 
140
­pÚÐ-ÐÐ 
141
­ÚÐ-%ЂƒÐE%ÐÐ  
132
­NÚÐ-|ÐÐ  
142
­NÚÐ-„ÐÐ 
133
­OÚÐ-}ÐÐ  
143
­OÚÐ-…ÐÐ 
134
­PÚÐ-~ÐÐ  
144
­PÚÐ-†ÐÐ 
135
­QÚÐ-ÐÐ  
145
­QÚÐ-‡ÐÐ 
136
­RÚÐ-ÐÐ 
146
­RÚÐ-ˆÐÐ 
137
­SÚÐ-ÐÐ 
147
­SÚÐ-ÐÐ 
138
­TÚÐ-ÐÐ  
148
­TÚÐ-‡ÐÐ 
139
­UÚÐ-ÐÐ 
149
­UÚÐ-ŠÐÐ 
140
­VÚÐ-ƒÐÐ 
150
­VÚÐ-ÐÐ 
141
­WÚÐ-ÐÐ 
151
­WÚÐ-ŒÐÐ 
142
­XÚÐ-ÐÐ  
152
­XÚÐ-‡ÐÐ 
143
­YÚÐ-ÐÐ 
153
­YÚÐ-ÐÐ 
144
­ZÚÐ-ÐÐ 
154
­ZÚÐ-ŽÐÐ 
145
­[ÚÐ-ÐÐ 
155
­[ÚÐ-ÐÐ 
146
­ÚÐ-ˆÐÐ 
156
­†ÚÐ-ÐÐ 
147
­¬ÚÐ-ÐÐ 
157
­¬ÚÐ-ÐÐ 
148
­\ÚÐ-ŠÐÐ 
158
­\ÚÐ-ÐÐ 
149
­]ÚÐ-ÐÐ 
159
­]ÚÐ-ÐÐ 
150
­^ÚÐ-ŒÐÐ 
160
­^ÚÐ-ÐÐ 
151
­¨ÚÐ-ÐÐ 
161
­¨ÚÐ-ÐÐ 
152
­_ÚÐ-ŽÐÐ 
162
­_ÚÐ-ÐÐ 
153
­¢ÚÐ-ÐÐ 
163
­¢ÚÐ-ÐÐ 
154
­£ÚÐ-ÐÐ 
164
­£ÚÐ-˜ÐÐ 
155
­©ÚÐ-ÐÐ 
165
­©ÚÐ-ÐÐ 
156
­ªÚÐ-ÐÐ 
166
­ªÚÐ-šÐÐ 
157
­§ÚÐ-ÐÐ 
167
­§ÚÐ-ÐÐ 
158
­¤ÚÐ-ÐÐ 
168
­¤ÚÐ-œÐÐ 
159
­³ÚÐ-ŠÐÐ 
169
­³ÚÐ-ÐÐ 
160
­´ÚÐ-ÐÐ 
170
­´ÚÐ-ÐÐ 
161
­·ÚÐ-ÐÐ 
171
­·ÚÐ-žÐÐ 
162
­ËÚÐ-ÐÐ 
172
­ËÚÐ-ŸÐÐ 
163
­YÚÐ-˜ÐÐ 
173
­YÚÐ- ÐÐ 
164
­ZÚÐ-ÐÐ 
174
­ZÚÐ-¡ÐÐ 
175
­qÚÐ- ÐÐ 
176
­rÚÐ-¢ÐÐ 
177
­sÚÐ-£ÐÐ 
165
­ÚÐ-
178
­ÚÐ-‡