C# Class LondonBike.BikeLocation

Stores and updates info about where the bikes are TfL have more info on the data they provide here http://www.tfl.gov.uk/businessandpartners/syndication/default.aspx this normally calls a AppEngine service which returns a pipe-seperates list, very much like baselist.txt, but it's live, coming from the TFL urls
Show file Open project: nicwise/londonbikeapp Class Usage Examples

Public Properties

Property Type Description
BikesAvailable int
Capacity int
DistanceFromCurrentPoint int
DocksAvailable int
Heading int
IsAvailable bool
Lat double
Long double
Name string
Touched bool
UniqueId string
devkey string
isUpdating bool

Public Methods

Method Description
AddBike ( BikeLocation location ) : void
BikeLocation ( string dock, bool setAvailable ) : System
BikeLocation ( string name, string postcode, int capacity, double lat, double _long, bool isAvailable ) : System
BuildBikeList ( ) : void
CalculateDistanceInMeters ( CLLocationCoordinate2D source, CLLocationCoordinate2D dest ) : double
CheckBikeIds ( ) : void
Debug ( double _latSource, double _longSource, double _latDest, double _longDest ) : void
FindClosestBike ( double _lat, double _long ) : BikeLocation
FindClosestBikeList ( double _lat, double _long ) : IEnumerable
HeadingToString ( int heading ) : string
LogRoute ( ) : void
LogSearch ( ) : void
LogTrip ( int time, int distance ) : void
RemoveBike ( BikeLocation location ) : void
UpdateFromWebsite ( NSAction onDone ) : bool
WriteToPersistentFile ( ) : void

Private Methods

Method Description
CalculateDistance ( double _latSource, double _longSource, double _latDest, double _longDest ) : double
CalculateHeading ( double _latSource, double _longSource, double _latDest, double _longDest ) : double
ToDeg ( double rad ) : double
ToRad ( double deg ) : double

Method Details

AddBike() public static method

public static AddBike ( BikeLocation location ) : void
location BikeLocation
return void

BikeLocation() public method

public BikeLocation ( string dock, bool setAvailable ) : System
dock string
setAvailable bool
return System

BikeLocation() public method

public BikeLocation ( string name, string postcode, int capacity, double lat, double _long, bool isAvailable ) : System
name string
postcode string
capacity int
lat double
_long double
isAvailable bool
return System

BuildBikeList() public static method

public static BuildBikeList ( ) : void
return void

CalculateDistanceInMeters() public static method

public static CalculateDistanceInMeters ( CLLocationCoordinate2D source, CLLocationCoordinate2D dest ) : double
source CLLocationCoordinate2D
dest CLLocationCoordinate2D
return double

CheckBikeIds() public static method

public static CheckBikeIds ( ) : void
return void

Debug() public static method

public static Debug ( double _latSource, double _longSource, double _latDest, double _longDest ) : void
_latSource double
_longSource double
_latDest double
_longDest double
return void

FindClosestBike() public static method

public static FindClosestBike ( double _lat, double _long ) : BikeLocation
_lat double
_long double
return BikeLocation

FindClosestBikeList() public static method

public static FindClosestBikeList ( double _lat, double _long ) : IEnumerable
_lat double
_long double
return IEnumerable

HeadingToString() public static method

public static HeadingToString ( int heading ) : string
heading int
return string

LogRoute() public static method

public static LogRoute ( ) : void
return void

LogSearch() public static method

public static LogSearch ( ) : void
return void

LogTrip() public static method

public static LogTrip ( int time, int distance ) : void
time int
distance int
return void

RemoveBike() public static method

public static RemoveBike ( BikeLocation location ) : void
location BikeLocation
return void

UpdateFromWebsite() public static method

public static UpdateFromWebsite ( NSAction onDone ) : bool
onDone NSAction
return bool

WriteToPersistentFile() public static method

public static WriteToPersistentFile ( ) : void
return void

Property Details

BikesAvailable public property

public int BikesAvailable
return int

Capacity public property

public int Capacity
return int

DistanceFromCurrentPoint public property

public int DistanceFromCurrentPoint
return int

DocksAvailable public property

public int DocksAvailable
return int

Heading public property

public int Heading
return int

IsAvailable public property

public bool IsAvailable
return bool

Lat public property

public double Lat
return double

Long public property

public double Long
return double

Name public property

public string Name
return string

Touched public property

public bool Touched
return bool

UniqueId public property

public string UniqueId
return string

devkey public static property

public static string devkey
return string

isUpdating public static property

public static bool isUpdating
return bool