gps in wpf

17
GPS in WPF Students: Ziv Dayan & Viki Kravchenko Instructor: Viktor Kulikov

Upload: marius

Post on 23-Feb-2016

45 views

Category:

Documents


1 download

DESCRIPTION

GPS in WPF. Students: Ziv Dayan & Viki Kravchenko Instructor: Viktor Kulikov. GPS. Global Positioning System At least 24 satellites Other systems: Galileo, GLONASS, Beidou-2. Project Overview. Uses. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: GPS in WPF

GPS in WPFStudents: Ziv Dayan & Viki Kravchenko

Instructor: Viktor Kulikov

Page 2: GPS in WPF

GPS• Global Positioning System• At least 24 satellites

• Other systems: Galileo, GLONASS, Beidou-2

Page 4: GPS in WPF

Uses• Sitting in a train, recording the route and

saving a marker on each train station. Thus getting a view of the train system in Israel.

• Recording a walking path in one’s neighborhood, marking all favorite café shops, parks and bus stations.

Page 5: GPS in WPF

NMEA 0183• The National Marine Electronics

Association• A combined electrical and data

specification for communication between marine electronic devices such as echo sounder, sonars, anemometer (wind speed and direction), autopilot, GPS receivers and many other types of instruments

Page 6: GPS in WPF

NMEA GGA Message Example• $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47Where:

GGA Global Positioning System Fix Data 123519 Fix taken at 12:35:19 UTC 4807.038,N Latitude 48 deg 07.038' N 01131.000,E Longitude 11 deg 31.000' E 1 Fix quality: 0 = invalid 1 = GPS fix (SPS) 2 = DGPS fix 3 = PPS fix

4 = Real Time Kinematic 5 = Float RTK

6 = estimated (dead reckoning) (2.3 feature) 7 = Manual input mode 8 = Simulation mode

08 Number of satellites being tracked 0.9 Horizontal dilution of position 545.4,M Altitude, Meters, above mean sea level 46.9,M Height of geoid (mean sea level) above WGS84 ellipsoid (empty field) time in seconds since last DGPS update (empty field) DGPS station ID number *47 the checksum data, always begins with *

Page 7: GPS in WPF

WPF• Windows Presentation Foundation

(Avalon)• Separation of Appearance and Behavior

– Appearance – XAML– Behavior – programming language

(C#, Visual Basic, etc).• Highly customizable• Resolution independence (logical units)

Page 8: GPS in WPF

WPF• XAML:

- Extensible Application Markup Language- Example:

<Button> <Button.Background> <SolidColorBrush Color="Blue"/> </Button.Background> <Button.Foreground> <SolidColorBrush Color="Red"/> </Button.Foreground> <Button.Content> This is a button </Button.Content></Button>

Page 9: GPS in WPF

WPF vs. WinForms• WPF:

- More features and possibilities- Non-standard Applications

• Windows Forms:- Simpler- Easier to find Experts

Page 10: GPS in WPF

Expression Blend

Page 11: GPS in WPF

Databases• Paths are saved in binary files (*.pth), such

that the path’s name is the file’s name.• Markers are saved in a XML document.

<?xml version=”1.0” encoding=”utf-8” ?><Markers> <Marker> <Name>Café Greg</Name> <Latitude>32.7763</Latitude> <Longitude>35.0249</Longitude> <Type>cafe</Type> </Marker> <Marker> <Name>Fishbach Computer Farm</Name> <Latitude>32.777</Latitude> <Longitude>35.0245</Longitude> <Type>computer</Type> </Marker></Markers>

Page 12: GPS in WPF

Handling XML Document

+getMarkerNames() : ArrayList+getMarkerDetails() : ArrayList+getGroupDetails() : ArrayList+getGroupNames() : ArrayList+writeMarker() : bool

+iconList-cwd : string

MarkerHandler

+clsValidator() : clsValidator+ValidateXMLFile() : bool+ValidationFailed() : void

-m_sXMLFileName : string-m_sSchemaFileName : string-m_objXmlSchemaCollection-m_bIsFailure : bool

clsValidator

Markers.xml: Markers.xsd:

Page 13: GPS in WPF

Google Static Map API• Sending a query with location, map and

feature parameters.http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318&markers=color:red|color:red|label:C|40.718217,-73.998284&sensor=false

• Receiving a response containing a static picture of the requested map.

• Limitation of 2048 characters.• Use Polylines to overcome this limitation –

PolylineCreator Class

Page 14: GPS in WPF

Polyline Example• Original list of points:

37.44601,-122.14934|37.44591,-122.14945|37.44582,-122.14956|37.44571,-122.14964|37.44563,-122.14974|37.44555,-122.14984

• After converting to Polyline: qtpcFjhphVRTPTTNNRNR

Page 15: GPS in WPF

Put It All Together

clsValidator

binary.pth

Path Select Window

Show Map Window

Record Window

PresentationTier

getPath

Logic Tier PolylineCreator Class

MakeHandlerClass

Validate

Data Tier

read from GPS

reco

rd p

ath writeMarker

getData

createPolyline

MarkersXML

MarkersXSD

save

path Validateread/write

read file

Page 16: GPS in WPF

The GUI• Let’s run the program and see for

ourselves!

Page 17: GPS in WPF

Thank you for your attention!