diff --git a/client/src/components/DynamicReport/Charts/AnnualAverageByLane.jsx b/client/src/components/DynamicReport/Charts/AnnualAverageByLane.jsx
new file mode 100644
index 0000000..9d55a6d
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/AnnualAverageByLane.jsx
@@ -0,0 +1,59 @@
+import React, { useEffect, useState } from "react";
+import axios from "axios";
+import { getSingleSeriesByField } from "./chartDataHelpers";
+import LineChart from "./LineChart";
+import LoadingChart from "../../Loaders/loadingChart";
+import { apiUrl } from "../../../DocConfig";
+
+axios.defaults.withCredentials = true;
+
+export default function AnnualAverageByLane({ det_num, startDate, endDate }) {
+ const [series, setSeries] = useState([]);
+ const [labels, setLabels] = useState([]);
+
+ useEffect(() => {
+ (async () => {
+
+ let res = null;
+
+ res = await axios.get (
+ `${apiUrl}/Detector/AvgVolumeByLaneByParams`,
+ {
+ params : {
+ det_num : det_num,
+ startDate : startDate,
+ endDate : endDate
+
+ }
+ }
+ );
+
+ const _data = res.data.sort((a, b) => a.lane.localeCompare(b.lane));
+ const _labels = _data.map((d) => d.lane);
+
+ const _series = getSingleSeriesByField(
+ res.data,
+ "avg_daily_traffic"
+ );
+
+ setSeries(_series);
+ setLabels(_labels);
+ })();
+ }, [det_num, setSeries, setLabels]);
+ return (
+
+ {series.length ? (
+
+ ) : (
+
+ )}
+
+ );
+}
diff --git a/client/src/components/DynamicReport/Charts/AnnualHourlyAverageOccupancyPercent.jsx b/client/src/components/DynamicReport/Charts/AnnualHourlyAverageOccupancyPercent.jsx
new file mode 100644
index 0000000..f97af96
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/AnnualHourlyAverageOccupancyPercent.jsx
@@ -0,0 +1,69 @@
+import React, { useEffect, useState } from "react";
+import axios from "axios";
+import {
+ getTimeLabels,
+ sortTimeData,
+ getMultipleSeriesByField,
+} from "./chartDataHelpers";
+import LineChart from "./LineChart";
+import LoadingChart from "../../Loaders/loadingChart";
+import { apiUrl } from "../../../DocConfig";
+
+axios.defaults.withCredentials = true;
+
+export default function AnnualHourlyAverageOccupancyPercent({det_num, startDate, endDate}) {
+ const [series, setSeries] = useState([]);
+ const [dateLabels, setDateLabels] = useState([]);
+
+ useEffect(() => {
+ (async () => {
+ let res = null;
+
+ res = await axios.get (
+ `${apiUrl}/Detector/AvgHourlyOccupancyByParams`,
+ {
+ params : {
+ det_num : det_num,
+ startDate : startDate,
+ endDate : endDate
+
+ }
+ }
+ );
+
+ const _data = res.data.sort((a, b) => {
+ return a.min_since - b.min_since;
+ });
+
+ const _dateLabels = getTimeLabels(
+ _data.filter((row) => row.lane_type === "All Lanes")
+ );
+ const _series = getMultipleSeriesByField(
+ _data,
+ "lane_type",
+ "avg_occupancy_pct"
+ );
+
+ setSeries(_series);
+ setDateLabels(_dateLabels);
+ })();
+ }, [setSeries, setDateLabels]);
+ return (
+ <>
+ {series.length ? (
+
+
+
+ ) : (
+
+ )}
+ >
+ );
+}
diff --git a/client/src/components/DynamicReport/Charts/AnnualHourlyAverageSpeeds.jsx b/client/src/components/DynamicReport/Charts/AnnualHourlyAverageSpeeds.jsx
new file mode 100644
index 0000000..29efca7
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/AnnualHourlyAverageSpeeds.jsx
@@ -0,0 +1,65 @@
+import React, { useEffect, useState } from "react";
+import axios from "axios";
+import { getTimeLabels, getMultipleSeriesByField } from "./chartDataHelpers";
+import LineChart from "./LineChart";
+import LoadingChart from "../../Loaders/loadingChart";
+import { apiUrl } from "../../../DocConfig";
+
+axios.defaults.withCredentials = true;
+
+export default function AnnualHourlyAverageSpeeds({det_num, startDate, endDate}) {
+ const [series, setSeries] = useState([]);
+ const [dateLabels, setDateLabels] = useState([]);
+
+ console.log(det_num, startDate, endDate)
+
+ useEffect(() => {
+ (async () => {
+ let res = null;
+
+ res = await axios.get (
+ `${apiUrl}/Detector/AvgHourlySpeedByParams`,
+ {
+ params : {
+ det_num : det_num,
+ startDate : startDate,
+ endDate : endDate
+
+ }
+ }
+ );
+
+ const _data = res.data.sort((a, b) => {
+ return a.min_since - b.min_since;
+ });
+
+ const _dateLabels = getTimeLabels(
+ _data.filter((row) => row.lane_type === "All Lanes")
+ );
+ const _series = getMultipleSeriesByField(
+ _data,
+ "lane_type",
+ "avg_speed"
+ );
+
+ setSeries(_series);
+ setDateLabels(_dateLabels);
+ })();
+ }, [setSeries, setDateLabels]);
+ return (
+
+ {series.length ? (
+
+ ) : (
+
+ )}
+
+ );
+}
diff --git a/client/src/components/DynamicReport/Charts/AnnualHourlyAverageThroughput.jsx b/client/src/components/DynamicReport/Charts/AnnualHourlyAverageThroughput.jsx
new file mode 100644
index 0000000..986cbee
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/AnnualHourlyAverageThroughput.jsx
@@ -0,0 +1,69 @@
+import React, { useEffect, useState } from "react";
+import axios from "axios";
+import {
+ getTimeLabels,
+ getMultipleSeriesByField,
+ sortTimeData,
+} from "./chartDataHelpers";
+import LineChart from "./LineChart";
+import LoadingChart from "../../Loaders/loadingChart";
+import { apiUrl } from "../../../DocConfig";
+
+axios.defaults.withCredentials = true;
+
+export default function AnnualHourlyAverageThroughput({det_num, startDate, endDate }) {
+ // const [setData] = useState(null);
+ const [series, setSeries] = useState([]);
+ const [dateLabels, setDateLabels] = useState([]);
+
+ useEffect(() => {
+ (async () => {
+ let res = null;
+
+ res = await axios.get (
+ `${apiUrl}/Detector/AvgHourlyThroughputByParams`,
+ {
+ params : {
+ det_num : det_num,
+ startDate : startDate,
+ endDate : endDate
+
+ }
+ }
+ );
+
+
+ const _data = res.data.sort((a, b) => {
+ return a.min_since - b.min_since;
+ });
+
+ const _dateLabels = getTimeLabels(
+ _data.filter((row) => row.lane_type === "All Lanes")
+ );
+ const _series = getMultipleSeriesByField(
+ _data,
+ "lane_type",
+ "avg_throughput"
+ );
+
+ setSeries(_series);
+ setDateLabels(_dateLabels);
+ })();
+ }, [setSeries, setDateLabels]);
+ return (
+
+ {series.length ? (
+
+ ) : (
+
+ )}
+
+ );
+}
diff --git a/client/src/components/DynamicReport/Charts/DistributionOfDataPassingQCByDate.jsx b/client/src/components/DynamicReport/Charts/DistributionOfDataPassingQCByDate.jsx
new file mode 100644
index 0000000..a0ed0bc
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/DistributionOfDataPassingQCByDate.jsx
@@ -0,0 +1,153 @@
+import React, { useEffect, useState } from "react";
+import axios from "axios";
+
+import exportToCsv from "./exportToCsv";
+// import {
+// getTimeLabels,
+// getMultipleSeriesByField,
+// sortTimeData,
+// } from "./chartDataHelpers";
+
+// import LineChart from "./LineChart";
+
+import {
+ Chart,
+ ChartArea,
+ ChartTitle,
+ ChartSeries,
+ ChartSeriesItem,
+ ChartValueAxis,
+ ChartValueAxisItem,
+ ChartCategoryAxis,
+ ChartCategoryAxisItem,
+} from "@progress/kendo-react-charts";
+import LoadingChart from "../../Loaders/loadingChart";
+import { apiUrl } from "../../../DocConfig";
+
+axios.defaults.withCredentials = true;
+
+// const chartColors = ["red", "blue", "green"];
+const fontTitle = `bold 12pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+const fontAxisTitle = `bold 10pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+const fontAxis = `bold 8pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+export default function DistributionOfDataPassingQCByDate({
+ det_num,
+ startDate,
+ endDate,
+ }) {
+ // const [data, setData] = useState(null);
+ const [series, setSeries] = useState([]);
+ const [dateLabels, setDateLabels] = useState([]);
+
+ useEffect(() => {
+ (async () => {
+ let res = null;
+
+ res = await axios.get (
+ `${apiUrl}/Detector/DistributionDataPassingQualityControlCriteriaByDateByParams`,
+ {
+ params : {
+ det_num : det_num,
+ startDate : startDate,
+ endDate : endDate
+
+ }
+ }
+ );
+
+ const _dateLabels = [];
+
+ let _data = res.data
+ .map((item) => {
+ item.date = new Date(
+ parseInt(item.collected.replace(/[^0-9 +]/g, ""))
+ );
+ item.passing = 1 - item.num_errors / 288;
+ return item;
+ })
+ .sort((a, b) => a.date - b.date);
+
+ _data.forEach((item) => {
+ const strMonth = item.date.toLocaleString("default", {
+ month: "long",
+ });
+ _dateLabels.push(strMonth + " " + (item.date.getDate() + 1));
+ });
+
+ setDateLabels(_dateLabels);
+ setSeries(_data);
+ })();
+ }, [det_num, setSeries, setDateLabels]);
+ return (
+ <>
+ {series.length > 0 ? (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ) : (
+
+ )}
+ >
+ );
+}
diff --git a/client/src/components/DynamicReport/Charts/DistributionOfDataPassingQCByWeekday.jsx b/client/src/components/DynamicReport/Charts/DistributionOfDataPassingQCByWeekday.jsx
new file mode 100644
index 0000000..2dbd3cf
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/DistributionOfDataPassingQCByWeekday.jsx
@@ -0,0 +1,167 @@
+import React, { useEffect, useState } from "react";
+import axios from "axios";
+import exportToCsv from "./exportToCsv";
+// import {
+// getTimeLabels,
+// getMultipleSeriesByField,
+// sortTimeData,
+// } from "./chartDataHelpers";
+
+// import LineChart from "./LineChart";
+
+import {
+ Chart,
+ ChartArea,
+ ChartTitle,
+ ChartSeries,
+ ChartSeriesItem,
+ ChartValueAxis,
+ ChartValueAxisItem,
+ ChartCategoryAxis,
+ ChartCategoryAxisItem,
+} from "@progress/kendo-react-charts";
+import LoadingChart from "../../Loaders/loadingChart";
+import { apiUrl } from "../../../DocConfig";
+
+axios.defaults.withCredentials = true;
+
+// const chartColors = ["red", "blue", "green"];
+const fontTitle = `bold 12pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+const fontAxisTitle = `bold 10pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+const fontAxis = `bold 8pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+export default function DistributionOfDataPassingQCByWeekday({
+ det_num,
+ startDate,
+ endDate,
+}) {
+ // const [data, setData] = useState(null);
+ const [series, setSeries] = useState([]);
+ const [Labels, setLabels] = useState([]);
+ const [numDays, setNumDays] = useState(0);
+
+ useEffect(() => {
+ (async () => {
+ let res = null;
+
+ res = await axios.get(
+ apiUrl +
+ "/Detector/DistributionDataPassingQualityControlCriteriaByWeekdayByParams",
+ {
+ params: {
+ det_num : det_num,
+ startDate : startDate,
+ endDate : endDate
+ },
+ }
+ );
+
+ setNumDays(res.data.numDays);
+
+ const _labels = [];
+
+ let _data = res.data["data"]
+ .map((item) => {
+ item.passing = 1 - item.NumErrors / res.data.numDays;
+ return item;
+ })
+ .sort((a, b) => {
+ const weekdays = [
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday",
+ ];
+ const weekdayIndexA = weekdays.indexOf(a.Weekday);
+ const weekdayIndexB = weekdays.indexOf(b.Weekday);
+ if (weekdayIndexA !== weekdayIndexB) {
+ return weekdayIndexA - weekdayIndexB;
+ } else {
+ return a.MinSince - b.MinSince;
+ }
+ });
+
+ _data.forEach((item) => {
+ _labels.push(item.Weekday);
+ });
+
+ setLabels(_labels);
+ setSeries(_data);
+ })();
+ }, [det_num, setSeries, setLabels, setNumDays]);
+
+ return (
+ <>
+ {series.length > 0 ? (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ) : (
+
+ )}
+ >
+ );
+}
diff --git a/client/src/components/DynamicReport/Charts/LineChart.jsx b/client/src/components/DynamicReport/Charts/LineChart.jsx
new file mode 100644
index 0000000..50b78a7
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/LineChart.jsx
@@ -0,0 +1,130 @@
+import React from "react";
+import {
+ Chart,
+ ChartArea,
+ ChartTitle,
+ ChartSeries,
+ ChartSeriesItem,
+ ChartValueAxis,
+ ChartValueAxisItem,
+ ChartCategoryAxis,
+ ChartCategoryAxisItem,
+ ChartLegend,
+ // ChartTooltip,
+ // ChartSeriesItemTooltip,
+ // ChartCategoryAxisLabels,
+} from "@progress/kendo-react-charts";
+
+import exportToCsv from "./exportToCsv";
+
+const chartColors = ["red", "blue", "green"];
+
+const fontTitle = `bold 12pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+const fontAxisTitle = `bold 10pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+const fontAxis = `bold 8pt -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`;
+
+export default function LineChart({
+ field,
+ series,
+ title,
+ catTitle,
+ valueTitle,
+ labels,
+}) {
+
+ return (
+ <>
+ {series.length > 0 ? (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {series.map((series, i) => (
+
+ ))}
+
+
+
+ ) : (
+ <>Loading>
+ )}
+ >
+ );
+}
diff --git a/client/src/components/DynamicReport/Charts/chartDataHelpers.jsx b/client/src/components/DynamicReport/Charts/chartDataHelpers.jsx
new file mode 100644
index 0000000..ac4876f
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/chartDataHelpers.jsx
@@ -0,0 +1,82 @@
+function getTimeLabels(data) {
+ const seen = {};
+ return data.map((row) => {
+ const hour_since = Math.floor(row.min_since / 60) * 60;
+ const date = new Date();
+ date.setHours(0);
+ date.setMinutes(0);
+ date.setSeconds(0);
+ date.setMinutes(hour_since);
+ const time = date.toLocaleTimeString([], {
+ hour: "2-digit",
+ minute: "2-digit",
+ });
+ if (seen[time]) {
+ return "";
+ } else {
+ seen[time] = true;
+ return time;
+ }
+ });
+}
+
+function getDistinctPropertyList(data, prop, sort) {
+ const labels = [];
+ data.forEach((row) => {
+ const label = row[prop];
+ if (!labels.includes(label)) {
+ labels.push(label);
+ }
+ });
+
+ return sort ? labels.sort() : labels;
+}
+
+function getMinutesSinceMidnight(strDate) {
+ const midnight = new Date("1/1/2001");
+ const targetTime = new Date(`1/1/2001 ${strDate}`);
+ const timeSinceMidnight = targetTime.getTime() - midnight.getTime();
+ return timeSinceMidnight;
+}
+
+function sortTimeData(data, timeField) {
+ timeField = timeField || "hour_in_day";
+ return data.sort((a, b) => {
+ let aMins = getMinutesSinceMidnight(a[timeField]);
+ let bMins = getMinutesSinceMidnight(b[timeField]);
+ return aMins - bMins;
+ });
+}
+
+function getSingleSeriesByField(data, dataField) {
+ return [
+ {
+ name: dataField,
+ field: dataField,
+ data: data,
+ },
+ ];
+}
+
+function getMultipleSeriesByField(data, filterField, dataField) {
+ const seriesKeys = getDistinctPropertyList(data, filterField, true);
+ const seriesList = [];
+ const dashTypes = ["solid", "longDash", "dash"];
+
+ seriesKeys.forEach((key, i) => {
+ seriesList.push({
+ name: key,
+ field: dataField,
+ data: data.filter((row) => row[filterField] === key),
+ dashType: dashTypes[i],
+ });
+ });
+ return seriesList;
+}
+
+export {
+ getMultipleSeriesByField,
+ getTimeLabels,
+ sortTimeData,
+ getSingleSeriesByField,
+};
diff --git a/client/src/components/DynamicReport/Charts/exportToCsv.js b/client/src/components/DynamicReport/Charts/exportToCsv.js
new file mode 100644
index 0000000..6a9c32b
--- /dev/null
+++ b/client/src/components/DynamicReport/Charts/exportToCsv.js
@@ -0,0 +1,32 @@
+function exportToCsv(data) {
+ // Define the columns to exclude from the CSV output
+ const excludedColumns = ["id", "reportId", "isPeriod1", "year"];
+
+ // Extract the headers of the first row, excluding the excluded columns
+ const headers = Object.keys(data)
+ .filter((key) => !excludedColumns.includes(key))
+ .join(",");
+
+ // Extract the rows of the data array, excluding the excluded columns
+ const rows = data
+ .map((row) =>
+ Object.entries(row)
+ .filter(([key]) => !excludedColumns.includes(key))
+ .map(([_, value]) => value)
+ .join(",")
+ )
+ .join("\n");
+
+ // Combine the headers and rows into a CSV string with a header row
+ const csv = `${headers}\n${rows}`;
+
+ // Create a Blob object and download the file
+ const blob = new Blob([csv], { type: "text/csv" });
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.setAttribute("href", url);
+ link.setAttribute("download", "data.csv");
+ link.click();
+}
+
+export default exportToCsv;
diff --git a/client/src/components/DynamicReport/Components/CorridorDropdown.jsx b/client/src/components/DynamicReport/Components/CorridorDropdown.jsx
new file mode 100644
index 0000000..edfcab5
--- /dev/null
+++ b/client/src/components/DynamicReport/Components/CorridorDropdown.jsx
@@ -0,0 +1,58 @@
+import { useEffect, useState } from "react";
+import { observer } from "mobx-react-lite";
+
+import TextField from "@mui/material/TextField";
+import Autocomplete from "@mui/material/Autocomplete";
+import getCorridors from "../../Map/getCorridors";
+
+function CorridorDropdown({corridor, setCorridor}) {
+
+ const [options, setOptions] = useState([]);
+
+ useEffect(() => {
+ (async () => {
+ const corridors = await getCorridors();
+ setOptions(
+ corridors
+ .sort((a, b) => a.Name - b.Name)
+ .map((corridor, i) => {
+ return {
+ label: `${corridor.Name}`,
+ id: i,
+ corridor,
+ };
+ })
+ );
+ })();
+ }, []);
+
+ return (
+ <>
+
+
+
Select Corridor:
+
{
+ return option.id === val.id;
+ }}
+ size="small"
+ className="w-1/2"
+ options={options}
+ value={corridor}
+ onChange={(event, newValue) => {setCorridor(newValue)}}
+ renderInput={(params) => (
+
+ )}
+ />
+
+
+
+ >
+ );
+}
+
+export default observer(CorridorDropdown);
diff --git a/client/src/components/DynamicReport/Components/DetectorDropdown.jsx b/client/src/components/DynamicReport/Components/DetectorDropdown.jsx
new file mode 100644
index 0000000..64a70bb
--- /dev/null
+++ b/client/src/components/DynamicReport/Components/DetectorDropdown.jsx
@@ -0,0 +1,83 @@
+import { useEffect, useState } from "react";
+import { observer } from "mobx-react-lite";
+import { useDataStore } from "../../../stores/DataContext"
+
+import getDetectors from "../../Map/getDetectors";
+import TextField from "@mui/material/TextField";
+import Autocomplete from "@mui/material/Autocomplete";
+
+function DetectorDropdown({detector, setReportData, setDetector}) {
+ /*
+ {
+ "label": "2 (I-10 EB 83RD AVE)",
+ "id": 1,
+ "detector": {
+ "ID": 22,
+ "det_num": 2,
+ "Location": "I-10 EB 83RD AVE",
+ "Route": "I-10",
+ "Direction": "EB",
+ "Milepost": 135.883,
+ "GPS": true,
+ "Type": "pad",
+ "Length_ft": 3602.75952149,
+ "y": 33.46212387,
+ "x": -112.23562622,
+ "Segment": "[[-112.22637512899996,33.462164166000036],[-112.23080390499996,33.46207975200008],[-112.23333717099996,33.46207578700006],[-112.23333775499998,33.46207578600007],[-112.23522974899998,33.46206573300003],[-112.23818539099994,33.46198686500003]]"
+ }
+ }
+ */
+
+ const [detectors, setDetectors] = useState([]);
+
+ useEffect(() => {
+ (async () => {
+ const d = await getDetectors();
+ setDetectors(
+ d
+ .sort((a, b) => a.det_num - b.det_num)
+ .map((detector, i) => {
+ return {
+ label: `${detector.det_num} (${detector.Location})`,
+ id: i,
+ detector,
+ };
+ })
+ );
+ })();
+ }, []);
+
+ const updateParentState = (newValue) => {
+
+ setDetector(newValue);
+ setReportData(undefined);
+
+ }
+
+ return (
+
+
+
Select Detector:
+
{
+ return option.id === val.id;
+ }}
+ size="small"
+ className="w-1/2"
+ options={detectors}
+ value={detector}
+ onChange={(event, newValue) => {updateParentState(newValue)}}
+ renderInput={(params) => (
+
+ )}
+ />
+
+
+ );
+}
+
+export default observer(DetectorDropdown);
diff --git a/client/src/components/DynamicReport/Components/ReportBuilderMap.jsx b/client/src/components/DynamicReport/Components/ReportBuilderMap.jsx
new file mode 100644
index 0000000..14a4d41
--- /dev/null
+++ b/client/src/components/DynamicReport/Components/ReportBuilderMap.jsx
@@ -0,0 +1,79 @@
+import React, { useRef, useEffect, useState } from "react";
+
+import ArcGISMap from "@arcgis/core/Map";
+import MapView from "@arcgis/core/views/MapView";
+import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer";
+
+// import { useDataStore } from "../../stores/DataContext";
+// import getDetectorsLayer from "../../Map/getDetectorsLayer";
+// import getCorridorsLayer from "../../Map/getCorridorsLayer";
+
+import ZoomWidget from "../../MapWidgets/zoomWidget";
+import HomeWidget from "../../MapWidgets/homeWidget";
+import BasemapToggleWidget from "../../MapWidgets/basemapToggleWidget";
+import { report } from "process";
+
+function QueryBuilderMap({detectorsLayer, definitionExpression}) {
+
+ const mapDiv = useRef(null);
+
+ useEffect(() => {
+
+ if (mapDiv.current) {
+
+ const _map = new ArcGISMap({
+ basemap: "gray-vector",
+ });
+
+ const _view = new MapView({
+ map: _map,
+ container: mapDiv.current,
+ center: [-112.024, 33.541],
+ zoom: 9,
+ constraints: {
+ rotationEnabled: false,
+ minZoom: 2,
+ maxZoom: 20,
+ snapToZoom: true,
+ },
+ popup: {
+ alignment: "top-center",
+ dockEnabled: true,
+ collapseEnabled: false,
+ actions: [],
+ dockOptions: {
+ buttonEnabled: false,
+ breakpoint: true,
+ },
+ },
+ ui: { components: [] },
+ });
+
+ ZoomWidget(_view);
+ HomeWidget(_view);
+ BasemapToggleWidget(_view);
+
+ // // Add Layers to Map
+ _map.addMany([detectorsLayer])
+
+ // Apply Definition Expression to Layers
+ detectorsLayer.definitionExpression=definitionExpression;
+ detectorsLayer.queryExtent({
+ where : definitionExpression
+ })
+ .then((result) => {
+ _view.goTo({
+ target: result.extent,
+ zoom: 15
+ })
+
+ console.log(_view.zoom)
+ })
+
+ }
+ }, [mapDiv, detectorsLayer, definitionExpression]);
+
+ return ;
+}
+
+export default QueryBuilderMap;
diff --git a/client/src/components/DynamicReport/Components/ReportTypeToggle.jsx b/client/src/components/DynamicReport/Components/ReportTypeToggle.jsx
new file mode 100644
index 0000000..c0ecce9
--- /dev/null
+++ b/client/src/components/DynamicReport/Components/ReportTypeToggle.jsx
@@ -0,0 +1,35 @@
+import React from "react";
+import { observer } from "mobx-react-lite";
+
+function ReportTypeToggle({ reportType, setReportType }) {
+
+ const sharedButtonStyle = "rounded py-1 px-2 font-bold ";
+ const activeButtonStyle = "bg-blue-500 text-white";
+ const inactiveButtonStyle = "bg-gray-200 text-gray-800 hover:underline";
+
+ const isDetectorActive = (reportType === "detector") ? true : false;
+
+ return (
+
+
Select Report Type:
+
+ {/*
*/}
+
+
+ );
+}
+
+export default observer(ReportTypeToggle);
diff --git a/client/src/components/DynamicReport/Components/TimePeriodSelection.jsx b/client/src/components/DynamicReport/Components/TimePeriodSelection.jsx
new file mode 100644
index 0000000..3061462
--- /dev/null
+++ b/client/src/components/DynamicReport/Components/TimePeriodSelection.jsx
@@ -0,0 +1,42 @@
+import TextField from "@mui/material/TextField";
+import { observer } from "mobx-react-lite";
+
+function TimePeriodSelection({ setStartDate, setEndDate, startDate, endDate }) {
+
+ return (
+
+
+
+ Time Period:{" "}
+
+
+
+
+ setStartDate(e.target.value)}
+ value={startDate}
+ size="small"
+ label="Start Date"
+ type="date"
+ sx={{ my: 1, mr: 2 }}
+ InputLabelProps={{
+ shrink: true,
+ }}
+ />
+ setEndDate(e.target.value)}
+ value={endDate}
+ size="small"
+ label="End Date"
+ type="date"
+ sx={{ my: 1 }}
+ InputLabelProps={{
+ shrink: true,
+ }}
+ />
+
+
+
+ );
+}
+export default observer(TimePeriodSelection);
diff --git a/client/src/components/DynamicReport/MainDynamicReportComponent.jsx b/client/src/components/DynamicReport/MainDynamicReportComponent.jsx
new file mode 100644
index 0000000..7ebbd27
--- /dev/null
+++ b/client/src/components/DynamicReport/MainDynamicReportComponent.jsx
@@ -0,0 +1,208 @@
+import React, { useState } from "react";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import {
+ faCalendarDays,
+ faLocationDot,
+ faShield,
+ faClock,
+} from "@fortawesome/free-solid-svg-icons";
+
+// Maps
+import ReportBuilderMap from "../DynamicReport/Components/ReportBuilderMap";
+
+// Charts
+import AnnualHourlyAverageSpeeds from "./Charts/AnnualHourlyAverageSpeeds";
+import AnnualHourlyAverageThroughput from "./Charts/AnnualHourlyAverageThroughput";
+import AnnualHourlyAverageOccupancyPercent from "./Charts/AnnualHourlyAverageOccupancyPercent"
+import AnnualAverageByLane from "./Charts/AnnualAverageByLane";
+import DistributionOfDataPassingQCByDate from "./Charts/DistributionOfDataPassingQCByDate";
+import DistributionOfDataPassingQCByWeekday from "./Charts/DistributionOfDataPassingQCByWeekday";
+
+
+function MainDynamicReportComponent({ data, detectorsLayer }) {
+ /*
+ Main report creation component.
+
+ Inputs:
+ data -- object (standardized for both detector and corridor reports)
+
+ Detector Data --
+ {
+ "startDate": "2023-10-31",
+ "endDate": "2023-11-30",
+ "reportType": "detector",
+ "detNumbers": 1,
+ "detIDs": 21,
+ "description": "I-10 WB 83RD AVE",
+ "route": "I-10",
+ "detectorCorridor": {
+ "ID": 21,
+ "det_num": 1,
+ "Location": "I-10 WB 83RD AVE",
+ "Route": "I-10",
+ "Direction": "WB",
+ "Milepost": 135.753,
+ "GPS": false,
+ "Type": "pad",
+ "Length_ft": 2170.30493164,
+ "y": 33.46250153,
+ "x": -112.23600769,
+ "Segment": "[[-112.23106460499997,33.46280114000007],[-112.23443235799999,33.46265030200004],[-112.23817470799997,33.462558029000036]]"
+ }
+ }
+
+ */
+
+ // Report Detector Number
+ const detNum = data.detectorCorridor.det_num;
+ const definitionExpression = `det_num=${detNum}`;
+
+ // Header Styling
+ const divStyle = "mt-2 flex items-center text-sm text-gray-500";
+ const iconStyle = "mr-1.5 h-5 w-5 flex-shrink-0 text-gray-400";
+
+ return (
+
+
+ {/* Header */}
+
+
+
+ {(data.reportType === 'detector') ? "Detector" : "Corridor"} Report
+
+
+
+
+
+
+ Detector IDs:
+ {data.detNumbers}
+
+
+
+
+ {(data.reportType === 'detector') ? 'Detector Location:' : 'Route:'}
+ {data.route}
+
+
+
+
+ Start Search Date: {data.startDate}
+
+
+
+
+ End Search Date: {data.endDate}
+
+
+
+
+
+
+ {/* End Header */}
+
+ {/* Report Content */}
+
+
+
+
+
+
+
+ {
+ detectorsLayer != undefined &&
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+
+};
+
+export default MainDynamicReportComponent
\ No newline at end of file
diff --git a/client/src/components/GeneratedReport/MainGeneratedReport.jsx b/client/src/components/GeneratedReport/MainGeneratedReport.jsx
index 840eee0..62dcfad 100644
--- a/client/src/components/GeneratedReport/MainGeneratedReport.jsx
+++ b/client/src/components/GeneratedReport/MainGeneratedReport.jsx
@@ -9,7 +9,7 @@ import DetectorQualityTable from "../Detector/QualityTable";
import DetectorDefinition from "../Detector/DetectorDefinition";
import PageHeader from "./PageHeader";
import PageSideMenu from "./PageSideMenu";
-import CorridorMap from "../Corridor/CorridorMap";
+
export default function GeneratedReport({ data, det_num, year }) {
const containerRef = useRef();
diff --git a/client/src/components/GeneratedReport/ReportChartsSection.jsx b/client/src/components/GeneratedReport/ReportChartsSection.jsx
index e42f564..96ebf87 100644
--- a/client/src/components/GeneratedReport/ReportChartsSection.jsx
+++ b/client/src/components/GeneratedReport/ReportChartsSection.jsx
@@ -14,7 +14,11 @@ export default function ReportChartsSection({ id, det_num, year }) {
return (
<>
{det_num}
-
+
-
+
;
+ return
;
}
export default QueryBuilderMap;
diff --git a/client/src/components/ReportBuilder/SubmitButton.jsx b/client/src/components/ReportBuilder/SubmitButton.jsx
index 0ee96ca..377b1bb 100644
--- a/client/src/components/ReportBuilder/SubmitButton.jsx
+++ b/client/src/components/ReportBuilder/SubmitButton.jsx
@@ -17,7 +17,7 @@ function SubmitButton() {
onClick={submitClicked}
className="bg-green-500 hover:bg-green-600 text-white font-bold py-1 px-4 rounded"
>
- Calculate
+ Submit
);
}
diff --git a/client/src/components/ReportBuilder/SubmitButtonDirectReport.jsx b/client/src/components/ReportBuilder/SubmitButtonDirectReport.jsx
new file mode 100644
index 0000000..ed0cd84
--- /dev/null
+++ b/client/src/components/ReportBuilder/SubmitButtonDirectReport.jsx
@@ -0,0 +1,196 @@
+/*
+Component for dynamically kicking off the report generation process.
+
+Updates:
+
+11/3/2020 - Chapman Munn - added dynamic-reports route.
+*/
+
+
+import React from "react";
+import { observer } from "mobx-react-lite";
+import { useDataStore } from "../../stores/DataContext";
+import { apiUrl } from "../../DocConfig";
+import axios from "axios";
+
+function SubmitButton() {
+
+ const store = useDataStore();
+
+ function submitClicked() {
+
+ const detectorCorridorSelected = () => {
+ /*
+ Make sure the user has selected a detector or a corridor
+ */
+
+ if (store.queryBuilder.reportType === 'detector') {
+ if (store.queryBuilder.selectedDetector === null) {
+ alert('Please select a Detector.')
+ return false
+ }
+ else {
+ return true
+ }
+ }
+ else {
+ if (store.queryBuilder.selectedCorridor === null) {
+ alert('Please select a Corridor.')
+ return false;
+ }
+ else {
+ return true
+ }
+
+ }
+
+ }
+
+ const checkDateRange = () => {
+
+ if (store.queryBuilder.startDate === undefined || store.queryBuilder.endDate === undefined) {
+ alert("Please select a valid Start Date and End Date.")
+ return false
+ }
+ else {
+ return true
+ }
+
+ }
+
+ if (detectorCorridorSelected() && checkDateRange()) {
+
+ var reportType = store.queryBuilder.reportType;
+ var reportData = {
+ startDate: store.queryBuilder.startDate,
+ endDate: store.queryBuilder.endDate,
+ reportType: store.queryBuilder.reportType,
+ detNumbers: null,
+ detIDs: null,
+ description: null,
+ route: null,
+ detectorCorridor : null,
+ corridorID : null
+ };
+
+ if (reportType === 'detector') {
+
+ var detectorData = store.queryBuilder.selectedDetector.detector
+ /*
+ {
+ "ID": 21,
+ "det_num": 1, (Detector Number)
+ "Location": "I-10 WB 83RD AVE",
+ "Route": "I-10",
+ "Direction": "WB",
+ "Milepost": 135.753,
+ "GPS": false,
+ "Type": "pad",
+ "Length_ft": 2170.30493164,
+ "y": 33.46250153,
+ "x": -112.23600769,
+ "Segment": "[[-112.23106460499997,33.46280114000007],[-112.23443235799999,33.46265030200004],[-112.23817470799997,33.462558029000036]]"
+ }
+ */
+ reportData.detNumbers = detectorData.det_num;
+ reportData.detIDs = detectorData['ID']
+ reportData.description = detectorData['Location']
+ reportData.route = detectorData['Route']
+
+ axios.get(
+ `${apiUrl}/Detector/GetDetectorJSON`,
+ {
+ params: {
+ det_num: reportData['detNumbers']
+ }
+ }
+ ).then((data) => {
+
+ reportData.detectorCorridor = data.data;
+
+ var queryParams = encodeURIComponent(JSON.stringify(reportData))
+ window.open(`/dynamic-report?reportParams=${queryParams}`, '_blank')
+
+ });
+
+ }
+
+ else {
+
+ /*
+ {
+ "Detectors": [
+ {
+ "ID": 357,
+ "det_num": 10,
+ "Location": "Estrella",
+ "Route": "I-10",
+ "Direction": "EB",
+ "Milepost": 126.839,
+ "GPS": null,
+ "Type": null,
+ "Length_ft": null,
+ "y": 33.46115,
+ "x": -112.39,
+ "Segment": null
+ },
+ {
+ "ID": 429,
+ "det_num": 761,
+ "Location": "Bullard Ave",
+ "Route": "I-10",
+ "Direction": "EB",
+ "Milepost": 127.93,
+ "GPS": null,
+ "Type": null,
+ "Length_ft": null,
+ "y": 33.45894,
+ "x": -112.3715,
+ "Segment": null
+ },
+ ],
+ "id": 29,
+ "Name": "Estrella Pkwy to Loop 101 – Agua Fria (EB)",
+ "Description": "The I-10 detectors eastbound from Estrella Pkwy to the Loop 101 - Agua Fria",
+ "Year": null
+ }
+ */
+
+ reportData.detNumbers = store.queryBuilder.selectedCorridor.corridor['Detectors'].map(item => item.det_num).join(', ');
+ reportData.detIDs = store.queryBuilder.selectedCorridor.corridor['Detectors'].map(item => item.ID).join(', ');
+ reportData.description = store.queryBuilder.selectedCorridor.corridor.description;
+ reportData.route = store.queryBuilder.selectedCorridor.corridor.Name;
+ reportData.corridorID = store.queryBuilder.selectedCorridor.corridor['id']
+
+ // http://localhost:56118/Detector/GetCorridorJSON?corridor_id=29
+ axios.get(
+ `${apiUrl}/Detector/GetCorridorJSON`,
+ {
+ params: {
+ corridor_id: reportData['corridorID']
+ }
+ }
+ ).then((data) => {
+
+ reportData.detectorCorridor = data.data;
+
+ var queryParams = encodeURIComponent(JSON.stringify(reportData))
+ window.open(`/dynamic-report?reportParams=${queryParams}`, '_blank')
+
+ })
+
+ }
+
+ }
+ }
+
+ return (
+
+ );
+}
+export default observer(SubmitButton);
diff --git a/client/src/components/ReportBuilder/TimePeriodSelection.jsx b/client/src/components/ReportBuilder/TimePeriodSelection.jsx
index 9396f9d..b7c4dce 100644
--- a/client/src/components/ReportBuilder/TimePeriodSelection.jsx
+++ b/client/src/components/ReportBuilder/TimePeriodSelection.jsx
@@ -23,8 +23,7 @@ function TimePeriodSelection({ timePeriod }) {
store.queryBuilder.setEndDate(val);
}
}
- console.log(store.queryBuilder);
-
+
const showErrors =
store.queryBuilder.validated &&
!store.queryBuilder.isTimePeriodValid(timePeriod);
diff --git a/client/src/pages/Detector.jsx b/client/src/pages/Detector.jsx
index 0987174..d71a60c 100644
--- a/client/src/pages/Detector.jsx
+++ b/client/src/pages/Detector.jsx
@@ -1,3 +1,6 @@
+/*
+Individual detector component.
+*/
import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import MainGeneratedReport from "../components/GeneratedReport/MainGeneratedReport";
diff --git a/client/src/pages/DynamicReport.jsx b/client/src/pages/DynamicReport.jsx
new file mode 100644
index 0000000..252b019
--- /dev/null
+++ b/client/src/pages/DynamicReport.jsx
@@ -0,0 +1,23 @@
+/*
+Dynamically created reports page.
+*/
+
+import React from "react";
+import MainDynamicReportComponent from "../components/DynamicReport/MainDynamicReportComponent";
+
+function DynamicReport () {
+
+ var urlParams = new URLSearchParams(window.location.search);
+ var reportParams = JSON.parse(urlParams.get('reportParams'));
+
+ return (
+
+
+
+
+
+ )
+
+};
+
+export default DynamicReport;
\ No newline at end of file
diff --git a/client/src/pages/ReportBuilder.jsx b/client/src/pages/ReportBuilder.jsx
index 1c746fd..0be13ac 100644
--- a/client/src/pages/ReportBuilder.jsx
+++ b/client/src/pages/ReportBuilder.jsx
@@ -4,9 +4,10 @@ import CorridorDropdown from "../components/ReportBuilder/CorridorDropdown";
// import AnalysisCheckboxGrid from "../components/ReportBuilder/AnalysisCheckboxGrid";
import TimePeriodSelection from "../components/ReportBuilder/TimePeriodSelection";
import ReportBuilderMap from "../components/ReportBuilder/ReportBuilderMap";
-import CorridorsMap from "../components/Map/CorridorsMap";
+// import CorridorsMap from "../components/Map/CorridorsMap";
import ResetButton from "../components/ReportBuilder/ResetButton";
import SubmitButton from "../components/ReportBuilder/SubmitButton";
+// import SubmitButtonDirectReport from "../components/ReportBuilder/SubmitButtonDirectReport";
import ReportBuilderSubmitModal from "../components/ReportBuilder/ReportBuilderSubmitModal";
import { observer } from "mobx-react-lite";
import { useDataStore } from "../stores/DataContext";
diff --git a/client/src/pages/ReportBuilderDynamic.jsx b/client/src/pages/ReportBuilderDynamic.jsx
new file mode 100644
index 0000000..8682933
--- /dev/null
+++ b/client/src/pages/ReportBuilderDynamic.jsx
@@ -0,0 +1,272 @@
+import React, { useState, useEffect } from "react";
+import { useDataStore } from "../stores/DataContext";
+
+import ReportTypeToggle from "../components/DynamicReport/Components/ReportTypeToggle"
+import TimePeriodSelection from "../components/DynamicReport/Components/TimePeriodSelection";
+import DetectorDropdown from "../components/DynamicReport/Components/DetectorDropdown";
+import CorridorDropdown from "../components/DynamicReport/Components/CorridorDropdown";
+
+import getDetectorsLayer from "../components/Map/getDetectorsLayer";
+
+import MainDynamicReportComponent from "../components/DynamicReport/MainDynamicReportComponent";
+
+import { apiUrl } from "../DocConfig";
+import axios from "axios";
+
+function assembleDates() {
+ let dateObj = new Date();
+ let month = (dateObj.getUTCMonth() + 1).toString().padStart(2, '0');
+ let day = dateObj.getUTCDate().toString().padStart(2, '0');
+ let year = dateObj.getUTCFullYear();
+ let result = {
+ today: `${year}-${month}-${day}`,
+ past: `${year - 2}-${month}-${day}`
+ }
+ return result
+}
+
+function ReportBuilder() {
+
+ ////////////////////////////
+ // Data Store
+ ////////////////////////////
+ const store = useDataStore();
+
+ ////////////////////////////
+ // Set Component State
+ ////////////////////////////
+ const [dynamicReportData, setReportData] = useState(undefined);
+ const [detector, setDetector] = useState(undefined);
+ const [corridor, setCorridor] = useState(undefined);
+ const [reportType, setReportType] = useState('detector');
+
+ let dates = assembleDates();
+ const [startDate, setStartDate] = useState(dates['past']);
+ const [endDate, setEndDate] = useState(dates['today']);
+
+ var [detectorsLayer, setDetectorsLayer] = useState(undefined)
+ var [corridorsLayer, setCorridorsLayer] = useState(undefined)
+
+ ////////////////////////////
+ // Submit Report
+ ////////////////////////////
+ const detectorCorridorSelected = () => {
+
+ if (reportType === 'detector') {
+ if (detector === undefined) {
+ alert('Please select a Detector.')
+ return false
+ }
+ else {
+ return true
+ }
+ }
+ else {
+ if (corridor === undefined) {
+ alert('Please select a Corridor.')
+ return false;
+ }
+ else {
+ return true
+ }
+ }
+ };
+
+ const checkDateRange = () => {
+
+ if (startDate === undefined || endDate === undefined) {
+ alert("Please select a valid Start Date and End Date.")
+ return false
+ }
+ else {
+ return true
+ }
+
+ };
+
+ const submitClicked = () => {
+
+ if (detectorCorridorSelected() && checkDateRange()) {
+
+ var reportData = {
+ startDate: startDate,
+ endDate: endDate,
+ reportType: reportType,
+ detNumbers: null,
+ detIDs: null,
+ description: null,
+ route: null,
+ detectorCorridor: null,
+ corridorID: null
+ };
+
+ if (reportType === 'detector') {
+
+ var detectorData = detector.detector
+ /*
+ {
+ "ID": 21,
+ "det_num": 1, (Detector Number)
+ "Location": "I-10 WB 83RD AVE",
+ "Route": "I-10",
+ "Direction": "WB",
+ "Milepost": 135.753,
+ "GPS": false,
+ "Type": "pad",
+ "Length_ft": 2170.30493164,
+ "y": 33.46250153,
+ "x": -112.23600769,
+ "Segment": "[[-112.23106460499997,33.46280114000007],[-112.23443235799999,33.46265030200004],[-112.23817470799997,33.462558029000036]]"
+ }
+ */
+ reportData.detNumbers = detectorData.det_num;
+ reportData.detIDs = detectorData['ID']
+ reportData.description = detectorData['Location']
+ reportData.route = detectorData['Route']
+
+ reportData.detectorCorridor = detectorData;
+ setReportData(reportData)
+ }
+
+ else {
+
+ /*
+ {
+ "Detectors": [
+ {
+ "ID": 357,
+ "det_num": 10,
+ "Location": "Estrella",
+ "Route": "I-10",
+ "Direction": "EB",
+ "Milepost": 126.839,
+ "GPS": null,
+ "Type": null,
+ "Length_ft": null,
+ "y": 33.46115,
+ "x": -112.39,
+ "Segment": null
+ },
+ {
+ "ID": 429,
+ "det_num": 761,
+ "Location": "Bullard Ave",
+ "Route": "I-10",
+ "Direction": "EB",
+ "Milepost": 127.93,
+ "GPS": null,
+ "Type": null,
+ "Length_ft": null,
+ "y": 33.45894,
+ "x": -112.3715,
+ "Segment": null
+ },
+ ],
+ "id": 29,
+ "Name": "Estrella Pkwy to Loop 101 – Agua Fria (EB)",
+ "Description": "The I-10 detectors eastbound from Estrella Pkwy to the Loop 101 - Agua Fria",
+ "Year": null
+ }
+ */
+
+ reportData.detNumbers = store.queryBuilder.selectedCorridor.corridor['Detectors'].map(item => item.det_num).join(', ');
+ reportData.detIDs = store.queryBuilder.selectedCorridor.corridor['Detectors'].map(item => item.ID).join(', ');
+ reportData.description = store.queryBuilder.selectedCorridor.corridor.description;
+ reportData.route = store.queryBuilder.selectedCorridor.corridor.Name;
+ reportData.corridorID = store.queryBuilder.selectedCorridor.corridor['id']
+
+ // http://localhost:56118/Detector/GetCorridorJSON?corridor_id=29
+ axios.get(
+ `${apiUrl}/Detector/GetCorridorJSON`,
+ {
+ params: {
+ corridor_id: reportData['corridorID']
+ }
+ }
+ ).then((data) => {
+
+ reportData.detectorCorridor = data.data;
+
+ setReportData(reportData)
+
+ })
+
+ }
+
+ }
+ };
+
+ const resetClicked = () => {
+ setDetector(undefined);
+ setReportData(undefined);
+ };
+
+ ////////////////////////////
+ // Map Items
+ ////////////////////////////
+
+ // var MapClass = new Map({ container: 'x' });
+
+ // (async () => {
+ if (detectorsLayer === undefined) {
+ getDetectorsLayer()
+ .then((result) => {
+
+ setDetectorsLayer(result);
+
+ });
+ }
+
+ ////////////////////////////
+ // Render
+ ////////////////////////////
+ return (
+
+
+
+ {/* Report Selections */}
+
+
+ {reportType === 'detector' && }
+ {reportType === 'corridor' && }
+
+
+
+ {/* Reset and Generate Buttons */}
+
+
+
+
+
+
+
+
+
+ {
+ dynamicReportData != undefined &&
+ }
+ {
+ dynamicReportData === undefined &&
Select a Detector/Corridor, Time Period, and press the Generate button.
+ }
+
+
+
+
+
+ )
+ // }
+}
+export default ReportBuilder;
diff --git a/client/src/stores/queryBuilderData.js b/client/src/stores/queryBuilderData.js
index 96151d4..4e77ccc 100644
--- a/client/src/stores/queryBuilderData.js
+++ b/client/src/stores/queryBuilderData.js
@@ -285,8 +285,7 @@ const queryBuilderData = {
email: this.email,
date_submitted: new Date(),
};
- console.log(data);
-
+
const res = await axios.post(url, JSON.stringify(data), {
headers: {
"Content-Type": "application/json",
diff --git a/database/dbo.Detectors.Table.sql b/database/dbo.Detectors.Table.sql
new file mode 100644
index 0000000..21be7b5
Binary files /dev/null and b/database/dbo.Detectors.Table.sql differ
diff --git a/database/dbo.Errors2015.Table.sql b/database/dbo.Errors2015.Table.sql
new file mode 100644
index 0000000..4b5707b
Binary files /dev/null and b/database/dbo.Errors2015.Table.sql differ
diff --git a/database/dbo.Errors2016.Table.sql b/database/dbo.Errors2016.Table.sql
new file mode 100644
index 0000000..9598123
Binary files /dev/null and b/database/dbo.Errors2016.Table.sql differ
diff --git a/database/dbo.Errors2017.Table.sql b/database/dbo.Errors2017.Table.sql
new file mode 100644
index 0000000..dc6adc2
Binary files /dev/null and b/database/dbo.Errors2017.Table.sql differ
diff --git a/database/dbo.Errors2018.Table.sql b/database/dbo.Errors2018.Table.sql
new file mode 100644
index 0000000..a73120d
Binary files /dev/null and b/database/dbo.Errors2018.Table.sql differ
diff --git a/database/dbo.Errors2019.Table.sql b/database/dbo.Errors2019.Table.sql
new file mode 100644
index 0000000..3f0758c
Binary files /dev/null and b/database/dbo.Errors2019.Table.sql differ
diff --git a/database/dbo.Errors2020.Table.sql b/database/dbo.Errors2020.Table.sql
new file mode 100644
index 0000000..412e65d
Binary files /dev/null and b/database/dbo.Errors2020.Table.sql differ
diff --git a/database/dbo.Errors2021.Table.sql b/database/dbo.Errors2021.Table.sql
new file mode 100644
index 0000000..2060512
Binary files /dev/null and b/database/dbo.Errors2021.Table.sql differ
diff --git a/database/dbo.Errors2022.Table.sql b/database/dbo.Errors2022.Table.sql
new file mode 100644
index 0000000..d82e3d3
Binary files /dev/null and b/database/dbo.Errors2022.Table.sql differ
diff --git a/database/dbo.RawData2015.Table.sql b/database/dbo.RawData2015.Table.sql
new file mode 100644
index 0000000..d9a1c9a
Binary files /dev/null and b/database/dbo.RawData2015.Table.sql differ
diff --git a/database/dbo.RawData2016.Table.sql b/database/dbo.RawData2016.Table.sql
new file mode 100644
index 0000000..b2ca728
Binary files /dev/null and b/database/dbo.RawData2016.Table.sql differ
diff --git a/database/dbo.RawData2017.Table.sql b/database/dbo.RawData2017.Table.sql
new file mode 100644
index 0000000..65fe878
Binary files /dev/null and b/database/dbo.RawData2017.Table.sql differ
diff --git a/database/dbo.RawData2018.Table.sql b/database/dbo.RawData2018.Table.sql
new file mode 100644
index 0000000..a3ec622
Binary files /dev/null and b/database/dbo.RawData2018.Table.sql differ
diff --git a/database/dbo.RawData2019.Table.sql b/database/dbo.RawData2019.Table.sql
new file mode 100644
index 0000000..3ccd44f
Binary files /dev/null and b/database/dbo.RawData2019.Table.sql differ
diff --git a/database/dbo.RawData2020.Table.sql b/database/dbo.RawData2020.Table.sql
new file mode 100644
index 0000000..d77c38d
Binary files /dev/null and b/database/dbo.RawData2020.Table.sql differ
diff --git a/database/dbo.RawData2021.Table.sql b/database/dbo.RawData2021.Table.sql
new file mode 100644
index 0000000..cc8dc81
Binary files /dev/null and b/database/dbo.RawData2021.Table.sql differ
diff --git a/database/dbo.RawData2022.Table.sql b/database/dbo.RawData2022.Table.sql
new file mode 100644
index 0000000..7087b83
Binary files /dev/null and b/database/dbo.RawData2022.Table.sql differ
diff --git a/database/dbo.ReturnAvgHourlyOccupancyData.StoredProcedure.sql b/database/dbo.ReturnAvgHourlyOccupancyData.StoredProcedure.sql
new file mode 100644
index 0000000..a75724a
Binary files /dev/null and b/database/dbo.ReturnAvgHourlyOccupancyData.StoredProcedure.sql differ
diff --git a/database/dbo.ReturnAvgHourlySpeedData.StoredProcedure.sql b/database/dbo.ReturnAvgHourlySpeedData.StoredProcedure.sql
new file mode 100644
index 0000000..3071f06
Binary files /dev/null and b/database/dbo.ReturnAvgHourlySpeedData.StoredProcedure.sql differ
diff --git a/database/dbo.ReturnAvgHourlyThroughputData.StoredProcedure.sql b/database/dbo.ReturnAvgHourlyThroughputData.StoredProcedure.sql
new file mode 100644
index 0000000..3b86c28
Binary files /dev/null and b/database/dbo.ReturnAvgHourlyThroughputData.StoredProcedure.sql differ
diff --git a/database/dbo.ReturnAvgVolumeByLane.StoredProcedure.sql b/database/dbo.ReturnAvgVolumeByLane.StoredProcedure.sql
new file mode 100644
index 0000000..6295478
Binary files /dev/null and b/database/dbo.ReturnAvgVolumeByLane.StoredProcedure.sql differ
diff --git a/database/dbo.ReturnMiscDataReport.StoredProcedure.sql b/database/dbo.ReturnMiscDataReport.StoredProcedure.sql
new file mode 100644
index 0000000..9beb0ed
Binary files /dev/null and b/database/dbo.ReturnMiscDataReport.StoredProcedure.sql differ
diff --git a/deleteme.txt b/deleteme.txt
new file mode 100644
index 0000000..ec91066
--- /dev/null
+++ b/deleteme.txt
@@ -0,0 +1,8 @@
+1. Starting the application from VS
+2. Double click on FMS Dashboard solution
+3. C:\Workspace\FMS
+4. Install Node
+
+Create a dynamic report page where users can select a Detector and a start and stop date then populate charts on the fly.
+
+This needs to be able to work for individual detectors and cooridors which are made up of multiple detectors.
\ No newline at end of file
diff --git a/server/FMS Dashboard/Controllers/CorridorsController.cs b/server/FMS Dashboard/Controllers/CorridorsController.cs
index 2d39554..9aa562d 100644
--- a/server/FMS Dashboard/Controllers/CorridorsController.cs
+++ b/server/FMS Dashboard/Controllers/CorridorsController.cs
@@ -11,7 +11,7 @@ public class CorridorsController : Controller
{
public ActionResult AddNew(AddCorridorVM vm)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var corridor = new Corridor();
corridor.Description = vm.corridorDescription;
@@ -32,6 +32,7 @@ public ActionResult AddNew(AddCorridorVM vm)
}
catch (Exception ex)
{
+ Console.WriteLine(ex.Message, "New Corridor Processing failed.");
throw;
}
}
@@ -44,7 +45,7 @@ public ActionResult AddNew(AddCorridorVM vm)
public ActionResult GetCorridorValidity()
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_Validity
.Join(context.CorridorDetectors,
@@ -68,7 +69,7 @@ public ActionResult GetCorridorValidity()
public ActionResult GetCorridors()
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var corridors = context.Corridors.ToList();
diff --git a/server/FMS Dashboard/Controllers/DetectorController.cs b/server/FMS Dashboard/Controllers/DetectorController.cs
index 4321337..831ee5b 100644
--- a/server/FMS Dashboard/Controllers/DetectorController.cs
+++ b/server/FMS Dashboard/Controllers/DetectorController.cs
@@ -40,7 +40,7 @@ public class DetectorController : Controller
public JsonResult GetValidityData()
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_Validity.ToList();
return Json(data, JsonRequestBehavior.AllowGet);
@@ -49,7 +49,7 @@ public JsonResult GetValidityData()
public JsonResult GetValidity()
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_Validity.ToList();
return Json(data, JsonRequestBehavior.AllowGet);
@@ -59,7 +59,7 @@ public JsonResult GetValidity()
public JsonResult GetDetectors()
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
try
{
@@ -78,89 +78,45 @@ public JsonResult GetDetectors()
public static Corridor GetCorridor(int corridor_id)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var detector = context.Corridors.Where(x => x.id == corridor_id).FirstOrDefault();
return detector;
}
}
+ public JsonResult GetCorridorJSON(int corridor_id)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ var corridor = context.Corridors.Where(x => x.id == corridor_id).FirstOrDefault();
+ return Json(corridor, JsonRequestBehavior.AllowGet);
+ }
+ }
+
public static Detector GetDetector(int det_num)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var detector = context.Detectors.Where(x => x.det_num == det_num).FirstOrDefault();
return detector;
}
}
- //public JsonResult GetErrorData(int det_num, int year)
- //{
- // using (var context = new FreewayMSEntities())
- // {
- // var data = context.vw_Errors.Where(x => x.detector_number == det_num && x.year == year)
- // .GroupBy(x => x.detector_number)
- // .Select(y => new
- // {
- // speed_error = y.Sum(x => x.speed_error == true ? 1 : 0),
- // volume_error = y.Sum(x => x.volume_error == true ? 1 : 0),
- // occupancy_error = y.Sum(x => x.occupancy_error == true ? 1 : 0),
- // zeros_error = y.Sum(x => x.zeros_error == true ? 1 : 0),
- // difference_error = y.Sum(x => x.difference_error == true ? 1 : 0)
- // }).FirstOrDefault();
-
- // var totalRows = context.vw_RawData.Where(x => x.detector_number == det_num && x.year == year).Count();
-
- // var list = new List
();
- // var speed = new {
- // value = data.speed_error,
- // pct = (float)data.speed_error / (float)totalRows,
- // label = "Speed"
- // };
-
- // var volume = new
- // {
- // value = data.volume_error,
- // pct = (float)data.volume_error / (float)totalRows,
- // label = "Volume"
- // };
-
- // var occupancy = new
- // {
- // value = data.occupancy_error,
- // pct = (float)data.occupancy_error / (float)totalRows,
- // label = "Occupancy"
- // };
-
- // var zeros = new
- // {
- // value = data.zeros_error,
- // pct = (float)data.zeros_error / (float)totalRows,
- // label = "Zeros"
- // };
-
- // var difference = new
- // {
- // value = data.difference_error,
- // pct = (float)data.difference_error / (float)totalRows,
- // label = "Difference"
- // };
-
- // list.Add(speed);
- // list.Add(volume);
- // list.Add(occupancy);
- // list.Add(zeros);
- // list.Add(difference);
-
- // return Json(list, JsonRequestBehavior.AllowGet);
- // }
- //}
+ public JsonResult GetDetectorJSON(int det_num)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ var detector = context.Detectors.Where(x => x.det_num == det_num).FirstOrDefault();
+ return Json(detector, JsonRequestBehavior.AllowGet);
+ }
+ }
public JsonResult AvgHourlySpeed(int det_num, int year)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgHourlySpeed.Where(x => x.detector_number == det_num && x.year == year).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
@@ -169,7 +125,7 @@ public JsonResult AvgHourlySpeed(int det_num, int year)
public JsonResult DistributionDataPassingQualityControlCriteriaByDate(Guid? reportId, int? det_num, int? year)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
int detector_number = 0;
@@ -206,9 +162,23 @@ public JsonResult DistributionDataPassingQualityControlCriteriaByDate(Guid? repo
}
}
+ public JsonResult DistributionDataPassingQualityControlCriteriaByDateByParams(int det_num, DateTime startDate, DateTime endDate)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ var data = context.vw_Errors
+ .Where(x => x.detector_number == det_num && x.collected > startDate && x.collected < endDate)
+ .GroupBy(x => x.collected)
+ .Select(g => new { num_errors = g.Count(), collected = g.Key })
+ .ToList();
+
+ return Json(data, JsonRequestBehavior.AllowGet);
+ }
+ }
+
public JsonResult AnnualQualityControlFlagsByHourOfDay(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var report = context.GeneratedReports.Where(x => x.id == reportId).FirstOrDefault();
@@ -241,6 +211,37 @@ where SqlFunctions.DatePart("dw", e.collected) >= 2 &&
}
}
+ public JsonResult AnnualQualityControlFlagsByHourOfDayByParams(int det_num, DateTime startDate, DateTime endDate)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ endDate = endDate.AddDays(1);
+
+ var results = from e in context.vw_Errors
+ where SqlFunctions.DatePart("dw", e.collected) >= 2 &&
+ SqlFunctions.DatePart("dw", e.collected) <= 6
+ && e.detector_number == det_num
+ && e.collected > startDate && e.collected < endDate
+ group e by new
+ {
+ min_since = e.min_since
+ } into g
+ select new
+ {
+ min_since = g.Key.min_since,
+ all_rows = g.Count(),
+ occupancy_error = g.Count(x => x.occupancy_error == true),
+ speed_error = g.Count(x => x.speed_error == true),
+ volume_error = g.Count(x => x.volume_error == true),
+ zeros_error = g.Count(x => x.zeros_error == true),
+ difference_error = g.Count(x => x.difference_error == true)
+ };
+ var data = results.ToList();
+
+ return Json(data, JsonRequestBehavior.AllowGet);
+ }
+ }
+
private bool isWeekday(DateTime? date)
{
if (date == null) return false;
@@ -250,7 +251,7 @@ private bool isWeekday(DateTime? date)
public JsonResult DistributionDataPassingQualityControlCriteriaByWeekday(Guid? reportId, int? year, int? det_num)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
int detector_number = 0;
@@ -300,9 +301,35 @@ public JsonResult DistributionDataPassingQualityControlCriteriaByWeekday(Guid? r
}
}
+ public JsonResult DistributionDataPassingQualityControlCriteriaByWeekdayByParams(int det_num, DateTime startDate, DateTime endDate)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ TimeSpan span = endDate - startDate;
+ int numDays = span.Days + 1;
+
+ var data = context.vw_Errors
+ .Where(x => x.detector_number == det_num && x.collected > startDate && x.collected < endDate)
+ .Select(x => new { x.collected, x.min_since })
+ .ToList()
+ .Select(x => new { Weekday = x.collected.HasValue ? x.collected.Value.DayOfWeek : DayOfWeek.Sunday, MinSince = x.min_since })
+ .GroupBy(x => new { x.Weekday, x.MinSince })
+ .Select(g => new { NumErrors = g.Count(), Weekday = g.Key.Weekday.ToString(), MinSince = g.Key.MinSince })
+ .OrderBy(x => x.Weekday)
+ .ThenBy(x => x.MinSince)
+ .ToList();
+
+ return Json(new
+ {
+ data = data,
+ numDays = numDays
+ }, JsonRequestBehavior.AllowGet);
+ }
+ }
+
public JsonResult AvgHourlyOccupancyByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgHourlyOccupancy.Where(x => x.reportId == reportId).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
@@ -311,16 +338,27 @@ public JsonResult AvgHourlyOccupancyByReportId(Guid reportId)
public JsonResult AvgHourlyOccupancyByDetNum(int det_num, int year)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgHourlyOccupancy.Where(x => x.detector_number == det_num && x.year == year).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
}
}
+ public JsonResult AvgHourlyOccupancyByParams(int det_num, DateTime startDate, DateTime endDate)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ IEnumerable result = context.ReturnAvgHourlyOccupancyData(det_num, startDate, endDate);
+ // http://localhost:56118/Detector/AvgHourlyOccupancyByParams?det_num=573&startDate=2018-01-01&endDate=2019-01-01
+ var data = result.ToList();
+ return Json(data, JsonRequestBehavior.AllowGet);
+ }
+ }
+
public JsonResult GetMiscDetectorDataByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var report = context.GeneratedReports.Where(x => x.id == reportId).FirstOrDefault();
var existingLanes = context.vw_ExistingLanes.Where(x => x.detector_number == report.det_num && x.year == report.startDate.Year).FirstOrDefault();
@@ -333,9 +371,18 @@ public JsonResult GetMiscDetectorDataByReportId(Guid reportId)
}
}
+ public JsonResult GetMiscDetectorDataByParams(int det_num, int year)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ var existingLanes = context.vw_ExistingLanes.Where(x => x.detector_number == det_num && x.year == year).FirstOrDefault();
+ return Json(new { existingLanes = existingLanes }, JsonRequestBehavior.AllowGet);
+ }
+ }
+
public JsonResult GetErrorDataByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
//if (year != null)
//{
@@ -352,16 +399,9 @@ public JsonResult GetErrorDataByReportId(Guid reportId)
}
}
- public string GetChartImage()
- {
-
-
- return "test";
- }
-
public JsonResult SpeedVsDensityByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
try
{
@@ -400,7 +440,7 @@ where SqlFunctions.DatePart("dw", e.collected) >= 2 &&
public JsonResult SpeedVsDensityByDetNum(int year, int det_num)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
try
{
@@ -428,7 +468,7 @@ where SqlFunctions.DatePart("dw", e.collected) >= 2 &&
public JsonResult FlowVsDensityByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
try
{
@@ -465,7 +505,7 @@ where SqlFunctions.DatePart("dw", e.collected) >= 2 &&
public JsonResult FlowVsDensityByDetNum(int year, int det_num)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
context.Database.CommandTimeout = 60;
try
@@ -496,7 +536,7 @@ where SqlFunctions.DatePart("dw", e.collected) >= 2 &&
public JsonResult SpeedVsFlowByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
try
{
@@ -537,7 +577,7 @@ where SqlFunctions.DatePart("dw", e.collected) >= 2 &&
public JsonResult AvgVolumeByLaneByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgVolumeByLane.Where(x => x.reportId == reportId).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
@@ -545,16 +585,27 @@ public JsonResult AvgVolumeByLaneByReportId(Guid reportId)
}
public JsonResult AvgVolumeByLaneByDetNum(int det_num, int year)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgVolumeByLane.Where(x => x.detector_number == det_num && x.year == year).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
}
}
+ public JsonResult AvgVolumeByLaneByParams(int det_num, DateTime startDate, DateTime endDate)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ IEnumerable result = context.ReturnAvgVolumeByLane(det_num, startDate, endDate);
+ // http://localhost:56118/Detector/AvgVolumeByLaneByParams?det_num=573&startDate=2018-01-01&endDate=2019-01-01
+ var data = result.ToList();
+ return Json(data, JsonRequestBehavior.AllowGet);
+ }
+ }
+
public JsonResult AvgHourlySpeedByDetNum(int det_num, int year)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgHourlySpeed.Where(x => x.detector_number == det_num && x.year == year).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
@@ -563,16 +614,28 @@ public JsonResult AvgHourlySpeedByDetNum(int det_num, int year)
public JsonResult AvgHourlySpeedByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgHourlySpeed.Where(x => x.reportId == reportId).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
}
}
+ public JsonResult AvgHourlySpeedByParams(int det_num, DateTime startDate, DateTime endDate)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ IEnumerable result = context.ReturnAvgHourlySpeedData(det_num, startDate, endDate);
+ // var data = context.ReturnAvgHourlySpeedData.Where(x => x.detector_number == det_num && x.start_date == startDate && x.end_date == endDate).ToList();
+ // http://localhost:56118/Detector/AvgHourlySpeedByParams?det_num=573&startDate=2018-01-01&endDate=2019-01-01
+ var data = result.ToList();
+ return Json(data, JsonRequestBehavior.AllowGet);
+ }
+ }
+
public JsonResult AvgHourlyThroughputByReportId(Guid reportId)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgHourlyThroughput.Where(x => x.reportId == reportId).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
@@ -581,16 +644,27 @@ public JsonResult AvgHourlyThroughputByReportId(Guid reportId)
public JsonResult AvgHourlyThroughputByDetNum(int det_num, int year)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var data = context.detector_AvgHourlyThroughput.Where(x => x.detector_number == det_num && x.year == year).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
}
}
+ public JsonResult AvgHourlyThroughputByParams(int det_num, DateTime startDate, DateTime endDate)
+ {
+ using (var context = new FreewayMSEntities2())
+ {
+ IEnumerable result = context.ReturnAvgHourlyThroughputData(det_num, startDate, endDate);
+ // http://localhost:56118/Detector/AvgHourlyThroughputByParams?det_num=573&startDate=2018-01-01&endDate=2019-01-01
+ var data = result.ToList();
+ return Json(data, JsonRequestBehavior.AllowGet);
+ }
+ }
+
//public JsonResult GetLaneErrors(int det_num, int year)
//{
- // using (var context = new FreewayMSEntities())
+ // using (var context = new FreewayMSEntities2())
// {
// var data = context.vw_LaneErrors.Where(x => x.detector_number == det_num && x.year == year).ToList();
// return Json(data, JsonRequestBehavior.AllowGet);
@@ -598,7 +672,7 @@ public JsonResult AvgHourlyThroughputByDetNum(int det_num, int year)
//}
//public JsonResult GetErrors(int det_num, int year)
//{
- // using (var context = new FreewayMSEntities())
+ // using (var context = new FreewayMSEntities2())
// {
// var data = context.vw_Errors.Where(x => x.detector_number == det_num && x.year == year).Take(10000).ToList();
// var jsonResult = Json(data, JsonRequestBehavior.AllowGet);
diff --git a/server/FMS Dashboard/Controllers/ReportsController.cs b/server/FMS Dashboard/Controllers/ReportsController.cs
index 9cb9fda..0180055 100644
--- a/server/FMS Dashboard/Controllers/ReportsController.cs
+++ b/server/FMS Dashboard/Controllers/ReportsController.cs
@@ -21,7 +21,7 @@ public class ReportsController : Controller
public JsonResult GetGeneratedReports()
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
var query = context.GeneratedReports.GroupJoin(
context.Detectors,
@@ -89,7 +89,7 @@ public bool SendEmail(GeneratedReport report)
public JsonResult AddGeneratedReport(GeneratedReport newReport)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
try
{
@@ -117,7 +117,7 @@ public JsonResult AddGeneratedReport(GeneratedReport newReport)
public bool UpdateStatusToComplete(GeneratedReport report)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
context.Database.CommandTimeout = 180;
@@ -132,6 +132,7 @@ public bool UpdateStatusToComplete(GeneratedReport report)
}
catch (Exception ex)
{
+ Console.WriteLine(ex.Message, "Update Status to Complete Processing failed.");
return false;
}
}
@@ -145,7 +146,7 @@ class StartAndEndDates {
public JsonResult DeleteGeneratedReport(Guid id)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
context.Database.CommandTimeout = 180;
try
@@ -164,6 +165,7 @@ public JsonResult DeleteGeneratedReport(Guid id)
}
catch (Exception ex)
{
+ Console.WriteLine(ex.Message, "Delete Report Processing failed.");
return Json(new { id = "Error!" }, JsonRequestBehavior.AllowGet);
}
}
@@ -172,7 +174,7 @@ public JsonResult DeleteGeneratedReport(Guid id)
public bool GenerateReportData(GeneratedReport newReport)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
context.Database.CommandTimeout = 180;
@@ -186,6 +188,7 @@ public bool GenerateReportData(GeneratedReport newReport)
}
catch (Exception ex)
{
+ Console.WriteLine(ex.Message, "New Report Processing failed.");
return false;
}
}
diff --git a/server/FMS Dashboard/FMS Dashboard.csproj b/server/FMS Dashboard/FMS Dashboard.csproj
index c3690e2..52fbd1a 100644
--- a/server/FMS Dashboard/FMS Dashboard.csproj
+++ b/server/FMS Dashboard/FMS Dashboard.csproj
@@ -239,10 +239,6 @@
True
..\packages\WebGrease.1.6.0\lib\WebGrease.dll
-
- True
- ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll
-
@@ -261,182 +257,116 @@
Global.asax
-
- DataModel.tt
-
-
- DataModel.tt
-
- DataModel.tt
+ Model1.tt
- DataModel.tt
-
-
- True
- True
- DataModel.Context.tt
-
-
- True
- True
- DataModel.tt
-
-
- True
- True
- DataModel.edmx
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
+ Model1.tt
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
+ Model1.tt
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
-
-
- DataModel.tt
+
+ True
+ True
+ Model1.Context.tt
-
- DataModel.tt
+
+ True
+ True
+ Model1.tt
-
- DataModel.tt
+
+ True
+ True
+ Model1.edmx
-
- DataModel.tt
+
+ Model1.tt
-
- DataModel.tt
+
+ Model1.tt
-
- DataModel.tt
+
+ Model1.tt
-
- DataModel.tt
+
+ Model1.tt
-
- DataModel.tt
+
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
- DataModel.tt
+ Model1.tt
-
+
TextTemplatingFileGenerator
- DataModel.edmx
- DataModel.Context.cs
+ Model1.edmx
+ Model1.Context.cs
-
+
TextTemplatingFileGenerator
- DataModel.edmx
- DataModel.cs
+ Model1.edmx
+ Model1.cs
@@ -450,12 +380,12 @@
-
+
EntityModelCodeGenerator
- DataModel.Designer.cs
+ Model1.Designer.cs
-
- DataModel.edmx
+
+ Model1.edmx
diff --git a/server/FMS Dashboard/Global.asax.cs b/server/FMS Dashboard/Global.asax.cs
index 7d87d81..7f15378 100644
--- a/server/FMS Dashboard/Global.asax.cs
+++ b/server/FMS Dashboard/Global.asax.cs
@@ -54,7 +54,7 @@ protected void Application_BeginRequest(Object sender, EventArgs e)
private string GetRoleByDomainName(string name)
{
- using (var context = new FreewayMSEntities())
+ using (var context = new FreewayMSEntities2())
{
//var currentUser = context.ApplicationUsers.Where(x => x.domainName == name.Replace("AZMAG\\", "")).FirstOrDefault();
//if (currentUser == null)
diff --git a/server/FMS Dashboard/Models/ApplicationRole.cs b/server/FMS Dashboard/Models/ApplicationRole.cs
deleted file mode 100644
index 215c90b..0000000
--- a/server/FMS Dashboard/Models/ApplicationRole.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class ApplicationRole
- {
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
- public ApplicationRole()
- {
- this.ApplicationUsers = new HashSet();
- }
-
- public int id { get; set; }
- public string name { get; set; }
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
- public virtual ICollection ApplicationUsers { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/DataModel.edmx b/server/FMS Dashboard/Models/DataModel.edmx
deleted file mode 100644
index 8b63047..0000000
--- a/server/FMS Dashboard/Models/DataModel.edmx
+++ /dev/null
@@ -1,2893 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SELECT
- [Detectors].[ID] AS [ID],
- [Detectors].[det_num] AS [det_num],
- [Detectors].[Location] AS [Location],
- [Detectors].[Route] AS [Route],
- [Detectors].[Direction] AS [Direction],
- [Detectors].[Milepost] AS [Milepost],
- [Detectors].[GPS] AS [GPS],
- [Detectors].[Type] AS [Type],
- [Detectors].[Length_ft] AS [Length_ft],
- [Detectors].[y] AS [y],
- [Detectors].[x] AS [x],
- [Detectors].[Segment] AS [Segment]
- FROM [dbo].[Detectors] AS [Detectors]
-
-
- SELECT
- [newCorridors].[det_num] AS [det_num],
- [newCorridors].[line_string] AS [line_string]
- FROM [dbo].[newCorridors] AS [newCorridors]
-
-
- SELECT
- [RawData2018].[id] AS [id],
- [RawData2018].[detector_number] AS [detector_number],
- [RawData2018].[collected] AS [collected],
- [RawData2018].[min_since] AS [min_since],
- [RawData2018].[lane] AS [lane],
- [RawData2018].[speed] AS [speed],
- [RawData2018].[samples] AS [samples],
- [RawData2018].[occupancy] AS [occupancy],
- [RawData2018].[volume] AS [volume],
- [RawData2018].[vph] AS [vph],
- [RawData2018].[isGP] AS [isGP]
- FROM [dbo].[RawData2018] AS [RawData2018]
-
-
- SELECT
- [vw_detector_AvgAnnualVolumeByLane].[detector_number] AS [detector_number],
- [vw_detector_AvgAnnualVolumeByLane].[lane] AS [lane],
- [vw_detector_AvgAnnualVolumeByLane].[year] AS [year],
- [vw_detector_AvgAnnualVolumeByLane].[avg_annual_daily_traffic] AS [avg_annual_daily_traffic]
- FROM [dbo].[vw_detector_AvgAnnualVolumeByLane] AS [vw_detector_AvgAnnualVolumeByLane]
-
-
- SELECT
- [vw_detector_AvgByLane].[id] AS [id],
- [vw_detector_AvgByLane].[detector_number] AS [detector_number],
- [vw_detector_AvgByLane].[lane] AS [lane],
- [vw_detector_AvgByLane].[year] AS [year],
- [vw_detector_AvgByLane].[avg_speed] AS [avg_speed],
- [vw_detector_AvgByLane].[avg_volume] AS [avg_volume],
- [vw_detector_AvgByLane].[avg_ADT] AS [avg_ADT]
- FROM [dbo].[vw_detector_AvgByLane] AS [vw_detector_AvgByLane]
-
-
- SELECT
- [vw_detector_AvgHourlySpeed].[detector_number] AS [detector_number],
- [vw_detector_AvgHourlySpeed].[avg_speed] AS [avg_speed],
- [vw_detector_AvgHourlySpeed].[hour_in_day] AS [hour_in_day],
- [vw_detector_AvgHourlySpeed].[lane_type] AS [lane_type],
- [vw_detector_AvgHourlySpeed].[year] AS [year]
- FROM [dbo].[vw_detector_AvgHourlySpeed] AS [vw_detector_AvgHourlySpeed]
-
-
- SELECT
- [vw_detector_AvgHourlyThroughput].[detector_number] AS [detector_number],
- [vw_detector_AvgHourlyThroughput].[avg_throughput] AS [avg_throughput],
- [vw_detector_AvgHourlyThroughput].[hour_in_day] AS [hour_in_day],
- [vw_detector_AvgHourlyThroughput].[lane_type] AS [lane_type],
- [vw_detector_AvgHourlyThroughput].[year] AS [year]
- FROM [dbo].[vw_detector_AvgHourlyThroughput] AS [vw_detector_AvgHourlyThroughput]
-
-
- SELECT
- [vw_detector_MiscData].[Id] AS [Id],
- [vw_detector_MiscData].[detector_number] AS [detector_number],
- [vw_detector_MiscData].[num_days] AS [num_days],
- [vw_detector_MiscData].[gp_lane_cnt] AS [gp_lane_cnt],
- [vw_detector_MiscData].[hov_lane_cnt] AS [hov_lane_cnt],
- [vw_detector_MiscData].[year] AS [year]
- FROM [dbo].[vw_detector_MiscData] AS [vw_detector_MiscData]
-
-
- SELECT
- [vw_detector_Validity].[id] AS [id],
- [vw_detector_Validity].[detector_number] AS [detector_number],
- [vw_detector_Validity].[year] AS [year],
- [vw_detector_Validity].[error] AS [error],
- [vw_detector_Validity].[valid] AS [valid],
- [vw_detector_Validity].[total] AS [total],
- [vw_detector_Validity].[pct] AS [pct]
- FROM [dbo].[vw_detector_Validity] AS [vw_detector_Validity]
-
-
- SELECT
- [vw_Errors].[year] AS [year],
- [vw_Errors].[id] AS [id],
- [vw_Errors].[detector_number] AS [detector_number],
- [vw_Errors].[collected] AS [collected],
- [vw_Errors].[min_since] AS [min_since],
- [vw_Errors].[speed_error] AS [speed_error],
- [vw_Errors].[volume_error] AS [volume_error],
- [vw_Errors].[occupancy_error] AS [occupancy_error],
- [vw_Errors].[difference_error] AS [difference_error],
- [vw_Errors].[zeros_error] AS [zeros_error]
- FROM [dbo].[vw_Errors] AS [vw_Errors]
-
-
- SELECT
- [vw_ExistingLanes].[year] AS [year],
- [vw_ExistingLanes].[detector_number] AS [detector_number],
- [vw_ExistingLanes].[lane1] AS [lane1],
- [vw_ExistingLanes].[lane2] AS [lane2],
- [vw_ExistingLanes].[lane3] AS [lane3],
- [vw_ExistingLanes].[lane4] AS [lane4],
- [vw_ExistingLanes].[lane5] AS [lane5],
- [vw_ExistingLanes].[lane6] AS [lane6],
- [vw_ExistingLanes].[lane7] AS [lane7],
- [vw_ExistingLanes].[lane8] AS [lane8],
- [vw_ExistingLanes].[lane9] AS [lane9],
- [vw_ExistingLanes].[lane10] AS [lane10],
- [vw_ExistingLanes].[HOV] AS [HOV],
- [vw_ExistingLanes].[HOV2] AS [HOV2]
- FROM [dbo].[vw_ExistingLanes] AS [vw_ExistingLanes]
-
-
- SELECT
- [vw_LaneErrors].[year] AS [year],
- [vw_LaneErrors].[id] AS [id],
- [vw_LaneErrors].[detector_number] AS [detector_number],
- [vw_LaneErrors].[collected] AS [collected],
- [vw_LaneErrors].[min_since] AS [min_since],
- [vw_LaneErrors].[lane1] AS [lane1],
- [vw_LaneErrors].[lane2] AS [lane2],
- [vw_LaneErrors].[lane3] AS [lane3],
- [vw_LaneErrors].[lane4] AS [lane4],
- [vw_LaneErrors].[lane5] AS [lane5],
- [vw_LaneErrors].[lane6] AS [lane6],
- [vw_LaneErrors].[lane7] AS [lane7],
- [vw_LaneErrors].[lane8] AS [lane8],
- [vw_LaneErrors].[lane9] AS [lane9],
- [vw_LaneErrors].[lane10] AS [lane10],
- [vw_LaneErrors].[HOV] AS [HOV],
- [vw_LaneErrors].[HOV2] AS [HOV2]
- FROM [dbo].[vw_LaneErrors] AS [vw_LaneErrors]
-
-
- SELECT
- [vw_RawData].[year] AS [year],
- [vw_RawData].[id] AS [id],
- [vw_RawData].[detector_number] AS [detector_number],
- [vw_RawData].[collected] AS [collected],
- [vw_RawData].[min_since] AS [min_since],
- [vw_RawData].[lane] AS [lane],
- [vw_RawData].[speed] AS [speed],
- [vw_RawData].[samples] AS [samples],
- [vw_RawData].[occupancy] AS [occupancy],
- [vw_RawData].[volume] AS [volume],
- [vw_RawData].[vph] AS [vph],
- [vw_RawData].[isGP] AS [isGP]
- FROM [dbo].[vw_RawData] AS [vw_RawData]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/server/FMS Dashboard/Models/DataModel.edmx.diagram b/server/FMS Dashboard/Models/DataModel.edmx.diagram
deleted file mode 100644
index 2b2609d..0000000
--- a/server/FMS Dashboard/Models/DataModel.edmx.diagram
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/server/FMS Dashboard/Models/Errors2017.cs b/server/FMS Dashboard/Models/Errors2017.cs
deleted file mode 100644
index 3fce38a..0000000
--- a/server/FMS Dashboard/Models/Errors2017.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class Errors2017
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable speed_error { get; set; }
- public Nullable volume_error { get; set; }
- public Nullable occupancy_error { get; set; }
- public Nullable difference_error { get; set; }
- public Nullable zeros_error { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/Errors2018.cs b/server/FMS Dashboard/Models/Errors2018.cs
deleted file mode 100644
index 82e0e74..0000000
--- a/server/FMS Dashboard/Models/Errors2018.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class Errors2018
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable speed_error { get; set; }
- public Nullable volume_error { get; set; }
- public Nullable occupancy_error { get; set; }
- public Nullable difference_error { get; set; }
- public Nullable zeros_error { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/Errors2019.cs b/server/FMS Dashboard/Models/Errors2019.cs
deleted file mode 100644
index bd340b3..0000000
--- a/server/FMS Dashboard/Models/Errors2019.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class Errors2019
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable speed_error { get; set; }
- public Nullable volume_error { get; set; }
- public Nullable occupancy_error { get; set; }
- public Nullable difference_error { get; set; }
- public Nullable zeros_error { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/Errors2020.cs b/server/FMS Dashboard/Models/Errors2020.cs
deleted file mode 100644
index 9e172a4..0000000
--- a/server/FMS Dashboard/Models/Errors2020.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class Errors2020
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable speed_error { get; set; }
- public Nullable volume_error { get; set; }
- public Nullable occupancy_error { get; set; }
- public Nullable difference_error { get; set; }
- public Nullable zeros_error { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/Errors2021.cs b/server/FMS Dashboard/Models/Errors2021.cs
deleted file mode 100644
index f192495..0000000
--- a/server/FMS Dashboard/Models/Errors2021.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class Errors2021
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable speed_error { get; set; }
- public Nullable volume_error { get; set; }
- public Nullable occupancy_error { get; set; }
- public Nullable difference_error { get; set; }
- public Nullable zeros_error { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/Errors2022.cs b/server/FMS Dashboard/Models/Errors2022.cs
deleted file mode 100644
index 68e4504..0000000
--- a/server/FMS Dashboard/Models/Errors2022.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class Errors2022
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable speed_error { get; set; }
- public Nullable volume_error { get; set; }
- public Nullable occupancy_error { get; set; }
- public Nullable difference_error { get; set; }
- public Nullable zeros_error { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/LaneErrors2015.cs b/server/FMS Dashboard/Models/LaneErrors2015.cs
deleted file mode 100644
index a9fef89..0000000
--- a/server/FMS Dashboard/Models/LaneErrors2015.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class LaneErrors2015
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable lane1 { get; set; }
- public Nullable lane2 { get; set; }
- public Nullable lane3 { get; set; }
- public Nullable lane4 { get; set; }
- public Nullable lane5 { get; set; }
- public Nullable lane6 { get; set; }
- public Nullable lane7 { get; set; }
- public Nullable lane8 { get; set; }
- public Nullable lane9 { get; set; }
- public Nullable lane10 { get; set; }
- public Nullable HOV { get; set; }
- public Nullable HOV2 { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/LaneErrors2016.cs b/server/FMS Dashboard/Models/LaneErrors2016.cs
deleted file mode 100644
index 6d92bb1..0000000
--- a/server/FMS Dashboard/Models/LaneErrors2016.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class LaneErrors2016
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable lane1 { get; set; }
- public Nullable lane2 { get; set; }
- public Nullable lane3 { get; set; }
- public Nullable lane4 { get; set; }
- public Nullable lane5 { get; set; }
- public Nullable lane6 { get; set; }
- public Nullable lane7 { get; set; }
- public Nullable lane8 { get; set; }
- public Nullable lane9 { get; set; }
- public Nullable lane10 { get; set; }
- public Nullable HOV { get; set; }
- public Nullable HOV2 { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/LaneErrors2017.cs b/server/FMS Dashboard/Models/LaneErrors2017.cs
deleted file mode 100644
index d5ff70c..0000000
--- a/server/FMS Dashboard/Models/LaneErrors2017.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class LaneErrors2017
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable lane1 { get; set; }
- public Nullable lane2 { get; set; }
- public Nullable lane3 { get; set; }
- public Nullable lane4 { get; set; }
- public Nullable lane5 { get; set; }
- public Nullable lane6 { get; set; }
- public Nullable lane7 { get; set; }
- public Nullable lane8 { get; set; }
- public Nullable lane9 { get; set; }
- public Nullable lane10 { get; set; }
- public Nullable HOV { get; set; }
- public Nullable HOV2 { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/LaneErrors2018.cs b/server/FMS Dashboard/Models/LaneErrors2018.cs
deleted file mode 100644
index 1017ee1..0000000
--- a/server/FMS Dashboard/Models/LaneErrors2018.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class LaneErrors2018
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable lane1 { get; set; }
- public Nullable lane2 { get; set; }
- public Nullable lane3 { get; set; }
- public Nullable lane4 { get; set; }
- public Nullable lane5 { get; set; }
- public Nullable lane6 { get; set; }
- public Nullable lane7 { get; set; }
- public Nullable lane8 { get; set; }
- public Nullable lane9 { get; set; }
- public Nullable lane10 { get; set; }
- public Nullable HOV { get; set; }
- public Nullable HOV2 { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/LaneErrors2019.cs b/server/FMS Dashboard/Models/LaneErrors2019.cs
deleted file mode 100644
index 17a9276..0000000
--- a/server/FMS Dashboard/Models/LaneErrors2019.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class LaneErrors2019
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable lane1 { get; set; }
- public Nullable lane2 { get; set; }
- public Nullable lane3 { get; set; }
- public Nullable lane4 { get; set; }
- public Nullable lane5 { get; set; }
- public Nullable lane6 { get; set; }
- public Nullable lane7 { get; set; }
- public Nullable lane8 { get; set; }
- public Nullable lane9 { get; set; }
- public Nullable lane10 { get; set; }
- public Nullable HOV { get; set; }
- public Nullable HOV2 { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/LaneErrors2020.cs b/server/FMS Dashboard/Models/LaneErrors2020.cs
deleted file mode 100644
index a96a7e4..0000000
--- a/server/FMS Dashboard/Models/LaneErrors2020.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class LaneErrors2020
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable lane1 { get; set; }
- public Nullable lane2 { get; set; }
- public Nullable lane3 { get; set; }
- public Nullable lane4 { get; set; }
- public Nullable lane5 { get; set; }
- public Nullable lane6 { get; set; }
- public Nullable lane7 { get; set; }
- public Nullable lane8 { get; set; }
- public Nullable lane9 { get; set; }
- public Nullable lane10 { get; set; }
- public Nullable HOV { get; set; }
- public Nullable HOV2 { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/LaneErrors2021.cs b/server/FMS Dashboard/Models/LaneErrors2021.cs
deleted file mode 100644
index a96deda..0000000
--- a/server/FMS Dashboard/Models/LaneErrors2021.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class LaneErrors2021
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable lane1 { get; set; }
- public Nullable lane2 { get; set; }
- public Nullable lane3 { get; set; }
- public Nullable lane4 { get; set; }
- public Nullable lane5 { get; set; }
- public Nullable lane6 { get; set; }
- public Nullable lane7 { get; set; }
- public Nullable lane8 { get; set; }
- public Nullable lane9 { get; set; }
- public Nullable lane10 { get; set; }
- public Nullable HOV { get; set; }
- public Nullable HOV2 { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/LaneErrors2022.cs b/server/FMS Dashboard/Models/LaneErrors2022.cs
deleted file mode 100644
index fa64c95..0000000
--- a/server/FMS Dashboard/Models/LaneErrors2022.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace FMS_Dashboard.Models
-{
- using System;
- using System.Collections.Generic;
-
- public partial class LaneErrors2022
- {
- public int id { get; set; }
- public Nullable detector_number { get; set; }
- public Nullable collected { get; set; }
- public Nullable min_since { get; set; }
- public Nullable lane1 { get; set; }
- public Nullable lane2 { get; set; }
- public Nullable lane3 { get; set; }
- public Nullable lane4 { get; set; }
- public Nullable lane5 { get; set; }
- public Nullable lane6 { get; set; }
- public Nullable lane7 { get; set; }
- public Nullable lane8 { get; set; }
- public Nullable lane9 { get; set; }
- public Nullable lane10 { get; set; }
- public Nullable HOV { get; set; }
- public Nullable HOV2 { get; set; }
- }
-}
diff --git a/server/FMS Dashboard/Models/DataModel.Context.cs b/server/FMS Dashboard/Models/Model1.Context.cs
similarity index 63%
rename from server/FMS Dashboard/Models/DataModel.Context.cs
rename to server/FMS Dashboard/Models/Model1.Context.cs
index c2a287b..84857ac 100644
--- a/server/FMS Dashboard/Models/DataModel.Context.cs
+++ b/server/FMS Dashboard/Models/Model1.Context.cs
@@ -15,10 +15,10 @@ namespace FMS_Dashboard.Models
using System.Data.Entity.Core.Objects;
using System.Linq;
- public partial class FreewayMSEntities : DbContext
+ public partial class FreewayMSEntities2 : DbContext
{
- public FreewayMSEntities()
- : base("name=FreewayMSEntities")
+ public FreewayMSEntities2()
+ : base("name=FreewayMSEntities2")
{
}
@@ -27,8 +27,6 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
throw new UnintentionalCodeFirstException();
}
- public virtual DbSet ApplicationRoles { get; set; }
- public virtual DbSet ApplicationUsers { get; set; }
public virtual DbSet CorridorDetectors { get; set; }
public virtual DbSet Corridors { get; set; }
public virtual DbSet detector_AvgByLane { get; set; }
@@ -39,33 +37,8 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
public virtual DbSet detector_MiscData { get; set; }
public virtual DbSet detector_SpeedVsFlow { get; set; }
public virtual DbSet detector_Validity { get; set; }
- public virtual DbSet Errors2015 { get; set; }
- public virtual DbSet Errors2016 { get; set; }
- public virtual DbSet Errors2017 { get; set; }
- public virtual DbSet Errors2018 { get; set; }
- public virtual DbSet Errors2019 { get; set; }
- public virtual DbSet Errors2020 { get; set; }
- public virtual DbSet Errors2021 { get; set; }
- public virtual DbSet Errors2022 { get; set; }
public virtual DbSet GeneratedReports { get; set; }
- public virtual DbSet LaneErrors2015 { get; set; }
- public virtual DbSet LaneErrors2016 { get; set; }
- public virtual DbSet LaneErrors2017 { get; set; }
- public virtual DbSet LaneErrors2018 { get; set; }
- public virtual DbSet LaneErrors2019 { get; set; }
- public virtual DbSet LaneErrors2020 { get; set; }
- public virtual DbSet LaneErrors2021 { get; set; }
- public virtual DbSet LaneErrors2022 { get; set; }
- public virtual DbSet RawData2015 { get; set; }
- public virtual DbSet RawData2016 { get; set; }
- public virtual DbSet RawData2017 { get; set; }
- public virtual DbSet RawData2019 { get; set; }
- public virtual DbSet RawData2020 { get; set; }
- public virtual DbSet RawData2021 { get; set; }
- public virtual DbSet RawData2022 { get; set; }
public virtual DbSet Detectors { get; set; }
- public virtual DbSet newCorridors { get; set; }
- public virtual DbSet RawData2018 { get; set; }
public virtual DbSet vw_detector_AvgAnnualVolumeByLane { get; set; }
public virtual DbSet vw_detector_AvgByLane { get; set; }
public virtual DbSet vw_detector_AvgHourlySpeed { get; set; }
@@ -77,6 +50,23 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
public virtual DbSet vw_LaneErrors { get; set; }
public virtual DbSet vw_RawData { get; set; }
+ public virtual ObjectResult ReturnAvgHourlySpeedData(Nullable det_num, Nullable start_date, Nullable end_date)
+ {
+ var det_numParameter = det_num.HasValue ?
+ new ObjectParameter("det_num", det_num) :
+ new ObjectParameter("det_num", typeof(int));
+
+ var start_dateParameter = start_date.HasValue ?
+ new ObjectParameter("start_date", start_date) :
+ new ObjectParameter("start_date", typeof(System.DateTime));
+
+ var end_dateParameter = end_date.HasValue ?
+ new ObjectParameter("end_date", end_date) :
+ new ObjectParameter("end_date", typeof(System.DateTime));
+
+ return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("ReturnAvgHourlySpeedData", det_numParameter, start_dateParameter, end_dateParameter);
+ }
+
public virtual int GenerateAvgHourlyOccupancyData(Nullable report_id, Nullable det_num, Nullable start_date, Nullable end_date)
{
var report_idParameter = report_id.HasValue ?
@@ -185,5 +175,73 @@ public virtual int GenerateMiscDataReport(Nullable report_id, Nulla
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GenerateMiscDataReport", report_idParameter, det_numParameter, start_dateParameter, end_dateParameter, isPeriod1Parameter);
}
+
+ public virtual ObjectResult ReturnAvgHourlyOccupancyData(Nullable det_num, Nullable start_date, Nullable end_date)
+ {
+ var det_numParameter = det_num.HasValue ?
+ new ObjectParameter("det_num", det_num) :
+ new ObjectParameter("det_num", typeof(int));
+
+ var start_dateParameter = start_date.HasValue ?
+ new ObjectParameter("start_date", start_date) :
+ new ObjectParameter("start_date", typeof(System.DateTime));
+
+ var end_dateParameter = end_date.HasValue ?
+ new ObjectParameter("end_date", end_date) :
+ new ObjectParameter("end_date", typeof(System.DateTime));
+
+ return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("ReturnAvgHourlyOccupancyData", det_numParameter, start_dateParameter, end_dateParameter);
+ }
+
+ public virtual ObjectResult ReturnAvgHourlyThroughputData(Nullable det_num, Nullable start_date, Nullable end_date)
+ {
+ var det_numParameter = det_num.HasValue ?
+ new ObjectParameter("det_num", det_num) :
+ new ObjectParameter("det_num", typeof(int));
+
+ var start_dateParameter = start_date.HasValue ?
+ new ObjectParameter("start_date", start_date) :
+ new ObjectParameter("start_date", typeof(System.DateTime));
+
+ var end_dateParameter = end_date.HasValue ?
+ new ObjectParameter("end_date", end_date) :
+ new ObjectParameter("end_date", typeof(System.DateTime));
+
+ return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("ReturnAvgHourlyThroughputData", det_numParameter, start_dateParameter, end_dateParameter);
+ }
+
+ public virtual ObjectResult ReturnAvgVolumeByLane(Nullable det_num, Nullable start_date, Nullable end_date)
+ {
+ var det_numParameter = det_num.HasValue ?
+ new ObjectParameter("det_num", det_num) :
+ new ObjectParameter("det_num", typeof(int));
+
+ var start_dateParameter = start_date.HasValue ?
+ new ObjectParameter("start_date", start_date) :
+ new ObjectParameter("start_date", typeof(System.DateTime));
+
+ var end_dateParameter = end_date.HasValue ?
+ new ObjectParameter("end_date", end_date) :
+ new ObjectParameter("end_date", typeof(System.DateTime));
+
+ return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("ReturnAvgVolumeByLane", det_numParameter, start_dateParameter, end_dateParameter);
+ }
+
+ public virtual ObjectResult ReturnMiscDataReport(Nullable det_num, Nullable start_date, Nullable end_date)
+ {
+ var det_numParameter = det_num.HasValue ?
+ new ObjectParameter("det_num", det_num) :
+ new ObjectParameter("det_num", typeof(int));
+
+ var start_dateParameter = start_date.HasValue ?
+ new ObjectParameter("start_date", start_date) :
+ new ObjectParameter("start_date", typeof(System.DateTime));
+
+ var end_dateParameter = end_date.HasValue ?
+ new ObjectParameter("end_date", end_date) :
+ new ObjectParameter("end_date", typeof(System.DateTime));
+
+ return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("ReturnMiscDataReport", det_numParameter, start_dateParameter, end_dateParameter);
+ }
}
}
diff --git a/server/FMS Dashboard/Models/DataModel.Context.tt b/server/FMS Dashboard/Models/Model1.Context.tt
similarity index 99%
rename from server/FMS Dashboard/Models/DataModel.Context.tt
rename to server/FMS Dashboard/Models/Model1.Context.tt
index 4811b5a..7b8920f 100644
--- a/server/FMS Dashboard/Models/DataModel.Context.tt
+++ b/server/FMS Dashboard/Models/Model1.Context.tt
@@ -2,7 +2,7 @@
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
output extension=".cs"#><#
-const string inputFile = @"DataModel.edmx";
+const string inputFile = @"Model1.edmx";
var textTransform = DynamicTextTransformation.Create(this);
var code = new CodeGenerationTools(this);
var ef = new MetadataTools(this);
diff --git a/server/FMS Dashboard/Models/DataModel.Designer.cs b/server/FMS Dashboard/Models/Model1.Designer.cs
similarity index 83%
rename from server/FMS Dashboard/Models/DataModel.Designer.cs
rename to server/FMS Dashboard/Models/Model1.Designer.cs
index b58af12..a59cf83 100644
--- a/server/FMS Dashboard/Models/DataModel.Designer.cs
+++ b/server/FMS Dashboard/Models/Model1.Designer.cs
@@ -1,4 +1,4 @@
-// T4 code generation is enabled for model 'C:\Projects\.net\Transportation\FMS\server\FMS Dashboard\Models\DataModel.edmx'.
+// T4 code generation is enabled for model 'C:\Workspace\FMS\server\FMS Dashboard\Models\Model1.edmx'.
// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
// is open in the designer.
diff --git a/server/FMS Dashboard/Models/DataModel.cs b/server/FMS Dashboard/Models/Model1.cs
similarity index 100%
rename from server/FMS Dashboard/Models/DataModel.cs
rename to server/FMS Dashboard/Models/Model1.cs
diff --git a/server/FMS Dashboard/Models/Model1.edmx b/server/FMS Dashboard/Models/Model1.edmx
new file mode 100644
index 0000000..665cb8e
--- /dev/null
+++ b/server/FMS Dashboard/Models/Model1.edmx
@@ -0,0 +1,1320 @@
+
+
+
+