diff options
-rw-r--r-- | .idea/workspace.xml | 272 | ||||
-rw-r--r-- | app/Resources/views/default/index.html.twig | 2 | ||||
-rw-r--r-- | web/js/realtime.js | 80 |
3 files changed, 141 insertions, 213 deletions
diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 99597d9..2cf848a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,13 +2,7 @@ <project version="4"> <component name="ChangeListManager"> <list default="true" id="c02a68ca-4895-49ef-94e1-572ab8cf87ba" name="Default" comment=""> - <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/Resources/views/emails/registration.php" /> - <change type="DELETED" beforePath="$PROJECT_DIR$/app/config/parameters.yml.dist" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/php.xml" afterPath="$PROJECT_DIR$/.idea/php.xml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/pollution-sensor.iml" afterPath="$PROJECT_DIR$/.idea/pollution-sensor.iml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/config/config.yml" afterPath="$PROJECT_DIR$/app/config/config.yml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/AppBundle/Controller/NewDataController.php" afterPath="$PROJECT_DIR$/src/AppBundle/Controller/NewDataController.php" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/Resources/views/default/index.html.twig" afterPath="$PROJECT_DIR$/app/Resources/views/default/index.html.twig" /> </list> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="TRACKING_ENABLED" value="true" /> @@ -26,8 +20,8 @@ <file leaf-file-name="HomeController.php" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/HomeController.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="375"> - <caret line="32" column="0" lean-forward="false" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" /> + <state relative-caret-position="378"> + <caret line="33" column="8" lean-forward="false" selection-start-line="33" selection-start-column="8" selection-end-line="34" selection-end-column="80" /> <folding> <element signature="e#6#87#0#PHP" expanded="true" /> <element signature="e#122#181#0#PHP" expanded="true" /> @@ -39,8 +33,8 @@ <file leaf-file-name="NewDataController.php" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/NewDataController.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="795"> - <caret line="77" column="0" lean-forward="true" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" /> + <state relative-caret-position="446"> + <caret line="37" column="40" lean-forward="false" selection-start-line="37" selection-start-column="40" selection-end-line="37" selection-end-column="40" /> <folding> <element signature="e#6#87#0#PHP" expanded="true" /> <element signature="e#122#181#0#PHP" expanded="true" /> @@ -49,50 +43,20 @@ </provider> </entry> </file> - <file leaf-file-name="registration.php" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/app/Resources/views/emails/registration.php"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="45"> - <caret line="3" column="46" lean-forward="false" selection-start-line="3" selection-start-column="46" selection-end-line="3" selection-end-column="46" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="parameters.yml" pinned="false" current-in-tab="true"> - <entry file="file://$PROJECT_DIR$/app/config/parameters.yml"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="255"> - <caret line="17" column="50" lean-forward="false" selection-start-line="17" selection-start-column="50" selection-end-line="17" selection-end-column="50" /> - <folding /> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="config.yml" pinned="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/app/config/config.yml"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="-90"> - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="1" selection-end-column="34" /> - <folding /> - </state> - </provider> - </entry> - </file> <file leaf-file-name="index.html.twig" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/app/Resources/views/default/index.html.twig"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="165"> + <state relative-caret-position="198"> <caret line="11" column="28" lean-forward="false" selection-start-line="11" selection-start-column="28" selection-end-line="11" selection-end-column="28" /> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="realtime.js" pinned="false" current-in-tab="false"> + <file leaf-file-name="realtime.js" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/web/js/realtime.js"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="390"> + <state relative-caret-position="468"> <caret line="26" column="25" lean-forward="false" selection-start-line="26" selection-start-column="25" selection-end-line="26" selection-end-column="25" /> <folding /> </state> @@ -102,7 +66,7 @@ <file leaf-file-name="app.php" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/web/app.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="180"> + <state relative-caret-position="216"> <caret line="12" column="1" lean-forward="false" selection-start-line="12" selection-start-column="1" selection-end-line="12" selection-end-column="1" /> <folding /> </state> @@ -139,10 +103,8 @@ <option value="$PROJECT_DIR$/bin/console" /> <option value="$PROJECT_DIR$/src/AppBundle/Controller/NewData.php" /> <option value="$PROJECT_DIR$/app/Resources/views/default/index.html.twig" /> - <option value="$PROJECT_DIR$/web/js/realtime.js" /> - <option value="$PROJECT_DIR$/app/config/parameters.yml.dist" /> <option value="$PROJECT_DIR$/src/AppBundle/Controller/NewDataController.php" /> - <option value="$PROJECT_DIR$/app/Resources/views/emails/registration.php" /> + <option value="$PROJECT_DIR$/web/js/realtime.js" /> </list> </option> </component> @@ -152,7 +114,7 @@ <detection-done>true</detection-done> <sorting>DEFINITION_ORDER</sorting> </component> - <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" interpreter_name="PHP 7"> + <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true"> <include_path> <path value="$PROJECT_DIR$/vendor/doctrine/orm" /> <path value="$PROJECT_DIR$/vendor/doctrine/dbal" /> @@ -216,52 +178,38 @@ <foldersAlwaysOnTop value="true" /> </navigator> <panes> - <pane id="Scope" /> <pane id="ProjectPane"> <subPane> <expand> <path> - <item name="pollutometer" type="b2602c69:ProjectViewProjectNode" /> - <item name="pollutometer" type="2a2b976b:PhpTreeStructureProvider$1" /> + <item name="pollution-sensor" type="b2602c69:ProjectViewProjectNode" /> + <item name="pollution-sensor" type="2a2b976b:PhpTreeStructureProvider$1" /> </path> <path> - <item name="pollutometer" type="b2602c69:ProjectViewProjectNode" /> - <item name="pollutometer" type="2a2b976b:PhpTreeStructureProvider$1" /> + <item name="pollution-sensor" type="b2602c69:ProjectViewProjectNode" /> + <item name="pollution-sensor" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="app" type="2a2b976b:PhpTreeStructureProvider$1" /> </path> <path> - <item name="pollutometer" type="b2602c69:ProjectViewProjectNode" /> - <item name="pollutometer" type="2a2b976b:PhpTreeStructureProvider$1" /> + <item name="pollution-sensor" type="b2602c69:ProjectViewProjectNode" /> + <item name="pollution-sensor" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="app" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="config" type="2a2b976b:PhpTreeStructureProvider$1" /> </path> <path> - <item name="pollutometer" type="b2602c69:ProjectViewProjectNode" /> - <item name="pollutometer" type="2a2b976b:PhpTreeStructureProvider$1" /> - <item name="app" type="2a2b976b:PhpTreeStructureProvider$1" /> - <item name="Resources" type="2a2b976b:PhpTreeStructureProvider$1" /> - </path> - <path> - <item name="pollutometer" type="b2602c69:ProjectViewProjectNode" /> - <item name="pollutometer" type="2a2b976b:PhpTreeStructureProvider$1" /> - <item name="app" type="2a2b976b:PhpTreeStructureProvider$1" /> - <item name="Resources" type="2a2b976b:PhpTreeStructureProvider$1" /> - <item name="views" type="2a2b976b:PhpTreeStructureProvider$1" /> - </path> - <path> - <item name="pollutometer" type="b2602c69:ProjectViewProjectNode" /> - <item name="pollutometer" type="2a2b976b:PhpTreeStructureProvider$1" /> + <item name="pollution-sensor" type="b2602c69:ProjectViewProjectNode" /> + <item name="pollution-sensor" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="src" type="2a2b976b:PhpTreeStructureProvider$1" /> </path> <path> - <item name="pollutometer" type="b2602c69:ProjectViewProjectNode" /> - <item name="pollutometer" type="2a2b976b:PhpTreeStructureProvider$1" /> + <item name="pollution-sensor" type="b2602c69:ProjectViewProjectNode" /> + <item name="pollution-sensor" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="src" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="AppBundle" type="2a2b976b:PhpTreeStructureProvider$1" /> </path> <path> - <item name="pollutometer" type="b2602c69:ProjectViewProjectNode" /> - <item name="pollutometer" type="2a2b976b:PhpTreeStructureProvider$1" /> + <item name="pollution-sensor" type="b2602c69:ProjectViewProjectNode" /> + <item name="pollution-sensor" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="src" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="AppBundle" type="2a2b976b:PhpTreeStructureProvider$1" /> <item name="Controller" type="2a2b976b:PhpTreeStructureProvider$1" /> @@ -271,12 +219,13 @@ </subPane> </pane> <pane id="Scratches" /> + <pane id="Scope" /> </panes> </component> <component name="PropertiesComponent"> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" /> - <property name="settings.editor.selected.configurable" value="reference.webide.settings.project.settings.php" /> + <property name="settings.editor.selected.configurable" value="Symfony2.SettingsForm" /> </component> <component name="RunDashboard"> <option name="ruleStates"> @@ -314,29 +263,27 @@ <workItem from="1511347081605" duration="1264000" /> <workItem from="1511428524892" duration="6187000" /> <workItem from="1511512197156" duration="4678000" /> - <workItem from="1511785199965" duration="2001000" /> - <workItem from="1512036482812" duration="1293000" /> </task> <servers /> </component> <component name="TimeTrackingManager"> - <option name="totallyTimeSpent" value="16150000" /> + <option name="totallyTimeSpent" value="12856000" /> </component> <component name="ToolWindowManager"> - <frame x="293" y="47" width="1366" height="741" extended-state="6" /> + <frame x="67" y="25" width="1853" height="925" extended-state="6" /> <editor active="true" /> <layout> - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.12884334" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.12898003" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39968404" sideWeight="0.5036573" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> - <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32917318" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> + <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25429016" sideWeight="0.4848485" order="7" side_tool="false" content_ui="tabs" /> - <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> + <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25458997" sideWeight="0.4848485" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39968404" sideWeight="0.49634275" order="3" side_tool="false" content_ui="tabs" /> + <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> @@ -361,98 +308,6 @@ <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/HomeController.php"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - <folding> - <element signature="e#6#87#0#PHP" expanded="true" /> - <element signature="e#122#181#0#PHP" expanded="true" /> - </folding> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/NewDataController.php"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="585"> - <caret line="46" column="0" lean-forward="true" selection-start-line="46" selection-start-column="0" selection-end-line="46" selection-end-column="0" /> - <folding> - <element signature="e#6#87#0#PHP" expanded="true" /> - <element signature="e#122#181#0#PHP" expanded="true" /> - </folding> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/app/Resources/views/default/index.html.twig"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="165"> - <caret line="11" column="28" lean-forward="false" selection-start-line="11" selection-start-column="28" selection-end-line="11" selection-end-column="28" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/web/js/realtime.js"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="390"> - <caret line="26" column="25" lean-forward="false" selection-start-line="26" selection-start-column="25" selection-end-line="26" selection-end-column="25" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/web/app.php"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="180"> - <caret line="12" column="1" lean-forward="false" selection-start-line="12" selection-start-column="1" selection-end-line="12" selection-end-column="1" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/HomeController.php"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="390"> - <caret line="33" column="8" lean-forward="false" selection-start-line="33" selection-start-column="8" selection-end-line="34" selection-end-column="80" /> - <folding> - <element signature="e#6#87#0#PHP" expanded="true" /> - <element signature="e#122#181#0#PHP" expanded="true" /> - </folding> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/NewDataController.php"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="450"> - <caret line="37" column="40" lean-forward="false" selection-start-line="37" selection-start-column="40" selection-end-line="37" selection-end-column="40" /> - <folding> - <element signature="e#6#87#0#PHP" expanded="true" /> - <element signature="e#122#181#0#PHP" expanded="true" /> - </folding> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/app/Resources/views/default/index.html.twig"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="165"> - <caret line="11" column="28" lean-forward="false" selection-start-line="11" selection-start-column="28" selection-end-line="11" selection-end-column="28" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/web/app.php"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="180"> - <caret line="12" column="1" lean-forward="false" selection-start-line="12" selection-start-column="1" selection-end-line="12" selection-end-column="1" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/web/js/realtime.js"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="390"> - <caret line="26" column="25" lean-forward="false" selection-start-line="26" selection-start-column="25" selection-end-line="26" selection-end-column="25" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/HomeController.php"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="0"> <caret line="0" column="5" lean-forward="true" selection-start-line="0" selection-start-column="5" selection-end-line="0" selection-end-column="5" /> <folding> <element signature="e#6#87#0#PHP" expanded="true" /> @@ -473,6 +328,7 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="18"> <caret line="1" column="13" lean-forward="false" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" /> + <folding /> </state> </provider> </entry> @@ -488,6 +344,7 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + <folding /> </state> </provider> </entry> @@ -495,6 +352,7 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + <folding /> </state> </provider> </entry> @@ -502,6 +360,7 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + <folding /> </state> </provider> </entry> @@ -509,6 +368,7 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="18"> <caret line="1" column="13" lean-forward="false" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" /> + <folding /> </state> </provider> </entry> @@ -538,6 +398,7 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="270"> <caret line="15" column="95" lean-forward="true" selection-start-line="15" selection-start-column="95" selection-end-line="15" selection-end-column="95" /> + <folding /> </state> </provider> </entry> @@ -545,6 +406,7 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="288"> <caret line="16" column="13" lean-forward="true" selection-start-line="16" selection-start-column="13" selection-end-line="16" selection-end-column="13" /> + <folding /> </state> </provider> </entry> @@ -552,20 +414,29 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="144"> <caret line="10" column="14" lean-forward="true" selection-start-line="10" selection-start-column="14" selection-end-line="10" selection-end-column="14" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/.web-server-pid"> + <provider selected="true" editor-type-id="text-editor"> + <state relative-caret-position="0"> + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/.web-server-pid" /> <entry file="file://$PROJECT_DIR$/app/Resources/views/base.html.twig"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="180"> <caret line="10" column="25" lean-forward="false" selection-start-line="10" selection-start-column="25" selection-end-line="10" selection-end-column="25" /> + <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/web/app.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="180"> + <state relative-caret-position="216"> <caret line="12" column="1" lean-forward="false" selection-start-line="12" selection-start-column="1" selection-end-line="12" selection-end-column="1" /> <folding /> </state> @@ -583,29 +454,14 @@ <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="-184"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/app/Resources/views/default/index.html.twig"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="165"> - <caret line="11" column="28" lean-forward="false" selection-start-line="11" selection-start-column="28" selection-end-line="11" selection-end-column="28" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/web/js/realtime.js"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="390"> - <caret line="26" column="25" lean-forward="false" selection-start-line="26" selection-start-column="25" selection-end-line="26" selection-end-column="25" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/HomeController.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="375"> - <caret line="32" column="0" lean-forward="false" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" /> + <state relative-caret-position="378"> + <caret line="33" column="8" lean-forward="false" selection-start-line="33" selection-start-column="8" selection-end-line="34" selection-end-column="80" /> <folding> <element signature="e#6#87#0#PHP" expanded="true" /> <element signature="e#122#181#0#PHP" expanded="true" /> @@ -615,8 +471,8 @@ </entry> <entry file="file://$PROJECT_DIR$/src/AppBundle/Controller/NewDataController.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="795"> - <caret line="77" column="0" lean-forward="true" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" /> + <state relative-caret-position="446"> + <caret line="37" column="40" lean-forward="false" selection-start-line="37" selection-start-column="40" selection-end-line="37" selection-end-column="40" /> <folding> <element signature="e#6#87#0#PHP" expanded="true" /> <element signature="e#122#181#0#PHP" expanded="true" /> @@ -624,26 +480,18 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/app/Resources/views/emails/registration.php"> - <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="45"> - <caret line="3" column="46" lean-forward="false" selection-start-line="3" selection-start-column="46" selection-end-line="3" selection-end-column="46" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/app/config/config.yml"> + <entry file="file://$PROJECT_DIR$/app/Resources/views/default/index.html.twig"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="-90"> - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="1" selection-end-column="34" /> + <state relative-caret-position="198"> + <caret line="11" column="28" lean-forward="false" selection-start-line="11" selection-start-column="28" selection-end-line="11" selection-end-column="28" /> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/app/config/parameters.yml"> + <entry file="file://$PROJECT_DIR$/web/js/realtime.js"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="255"> - <caret line="17" column="50" lean-forward="false" selection-start-line="17" selection-start-column="50" selection-end-line="17" selection-end-column="50" /> + <state relative-caret-position="468"> + <caret line="26" column="25" lean-forward="false" selection-start-line="26" selection-start-column="25" selection-end-line="26" selection-end-column="25" /> <folding /> </state> </provider> diff --git a/app/Resources/views/default/index.html.twig b/app/Resources/views/default/index.html.twig index 36180cb..1ec4bd6 100644 --- a/app/Resources/views/default/index.html.twig +++ b/app/Resources/views/default/index.html.twig @@ -17,6 +17,8 @@ </tr> </table> </div> + <p id="aq"></p> + <img src="https://www.ourair.org/wp-content/uploads/AQItable.gif"> {% endblock %} {% block javascripts %} <script src="{{ asset('js/realtime.js') }}"></script> diff --git a/web/js/realtime.js b/web/js/realtime.js index 4526e5e..27cb25c 100644 --- a/web/js/realtime.js +++ b/web/js/realtime.js @@ -1,3 +1,56 @@ +function arrayMax(arr) { + var len = arr.length, max = -Infinity; + while (len--) { + if (arr[len] > max) { + max = arr[len]; + } + } + return max; +}; + + +const table = { + Co: { + breakpoints: [0, 4.4, 4.5, 9.4, 9.5, 12.4, 12.5, 15.4, 15.5, 30.4, 30.5, 40.4, 40.5, 50.4], + aq: [0, 50, 51, 100, 101, 150, 151, 200, 201, 300, 301, 400, 401, 500] + }, + So: { + breakpoints: [0.000, 0.034, 0.035, 0.144, 0.145, 0.224, 0.225, 0.304, 0.305, 0.604, 0.605, 0.804, 0.805, 1.004], + aq:[0, 50, 51, 100, 101, 150, 151, 200, 201, 300, 301, 400, 401, 500] + }, + No: { + breakpoints: [0.65, 1.24, 1.25, 1.64, 1.65, 2.04], + aq:[201, 300, 301, 400, 401, 500] + } +}; + + +function calculateAQI(gasName, concentration) { + var bpLow,bpHi; + var bpLowIndex, bpHiIndex; + + table[gasName].breakpoints.forEach(function(value, index) { + if(value < concentration && table[gasName].breakpoints[index + 1] > concentration) { + bpLow = value; + bpLowIndex = index; + } + + if(value > concentration && table[gasName].breakpoints[index - 1] < concentration) { + bpHi = value; + bpHiIndex = index; + } + + }); + + + + var airQualityIndex = ((table[gasName].aq[bpHiIndex] - table[gasName].aq[bpLowIndex]) / (bpHi - bpLow)) * (concentration - bpLow) + table[gasName].aq[bpLowIndex]; + + return airQualityIndex; + +} + + function update() { var data; @@ -14,6 +67,18 @@ function update() { table[2].textContent = data.No; table[3].textContent = data.So; + var indexes = []; + var CO = isNaN(calculateAQI("Co", data.Co)) ? 0 : calculateAQI("Co", data.Co); + var SO = isNaN(calculateAQI("So", data.So)) ? 0 : calculateAQI("So", data.So); + var NO = isNaN(calculateAQI("No", data.No)) ? 0 : calculateAQI("No", data.No); + indexes.push(CO); + indexes.push(NO); + indexes.push(SO); + + var max = arrayMax(indexes); + + document.querySelector("#aq").innerHTML = `The current air quality index is <strong>${max}</strong>`; + }) .catch(function(error) { console.log(error); @@ -24,4 +89,17 @@ function update() { } -setInterval(update, 60000); +setInterval(update, 10000); + + + + + + + + + + + + + |