Idea

Jeremy R avatar image
3 Likes"
Jeremy R suggested Matthew Gillespie commented

Support string literals in statistics collector values

In a Statistic Collector, when putting a string literal in the “Value” field of an Event Data Label on the Event Listening tab, the quotation marks are not removed from the value when logged in the Statistic Collector’s data.

For example, when the string literal “Transit” is returned, the quotation marks remain, whereas when using a method that returns a string (such as data.activity.name), this does not occur. I've attached an image of an extract of one of the columns of the Statistic Collector’s data as seen using “View Table”.

These quotation marks cause JSON parse errors when trying plot the output of the Statistic Collector on a graph. Here’s an example of a JSON parse error that is returned.

Callstack:
unable to trace stack
Error: SyntaxError JSON Parse error: Expected ']' in timeplotd3.js
{"genericChartType":1,"modelStartTime":13183084800,"chartTitle":"Location","xAxisTitle":"","yAxisTitle":"","showLegend":1,"precision":2,"fontSize":12,"titleFontSize":20,"axisFontSize":18,"xAxisIndex":0,"yAxisIndex":1,"style":2,"yAxisMode":0,"yMin":0,"yMax":100,"useTimeWindow":0,"timeWindowDuration":100,"keyColumns":[2],"columnFormats":[2,0,0,0],"colorData":[{"keyData":["Exercise"],"color":"rgb(178,178,178)","used":1},{"keyData":["Active"],"color":"rgb(0,174,214)","used":1},{"keyData":[""Transit""],"color":"rgb(255,152,150)","used":1},{"keyData":[],"color":"rgb(31,119,180)","used":1}]} - apply settings

Not being able to return string literals in Statistic Collectors is very frustrating and counter-intuitive. I am running version 18.2.0 of FlexSim.

statistics collectorstrings
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Comment

·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie commented

This is a bug, it will be fixed in the next bug fix release.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write a Comment

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.