add map to index.html
This commit is contained in:
parent
c663a9fb44
commit
f485846d75
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/../../../../../../:\Users\Frank\Desktop\gyrogpsc\.idea/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
6
.idea/misc.xml
generated
Normal file
6
.idea/misc.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/vcs.xml
generated
2
.idea/vcs.xml
generated
@ -2,6 +2,6 @@
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/serial/SparkFun_Ublox_Arduino_Library" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/serial/SparkFun_Ublox_Arduino_Library" vcs="" />
|
||||
</component>
|
||||
</project>
|
||||
136
.idea/workspace.xml
generated
136
.idea/workspace.xml
generated
@ -23,9 +23,10 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="99c957e4-aa42-481d-843d-3fbc901e0f79" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/serial/serial.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dispatcher/dispatcher.go" beforeDir="false" afterPath="$PROJECT_DIR$/dispatcher/dispatcher.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/index.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/server.go" beforeDir="false" afterPath="$PROJECT_DIR$/server.go" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -37,10 +38,14 @@
|
||||
<list>
|
||||
<option value="Go File" />
|
||||
<option value="Go Application" />
|
||||
<option value="HTML File" />
|
||||
<option value="tsconfig.json" />
|
||||
<option value="JavaScript File" />
|
||||
<option value="CSS File" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="GOROOT" path="/usr/local/Cellar/go/1.15.2/libexec" />
|
||||
<component name="GOROOT" path="C:\Go" />
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
@ -57,25 +62,48 @@
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="DefaultGoTemplateProperty" value="Go Application" />
|
||||
<property name="DefaultHtmlFileTemplate" value="HTML File" />
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="aspect.path.notification.shown" value="true" />
|
||||
<property name="configurable.Global.GOPATH.is.expanded" value="true" />
|
||||
<property name="configurable.Module.GOPATH.is.expanded" value="true" />
|
||||
<property name="configurable.Project.GOPATH.is.expanded" value="true" />
|
||||
<property name="do.not.suggest.installing.go.template.plugin" value="true" />
|
||||
<property name="go.import.settings.migrated" value="true" />
|
||||
<property name="go.sdk.automatically.set" value="true" />
|
||||
<property name="go.tried.to.enable.integration.vgo.integrator" value="true" />
|
||||
<property name="last_opened_file_path" value="$USER_HOME$" />
|
||||
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="list.type.of.created.stylesheet" value="CSS" />
|
||||
<property name="nodejs_package_manager_path" value="npm" />
|
||||
<property name="project.structure.last.edited" value="SDKs" />
|
||||
<property name="project.structure.proportion" value="0.0" />
|
||||
<property name="project.structure.side.proportion" value="0.2" />
|
||||
<property name="settings.editor.selected.configurable" value="project.propVCSSupport.Mappings" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\Frank\Desktop\gyrogpsc" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\Frank\Desktop\gyrogpsc\scripts" />
|
||||
<recent name="$PROJECT_DIR$/serial" />
|
||||
<recent name="$PROJECT_DIR$/internal" />
|
||||
<recent name="$PROJECT_DIR$" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="Go Build.go build server.go">
|
||||
<component name="RunManager" selected="JavaScript Debug.index.html">
|
||||
<configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
|
||||
<option name="arquillianRunConfiguration">
|
||||
<value>
|
||||
<option name="containerStateName" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="TEST_OBJECT" value="class" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="go build git.timovolkmann.de/gyrogpsc/serial" type="GoApplicationRunConfiguration" factoryName="Go Application" temporary="true" nameIsGenerated="true">
|
||||
<module name="gyrogpsc" />
|
||||
<working_directory value="$PROJECT_DIR$" />
|
||||
@ -93,12 +121,16 @@
|
||||
<directory value="$PROJECT_DIR$" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="Index1.html" type="JavascriptDebugType" temporary="true" nameIsGenerated="true" uri="http://localhost:63342/gyrogpsc/Index1.html" useBuiltInWebServerPort="true">
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="index.html" type="JavascriptDebugType" temporary="true" nameIsGenerated="true" uri="http://localhost:63342/gyrogpsc/index.html" useBuiltInWebServerPort="true">
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Go Build.go build server.go" />
|
||||
<item itemvalue="Go Build.go build git.timovolkmann.de/gyrogpsc/serial" />
|
||||
<item itemvalue="Go Build.go build server.go" />
|
||||
<item itemvalue="Go Build.go build git.timovolkmann.de/gyrogpsc/serial" />
|
||||
<item itemvalue="JavaScript Debug.index.html" />
|
||||
<item itemvalue="JavaScript Debug.Index1.html" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
@ -110,6 +142,17 @@
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1604516509922</updated>
|
||||
<workItem from="1605965847327" duration="11662000" />
|
||||
<workItem from="1606044185979" duration="4005000" />
|
||||
<workItem from="1606053101693" duration="960000" />
|
||||
<workItem from="1606135716210" duration="1075000" />
|
||||
<workItem from="1606211187573" duration="606000" />
|
||||
<workItem from="1606219930566" duration="4295000" />
|
||||
<workItem from="1606228717842" duration="801000" />
|
||||
<workItem from="1606230349867" duration="43000" />
|
||||
<workItem from="1606230402424" duration="7000" />
|
||||
<workItem from="1606234182736" duration="2404000" />
|
||||
<workItem from="1606292037599" duration="5100000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="initial working version">
|
||||
<created>1604747925521</created>
|
||||
@ -188,10 +231,22 @@
|
||||
<integration-enabled>true</integration-enabled>
|
||||
</component>
|
||||
<component name="WindowStateProjectService">
|
||||
<state x="752" y="178" key="#GOPATH" timestamp="1606230327112">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="752" y="178" key="#GOPATH/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1606230327112" />
|
||||
<state x="752" y="451" key="#GOROOT" timestamp="1606222796097">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="752" y="451" key="#GOROOT/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1606222796097" />
|
||||
<state x="640" y="377" key="#Go_Modules" timestamp="1604584628285">
|
||||
<screen x="0" y="23" width="1680" height="1027" />
|
||||
</state>
|
||||
<state x="640" y="377" key="#Go_Modules/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604584628285" />
|
||||
<state x="711" y="322" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1606045015443">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="711" y="322" key="#com.intellij.fileTypes.FileTypeChooser/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1606045015443" />
|
||||
<state x="603" y="247" key="#xdebugger.evaluate" timestamp="1604750409547">
|
||||
<screen x="0" y="23" width="1680" height="1027" />
|
||||
</state>
|
||||
@ -220,65 +275,90 @@
|
||||
<screen x="0" y="23" width="1680" height="1027" />
|
||||
</state>
|
||||
<state width="1638" height="346" key="GridCell.Tab.-1.right/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604750445987" />
|
||||
<state width="1638" height="330" key="GridCell.Tab.0.bottom" timestamp="1605641533913">
|
||||
<screen x="0" y="23" width="1920" height="1177" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.0.bottom" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.bottom/0.-1417.2560.1417/0.23.1680.1027@0.-1417.2560.1417" timestamp="1604948042531" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.0.bottom/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.bottom/0.23.1680.1027/0.-1417.2560.1417@0.-1417.2560.1417" timestamp="1604913985770" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.bottom/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604760252890" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.bottom/0.23.1680.1027@0.23.1680.1027" timestamp="1604933111805" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.bottom/0.23.1920.1116@0.23.1920.1116" timestamp="1605380018474" />
|
||||
<state width="1638" height="330" key="GridCell.Tab.0.bottom/0.23.1920.1177/0.-1417.2560.1417@0.23.1920.1177" timestamp="1605641533913" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.bottom/0.23.1920.1177@0.23.1920.1177" timestamp="1605533225921" />
|
||||
<state width="1638" height="330" key="GridCell.Tab.0.center" timestamp="1605641533912">
|
||||
<screen x="0" y="23" width="1920" height="1177" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.0.center" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.center/0.-1417.2560.1417/0.23.1680.1027@0.-1417.2560.1417" timestamp="1604948042530" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.0.center/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.center/0.23.1680.1027/0.-1417.2560.1417@0.-1417.2560.1417" timestamp="1604913985769" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.center/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604760252890" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.center/0.23.1680.1027@0.23.1680.1027" timestamp="1604933111805" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.center/0.23.1920.1116@0.23.1920.1116" timestamp="1605380018473" />
|
||||
<state width="1638" height="330" key="GridCell.Tab.0.center/0.23.1920.1177/0.-1417.2560.1417@0.23.1920.1177" timestamp="1605641533912" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.center/0.23.1920.1177@0.23.1920.1177" timestamp="1605533225920" />
|
||||
<state width="1638" height="330" key="GridCell.Tab.0.left" timestamp="1605641533911">
|
||||
<screen x="0" y="23" width="1920" height="1177" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.0.left" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.left/0.-1417.2560.1417/0.23.1680.1027@0.-1417.2560.1417" timestamp="1604948042530" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.0.left/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.left/0.23.1680.1027/0.-1417.2560.1417@0.-1417.2560.1417" timestamp="1604913985768" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.left/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604760252889" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.left/0.23.1680.1027@0.23.1680.1027" timestamp="1604933111805" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.left/0.23.1920.1116@0.23.1920.1116" timestamp="1605380018472" />
|
||||
<state width="1638" height="330" key="GridCell.Tab.0.left/0.23.1920.1177/0.-1417.2560.1417@0.23.1920.1177" timestamp="1605641533911" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.left/0.23.1920.1177@0.23.1920.1177" timestamp="1605533225919" />
|
||||
<state width="1638" height="330" key="GridCell.Tab.0.right" timestamp="1605641533912">
|
||||
<screen x="0" y="23" width="1920" height="1177" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.0.right" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.right/0.-1417.2560.1417/0.23.1680.1027@0.-1417.2560.1417" timestamp="1604948042531" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.0.right/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.right/0.23.1680.1027/0.-1417.2560.1417@0.-1417.2560.1417" timestamp="1604913985770" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.right/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604760252890" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.right/0.23.1680.1027@0.23.1680.1027" timestamp="1604933111805" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.right/0.23.1920.1116@0.23.1920.1116" timestamp="1605380018473" />
|
||||
<state width="1638" height="330" key="GridCell.Tab.0.right/0.23.1920.1177/0.-1417.2560.1417@0.23.1920.1177" timestamp="1605641533912" />
|
||||
<state width="1638" height="273" key="GridCell.Tab.0.right/0.23.1920.1177@0.23.1920.1177" timestamp="1605533225920" />
|
||||
<state width="1638" height="346" key="GridCell.Tab.1.bottom" timestamp="1604750442086">
|
||||
<screen x="0" y="23" width="1680" height="1027" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.1.bottom" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="348" key="GridCell.Tab.1.bottom/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1638" height="346" key="GridCell.Tab.1.bottom/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604750442086" />
|
||||
<state width="1638" height="346" key="GridCell.Tab.1.center" timestamp="1604750442085">
|
||||
<screen x="0" y="23" width="1680" height="1027" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.1.center" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="348" key="GridCell.Tab.1.center/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1638" height="346" key="GridCell.Tab.1.center/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604750442085" />
|
||||
<state width="1638" height="346" key="GridCell.Tab.1.left" timestamp="1604750442085">
|
||||
<screen x="0" y="23" width="1680" height="1027" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.1.left" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="348" key="GridCell.Tab.1.left/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1638" height="346" key="GridCell.Tab.1.left/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604750442085" />
|
||||
<state width="1638" height="346" key="GridCell.Tab.1.right" timestamp="1604750442085">
|
||||
<screen x="0" y="23" width="1680" height="1027" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.1.right" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="348" key="GridCell.Tab.1.right/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1638" height="346" key="GridCell.Tab.1.right/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604750442085" />
|
||||
<state x="204" y="155" width="1501" height="766" key="SettingsEditor" timestamp="1605609479939">
|
||||
<screen x="0" y="23" width="1920" height="1177" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.2.bottom" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="348" key="GridCell.Tab.2.bottom/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.2.center" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="348" key="GridCell.Tab.2.center/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.2.left" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="348" key="GridCell.Tab.2.left/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state width="1877" height="348" key="GridCell.Tab.2.right" timestamp="1605997889830">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="348" key="GridCell.Tab.2.right/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1605997889830" />
|
||||
<state x="204" y="117" width="1501" height="708" key="SettingsEditor" timestamp="1606230389423">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="204" y="117" width="1501" height="708" key="SettingsEditor/0.0.1920.1040/-1440.113.1440.860@0.0.1920.1040" timestamp="1606230389423" />
|
||||
<state x="179" y="138" width="1501" height="766" key="SettingsEditor/0.23.1680.1027/0.-1417.2560.1417@0.23.1680.1027" timestamp="1604757277174" />
|
||||
<state x="204" y="155" key="SettingsEditor/0.23.1920.1177/0.-1417.2560.1417@0.23.1920.1177" timestamp="1605609479939" />
|
||||
<state width="840" height="513" key="XDebugger.FullValuePopup" timestamp="1604750505120">
|
||||
|
||||
144
index.html
144
index.html
@ -3,89 +3,14 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.bundle.js"></script>
|
||||
<script>
|
||||
const GRAPH_RES = 100;
|
||||
var dataSmartphone = [];
|
||||
window.addEventListener("load", function(evt) {
|
||||
var orientation = [0,0,0];
|
||||
var multiplier = 180/Math.PI/15
|
||||
var output = document.getElementById("output");
|
||||
var input = document.getElementById("input");
|
||||
var ws;
|
||||
var print = function(message) {
|
||||
var d = document.createElement("div");
|
||||
d.textContent = message;
|
||||
output.appendChild(d);
|
||||
};
|
||||
var print2 = function(message) {
|
||||
var d = document.createElement("p");
|
||||
d.innerText = message;
|
||||
oldNode = output.firstChild
|
||||
output.replaceChild(d, oldNode)
|
||||
};
|
||||
document.getElementById("open").onclick = function(evt) {
|
||||
if (ws && ws.OPEN) {
|
||||
print("Websocket already open")
|
||||
return false;
|
||||
}
|
||||
ws = new WebSocket("{{.}}");
|
||||
ws.onopen = function(evt) {
|
||||
print("OPEN");
|
||||
}
|
||||
ws.onclose = function(evt) {
|
||||
ws = null;
|
||||
print2("CLOSE");
|
||||
}
|
||||
ws.onmessage = function(evt) {
|
||||
//print2("RESPONSE: " + evt.data);
|
||||
dataSmartphone.push(evt.data)
|
||||
// let dat = JSON.parse(evt.data)["bmi26x gyroscope"]
|
||||
// let dat = JSON.parse(evt.data)["lsm6dsm gyroscope"]
|
||||
//let dat = JSON.parse(evt.data)["lsm6ds3c gyroscope"]
|
||||
let dat = JSON.parse(evt.data)
|
||||
//console.log(dat)
|
||||
//console.log(dat.orientation)
|
||||
document.getElementById("gyroscope").style.transform = `rotateX(${-((dat.orientation[1]+90)%360)}deg) rotateY(${dat.orientation[0]}deg) rotateZ(${-dat.orientation[2]}deg)`
|
||||
|
||||
|
||||
/*
|
||||
console.log(dat)
|
||||
orientation[0] += dat[0] * multiplier
|
||||
orientation[1] += dat[1] * multiplier
|
||||
orientation[2] += dat[2] * multiplier
|
||||
// dataset.push(orientation[0])
|
||||
// while (dataset.length >= 50) {
|
||||
// dataset.shift();
|
||||
// }
|
||||
// addData(orientation[0] / multiplier)
|
||||
*/
|
||||
addData(dat.orientation[0])
|
||||
// addData(dat[0])
|
||||
//document.getElementById("gyroscope").style.transform = `rotateX(${-orientation[0]}deg) rotateY(${orientation[1]}deg) rotateZ(${-orientation[2]}deg) translateZ(50px)`
|
||||
}
|
||||
ws.onerror = function(evt) {
|
||||
print("ERROR: " + evt.data);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
document.getElementById("send").onclick = function(evt) {
|
||||
if (!ws) {
|
||||
return false;
|
||||
}
|
||||
print("SEND: " + input.value);
|
||||
ws.send(input.value);
|
||||
return false;
|
||||
};
|
||||
document.getElementById("close").onclick = function(evt) {
|
||||
if (!ws) {
|
||||
return false;
|
||||
}
|
||||
ws.close();
|
||||
return false;
|
||||
};
|
||||
});
|
||||
|
||||
</script>
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
|
||||
<script src="https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.js"></script>
|
||||
<link href="https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.css" rel="stylesheet" />
|
||||
<style>
|
||||
body { margin: 0; padding: 0; }
|
||||
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
|
||||
</style>
|
||||
<script src="scripts/websocket.js"></script>
|
||||
<style>
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
@ -162,6 +87,12 @@
|
||||
<button id="send">Send</button>
|
||||
</p>
|
||||
</form>
|
||||
<div class="scene" style='width: 600px; height: 400px;'>
|
||||
<div id="map" style='width: 600px; height: 400px;'></div>
|
||||
</div>
|
||||
|
||||
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
|
||||
<script src="scripts/map.js"></script>
|
||||
<div class="scene">
|
||||
<div id="gyroscope" class="cube">
|
||||
<div class="cube__face cube__face--front">front</div>
|
||||
@ -175,51 +106,8 @@
|
||||
<div style="width: 600px; height: 400px;">
|
||||
<canvas id="myChart" width="400" height="200"></canvas>
|
||||
</div>
|
||||
<script>
|
||||
var ctx = document.getElementById('myChart').getContext('2d');
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: new Array(GRAPH_RES),
|
||||
datasets: [{
|
||||
label: 'Z',
|
||||
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
||||
borderColor: 'rgba(255, 99, 132, 1)',
|
||||
borderWidth: 1,
|
||||
pointRadius: 0,
|
||||
lineTension: 0.5,
|
||||
data: new Array(GRAPH_RES)
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
// beginAtZero: true
|
||||
min: -100,
|
||||
max: 100
|
||||
}
|
||||
}]
|
||||
},
|
||||
animation: {
|
||||
duration: 0
|
||||
}
|
||||
}
|
||||
});
|
||||
myChart.data.labels.fill("", 0, GRAPH_RES);
|
||||
myChart.data.datasets.forEach((dataset) => dataset.data.fill(0, 0, GRAPH_RES))
|
||||
function addData(data) {
|
||||
myChart.data.labels.push("");
|
||||
myChart.data.datasets.forEach((dataset) => {
|
||||
dataset.data.push(data);
|
||||
});
|
||||
while (myChart.data.labels.length >= GRAPH_RES) {
|
||||
myChart.data.labels.shift();
|
||||
myChart.data.datasets.forEach((dataset) => dataset.data.shift())
|
||||
}
|
||||
myChart.update();
|
||||
};
|
||||
</script>
|
||||
<script src="scripts/chart.js"></script>
|
||||
|
||||
</td>
|
||||
<td valign="top" width="50%">
|
||||
<div id="output"></div>
|
||||
|
||||
43
scripts/chart.js
Normal file
43
scripts/chart.js
Normal file
@ -0,0 +1,43 @@
|
||||
var ctx = document.getElementById('myChart').getContext('2d');
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: new Array(GRAPH_RES),
|
||||
datasets: [{
|
||||
label: 'Z',
|
||||
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
||||
borderColor: 'rgba(255, 99, 132, 1)',
|
||||
borderWidth: 1,
|
||||
pointRadius: 0,
|
||||
lineTension: 0.5,
|
||||
data: new Array(GRAPH_RES)
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
// beginAtZero: true
|
||||
min: -100,
|
||||
max: 100
|
||||
}
|
||||
}]
|
||||
},
|
||||
animation: {
|
||||
duration: 0
|
||||
}
|
||||
}
|
||||
});
|
||||
myChart.data.labels.fill("", 0, GRAPH_RES);
|
||||
myChart.data.datasets.forEach((dataset) => dataset.data.fill(0, 0, GRAPH_RES))
|
||||
function addData(data) {
|
||||
myChart.data.labels.push("");
|
||||
myChart.data.datasets.forEach((dataset) => {
|
||||
dataset.data.push(data);
|
||||
});
|
||||
while (myChart.data.labels.length >= GRAPH_RES) {
|
||||
myChart.data.labels.shift();
|
||||
myChart.data.datasets.forEach((dataset) => dataset.data.shift())
|
||||
}
|
||||
myChart.update();
|
||||
};
|
||||
15969
scripts/hike.geo.json
Normal file
15969
scripts/hike.geo.json
Normal file
File diff suppressed because it is too large
Load Diff
56
scripts/map.js
Normal file
56
scripts/map.js
Normal file
@ -0,0 +1,56 @@
|
||||
mapboxgl.accessToken = 'pk.eyJ1IjoiZmhlcmtvbW0iLCJhIjoiY2tobm81bXppMGVuNzMyazY3eDU0M2dyaSJ9.qWJrwtv7KitW60pzs6h3Gg';
|
||||
var map = new mapboxgl.Map({
|
||||
container: 'map',
|
||||
style: 'mapbox://styles/mapbox/streets-v11',
|
||||
zoom: 0
|
||||
});
|
||||
|
||||
map.on('load', function () {
|
||||
// We use D3 to fetch the JSON here so that we can parse and use it separately
|
||||
// from GL JS's use in the added source. You can use any request method (library
|
||||
// or otherwise) that you want.
|
||||
d3.json(
|
||||
'scripts/hike.geo.json',
|
||||
function (err, data) {
|
||||
if (err) throw err;
|
||||
|
||||
// save full coordinate list for later
|
||||
var coordinates = data.features[0].geometry.coordinates;
|
||||
|
||||
// start by showing just the first coordinate
|
||||
data.features[0].geometry.coordinates = [coordinates[0]];
|
||||
|
||||
// add it to the map
|
||||
map.addSource('trace', { type: 'geojson', data: data });
|
||||
map.addLayer({
|
||||
'id': 'trace',
|
||||
'type': 'line',
|
||||
'source': 'trace',
|
||||
'paint': {
|
||||
'line-color': 'yellow',
|
||||
'line-opacity': 0.75,
|
||||
'line-width': 5
|
||||
}
|
||||
});
|
||||
|
||||
// setup the viewport
|
||||
map.jumpTo({ 'center': coordinates[0], 'zoom': 15 });
|
||||
map.setPitch(30);
|
||||
|
||||
// on a regular basis, add more coordinates from the saved list and update the map
|
||||
var i = 0;
|
||||
var timer = window.setInterval(function () {
|
||||
if (i < coordinates.length) {
|
||||
data.features[0].geometry.coordinates.push(
|
||||
coordinates[i]
|
||||
);
|
||||
map.getSource('trace').setData(data);
|
||||
map.panTo(coordinates[i]);
|
||||
i++;
|
||||
} else {
|
||||
window.clearInterval(timer);
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
);
|
||||
})
|
||||
80
scripts/websocket.js
Normal file
80
scripts/websocket.js
Normal file
@ -0,0 +1,80 @@
|
||||
const GRAPH_RES = 100;
|
||||
var dataSmartphone = [];
|
||||
window.addEventListener("load", function(evt) {
|
||||
var orientation = [0,0,0];
|
||||
var multiplier = 180/Math.PI/15
|
||||
var output = document.getElementById("output");
|
||||
var input = document.getElementById("input");
|
||||
var ws;
|
||||
var print = function(message) {
|
||||
var d = document.createElement("div");
|
||||
d.textContent = message;
|
||||
output.appendChild(d);
|
||||
};
|
||||
var print2 = function(message) {
|
||||
var d = document.createElement("p");
|
||||
d.innerText = message;
|
||||
oldNode = output.firstChild
|
||||
output.replaceChild(d, oldNode)
|
||||
};
|
||||
document.getElementById("open").onclick = function(evt) {
|
||||
if (ws && ws.OPEN) {
|
||||
print("Websocket already open")
|
||||
return false;
|
||||
}
|
||||
ws = new WebSocket("{{.}}");
|
||||
ws.onopen = function(evt) {
|
||||
print("OPEN");
|
||||
}
|
||||
ws.onclose = function(evt) {
|
||||
ws = null;
|
||||
print2("CLOSE");
|
||||
}
|
||||
ws.onmessage = function(evt) {
|
||||
//print2("RESPONSE: " + evt.data);
|
||||
dataSmartphone.push(evt.data)
|
||||
// let dat = JSON.parse(evt.data)["bmi26x gyroscope"]
|
||||
// let dat = JSON.parse(evt.data)["lsm6dsm gyroscope"]
|
||||
//let dat = JSON.parse(evt.data)["lsm6ds3c gyroscope"]
|
||||
let dat = JSON.parse(evt.data)
|
||||
//console.log(dat)
|
||||
//console.log(dat.orientation)
|
||||
document.getElementById("gyroscope").style.transform = `rotateX(${-((dat.orientation[1]+90)%360)}deg) rotateY(${dat.orientation[0]}deg) rotateZ(${-dat.orientation[2]}deg)`
|
||||
|
||||
|
||||
/*
|
||||
console.log(dat)
|
||||
orientation[0] += dat[0] * multiplier
|
||||
orientation[1] += dat[1] * multiplier
|
||||
orientation[2] += dat[2] * multiplier
|
||||
// dataset.push(orientation[0])
|
||||
// while (dataset.length >= 50) {
|
||||
// dataset.shift();
|
||||
// }
|
||||
// addData(orientation[0] / multiplier)
|
||||
*/
|
||||
addData(dat.orientation[0])
|
||||
// addData(dat[0])
|
||||
//document.getElementById("gyroscope").style.transform = `rotateX(${-orientation[0]}deg) rotateY(${orientation[1]}deg) rotateZ(${-orientation[2]}deg) translateZ(50px)`
|
||||
}
|
||||
ws.onerror = function(evt) {
|
||||
print("ERROR: " + evt.data);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
document.getElementById("send").onclick = function(evt) {
|
||||
if (!ws) {
|
||||
return false;
|
||||
}
|
||||
print("SEND: " + input.value);
|
||||
ws.send(input.value);
|
||||
return false;
|
||||
};
|
||||
document.getElementById("close").onclick = function(evt) {
|
||||
if (!ws) {
|
||||
return false;
|
||||
}
|
||||
ws.close();
|
||||
return false;
|
||||
};
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user