Commits

Anonymous committed 792315d

Epoly v3

Comments (0)

Files changed (4)

part3/camions/tracking.db

Binary file modified.

part4/docs/LO53.tex

 \begin{document}
 \selectlanguage{english}
 
-\title{LO53 : Play with Google Maps API}
+\title{LO53 : Tracking device application}
 \author{Jérémy GAGNARD \& Rémy HUBSCHER}
 \date{\today}
 
 \maketitle
 
-\section{Use the Google Maps API to include a map in a web page}
+\section{NMEA frames parsing}
 
-Google Maps has a wide array of APIs that let we embed the robust
-functionality and everyday usefulness of Google Maps into our own
-website and applications, and overlay our own data.
+\subsection{In Java}
 
-We used the Version 3 of Google Maps. This API is especially designed
-to be faster and more applicable to mobile devices, as well as
-traditional desktop browser applications.
+\subsubsection{Parser.java}
 
-The API provides a number of utilities for manipulating maps (just
-like on the \url{http://maps.google.com} web page) and adding content to the
-map through a variety of services, allowing to create robust maps
-applications on our website.
+\lstset{language=java,breaklines=true,xleftmargin=7mm,basicstyle=\scriptsize,frame=single,framexleftmargin=7mm,captionpos=b,tabsize=2,numbers=left,numberstyle=\scriptsize,escapechar={\%}{\_}}
 
+\lstinputlisting{../java/Parser.java}
 
-\subsection{Display the map}
-The fundamental element in any Google Maps V3 API application is the
-"\textit{map}" itself. This document discusses the usage of the fundamental
-\textit{google.maps.Map} object and the basics of map operations.
+The parser split the data from the file and build a RMC object.
 
-Here we have a few methods to display the map :
+The method \texttt{getList} returns an ArrayList of RMC objects which have the
+ structure of a GPRMC frame.
 
-\begin{enumerate}
-  \item Loading the Google Maps API
-  \item Creating a map DOM elements : creating a named div element and
-    obtaining a reference to this element in the browser's document
-    object model (DOM).
-  \item Initialize a map : creating a map options variable : allowing
-    to choose the display options (like : zoom, lat/lng, mapType, ...)
-  \item The elementary object : finally, we create the map in giving
-    some arguments (map DOM element, display options)
-\end{enumerate}
 
-% CODE
+\subsubsection{RMC.java}
 
-\subsection{Center the map and add controls}
+\lstinputlisting{../java/RMC.java}
 
-As we saw earlier, when we create the Google Map API, we can give it
-some options. One of these options corresponds to the latitude and
-longitude. We create an object latitude longitude with the
-float values (in this case, those of Belfort).
 
-Version 3 offers methods to interact directly on the display (such as
-zoom and Map Type).
+\subsection{In Python}
+\subsubsection{json\_table.py}
+\lstset{language=python,breaklines=true,xleftmargin=7mm,basicstyle=\scriptsize,frame=single,framexleftmargin=7mm,captionpos=b,tabsize=2,numbers=left,numberstyle=\scriptsize,escapechar={\%}{\_}}
+\lstinputlisting{../python/json_table.py}
 
 
-% CODE
+\section{Displaying the geographic position of the device with Google Maps}
 
-\newpage
+\lstset{language=java,breaklines=true,xleftmargin=7mm,basicstyle=\scriptsize,frame=single,framexleftmargin=7mm,captionpos=b,tabsize=2,numbers=left,numberstyle=\scriptsize,escapechar={\%}{\_}}
 
-\section{Display trajectories and positions (with a circle of precision)}
+\lstinputlisting{../js/device.js}
 
-\subsection{Draw the trajectories}
 
-We decided to set up a database to easily add trajectory. In our case,
-we used Django.
 
-Django is a web development framework in Python. It aims to make web
-development easy and fast. The project's slogan "The Web framework for
-perfectionists under pressure" \footnote{like us}.
+\section{Animate the mobile device}
 
-The database consists in several parts :
-\begin{enumerate}
-  \item 
-\end{enumerate}
+\lstset{language=html,breaklines=true,xleftmargin=7mm,basicstyle=\scriptsize,frame=single,framexleftmargin=7mm,captionpos=b,tabsize=2,numbers=left,numberstyle=\scriptsize,escapechar={\%}{\_}}
+
+\lstinputlisting{../java/index.html}
 
 \end{document}

part4/python/json_table.py

 import simplejson
 
 def convlat(info):
-    """ Converti une latitude NMEA en latitude décimale
+    """ Converti une latitude NMEA en latitude decimale
     >>> convlat('4737.8953')
     47.631818000000003
     """
     return deg + min + sec
 
 def convlon(info):
-    """ Converti une longitude NMEA en latitude décimale
+    """ Converti une longitude NMEA en latitude decimale
     >>> convlon('04737.8953')
     47.631818000000003
     """

part5/js/epoly.js

   var oddNodes = false;
   var x = point.lng();
   var y = point.lat();
-  for (var i=0; i < this.getVertexCount(); i++) {
+  for (var i=0; i < this.getPaths().getLength(); i++) {
     j++;
-    if (j == this.getVertexCount()) {j = 0;}
-    if (((this.getVertex(i).lat() < y) && (this.getVertex(j).lat() >= y))
-    || ((this.getVertex(j).lat() < y) && (this.getVertex(i).lat() >= y))) {
+    if (j == this.getPaths().getLength()) {j = 0;}
+    if (((this.getPaths().getAt(j).lat() < y) && (this.getPaths().getAt(j).lat() >= y))
+    || ((this.getPaths().getAt(j).lat() < y) && (this.getVertex(i).lat() >= y))) {
       if ( this.getVertex(i).lng() + (y - this.getVertex(i).lat())
-      /  (this.getVertex(j).lat()-this.getVertex(i).lat())
-      *  (this.getVertex(j).lng() - this.getVertex(i).lng())<x ) {
+      /  (this.getPaths().getAt(j).lat()-this.getVertex(i).lat())
+      *  (this.getPaths().getAt(j).lng() - this.getVertex(i).lng())<x ) {
         oddNodes = !oddNodes
       }
     }