[7e7e44]: / project / sparkplug™_mqtt_edge_and_host-stack_b9741afd / function_blocks_8ad6e219 / fb_payloadsimple_87cbd74b / fb_payloadsimpleencoder_1f607d29 / addallmetricstotemplate_2a347737 / 2a347737ea5b4cdfb12abfa794e04259.object  Maximize  Restore  History

Download this file

1 lines (1 with data), 9.5 kB

1
{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)2a347737-ea5b-4cdf-b12a-bfa794e04259","ParentGuid":"(Guid)1f607d29-4c3d-4ff9-917a-3446e8ba16b7","Name":"(string)AddAllMetricsToTemplate","Properties":{"@Type":"2c41fa04:IDictionary","@Value":{}},"TypeGuid":"(Guid)f8a58466-d7f6-439f-bbb8-d4600e41d099","EmbeddedTypeGuids":{"@Type":"[Guid]","@Value":["(Guid)a9ed5b7e-75c5-4651-af16-d2c27e98cb94","(Guid)3b83b776-fb25-43b8-99f2-3c507c9143fc"]}}},"TypeInfos":{"2c41fa04":"{2c41fa04-1834-41c1-816e-303c7aa2c05b}","81297157":"{81297157-7ec9-45ce-845e-84cab2b88ade}","Guid":"System.Guid","string":"System.String"}},"object":{"Graph":{"@Type":"f8a58466","@Value":{"Implementation":{"@Type":"3b83b776","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)1353","Tag":null,"Text":"(string)// At first we set no error"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1354","Tag":null,"Text":"(string)// If something changes it before end of the method we yield an error"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1355","Tag":null,"Text":"(string)AddAllMetricsToTemplate := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1356","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1357","Tag":null,"Text":"(string)IF SendList.ListSize <> 0 THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1358","Tag":null,"Text":"(string)    ItfCurElement := SendList.HeadElem;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1359","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1360","Tag":null,"Text":"(string)    WHILE ItfCurElement <> 0 DO"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1361","Tag":null,"Text":"(string)        ElementCounter := ElementCounter + 1;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1362","Tag":null,"Text":"(string)        HasItfMetric := __QUERYINTERFACE(itfCurElement,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1363","Tag":null,"Text":"(string)            itfMetric);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1364","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1365","Tag":null,"Text":"(string)        IF HasItfMetric THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1366","Tag":null,"Text":"(string)            // we can safely 'plug it' in the method"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1367","Tag":null,"Text":"(string)            AddAllMetricsToTemplate := THIS^.AddMetricCompleteTemplate(Timestamp := Timestamp,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1368","Tag":null,"Text":"(string)                SparkplugObject := itfMetric , "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1402","Tag":null,"Text":"(string)\t\t\t\tUseAliases := UseAliases,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1403","Tag":null,"Text":"(string)\t\t\t\tPayloadTemplate := PayloadTemplate);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1369","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1370","Tag":null,"Text":"(string)            // Succes"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1371","Tag":null,"Text":"(string)            WriteStackLog(GC_Sparkplug.CMP_STACK,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1372","Tag":null,"Text":"(string)                CmpLog.LogClass.LOG_DEBUG,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1373","Tag":null,"Text":"(string)                'SparkplugBSimple AddMetricList Element added: %s',"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1374","Tag":null,"Text":"(string)                TO_STRING(WCONCAT(itfMetric.Name,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1375","Tag":null,"Text":"(string)                        WCONCAT(\" : \","}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1376","Tag":null,"Text":"(string)                            TO_WSTRING(itfMetric.DataType)))));"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1377","Tag":null,"Text":"(string)        ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1378","Tag":null,"Text":"(string)            // SimpleValue Interface is NOT implemented"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1379","Tag":null,"Text":"(string)            WriteStackLog(GC_Sparkplug.CMP_STACK,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1380","Tag":null,"Text":"(string)                CmpLog.LogClass.LOG_ERROR,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1381","Tag":null,"Text":"(string)                'SparkplugBSimple AddMetricList Error: element does not implement IMetric Interface: %s',"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1382","Tag":null,"Text":"(string)                'Oops, this shouldn$'t happen');"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1383","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1384","Tag":null,"Text":"(string)            AddAllMetricsToTemplate := ERROR.NotImplemented;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1385","Tag":null,"Text":"(string)        END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1386","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1387","Tag":null,"Text":"(string)        HasItfMetric := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1388","Tag":null,"Text":"(string)        ItfCurElement := ItfCurElement.NextElem; // If NextElem = 0 we reached the end of the List"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1389","Tag":null,"Text":"(string)    END_WHILE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1390","Tag":null,"Text":"(string)ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1391","Tag":null,"Text":"(string)    // List empty"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1392","Tag":null,"Text":"(string)    WriteStackLog(GC_Sparkplug.CMP_STACK,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1393","Tag":null,"Text":"(string)        CmpLog.LogClass.LOG_DEBUG,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1394","Tag":null,"Text":"(string)        'SparkplugBSimple AddMetricList Error, List empty.',"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1395","Tag":null,"Text":"(string)        '');"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1396","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1397","Tag":null,"Text":"(string)    AddAllMetricsToTemplate := ERROR.NotImplemented;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)425","Tag":null,"Text":"(string)END_IF"}}]}}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)1333","Tag":null,"Text":"(string)(*"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1334","Tag":null,"Text":"(string)    Add a List of metric value's by spoonfeeding each metric in the List and add it seperatly"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1336","Tag":null,"Text":"(string)    "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1337","Tag":null,"Text":"(string)    The Method returns 'No Error' if all metrics have been processed with succes  "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1338","Tag":null,"Text":"(string)    An error is thrown if at least one metric adding has failed."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1339","Tag":null,"Text":"(string)    Check the SparkPlugLog for details on which Metric has thrown the error."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1340","Tag":null,"Text":"(string)*)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1341","Tag":null,"Text":"(string)METHOD AddAllMetricsToTemplate : ERROR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1342","Tag":null,"Text":"(string)VAR_INPUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1343","Tag":null,"Text":"(string)    Timestamp : T_DateTime;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1344","Tag":null,"Text":"(string)    // List of metrics we curently wish to send"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1345","Tag":null,"Text":"(string)    SendList : LinkedList.IList; // OF IMetric"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1346","Tag":null,"Text":"(string)    UseAliases : BOOL := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1347","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1399","Tag":null,"Text":"(string)VAR_IN_OUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1400","Tag":null,"Text":"(string)\t//The template to add the metrics to"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1401","Tag":null,"Text":"(string)\tPayloadTemplate : FB_PayloadTemplate;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1398","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1348","Tag":null,"Text":"(string)VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1349","Tag":null,"Text":"(string)    ItfCurElement : LinkedList.IElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1350","Tag":null,"Text":"(string)    itfMetric : IMetric;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1351","Tag":null,"Text":"(string)    HasItfMetric : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1352","Tag":null,"Text":"(string)    ElementCounter : UDINT := 0; // keep track of current elementnumber which is processed"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)14","Tag":null,"Text":"(string)END_VAR"}}]}}}}}}},"TypeInfos":{"3b83b776":"{3b83b776-fb25-43b8-99f2-3c507c9143fc}","a5de0b0b":"{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}","a9ed5b7e":"{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}","f3878285":"{f3878285-8e4f-490b-bb1b-9acbb7eb04db}","f8a58466":"{f8a58466-d7f6-439f-bbb8-d4600e41d099}","long":"System.Int64","string":"System.String"}}},"FormatVersion":"1.0"}