{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Dashboard for visualizing CAN/LIN data along with internal GPS/IMU data via the Synapse data source",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": 128,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "mssql",
        "uid": "Microsoft SQL Server"
      },
      "description": "",
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 0,
        "y": 0
      },
      "id": 9,
      "options": {
        "code": {
          "language": "plaintext",
          "showLineNumbers": false,
          "showMiniMap": false
        },
        "content": "<img src='https://cdn.shopify.com/s/files/1/0579/8032/1980/files/canedge3-3g-4g-gps-imu-v2.png'>",
        "mode": "markdown"
      },
      "pluginVersion": "10.1.5",
      "transformations": [],
      "transparent": true,
      "type": "text"
    },
    {
      "datasource": {
        "type": "datasource",
        "uid": "-- Dashboard --"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#3d85c6",
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "green",
                "value": 20
              },
              {
                "color": "super-light-green",
                "value": 50
              },
              {
                "color": "super-light-yellow",
                "value": 70
              },
              {
                "color": "yellow",
                "value": 90
              },
              {
                "color": "dark-yellow",
                "value": 110
              },
              {
                "color": "orange",
                "value": 130
              },
              {
                "color": "red",
                "value": 140
              },
              {
                "color": "dark-red",
                "value": 150
              }
            ]
          },
          "unit": "velocitykmh"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 4,
        "y": 0
      },
      "id": 11,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.1.5",
      "targets": [
        {
          "datasource": {
            "type": "datasource",
            "uid": "-- Dashboard --"
          },
          "panelId": 6,
          "refId": "A",
          "withTransforms": true
        }
      ],
      "title": "Speed (AVG)",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "time",
                "AVG_speedkmh"
              ]
            }
          }
        }
      ],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "mssql",
        "uid": "Microsoft SQL Server"
      },
      "description": "The trip distance shows the distance travelled since the last power cycle. If the device power supply is linked to the ignition, this will reflect a trip distance.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#3d85c6",
            "mode": "fixed"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "lengthkm"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "_col1"
            },
            "properties": [
              {
                "id": "mappings",
                "value": []
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 7,
        "y": 0
      },
      "id": 10,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.1.5",
      "targets": [
        {
          "dataset": "playgrounddb",
          "datasource": {
            "type": "mssql",
            "uid": "Microsoft SQL Server"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "SELECT\r\n    DATEADD(MILLISECOND, (DATEPART(MILLISECOND, t) / $__interval_ms) * $__interval_ms, DATEADD(SECOND, DATEDIFF(SECOND, '2020', t), '2020')) AS time,\r\n    MAX(DistanceTrip) as MAX_distancetrip\r\nFROM\r\n    OPENROWSET(\r\n        BULK '${device:csv}/CAN9_GnssDistance/*/*/*/*',\r\n        DATA_SOURCE = 'ParquetDataLake',\r\n        FORMAT = 'PARQUET'\r\n    ) AS r\r\nWHERE\r\n    CONCAT(r.filepath(1), '-', r.filepath(2), '-', r.filepath(3)) BETWEEN CONVERT(date, $__timeFrom()) AND CONVERT(date, $__timeTo())\r\n    AND $__timeFilter(t)\r\nGROUP BY\r\n    DATEDIFF(SECOND, '2020', t), DATEPART(MILLISECOND, t) / $__interval_ms\r\nORDER BY\r\n    time\r\nOFFSET 0 ROWS;",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Distance",
      "transformations": [
        {
          "id": "calculateField",
          "options": {
            "alias": "MAX_distancetripkm",
            "binary": {
              "left": "MAX_distancetrip",
              "operator": "/",
              "reducer": "sum",
              "right": "1000"
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            },
            "replaceFields": true
          }
        }
      ],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "mssql",
        "uid": "Microsoft SQL Server"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#3d85c6",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "green",
                "value": 20
              },
              {
                "color": "super-light-green",
                "value": 50
              },
              {
                "color": "super-light-yellow",
                "value": 70
              },
              {
                "color": "yellow",
                "value": 90
              },
              {
                "color": "dark-yellow",
                "value": 110
              },
              {
                "color": "orange",
                "value": 130
              },
              {
                "color": "red",
                "value": 140
              },
              {
                "color": "dark-red",
                "value": 150
              }
            ]
          },
          "unit": "lengthm"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 10,
        "y": 0
      },
      "id": 16,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.1.5",
      "targets": [
        {
          "dataset": "playgrounddb",
          "datasource": {
            "type": "mssql",
            "uid": "Microsoft SQL Server"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "SELECT\r\n    DATEADD(MILLISECOND, (DATEPART(MILLISECOND, t) / $__interval_ms) * $__interval_ms, DATEADD(SECOND, DATEDIFF(SECOND, '2020', t), '2020')) AS time,\r\n    AVG(altitude) as AVG_altitude\r\nFROM\r\n    OPENROWSET(\r\n        BULK '${device:csv}/CAN9_GnssAltitude/*/*/*/*',\r\n        DATA_SOURCE = 'ParquetDataLake',\r\n        FORMAT = 'PARQUET'\r\n    ) AS r\r\nWHERE\r\n    CONCAT(r.filepath(1), '-', r.filepath(2), '-', r.filepath(3)) BETWEEN CONVERT(date, $__timeFrom()) AND CONVERT(date, $__timeTo())\r\n    AND $__timeFilter(t)\r\nGROUP BY\r\n    DATEDIFF(SECOND, '2020', t), DATEPART(MILLISECOND, t) / $__interval_ms\r\nORDER BY\r\n    time\r\nOFFSET 0 ROWS;\r\n",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Altitude (AVG)",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "mssql",
        "uid": "Microsoft SQL Server"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#3d85c6",
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "yellow",
                "value": 5
              },
              {
                "color": "light-green",
                "value": 8
              },
              {
                "color": "green",
                "value": 12
              },
              {
                "color": "dark-green",
                "value": 14
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 13,
        "y": 0
      },
      "id": 14,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.1.5",
      "targets": [
        {
          "dataset": "playgrounddb",
          "datasource": {
            "type": "mssql",
            "uid": "Microsoft SQL Server"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "SELECT\r\n    DATEADD(MILLISECOND, (DATEPART(MILLISECOND, t) / $__interval_ms) * $__interval_ms, DATEADD(SECOND, DATEDIFF(SECOND, '2020', t), '2020')) AS time,\r\n    AVG(satellites) as AVG_satellites, AVG(fixtype) as AVG_fixtype\r\nFROM\r\n    OPENROWSET(\r\n        BULK '${device:csv}/CAN9_GnssStatus/*/*/*/*',\r\n        DATA_SOURCE = 'ParquetDataLake',\r\n        FORMAT = 'PARQUET'\r\n    ) AS r\r\nWHERE\r\n    CONCAT(r.filepath(1), '-', r.filepath(2), '-', r.filepath(3)) BETWEEN CONVERT(date, $__timeFrom()) AND CONVERT(date, $__timeTo())\r\n    AND $__timeFilter(t)\r\nGROUP BY\r\n    DATEDIFF(SECOND, '2020', t), DATEPART(MILLISECOND, t) / $__interval_ms\r\nORDER BY\r\n    time\r\nOFFSET 0 ROWS;\r\n\r\n\r\n\r\n",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Satellites",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "time",
                "AVG_satellites"
              ]
            }
          }
        }
      ],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "datasource",
        "uid": "-- Dashboard --"
      },
      "description": "This reflects the average GNSS Fix Type: 0 \"No fix\", 1 \"Dead reckoning only\", 2 \"2D-fix\", 3 \"3D-fix\", 4 \"GNSS + dead reckoning combined\", 5 \"Time only fix\"",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#3d85c6",
            "mode": "thresholds"
          },
          "decimals": 1,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 0.9
              },
              {
                "color": "yellow",
                "value": 1.9
              },
              {
                "color": "light-green",
                "value": 2.9
              },
              {
                "color": "dark-green",
                "value": 3.9
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 15,
        "y": 0
      },
      "id": 15,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.1.5",
      "targets": [
        {
          "datasource": {
            "type": "datasource",
            "uid": "-- Dashboard --"
          },
          "panelId": 14,
          "refId": "A"
        }
      ],
      "title": "FixType",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "time",
                "AVG_fixtype"
              ]
            }
          }
        }
      ],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "mssql",
        "uid": "Microsoft SQL Server"
      },
      "description": "This shows the GPS position with color coding based on Speed (in km/h).",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "green",
                "value": 20
              },
              {
                "color": "light-green",
                "value": 30
              },
              {
                "color": "super-light-green",
                "value": 40
              },
              {
                "color": "super-light-yellow",
                "value": 50
              },
              {
                "color": "yellow",
                "value": 60
              },
              {
                "color": "semi-dark-yellow",
                "value": 70
              },
              {
                "color": "super-light-orange",
                "value": 80
              },
              {
                "color": "light-orange",
                "value": 90
              },
              {
                "color": "orange",
                "value": 100
              },
              {
                "color": "semi-dark-orange",
                "value": 110
              },
              {
                "color": "dark-orange",
                "value": 120
              },
              {
                "color": "light-red",
                "value": 130
              },
              {
                "color": "red",
                "value": 140
              },
              {
                "color": "dark-red",
                "value": 150
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 11,
        "w": 7,
        "x": 17,
        "y": 0
      },
      "id": 6,
      "options": {
        "basemap": {
          "config": {},
          "name": "Layer 0",
          "opacity": 0.6,
          "tooltip": true,
          "type": "osm-standard"
        },
        "controls": {
          "mouseWheelZoom": true,
          "showAttribution": false,
          "showDebug": false,
          "showMeasure": false,
          "showScale": false,
          "showZoom": true
        },
        "layers": [
          {
            "config": {
              "arrow": 0,
              "style": {
                "color": {
                  "field": "AVG_speedkmh",
                  "fixed": "blue"
                },
                "lineWidth": 2,
                "opacity": 1,
                "rotation": {
                  "fixed": 0,
                  "max": 360,
                  "min": -360,
                  "mode": "mod"
                },
                "size": {
                  "fixed": 3,
                  "max": 15,
                  "min": 2
                },
                "symbol": {
                  "fixed": "img/icons/marker/circle.svg",
                  "mode": "fixed"
                },
                "symbolAlign": {
                  "horizontal": "center",
                  "vertical": "center"
                },
                "text": {
                  "field": "AVG_speed",
                  "fixed": "",
                  "mode": "fixed"
                },
                "textConfig": {
                  "fontSize": 12,
                  "offsetX": 0,
                  "offsetY": 0,
                  "textAlign": "center",
                  "textBaseline": "middle"
                }
              }
            },
            "location": {
              "latitude": "AVG_latitude",
              "longitude": "AVG_longitude",
              "mode": "coords"
            },
            "name": "Layer 2",
            "opacity": 1,
            "tooltip": true,
            "type": "route"
          }
        ],
        "tooltip": {
          "mode": "details"
        },
        "view": {
          "allLayers": true,
          "id": "fit",
          "lat": 0,
          "lon": 0,
          "padding": 10,
          "shared": true,
          "zoom": 15
        }
      },
      "pluginVersion": "10.1.5",
      "targets": [
        {
          "dataset": "playgrounddb",
          "datasource": {
            "type": "mssql",
            "uid": "Microsoft SQL Server"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "SELECT\r\n    DATEADD(MILLISECOND, (DATEPART(MILLISECOND, t) / $__interval_ms) * $__interval_ms, DATEADD(SECOND, DATEDIFF(SECOND, '2020', t), '2020')) AS time,\r\n    AVG(longitude) as AVG_longitude, AVG(latitude) as AVG_latitude, AVG(positionvalid) as AVG_positionvalid\r\nFROM\r\n    OPENROWSET(\r\n        BULK '${device:csv}/CAN9_GnssPos/*/*/*/*',\r\n        DATA_SOURCE = 'ParquetDataLake',\r\n        FORMAT = 'PARQUET'\r\n    ) AS r\r\nWHERE\r\n    CONCAT(r.filepath(1), '-', r.filepath(2), '-', r.filepath(3)) BETWEEN CONVERT(date, $__timeFrom()) AND CONVERT(date, $__timeTo())\r\n    AND $__timeFilter(t)\r\nGROUP BY\r\n    DATEDIFF(SECOND, '2020', t), DATEPART(MILLISECOND, t) / $__interval_ms\r\nORDER BY\r\n    time\r\nOFFSET 0 ROWS;",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        },
        {
          "dataset": "playgrounddb",
          "datasource": {
            "type": "mssql",
            "uid": "Microsoft SQL Server"
          },
          "editorMode": "code",
          "format": "table",
          "hide": false,
          "rawQuery": true,
          "rawSql": "SELECT\r\n    DATEADD(MILLISECOND, (DATEPART(MILLISECOND, t) / $__interval_ms) * $__interval_ms, DATEADD(SECOND, DATEDIFF(SECOND, '2020', t), '2020')) AS time,\r\n    AVG(speed) as AVG_speed\r\nFROM\r\n    OPENROWSET(\r\n        BULK '${device:csv}/CAN9_GnssSpeed/*/*/*/*',\r\n        DATA_SOURCE = 'ParquetDataLake',\r\n        FORMAT = 'PARQUET'\r\n    ) AS r\r\nWHERE\r\n    CONCAT(r.filepath(1), '-', r.filepath(2), '-', r.filepath(3)) BETWEEN CONVERT(date, $__timeFrom()) AND CONVERT(date, $__timeTo())\r\n    AND $__timeFilter(t)\r\nGROUP BY\r\n    DATEDIFF(SECOND, '2020', t), DATEPART(MILLISECOND, t) / $__interval_ms\r\nORDER BY\r\n    time\r\nOFFSET 0 ROWS;",
          "refId": "B",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "GPS Position",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "AVG_speedkmh",
            "binary": {
              "left": "AVG_speed",
              "operator": "*",
              "reducer": "sum",
              "right": "3.6"
            },
            "mode": "binary",
            "reduce": {
              "reducer": "sum"
            }
          }
        },
        {
          "id": "filterByValue",
          "options": {
            "filters": [
              {
                "config": {
                  "id": "isNull",
                  "options": {}
                },
                "fieldName": "AVG_longitude"
              },
              {
                "config": {
                  "id": "isNull",
                  "options": {}
                },
                "fieldName": "AVG_latitude"
              },
              {
                "config": {
                  "id": "isNull",
                  "options": {}
                },
                "fieldName": "AVG_speed"
              },
              {
                "config": {
                  "id": "equal",
                  "options": {
                    "value": 0
                  }
                },
                "fieldName": "AVG_positionvalid"
              }
            ],
            "match": "any",
            "type": "exclude"
          }
        }
      ],
      "type": "geomap"
    },
    {
      "datasource": {
        "type": "datasource",
        "uid": "-- Dashboard --"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#3d85c6",
            "mode": "fixed"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 21,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": 300000,
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 2,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "always",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "_col1"
            },
            "properties": [
              {
                "id": "mappings",
                "value": []
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_speed"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#3d85c6",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_speedaccuracykmh"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "color",
                "value": {
                  "fixedColor": "#cacaca",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 10,
        "x": 0,
        "y": 4
      },
      "id": 18,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "datasource",
            "uid": "-- Dashboard --"
          },
          "panelId": 6,
          "refId": "A",
          "withTransforms": true
        }
      ],
      "title": "Speed (km/h)",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "time",
                "AVG_speedkmh"
              ]
            }
          }
        }
      ],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "mssql",
        "uid": "Microsoft SQL Server"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#3d85c6",
            "mode": "fixed"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 25,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": 300000,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "green",
                "value": 20
              },
              {
                "color": "super-light-green",
                "value": 50
              },
              {
                "color": "super-light-yellow",
                "value": 70
              },
              {
                "color": "yellow",
                "value": 90
              },
              {
                "color": "dark-yellow",
                "value": 110
              },
              {
                "color": "orange",
                "value": 130
              },
              {
                "color": "red",
                "value": 140
              },
              {
                "color": "dark-red",
                "value": 150
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "_col1"
            },
            "properties": [
              {
                "id": "mappings",
                "value": []
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_accelerationx"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "x"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_accelerationy"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "y"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_accelerationz"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "z"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "x"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "blue",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "y"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "orange",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "z"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "green",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_heading"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#d9d9d9",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.axisPlacement",
                "value": "right"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_roll"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_pitch"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "purple",
                  "mode": "fixed"
                }
              },
              {
                "id": "displayName",
                "value": "pitch"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_roll"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "roll"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_heading"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "heading"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "heading"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#f1f1f1",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "roll"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#ff8200",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "pitch"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 7,
        "x": 10,
        "y": 4
      },
      "id": 13,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "dataset": "playgrounddb",
          "datasource": {
            "type": "mssql",
            "uid": "Microsoft SQL Server"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "SELECT\r\n    DATEADD(MILLISECOND, (DATEPART(MILLISECOND, t) / $__interval_ms) * $__interval_ms, DATEADD(SECOND, DATEDIFF(SECOND, '2020', t), '2020')) AS time,\r\n    AVG(roll) as AVG_roll, AVG(pitch) as AVG_pitch, AVG(heading) as AVG_heading\r\nFROM\r\n    OPENROWSET(\r\n        BULK '${device:csv}/CAN9_GnssAttitude/*/*/*/*',\r\n        DATA_SOURCE = 'ParquetDataLake',\r\n        FORMAT = 'PARQUET'\r\n    ) AS r\r\nWHERE\r\n    CONCAT(r.filepath(1), '-', r.filepath(2), '-', r.filepath(3)) BETWEEN CONVERT(date, $__timeFrom()) AND CONVERT(date, $__timeTo())\r\n    AND $__timeFilter(t)\r\nGROUP BY\r\n    DATEDIFF(SECOND, '2020', t), DATEPART(MILLISECOND, t) / $__interval_ms\r\nORDER BY\r\n    time\r\nOFFSET 0 ROWS;\r\n\r\n\r\n\r\n",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Attitude (deg)",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "time",
                "AVG_roll",
                "AVG_pitch",
                "AVG_heading"
              ]
            }
          }
        }
      ],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "mssql",
        "uid": "Microsoft SQL Server"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": 300000,
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 2,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "always",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "_col1"
            },
            "properties": [
              {
                "id": "mappings",
                "value": []
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 10,
        "x": 0,
        "y": 9
      },
      "id": 5,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "dataset": "playgrounddb",
          "datasource": {
            "type": "mssql",
            "uid": "Microsoft SQL Server"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "SELECT\r\n    DATEADD(MILLISECOND, (DATEPART(MILLISECOND, t) / $__interval_ms) * $__interval_ms, DATEADD(SECOND, DATEDIFF(SECOND, '2020', t), '2020')) AS time,\r\n    ${signal_value:csv}\r\nFROM\r\n    OPENROWSET(\r\n        BULK '${device:csv}/${message:csv}/*/*/*/*',\r\n        DATA_SOURCE = 'ParquetDataLake',\r\n        FORMAT = 'PARQUET'\r\n    ) AS r\r\nWHERE\r\n    CONCAT(r.filepath(1), '-', r.filepath(2), '-', r.filepath(3)) BETWEEN CONVERT(date, $__timeFrom()) AND CONVERT(date, $__timeTo())\r\n    AND $__timeFilter(t)\r\nGROUP BY\r\n    DATEDIFF(SECOND, '2020', t), DATEPART(MILLISECOND, t) / $__interval_ms\r\nORDER BY\r\n    time\r\nOFFSET 0 ROWS;\r\n",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Message: ${message:csv} | Signal: ${signal}",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "pattern": "/^(${aggregation:pipe})_.*|^time$/"
            }
          }
        }
      ],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "mssql",
        "uid": "Microsoft SQL Server"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#3d85c6",
            "mode": "fixed"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": 300000,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "green",
                "value": 20
              },
              {
                "color": "super-light-green",
                "value": 50
              },
              {
                "color": "super-light-yellow",
                "value": 70
              },
              {
                "color": "yellow",
                "value": 90
              },
              {
                "color": "dark-yellow",
                "value": 110
              },
              {
                "color": "orange",
                "value": 130
              },
              {
                "color": "red",
                "value": 140
              },
              {
                "color": "dark-red",
                "value": 150
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "_col1"
            },
            "properties": [
              {
                "id": "mappings",
                "value": []
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_accelerationx"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "x"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_accelerationy"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "y"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "AVG_accelerationz"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "z"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "x"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "purple",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "y"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "semi-dark-blue",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "z"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#646464",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.axisPlacement",
                "value": "right"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 7,
        "x": 10,
        "y": 10
      },
      "id": 12,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "dataset": "playgrounddb",
          "datasource": {
            "type": "mssql",
            "uid": "Microsoft SQL Server"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "SELECT\r\n    DATEADD(MILLISECOND, (DATEPART(MILLISECOND, t) / $__interval_ms) * $__interval_ms, DATEADD(SECOND, DATEDIFF(SECOND, '2020', t), '2020')) AS time,\r\n    AVG(accelerationx) as AVG_accelerationx, AVG(accelerationy) as AVG_accelerationy, AVG(accelerationz) as AVG_accelerationz\r\nFROM\r\n    OPENROWSET(\r\n        BULK '${device:csv}/CAN9_ImuData/*/*/*/*',\r\n        DATA_SOURCE = 'ParquetDataLake',\r\n        FORMAT = 'PARQUET'\r\n    ) AS r\r\nWHERE\r\n    CONCAT(r.filepath(1), '-', r.filepath(2), '-', r.filepath(3)) BETWEEN CONVERT(date, $__timeFrom()) AND CONVERT(date, $__timeTo())\r\n    AND $__timeFilter(t)\r\nGROUP BY\r\n    DATEDIFF(SECOND, '2020', t), DATEPART(MILLISECOND, t) / $__interval_ms\r\nORDER BY\r\n    time\r\nOFFSET 0 ROWS;\r\n",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Acceleration (m/s^2)",
      "transformations": [],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "datasource",
        "uid": "-- Dashboard --"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "purple",
            "mode": "fixed"
          },
          "custom": {
            "fillOpacity": 80,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 1
          },
          "decimals": 0,
          "mappings": [],
          "max": 4,
          "min": -4,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "green",
                "value": 20
              },
              {
                "color": "super-light-green",
                "value": 50
              },
              {
                "color": "super-light-yellow",
                "value": 70
              },
              {
                "color": "yellow",
                "value": 90
              },
              {
                "color": "dark-yellow",
                "value": 110
              },
              {
                "color": "orange",
                "value": 130
              },
              {
                "color": "red",
                "value": 140
              },
              {
                "color": "dark-red",
                "value": 150
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 7,
        "x": 17,
        "y": 11
      },
      "id": 17,
      "options": {
        "bucketOffset": 0,
        "bucketSize": 0.1,
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "datasource",
            "uid": "-- Dashboard --"
          },
          "panelId": 12,
          "refId": "A"
        }
      ],
      "title": "Acceleration X (m/s^2) - Histogram",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "time",
                "AVG_accelerationx"
              ]
            }
          }
        }
      ],
      "type": "histogram"
    }
  ],
  "refresh": "",
  "schemaVersion": 38,
  "style": "dark",
  "tags": [
    "synapse"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false
        },
        "datasource": {
          "type": "mssql",
          "uid": "Microsoft SQL Server"
        },
        "definition": "SELECT deviceid AS value, metaname AS text\nFROM tbl_aggregations_devicemeta\nORDER BY deviceid ASC",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "device",
        "options": [],
        "query": "SELECT deviceid AS value, metaname AS text\nFROM tbl_aggregations_devicemeta\nORDER BY deviceid ASC",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": true
        },
        "datasource": {
          "type": "mssql",
          "uid": "Microsoft SQL Server"
        },
        "definition": "SELECT MessageName FROM\n    OPENROWSET(\n        BULK '${device:csv}/messages/*/*/*/*',\n        DATA_SOURCE = 'ParquetDataLake',\n        FORMAT = 'PARQUET'\n    ) AS r\nWHERE MessageName <> 'messages'\nORDER BY MessageName ASC",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "message",
        "options": [],
        "query": "SELECT MessageName FROM\n    OPENROWSET(\n        BULK '${device:csv}/messages/*/*/*/*',\n        DATA_SOURCE = 'ParquetDataLake',\n        FORMAT = 'PARQUET'\n    ) AS r\nWHERE MessageName <> 'messages'\nORDER BY MessageName ASC",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "mssql",
          "uid": "Microsoft SQL Server"
        },
        "definition": "SELECT COLUMN_NAME\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE TABLE_NAME = 'tbl_' + ${device:singlequote} + '_' + ${message:singlequote}\nAND COLUMN_NAME <> 't'\nORDER BY ORDINAL_POSITION ASC",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "signal",
        "options": [],
        "query": "SELECT COLUMN_NAME\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE TABLE_NAME = 'tbl_' + ${device:singlequote} + '_' + ${message:singlequote}\nAND COLUMN_NAME <> 't'\nORDER BY ORDINAL_POSITION ASC",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": true,
          "text": [
            "All"
          ],
          "value": [
            "$__all"
          ]
        },
        "datasource": {
          "type": "mssql",
          "uid": "Microsoft SQL Server"
        },
        "definition": "WITH SplitColumns AS (\n    SELECT TRIM(value) AS ColumnName\n    FROM STRING_SPLIT('${signal:csv}', ',')\n)\nSELECT STRING_AGG(CONCAT(\n    'AVG(', ColumnName, ') AS AVG_', ColumnName, ', ',\n    'MIN(', ColumnName, ') AS MIN_', ColumnName, ', ',\n    'MAX(', ColumnName, ') AS MAX_', ColumnName\n), ', ')\nFROM SplitColumns;",
        "hide": 2,
        "includeAll": true,
        "multi": true,
        "name": "signal_value",
        "options": [],
        "query": "WITH SplitColumns AS (\n    SELECT TRIM(value) AS ColumnName\n    FROM STRING_SPLIT('${signal:csv}', ',')\n)\nSELECT STRING_AGG(CONCAT(\n    'AVG(', ColumnName, ') AS AVG_', ColumnName, ', ',\n    'MIN(', ColumnName, ') AS MIN_', ColumnName, ', ',\n    'MAX(', ColumnName, ') AS MAX_', ColumnName\n), ', ')\nFROM SplitColumns;",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": [
            "AVG"
          ],
          "value": [
            "AVG"
          ]
        },
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "aggregation",
        "options": [
          {
            "selected": false,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": true,
            "text": "AVG",
            "value": "AVG"
          },
          {
            "selected": false,
            "text": "MIN",
            "value": "MIN"
          },
          {
            "selected": false,
            "text": "MAX",
            "value": "MAX"
          }
        ],
        "query": "AVG, MIN, MAX",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-90d",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "internal-gps-dashboard-synapse",
  "uid": "internal-gps-dashboard-synapse",
  "version": 1,
  "weekStart": ""
}