Diff of /branches/FeatureBranches/PrimaryHost/SparkplugB/Function Blocks/FB_RemoteEdge/FB_RemoteEdge/ProcessNDATA/svnobj [000000] .. [r799]  Maximize  Restore

Switch to unified view

a b/branches/FeatureBranches/PrimaryHost/SparkplugB/Function Blocks/FB_RemoteEdge/FB_RemoteEdge/ProcessNDATA/svnobj
1
Gx_l¨5!0…jüov(’DČ­ļ£'õ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);: MetricFoundInNDATA := FALSE;€    IF __QUERYINTERFACE(itfExistingElement, itfExistingMetric) THENV      pMessage.GetFirstMetric( name => newName,N                         MetricValid => newMetricValid,@                         HasNext => newHasNext);œ       MetricFoundInNDATA := newMetricValid AND (newName = itfExistingMetric.Name);`    WHILE newHasNext AND NOT MetricFoundInNDATA DOX       pMessage.GetNextMetric(  name => newName,P                            MetricValid => newMetricValid,B                            HasNext => newHasNext);ž          MetricFoundInNDATA := newMetricValid AND (newName = itfExistingMetric.Name);     END_WHILE!   END_IF"> IF NOT MetricFoundInNDATA THEN#l    itfExistingMetric.Status := MetricStatus.NotBirthed;$END_WHILE%|// 3. For each metric in the NDATA, try to find it in the edge&F  // Found? ==> metric.ProcessNDATA'.  // NotFound ==> Error(RpMessage.GetFirstMetric( name => newName,)\                        datatype => newdatatype,*B                   timestamp => newtimestamp,+@                   valueString => newString,,<                 valueLreal => newLreal,-8                 valueReal => newreal,.@                 valueVarInt => newVarInt,/J                 MetricValid => newMetricValid,0<                   HasNext => newHasNext);12                         2LTHIS^.GetMetricbyName( DeviceId:= "", 3Z                       MetricName:= newName, 4f                       Metric=> itfExistingMetric, 5N                       GetTimestamp=> ,6f                       xError=> MetricNotExisting, 7D                       eError=> );8.                       92IF MetricNotExisting THEN:&    xError := TRUE;;f    eError := Error.OhMy_ThatShouldNotHaveHappened;<~    WriteDeviceLog( UDINT_TO_DWORD( CmpLog.LogClass.LOG_INFO ),=Š                    'PrimaryHost ProcessNDATA MetricNotExisting: %s',>˜                    TO_STRING( Error.OhMy_ThatShouldNotHaveHappened ) );    ?ELSE@J   // update one as it allready excistsAP    Update( Metric := itfExistingMetric,B8            Name := newName,CH            DataType := newdatatype,DZ            Status := MetricStatus.ONLINE_OK,EL            Timestamp := newtimestamp,FB            String_ := newString,G@            LReal_ :=  newLreal,H:            Real_ := newreal,IF            VarInt :=  newVarInt );JEND_IFK\WHILE newHasNext AND NOT MetricFoundInNDATA DOLR   pMessage.GetNextMetric( name => newName,Mh                            datatype => newdatatype,Nl                            timestamp => newtimestamp,Oj                            valueString => newString,Pf                            valueLreal => newLreal,Qb                            valueReal => newreal,Rj                            valueVarInt => newVarInt,St                            MetricValid => newMetricValid,Tf                            HasNext => newHasNext);U8                            VP THIS^.GetMetricbyName( DeviceId := "", Wd                           MetricName := newName, Xp                           Metric => itfExistingMetric, YV                           GetTimestamp=> ,Z`                     xError=> MetricNotExisting, eError=> );[6                           \4 IF MetricNotExisting THEN].        xError := TRUE;^n        eError := Error.OhMy_ThatShouldNotHaveHappened;_†        WriteDeviceLog( UDINT_TO_DWORD( CmpLog.LogClass.LOG_INFO ),`’                        'PrimaryHost ProcessNDATA MetricNotExisting: %s',aœ                        TO_STRING( Error.OhMy_ThatShouldNotHaveHappened ) );  b
3
    ELSEc    //update onedX        Update( Metric := itfExistingMetric,e@                Name := newName,fP                DataType := newdatatype,gb                Status := MetricStatus.ONLINE_OK,hT                Timestamp := newtimestamp,iJ                String_ := newString,jH                LReal_ :=  newLreal,kB                Real_ := newreal,lN                VarInt :=  newVarInt );m                 nInterfaceoL{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}p&METHOD ProcessNDATAqVAR_INPUTrD    itfPrimaryHost : IPrimaryHost;sEND_VARtVAR_IN_OUTu‚    pMessage : FB_PayloadSimpleDecoder; // already decoded pleasevVAR_OUTPUTw$    xError : BOOL;x&    eError : Error;yVARz8  existingHasNext     : BOOL;{@   itfExistingElement  : IElement;|J   itfExistingMetric   : IRemoteMetric;}8 MetricNotExisting   : BOOL;~   8 newHasNext          : BOOL;€8  newMetricValid      : BOOL;8  MetricFoundInNDATA  : 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;ÐÐÐEfÐÐ  
4
­ªÚÐ-
ÐÐ  
5
­«ÚÐ-ÐÐ  
6
­¬ÚÐ-ÐÐ  
7
­­ÚÐ-ÐÐ  
8
­®ÚÐ-ÐÐ  
9
­¯ÚÐ-ÐÐ  
10
­°ÚÐ-ÐÐ  
11
­±ÚÐ-ÐÐ  
12
­²ÚÐ-ÐÐ  
13
­³ÚÐ-ÐÐ  
14
­´ÚÐ-ÐÐ  
15
­µÚÐ-ÐÐ  
16
­¶ÚÐ-ÐÐ  
17
­·ÚÐ-ÐÐ  
18
­¹ÚÐ-ÐÐ  
19
­ºÚÐ-ÐÐ  
20
­»ÚÐ-ÐÐ  
21
­¼ÚÐ-ÐÐ  
22
­½ÚÐ-ÐÐ  
23
­¾ÚÐ- ÐÐ  
24
­¿ÚÐ-!ÐÐ  
25
­ÀÚÐ-"ÐÐ  
26
­ÁÚÐ-#ÐÐ  
27
­ÂÚÐ-!ÐÐ  
28
­ÃÚÐ-$ÐÐ  
29
­ÄÚÐ-ÐÐ  
30
­ÅÚÐ-%ÐÐ  
31
­ÆÚÐ-&ÐÐ  
32
­ÇÚÐ-'ÐÐ  
33
­ÈÚÐ-(ÐÐ  
34
­ÉÚÐ-)ÐÐ  
35
­ÊÚÐ-*ÐÐ  
36
­ËÚÐ-+ÐÐ  
37
­ÌÚÐ-,ÐÐ  
38
­ÍÚÐ--ÐÐ  
39
­ÎÚÐ-.ÐÐ  
40
­ÏÚÐ-/ÐÐ  
41
­ÐÚÐ-0ÐÐ  
42
­ÑÚÐ-1ÐÐ  
43
­ÒÚÐ-2ÐÐ  
44
­ÓÚÐ-3ÐÐ  
45
­ÔÚÐ-4ÐÐ  
46
­ÕÚÐ-5ÐÐ  
47
­ÖÚÐ-6ÐÐ  
48
­×ÚÐ-7ÐÐ  
49
­ØÚÐ-8ÐÐ  
50
­ÙÚÐ-9ÐÐ  
51
­)ÚÐ-:ÐÐ  
52
­êÚÐ-;ÐÐ  
53
­:ÚÐ-<ÐÐ  
54
­;ÚÐ-=ÐÐ  
55
­9ÚÐ->ÐÐ  
56
­ëÚÐ-?ÐÐ  
57
­ìÚÐ-@ÐÐ  
58
­íÚÐ-AÐÐ  
59
­îÚÐ-BÐÐ  
60
­ïÚÐ-CÐÐ  
61
­ðÚÐ-DÐÐ  
62
­ñÚÐ-EÐÐ  
63
­òÚÐ-FÐÐ  
64
­óÚÐ-GÐÐ  
65
­ôÚÐ-HÐÐ  
66
­õÚÐ-IÐÐ  
67
­öÚÐ-JÐÐ  
68
­÷ÚÐ-ÐÐ  
69
­øÚÐ-KÐÐ  
70
­ùÚÐ-LÐÐ  
71
­úÚÐ-MÐÐ  
72
­ûÚÐ-NÐÐ  
73
­üÚÐ-OÐÐ  
74
­ýÚÐ-PÐÐ  
75
­þÚÐ-QÐÐ  
76
­ÿÚÐ-RÐÐ  
77
­ÚÐ-SÐÐ  
78
­ÚÐ-TÐÐ  
79
­ÚÐ-UÐÐ  
80
­ÚÐ-VÐÐ  
81
­ÚÐ-WÐÐ  
82
­ÚÐ-XÐÐ  
83
­ÚÐ-YÐÐ  
84
­ÚÐ-ZÐÐ  
85
­ÚÐ-[ÐÐ  
86
­   ÚÐ-\ÐÐ    
87
­<ÚÐ-]ÐÐ  
88
­=ÚÐ-^ÐÐ  
89
­>ÚÐ-_ÐÐ  
90
­?ÚÐ-`ÐÐ  
91
­+ÚÐ-aÐÐ  
92
­ÚÐ-bÐÐ  
93
­ÚÐ-cÐÐ  
94
­ÚÐ-dÐÐ  
95
­ÚÐ-eÐÐ  
96
­ÚÐ-fÐÐ  
97
­ ÚÐ-gÐÐ  
98
­!ÚÐ-hÐÐ  
99
­"ÚÐ-iÐÐ  
100
­#ÚÐ-jÐÐ  
101
­$ÚÐ-kÐÐ  
102
­%ÚÐ-lÐÐ  
103
­&ÚÐ-mÐÐ  
104
­'ÚÐ-!ÐÐ  
105
­(ÚÐ-$ÐnoÐE"ÐÐ    
106
­‰ÚÐ-pÐÐ  
107
­ŠÚÐ-qÐÐ  
108
­‹ÚÐ-rÐÐ  
109
­ŒÚÐ-sÐÐ  
110
­ÚÐ-tÐÐ  
111
­ŽÚÐ-uÐÐ  
112
­ÚÐ-sÐÐ  
113
­ÚÐ-vÐÐ  
114
­‘ÚÐ-wÐÐ  
115
­’ÚÐ-xÐÐ  
116
­“ÚÐ-sÐÐ  
117
­”ÚÐ-yÐÐ  
118
­•ÚÐ-zÐÐ  
119
­–ÚÐ-{ÐÐ  
120
­—ÚÐ-|ÐÐ  
121
­˜ÚÐ-}ÐÐ  
122
­™ÚÐ-~ÐÐ  
123
­šÚÐ-ÐÐ  
124
­›ÚÐ-€ÐÐ 
125
­œÚÐ-ÐÐ 
126
­ÚÐ-‚ÐÐ 
127
­žÚÐ-ƒÐÐ 
128
­ŸÚÐ-„ÐÐ 
129
­ ÚÐ-…ÐÐ 
130
­¡ÚÐ-†ÐÐ 
131
­¢ÚÐ-‡ÐÐ 
132
­£ÚÐ-ˆÐÐ 
133
­¤ÚÐ-~ÐÐ  
134
­¥ÚÐ-‰ÐÐ 
135
­¦ÚÐ-ŠÐÐ 
136
­§ÚÐ-‹ÐÐ 
137
­¨ÚÐ-ŒÐÐ 
138
­©ÚÐ-ÐÐ 
139
­ÚÐ-s