From 6072de8f4a9ec4df586ede7f41e0ac97f075c385 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 2 Feb 2012 10:13:46 +0000 Subject: Bring dev back up to what it should be like? --- AndroidManifest.xml | 5 +- assets/building_estates.csv | 337 +++++++++++ assets/buildings_points.csv | 261 ++++++++ assets/bus_stops.csv | 1410 +++++++++++++++++++++++++++++++++++++++++++ assets/routes.csv | 6 + assets/routestops.csv | 328 ++++++++++ assets/sites.csv | 22 + project.properties | 2 +- res/values/strings.xml | 2 +- 9 files changed, 2369 insertions(+), 4 deletions(-) create mode 100644 assets/building_estates.csv create mode 100644 assets/buildings_points.csv create mode 100644 assets/bus_stops.csv create mode 100644 assets/routes.csv create mode 100644 assets/routestops.csv create mode 100644 assets/sites.csv diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 69eb2fd..bc4a89b 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,10 +1,11 @@ + android:versionCode="5" + android:versionName="0.2.2 (alpha)" > + diff --git a/assets/building_estates.csv b/assets/building_estates.csv new file mode 100644 index 0000000..febda75 --- /dev/null +++ b/assets/building_estates.csv @@ -0,0 +1,337 @@ +Name,ID,Site,Residential +Building 1,1,1,NR +Building 2,2,1,NR +Law,4,1,NR +Eustice,5,1,NR +Nuffield Theatre,6,1,NR +Lanchester,7,1,NR +A B Woods Laboratory,8,1,NR +Engineering Workshops,9,1,NR +Energy Centre (CHP),11,1,NR +Tizard,13,1,NR +Workshop adjacent to B13,13A,1,NR +Wolfson/Rayleigh,15,1,NR +Building 16,16,1,NR +R J Mitchell Wind Tunnel,17,1,NR +Jubilee Sports Complex,18,1,NR +ISVR,19,1,NR +High Voltage Laboratory,20,1,NR +Faraday,21,1,NR +Civil Eng Temp Accommodation,22,1,NR +EScience Building,25,1,NR +Building 26,26,1,NR +Chemistry,27,1,NR +Froude,28,1,NR +Graham Hills,29,1,NR +Synthetic Chemistry,30,1,NR +Combinatorial Chemistry,30A,1,NR +Hartley Store,31,1,NR +EEE Building,32,1,NR +Estates (Maintenance),33,1,NR +Education,34,1,NR +David Kiddle,35,1,NR +Library (inc. blds 10 12 & 14),36,1,NR +George Thomas,37,1,NR +George Thomas Building Exten,37A,1,NR +Staff Social Centre,38,1,NR +Soton Stat Sci Res Institute,39,1,NR +West Bld & Staff Social Centre,40,1,NR +Day Nursery,41,1,NR +Students' Union/Refectory,42,1,NR +Shackleton,44,1,NR +Geodata Institute,44A,1,NR +Potting Shed behind B44,44B,1,NR +Health Profs & Rehab Sciences,45,1,NR +Physics,46,1,NR +University Health Centre,48,1,NR +John Hansard Gallery,50,1,NR +Turner Sims Concert Hall,52,1,NR +New Mountbatten,53,1,NR +Mathematics,54,1,NR +Human Performance Laboratory,56,1,NR +Students' Union Retail Centre,57,1,NR +Murray,58,1,NR +Building 58A,58A,1,NR +New Zepler,59,1,NR +Gower,60,1,NR +Ship Science Store,61,1,NR +Nightingale,67,1,NR +Life Sciences,85,1,NR +Portacabin by Gower Building,86,1,NR +Interchange Kiosk,115,1,NR +26 University Road,1050,1,NR +28 University Road,1051,1,NR +31 University Road,1101,1,NR +39 University Road,1102,1,NR +41 University Rd - Chaplaincy,1104,1,NR +43 University Road,1105,1,NR +45 University Road,1106,1,NR +47 University Road,1107,1,NR +130 Burgess Road,1220,1,NR +134 Burgess Road,1221,1,NR +136 Burgess Road,1222,1,NR +44 Chamberlain Road,1419,1,NR +46 Chamberlain Road S/Union,1420,1,NR +P/kabin Occ Health rr 26/28 UR,9014,1,NR +Plumbers' Store behind B35,9019,1,NR +8 Chamberlain Road,1401,1,R +10 Chamberlain Road,1402,1,R +12 Chamberlain Road,1403,1,R +14 Chamberlain Road,1404,1,R +16 Chamberlain Road,1405,1,R +18 Chamberlain Road,1406,1,R +20 Chamberlain Road,1407,1,R +22 Chamberlain Road,1408,1,R +24 Chamberlain Road,1409,1,R +26 Chamberlain Road,1410,1,R +28 Chamberlain Road,1411,1,R +30 Chamberlain Road,1412,1,R +32 Chamberlain Road,1413,1,R +34 Chamberlain Road,1414,1,R +36 Chamberlain Road,1415,1,R +38 Chamberlain Road,1416,1,R +40 Chamberlain Road,1417,1,R +42 Chamberlain Road,1418,1,R +48 Chamberlain Road,1421,1,R +50 Chamberlain Road,1422,1,R +52 Chamberlain Road,1423,1,R +54 Chamberlain Road,1424,1,R +56 Chamberlain Road,1425,1,R +58 Chamberlain Road,1426,1,R +17 Hartley Avenue,1501,1,R +19 Hartley Avenue,1502,1,R +21 Hartley Avenue,1503,1,R +23 Hartley Avenue,1504,1,R +25 Hartley Avenue,1505,1,R +27 Hartley Avenue,1506,1,R +29 Hartley Avenue,1507,1,R +31 Hartley Avenue,1508,1,R +65 Heatherdeane Road,1580,1,R +62 Granby Grove,1601,1,R +64 Granby Grove,1602,1,R +Bassett House,1604,40,R +Birchwood,1620,37,R +158 Mayfield Road,1622,1,R +185 Broadlands Road,1630,1,R +10 Orchards Way,1640,1,R +Oakhurst Road,73,1,R +Boldrewood,62,2,NR +34 Bassett Crescent East,1603,2,NR +17 Oaklands Way,1395,2,R +Parkes Bldg,65,3,NR +Archaelogy (ex-Crawford),65A,3,NR +Burgess,65B,3,NR +16 Highfield Road,1310,3,NR +East Site,63A,4,NR +Terrapin,63C,4,NR +Adminstration,63F,4,NR +Textile Conservation Cnt,63G,4,NR +West Site,63K,4,NR +Students' Union,63L,4,NR +Chilworth Estate,71,5,NR +Chilworth Laboratories,89,5,NR +Alpha House,92,5,NR +3 Venture Road,96,5,NR +Epsilon House,97,5,NR +2 Venture Road,99,5,NR +National Oceanography Centre,68,6,NR +National Oceanography Centre - Block A1,68-A1,6,NR +National Oceanography Centre - Block A6,68-A6,6,NR +National Oceanography Centre - Block N9,68-N9,6,NR +72 Mead Crescent,1612,8,R +South Academic Block,9500,18,NR +Lab & Path Block,9510,18,NR +West Wing,9520,18,NR +Centre Block,9530,18,NR +P/Anne Maternity Unit,9550,18,NR +IDS,9555,18,NR +Duthie,9560,18,NR +Duthie/Tenovus Link,9561,18,NR +Tenovus,9570,18,NR +Somers Cancer Research,9580,18,NR +MRC Building,9581,18,NR +Royal South Hants,9585,20,NR +Aldermoor Health Centre,9590,19,NR +"North Hampshire Hospital, Basingstoke",9591,21,NR +"Royal Hampshire County Hospital, Winchester",9592,22,NR +"St. Mary's Hospital, Portsmouth",9593,23,NR +"St Mary's Hospital, Isle of Wight",9594,24,NR +"Nurses' accommodation, Portsmouth",9595,25,NR +New Sports Pavilion Wide Lane,93,39,NR +Boat House 1,94A,8,NR +Boat House 2,94B,8,NR +Westsuit Drying/Store,94C,8,NR +Store 1,94D,8,NR +Boat House Changing Rooms,94F,8,NR +Workshop,94G,8,NR +Classroom,94H,8,NR +Store 2,94J,8,NR +Old Sports Pavilion Wide Lane,95,39,NR +Staff P/kabin 1 Wide Lane,9001,39,NR +P/kabin 2 rear Bld 35,9002,1,NR +"Boiler House, Wide Lane",9003,39,NR +Gardening Shed Wide Lane,9004,39,NR +Changing Room 1 Wide Lane,9011,39,NR +Changing Room 2 Wide Lane,9012,39,NR +Unit 6 Store,150,45,NR +Unit 12 Bindery,151,45,NR +Unit 13 Print Centre,152,45,NR +Highfield Hall Aubrey House,75A,56,R +Highfield Hall Laundry,75B,56,R +Highfield Hall Wolfe House,75C,56,R +Glen Eyre Hall Block A Richard Newitt,73A,57,R +Glen Eyre Hall Block B Richard Newitt,73B,57,R +Glen Eyre Hall Bungalow 1,73B1,57,R +Glen Eyre Bungalow 2,73B2,57,R +Glen Eyre Bungalow 3,73B3,57,R +Glen Eyre Hall Bungalow 4,73B4,57,R +Glen Eyre Hall Block C Richard Newitt,73C,57,R +Glen Eyre Hall Block D Richard Newitt,73D,57,R +Glen Eyre Hall Block E Richard Newitt,73E,57,R +Glen Eyre Hall Block F Richard Newitt,73F,57,R +Glen Eyre Hall Block G Richard Newitt,73G,57,R +Glen Eyre Hall Block H Richard Newitt,73H,57,R +Glen Eyre Hall Block J,73J,57,R +"Glen Eyre Hall, Chancellor's Court, Selbourne",73K,57,R +"Glen Eyre Hall, Chancellor's Court, Jellicoe",73L,57,R +"Glen Eyre Hall, Chancellor's Court, Roll",73M,57,R +Block A Glen Eyre Hall Old Terrace,73N-A,57,R +Block B Glen Eyre Hall Old Terrace,73N-B,57,R +Block C Glen Eyre Hall Old Terrace,73N-C,57,R +Block D Glen Eyre Hall Old Terrace,73N-D,57,R +Block E Glen Eyre Hall Old Terrace,73N-E,57,R +Block F Glen Eyre Hall Old Terrace,73N-F,57,R +Block G Glen Eyre Hall Old Terrace,73N-G,57,R +Block H Glen Eyre Hall Old Terrace,73N-H,57,R +Block J Glen Eyre Hall Old Terrace,73N-J,57,R +Block K Glen Eyre Hall Old Terrace,73N-K,57,R +Glen Eyre Hall Main Building,73Q1,57,R +Glen Eyre Hall Dining Hall,73Q2,57,R +Glen Eyre Hall Squash Court,73S,57,R +Glen Eyre Hall Brunei House,73T,57,R +Glen Eyre Hall Block W,73W,57,R +Block Q Glen Eyre Hall New Terrace,73X-Q,57,R +Block R Glen Eyre Hall New Terrace,73X-R,57,R +Block S Glen Eyre Hall New Terrace,73X-S,57,R +Block T Glen Eyre Hall New Terrace,73X-T,57,R +South Hill A,70AA,58,R +South Hill B,70BB,58,R +South Hill C,70CC,58,R +Chamberlain A,70A,59,R +Chamberlain B,70B,59,R +Chamberlain C,70C,59,R +Chamberlain Dining Room,70D,59,R +Chamberlain Boiler House,70E,59,R +Chamberlain Bin Store,70F,59,R +50 Glen Eyre Road,1710,59,R +Hartley Grove A,79A,60,R +Hartley Grove B,79B,60,R +Hartley Grove C,79C,60,R +Beechmount House,73R,61,R +Bencraft Court Block A,81A,62,R +Bencraft Court Block B,81B,62,R +Bencraft Court Block C,81C,62,R +Bencraft Court Bar,81D,62,R +Bencraft Court Cycle Sheds,81E,62,R +Connaught A (Old Quad),72A1-A,63,R +Connaught B (Old Quad),72A1-B,63,R +Connaught C (Old Quad),72A1-C,63,R +Connaught D (Old Quad),72A2-D,63,R +Connaught E (Old Quad),72A2-E,63,R +Connaught F (Old Quad),72A2-F,63,R +Connaught G (Old Quad),72A2-G,63,R +Connaught H (Old Quad),72A2-H,63,R +Connaught J (New Quad),72A2-J,63,R +Connaught K (New Quad),72A2-K,63,R +Connaught L (New Quad),72A2-L,63,R +Connaught Hall Squash Court,72B,63,R +Connaught Hall Dining Room,72C,63,R +Connaught Hall/Lobby/Laundry,72CC,63,R +Connaught M (New Quad),72D-M,63,R +Connaught N (New Quad),72D-N,63,R +Connaught P (New Quad),72D-P,63,R +Connaught Q (New Quad),72E-Q,63,R +Connaught R (New Quad),72E-R,63,R +Connaught S (New Quad),72F-S,63,R +"Connaught Hall, The Bungalow",72G,63,R +Montefiore Hall Block A,76A,64,R +Montefiore Hall Block B,76B,64,R +Montefiore Hall Block C,76C,64,R +Montefiore Hall Block D,76D,64,R +Montefiore Hall Block E,76E,64,R +Montefiore Hall Block F,76F,64,R +Montefiore Hall Block G,76G,64,R +Montefiore Hall Block H,76H,64,R +Montefiore Hall Block J,76J,64,R +Montefiore Hall Block K,76K,64,R +Montefiore Hall Block L,76L,64,R +Montefiore Hall Block M,76M,64,R +Montefiore Hall Block N,76N,64,R +Montefiore Hall Block P,76P,64,R +Montefiore Hall Block Q,76Q,64,R +Montefiore Hall Block R,76R,64,R +Montefiore Hall Block S,76S,64,R +Montefiore Hall Social Centre,76SC,64,R +Montefiore Hall Block T,76T,64,R +Montefiore Hall Laundry,76U,64,R +Montefiore Hall Block V,76V,64,R +Montefiore Hall Block W,76W,64,R +Montefiore Hall Block X,76X,64,R +Montefiore Hall - Reception,76Z,64,R +South Stoneham House,78A,65,R +South Stoneham Tower,78B,65,R +South Stoneham Dining Room,78C,65,R +South Stoneham Staff Block,78D,65,R +South Stoneham Warden's Lodge,78E,65,R +St Margaret's Hall,77,66,R +Gateley Hall,82A,67,R +Romero Hall,82B,68,R +13 Chestnut Lodge,1626,69,R +Erasmus Park,1730,70,R +Erasmus - House 01,1730-01,70,R +Erasmus - House 02,1730-02,70,R +Erasmus - House 03,1730-03,70,R +Erasmus - House 04,1730-04,70,R +Erasmus - House 05,1730-05,70,R +Erasmus - House 06,1730-06,70,R +Erasmus - House 07,1730-07,70,R +Erasmus - House 08,1730-08,70,R +Erasmus - House 09,1730-09,70,R +Erasmus - House 10,1730-10,70,R +Erasmus - House 11,1730-11,70,R +Erasmus - House 12,1730-12,70,R +Erasmus - House 13,1730-13,70,R +Erasmus - House 14,1730-14,70,R +Erasmus - House 15,1730-15,70,R +Erasmus - House 16,1730-16,70,R +Erasmus - House 17,1730-17,70,R +Erasmus - House 18,1730-18,70,R +Erasmus - Flat 19,1730-19,70,R +Erasmus - Flat 20,1730-20,70,R +Erasmus - Flat 21,1730-21,70,R +Erasmus - Flat 22,1730-22,70,R +Erasmus - Flat 23,1730-23,70,R +Erasmus - Flat 24,1730-24,70,R +Erasmus - Flat 25,1730-25,70,R +Erasmus - Flat 26,1730-26,70,R +Erasmus - Flat 27,1730-27,70,R +Erasmus - Flat 28,1730-28,70,R +Erasmus - Flat 29,1730-29,70,R +Erasmus - Flat 30,1730-30,70,R +Erasmus - Flat 31,1730-31,70,R +Erasmus - Flat 32,1730-32,70,R +Erasmus - Flat 33,1730-33,70,R +Erasmus - Flat 34,1730-34,70,R +Erasmus - Flat 35,1730-35,70,R +Erasmus - Flat 36,1730-36,70,R +Erasmus - Flat 37,1730-37,70,R +Erasmus - Flat 38,1730-38,70,R +Erasmus - Flat 39,1730-39,70,R +Erasmus - Flat 40,1730-40,70,R +Erasmus - Flat 41,1730-41,70,R +24 Mead Crescent,1610,71,R +1A Oakhurst Road,1390,73,R +1B Oakhurst Road,1391,73,R +18-20 Shaftesbury Avenue,165,77,R +"1A Victoria Place, Portsmouth",166,78,R +College Keep,123,79,NR \ No newline at end of file diff --git a/assets/buildings_points.csv b/assets/buildings_points.csv new file mode 100644 index 0000000..d72dd34 --- /dev/null +++ b/assets/buildings_points.csv @@ -0,0 +1,261 @@ +id,long,lat,source +1,-1.3960704,50.9376734,http://os.openstreetmap.org/ +2,-1.3981275,50.9362789,http://os.openstreetmap.org/ +4,-1.3977134,50.9360909,http://os.openstreetmap.org/ +5,-1.3948313,50.9355883,http://os.openstreetmap.org/ +6,-1.3972189,50.9359585,http://os.openstreetmap.org/ +7,-1.3940282,50.9353558,http://os.openstreetmap.org/ +8,-1.3947926,50.936537,http://os.openstreetmap.org/ +9,-1.394215,50.9355501,http://os.openstreetmap.org/ +13,-1.393488,50.935551,http://os.openstreetmap.org/ +15,-1.3933722,50.9358355,http://os.openstreetmap.org/ +16,-1.3956608,50.9376285,http://os.openstreetmap.org/ +17,-1.3946145,50.9362396,http://os.openstreetmap.org/ +18,-1.3966792,50.9338813,http://os.openstreetmap.org/ +19,-1.392867,50.9355444,http://os.openstreetmap.org/ +20,-1.3951265,50.9368962,http://os.openstreetmap.org/ +21,-1.3932157,50.9351646,http://os.openstreetmap.org/ +22,-1.3941636,50.9350233,http://os.openstreetmap.org/ +25,-1.3934585,50.9347702,http://os.openstreetmap.org/ +26,-1.3941216,50.9347143,http://os.openstreetmap.org/ +27,-1.393776,50.93432,http://os.openstreetmap.org/ +28,-1.3945278,50.9346967,http://os.openstreetmap.org/ +29,-1.3939798,50.9340008,http://os.openstreetmap.org/ +30,-1.3944765,50.9343082,http://os.openstreetmap.org/ +32,-1.395905,50.9364157,http://os.openstreetmap.org/ +34,-1.395317,50.9344936,http://os.openstreetmap.org/ +35,-1.394475,50.93383,http://os.openstreetmap.org/ +36,-1.395156,50.934986,http://os.openstreetmap.org/ +37,-1.395696,50.934147,http://os.openstreetmap.org/ +38,-1.3974278,50.9354059,http://os.openstreetmap.org/ +39,-1.399298,50.936722,http://os.openstreetmap.org/ +40,-1.3973325,50.9347275,http://os.openstreetmap.org/ +41,-1.395301,50.933559,http://os.openstreetmap.org/ +42,-1.397511,50.934219,http://os.openstreetmap.org/ +44,-1.399062,50.934322,http://os.openstreetmap.org/ +45,-1.394014,50.937801,http://os.openstreetmap.org/ +46,-1.3996014,50.9348505,http://os.openstreetmap.org/ +48,-1.399485,50.935696,http://os.openstreetmap.org/ +50,-1.3994,50.936142,http://os.openstreetmap.org/ +52,-1.3988324,50.9358682,http://os.openstreetmap.org/ +53,-1.398236,50.937412,http://os.openstreetmap.org/ +54,-1.3988756,50.9362228,http://os.openstreetmap.org/ +57,-1.396755,50.934399,http://os.openstreetmap.org/ +58,-1.398697,50.936592,http://os.openstreetmap.org/ +59,-1.3977863,50.9374063,http://os.openstreetmap.org/ +60,-1.3975471,50.93774,http://os.openstreetmap.org/ +62,-1.4049952,50.9372304,http://os.openstreetmap.org/ +65,-1.402838,50.929203,http://os.openstreetmap.org/ +67,-1.3966181,50.9366885,http://os.openstreetmap.org/ +68,-1.394491,50.892773,http://os.openstreetmap.org/ +77,-1.4068368,50.920439,http://os.openstreetmap.org/ +85,-1.395323,50.936436,http://os.openstreetmap.org/ +86,-1.396765,50.93739,http://os.openstreetmap.org/ +92,-1.4255025,50.9621255,http://os.openstreetmap.org/ +93,-1.363412,50.952282,http://os.openstreetmap.org/ +96,-1.4233506,50.9619135,http://os.openstreetmap.org/ +97,-1.4250697,50.9609746,http://os.openstreetmap.org/ +99,-1.4226617,50.961019,http://os.openstreetmap.org/ +115,-1.397173,50.936291,http://os.openstreetmap.org/ +123,-1.396685,50.898575,http://os.openstreetmap.org/ +150,-1.3840867,50.9307365,http://os.openstreetmap.org/ +151,-1.3838409,50.9311694,http://os.openstreetmap.org/ +152,-1.3838018,50.9312434,http://os.openstreetmap.org/ +165,-1.3907767,50.9284882,http://os.openstreetmap.org/ +166,-1.082381,50.789497,http://os.openstreetmap.org/ +1050,-1.395323,50.933235,http://os.openstreetmap.org/ +1051,-1.395356,50.933338,http://os.openstreetmap.org/ +1101,-1.3959296,50.9330414,http://os.openstreetmap.org/ +1102,-1.3960392,50.9333389,http://os.openstreetmap.org/ +1104,-1.396101,50.9334345,http://os.openstreetmap.org/ +1105,-1.3961544,50.933516,http://os.openstreetmap.org/ +1106,-1.3962246,50.9335868,http://os.openstreetmap.org/ +1107,-1.3962471,50.9336275,http://os.openstreetmap.org/ +1220,-1.395103,50.938011,http://os.openstreetmap.org/ +1221,-1.395002,50.938026,http://os.openstreetmap.org/ +1222,-1.39495,50.938034,http://os.openstreetmap.org/ +1390,-1.400937,50.933636,http://os.openstreetmap.org/ +1391,-1.400937,50.933636,http://os.openstreetmap.org/ +1395,-1.4037955,50.9381522,http://os.openstreetmap.org/ +1401,-1.3979365,50.9330741,http://os.openstreetmap.org/ +1402,-1.3979888,50.933101,http://os.openstreetmap.org/ +1403,-1.3980886,50.9331489,http://os.openstreetmap.org/ +1404,-1.3981409,50.9331759,http://os.openstreetmap.org/ +1405,-1.3982264,50.9332298,http://os.openstreetmap.org/ +1406,-1.3982834,50.9332568,http://os.openstreetmap.org/ +1407,-1.398388,50.9333077,http://os.openstreetmap.org/ +1408,-1.3984498,50.9333406,http://os.openstreetmap.org/ +1409,-1.3985496,50.9333886,http://os.openstreetmap.org/ +1410,-1.3986066,50.9334155,http://os.openstreetmap.org/ +1411,-1.398716,50.9334605,http://os.openstreetmap.org/ +1412,-1.3987777,50.9334904,http://os.openstreetmap.org/ +1413,-1.3990059,50.9336012,http://os.openstreetmap.org/ +1414,-1.3990629,50.9336342,http://os.openstreetmap.org/ +1415,-1.3991675,50.9336731,http://os.openstreetmap.org/ +1416,-1.3992198,50.9337061,http://os.openstreetmap.org/ +1417,-1.3993291,50.933742,http://os.openstreetmap.org/ +1418,-1.3993814,50.933772,http://os.openstreetmap.org/ +1419,-1.3994954,50.9338139,http://os.openstreetmap.org/ +1420,-1.3995477,50.9338439,http://os.openstreetmap.org/ +1421,-1.3997949,50.9339487,http://os.openstreetmap.org/ +1422,-1.3998519,50.9339817,http://os.openstreetmap.org/ +1423,-1.3999612,50.9340266,http://os.openstreetmap.org/ +1424,-1.4000135,50.9340535,http://os.openstreetmap.org/ +1425,-1.4001038,50.9341015,http://os.openstreetmap.org/ +1426,-1.4001608,50.9341314,http://os.openstreetmap.org/ +1501,-1.393987,50.933098,http://os.openstreetmap.org/ +1502,-1.393974,50.933182,http://os.openstreetmap.org/ +1503,-1.393982,50.93327,http://os.openstreetmap.org/ +1504,-1.393979,50.933353,http://os.openstreetmap.org/ +1505,-1.393965,50.933445,http://os.openstreetmap.org/ +1506,-1.393944,50.933529,http://os.openstreetmap.org/ +1507,-1.393915,50.933605,http://os.openstreetmap.org/ +1508,-1.393915,50.933701,http://os.openstreetmap.org/ +1580,-1.401279,50.928944,http://os.openstreetmap.org/ +1601,-1.3925923,50.9350404,http://os.openstreetmap.org/ +1602,-1.3926691,50.9350607,http://os.openstreetmap.org/ +1603,-1.4032566,50.9380349,http://os.openstreetmap.org/ +1604,-1.4039043,50.9425216,http://os.openstreetmap.org/ +1610,-1.37853,50.936123,http://os.openstreetmap.org/ +1612,-1.380123,50.934734,http://os.openstreetmap.org/ +1622,-1.390499,50.936714,http://os.openstreetmap.org/ +1630,-1.393715,50.9369467,http://os.openstreetmap.org/ +1640,-1.398211,50.929989,http://os.openstreetmap.org/ +1710,-1.4032158,50.9421475,http://os.openstreetmap.org/ +1730,-1.3001172,51.0686667,http://os.openstreetmap.org/ +9001,-1.363689,50.951485,http://os.openstreetmap.org/ +9004,-1.363506,50.951576,http://os.openstreetmap.org/ +9011,-1.365365,50.950558,http://os.openstreetmap.org/ +9012,-1.365365,50.950558,http://os.openstreetmap.org/ +9500,-1.436441,50.932362,http://os.openstreetmap.org/ +9510,-1.435797,50.932819,http://os.openstreetmap.org/ +9520,-1.435561,50.933701,http://os.openstreetmap.org/ +9530,-1.434392,50.933247,http://os.openstreetmap.org/ +9550,-1.434907,50.935337,http://os.openstreetmap.org/ +9580,-1.433555,50.934307,http://os.openstreetmap.org/ +9585,-1.3973994,50.9125279,http://os.openstreetmap.org/ +9590,-1.427804,50.940327,http://os.openstreetmap.org/ +9591,-1.110778,51.279823,http://os.openstreetmap.org/ +9592,-1.330204,51.061089,http://os.openstreetmap.org/ +9593,-1.065159,50.800404,http://os.openstreetmap.org/ +9594,-1.300592,50.711353,http://os.openstreetmap.org/ +9595,-1.082381,50.789497,http://os.openstreetmap.org/ +37A,-1.395687,50.933811,http://os.openstreetmap.org/ +58A,-1.3980786,50.9367447,http://os.openstreetmap.org/ +63A,-1.3088779,51.0657027,http://os.openstreetmap.org/ +63C,-1.3087201,51.065325,http://os.openstreetmap.org/ +63F,-1.3097192,51.0656271,http://os.openstreetmap.org/ +63G,-1.3098995,51.0653675,http://os.openstreetmap.org/ +63K,-1.310366,51.066025,http://os.openstreetmap.org/ +63L,-1.3102375,51.066373,http://os.openstreetmap.org/ +65A,-1.403128,50.928783,http://os.openstreetmap.org/ +65B,-1.4036629,50.9288317,http://os.openstreetmap.org/ +70A,-1.4031107,50.941608,http://os.openstreetmap.org/ +70AA,-1.4025225,50.9415981,http://os.openstreetmap.org/ +70B,-1.4032631,50.9412373,http://os.openstreetmap.org/ +70BB,-1.401953,50.941452,http://os.openstreetmap.org/ +70C,-1.403592,50.941536,http://os.openstreetmap.org/ +70CC,-1.4024437,50.9412837,http://os.openstreetmap.org/ +70D,-1.4032263,50.941843,http://os.openstreetmap.org/ +70E,-1.4034784,50.9420383,http://os.openstreetmap.org/ +72A1-A,-1.374458,50.937782,http://os.openstreetmap.org/ +72A1-B,-1.374393,50.937683,http://os.openstreetmap.org/ +72A1-C,-1.374334,50.937595,http://os.openstreetmap.org/ +72A2-D,-1.37445,50.937393,http://os.openstreetmap.org/ +72A2-E,-1.37467,50.937344,http://os.openstreetmap.org/ +72A2-F,-1.374884,50.937279,http://os.openstreetmap.org/ +72A2-G,-1.375187,50.937355,http://os.openstreetmap.org/ +72A2-H,-1.375257,50.937454,http://os.openstreetmap.org/ +72A2-J,-1.375327,50.937561,http://os.openstreetmap.org/ +72A2-K,-1.374989,50.937805,http://os.openstreetmap.org/ +72A2-L,-1.375083,50.937973,http://os.openstreetmap.org/ +72C,-1.375367,50.93819,http://os.openstreetmap.org/ +72D-M,-1.37549,50.938461,http://os.openstreetmap.org/ +72D-N,-1.375209,50.938553,http://os.openstreetmap.org/ +72D-P,-1.374951,50.938625,http://os.openstreetmap.org/ +72E-Q,-1.374581,50.938484,http://os.openstreetmap.org/ +72E-R,-1.374367,50.938183,http://os.openstreetmap.org/ +72F-S,-1.375544,50.938591,http://os.openstreetmap.org/ +72G,-1.374106,50.937477,http://os.openstreetmap.org/ +73A,-1.4029587,50.943379,http://os.openstreetmap.org/ +73B,-1.4032985,50.9434045,http://os.openstreetmap.org/ +73B1,-1.400848,50.94405,http://os.openstreetmap.org/ +73B2,-1.400848,50.94405,http://os.openstreetmap.org/ +73B3,-1.400848,50.94405,http://os.openstreetmap.org/ +73B4,-1.400848,50.94405,http://os.openstreetmap.org/ +73C,-1.4032123,50.9436282,http://os.openstreetmap.org/ +73D,-1.4024566,50.9439382,http://os.openstreetmap.org/ +73E,-1.4021067,50.9438934,http://os.openstreetmap.org/ +73F,-1.402203,50.9436793,http://os.openstreetmap.org/ +73G,-1.4018785,50.9436666,http://os.openstreetmap.org/ +73H,-1.4020052,50.9441011,http://os.openstreetmap.org/ +73J,-1.401488,50.943919,http://os.openstreetmap.org/ +73K,-1.4009757,50.9432479,http://os.openstreetmap.org/ +73L,-1.4006309,50.9437049,http://os.openstreetmap.org/ +73M,-1.3998397,50.9437017,http://os.openstreetmap.org/ +73N-A,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-B,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-C,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-D,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-E,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-F,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-G,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-H,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-J,-1.402854,50.94236,http://os.openstreetmap.org/ +73N-K,-1.402854,50.94236,http://os.openstreetmap.org/ +73Q1,-1.402873,50.943848,http://os.openstreetmap.org/ +73Q2,-1.402873,50.943848,http://os.openstreetmap.org/ +73R,-1.404631,50.9434354,http://os.openstreetmap.org/ +73S,-1.401352,50.944126,http://os.openstreetmap.org/ +73T,-1.3994289,50.9431457,http://os.openstreetmap.org/ +73W,-1.4031058,50.9431776,http://os.openstreetmap.org/ +73X-Q,-1.4026798,50.9429667,http://os.openstreetmap.org/ +73X-R,-1.4023501,50.9429188,http://os.openstreetmap.org/ +73X-S,-1.4021625,50.9427239,http://os.openstreetmap.org/ +73X-T,-1.4022081,50.9424938,http://os.openstreetmap.org/ +75A,-1.4018216,50.9298947,http://os.openstreetmap.org/ +75C,-1.402665,50.9301743,http://os.openstreetmap.org/ +76A,-1.3784044,50.937321,http://os.openstreetmap.org/ +76B,-1.3778009,50.9376576,http://os.openstreetmap.org/ +76C,-1.377127,50.937645,http://os.openstreetmap.org/ +76D,-1.376708,50.937752,http://os.openstreetmap.org/ +76E,-1.376204,50.937859,http://os.openstreetmap.org/ +76F,-1.37733,50.938011,http://os.openstreetmap.org/ +76G,-1.376933,50.938107,http://os.openstreetmap.org/ +76H,-1.376402,50.938232,http://os.openstreetmap.org/ +76J,-1.377561,50.938339,http://os.openstreetmap.org/ +76K,-1.376944,50.938484,http://os.openstreetmap.org/ +76L,-1.376306,50.938629,http://os.openstreetmap.org/ +76M,-1.377389,50.938606,http://os.openstreetmap.org/ +76N,-1.376751,50.938763,http://os.openstreetmap.org/ +76P,-1.377196,50.938877,http://os.openstreetmap.org/ +76Q,-1.376536,50.939026,http://os.openstreetmap.org/ +76R,-1.376976,50.939156,http://os.openstreetmap.org/ +76S,-1.376349,50.939289,http://os.openstreetmap.org/ +76SC,-1.3780581,50.9380566,http://os.openstreetmap.org/ +76T,-1.376783,50.939426,http://os.openstreetmap.org/ +76U,-1.3780779,50.9383121,http://os.openstreetmap.org/ +76V,-1.3781373,50.937561,http://os.openstreetmap.org/ +76W,-1.3779839,50.9372773,http://os.openstreetmap.org/ +76X,-1.3784588,50.9370062,http://os.openstreetmap.org/ +76Z,-1.376976,50.937473,http://os.openstreetmap.org/ +78A,-1.376944,50.936687,http://os.openstreetmap.org/ +78B,-1.377465,50.936699,http://os.openstreetmap.org/ +78C,-1.377534,50.936543,http://os.openstreetmap.org/ +78E,-1.3759936,50.9373466,http://os.openstreetmap.org/ +79A,-1.402425,50.940872,http://os.openstreetmap.org/ +79B,-1.401899,50.940411,http://os.openstreetmap.org/ +79C,-1.401371,50.940643,http://os.openstreetmap.org/ +81A,-1.3907157,50.945967,http://os.openstreetmap.org/ +81B,-1.3904644,50.9458051,http://os.openstreetmap.org/ +81C,-1.390787,50.945606,http://os.openstreetmap.org/ +81D,-1.3909756,50.9458246,http://os.openstreetmap.org/ +81E,-1.3911761,50.9456236,http://os.openstreetmap.org/ +82A,-1.4077298,50.9169714,http://os.openstreetmap.org/ +82B,-1.4098021,50.9157541,http://os.openstreetmap.org/ +94A,-1.380039,50.934563,http://os.openstreetmap.org/ +94B,-1.380039,50.934563,http://os.openstreetmap.org/ +94C,-1.3807397,50.9337771,http://os.openstreetmap.org/ +94F,-1.380549,50.934185,http://os.openstreetmap.org/ +94G,-1.380509,50.934058,http://os.openstreetmap.org/ +94H,-1.380648,50.934078,http://os.openstreetmap.org/ \ No newline at end of file diff --git a/assets/bus_stops.csv b/assets/bus_stops.csv new file mode 100644 index 0000000..b5fdcb6 --- /dev/null +++ b/assets/bus_stops.csv @@ -0,0 +1,1410 @@ +"Location","Description","Bay","Latitude","Longitude","", +"HA030001","Bournemouth Rd os Asda S","","50 58.0700N","1 23.4674W","", +"HA030002","Bournemouth Rd opp Asda N","","50 58.0846N","1 23.4723W","", +"HA030012","Bournemouth Rd os The Hut SW","","50 58.7567N","1 23.1242W","", +"HA030013","Bournemouth Rd opp The Hut NE","","50 58.7804N","1 23.1153W","", +"HA030014","Winchester Rd os Chan Ford Precinct SW","","50 58.9599N","1 22.9856W","", +"HA030015","Winchester Rd opp Chan Ford Precinct NE","","50 58.9928N","1 22.9706W","", +"HA030039","Baddesley Rd nr Baddesley Bridge N","","50 59.7931N","1 23.9441W","", +"HA030040","Baddesley Rd nr Baddesley Bridge S","","50 59.7192N","1 23.9468W","", +"HA030046","Ashdown Rd nr Heathfield Rd NE","","51 0.0926N","1 23.0227W","", +"HA030047","Ashdown Rd nr Heathfield Rd SW","","51 0.0857N","1 23.0314W","", +"HA030066","Winchester Rd nr Peverells Wood Ave SW","","50 59.3538N","1 22.2802W","", +"HA030067","Winchester Rd os Fryern Arcade NE","","50 59.2690N","1 22.4677W","", +"HA030068","Winchester Rd nr Fryern Arcade SW","","50 59.2365N","1 22.5366W","", +"HA030069","Winchester Rd nr Kings Rd SW","","50 59.1213N","1 22.7980W","", +"HA030071","Winchester Rd nr Peverells Wood Ave NE","","50 59.3962N","1 22.2386W","", +"HA030072","Winchester Rd os Thornden School SW","","50 59.5922N","1 21.9684W","", +"HA030107","Bournemouth Rd nr Leigh Rd N","","50 58.5314N","1 23.2776W","", +"HA030108","Bournemouth Rd nr Leigh Rd S","","50 58.4571N","1 23.3008W","", +"HA030122","Chestnut Ave nr Golf Driving Range W","","50 57.7100N","1 22.7159W","", +"HA030123","Chestnut Ave nr Golf Driving Range E","","50 57.7010N","1 22.6511W","", +"HA030124","Chestnut Ave nr The Cricketers W","","50 57.6628N","1 22.4722W","", +"HA030125","Chestnut Ave nr The Cricketers E","","50 57.6663N","1 22.4235W","", +"HA030128","Nightingale Ave nr Passfield Ave E","","50 57.8230N","1 22.2582W","", +"HA030130","Nightingale Ave nr Linnet Square W","","50 57.8171N","1 22.5787W","", +"HA030131","Nightingale Ave nr Nightingale School E","","50 57.8844N","1 22.7504W","", +"HA030132","Nightingale Ave nr Nightingale School W","","50 57.8911N","1 22.7819W","", +"HA030133","Nightingale Ave nr Robin Square SW","","50 57.8384N","1 22.9236W","", +"HA030134","Nightingale Ave nr Robin Square NE","","50 57.8331N","1 22.9356W","", +"HA030179","Winchester Rd os Nuffield Hospital SW","","50 59.8228N","1 21.6061W","", +"HA030180","Winchester Rd opp Nuffield Hospital NE","","50 59.8149N","1 21.6379W","", +"HA030181","Winchester Rd opp Thornden School NE","","50 59.6679N","1 21.8878W","", +"HA030183","Parkway Station Mitchell Way NE","","50 56.9805N","1 21.8186W","", +"HA030184","Airport At Terminal Bldg W","","50 57.0478N","1 21.6998W","", +"HA030186","Stoneham Ln os Trojans N","","50 57.0410N","1 22.4302W","", +"HA030187","Stoneham Ln opp Trojans S","","50 57.0410N","1 22.4251W","", +"HA030188","Stoneham Ln os St Nicolas Church N","","50 57.2395N","1 22.4164W","", +"HA030189","Stoneham Ln opp St Nicolas Church S","","50 57.2389N","1 22.4104W","", +"HA030190","Stoneham Ln os Concorde Club S","","50 57.3684N","1 22.3028W","", +"HA030191","Stoneham Ln opp Concorde Club N","","50 57.3878N","1 22.3119W","", +"HA030192","Chestnut Ave opp Barton Peveril Coll W","","50 57.6679N","1 21.9237W","", +"HA030193","Chestnut Ave os Barton Peveril Coll E","","50 57.6700N","1 21.8997W","", +"HA030194","Chestnut Ave opp Eastleigh Coll W","","50 57.6425N","1 21.6216W","", +"HA030195","Chestnut Ave os Eastleigh Coll E","","50 57.6580N","1 21.5846W","", +"HA030196","Chestnut Ave nr Desborough Rd E","","50 57.6461N","1 21.3891W","", +"HA030197","Chestnut Ave nr High St W","","50 57.6285N","1 21.3279W","", +"HA030198","Southampton Rd nr York Rd NE","","50 57.5557N","1 21.3391W","", +"HA030199","Southampton Rd nr York Rd SW","","50 57.5085N","1 21.3740W","", +"HA030200","Wide Ln nr Parkway Station NE","","50 57.1627N","1 21.6956W","", +"HA030201","Parkway Station Wide Ln SW","","50 57.0581N","1 21.8073W","", +"HA030202","Southampton Rd nr Derby Rd SW","","50 57.7356N","1 21.1820W","", +"HA030203","Southampton Rd nr Derby Rd NE","","50 57.7502N","1 21.1775W","", +"HA030204","Southampton Rd nr Campbell Rd N","","50 57.8862N","1 21.0910W","", +"HA030205","Southampton Rd nr Campbell Rd S","","50 57.8846N","1 21.0851W","", +"HA030206","Southampton Rd nr The Swan Centre N","","50 58.0532N","1 21.0451W","", +"HA030207","Eastleigh Station Station Hill S","","50 58.1637N","1 21.0240W","", +"HA030208","Eastleigh bus station Stnd E","","50 58.1793N","1 21.1203W","", +"HA030209","Eastleigh bus station Stnd D","","50 58.1885N","1 21.1202W","", +"HA030212","Eastleigh bus station Stnd A","","50 58.2176N","1 21.1163W","", +"HA030213","Romsey Rd nr Newtown Rd E","","50 58.2319N","1 21.2580W","", +"HA030214","Leigh Rd nr Smithe Cl E","","50 58.2010N","1 21.6173W","", +"HA030215","Leigh Rd nr Sopwith Rd W","","50 58.2017N","1 21.6549W","", +"HA030216","Leigh Rd nr Dew Ln SE","","50 58.2603N","1 21.9139W","", +"HA030217","Leigh Rd nr Dew Ln NW","","50 58.2643N","1 21.9429W","", +"HA030218","Derby Rd nr Passfield Ave W","","50 57.8942N","1 22.1649W","", +"HA030219","Derby Rd nr Spencer Rd E","","50 57.8906N","1 22.0975W","", +"HA030220","Derby Rd nr Grantham Rd W","","50 57.8586N","1 21.8570W","", +"HA030221","Derby Rd nr Grantham Rd E","","50 57.8595N","1 21.8279W","", +"HA030222","Derby Rd nr Nutbeam Rd W","","50 57.8229N","1 21.5525W","", +"HA030223","Derby Rd nr Nutbeam Rd E","","50 57.8244N","1 21.5277W","", +"HA030224","Derby Rd os All Saints Church E","","50 57.8018N","1 21.3340W","", +"HA030225","Derby Rd nr High St os cafe W","","50 57.7878N","1 21.2573W","", +"HA030233","Bishopstoke Rd opp Dutton Ln W","","50 58.2056N","1 20.7961W","", +"HA030234","Bishopstoke Rd nr Chickenhall Ln E","","50 58.2164N","1 20.7011W","", +"HA030235","Riverside at jnc Fair Oak Rd S","","50 58.1899N","1 20.2058W","", +"HA030236","Spring Ln opp 16 NE","","50 58.2686N","1 20.2047W","", +"HA030237","Sedgewick Rd opp 2 NE","","50 58.2630N","1 20.0680W","", +"HA030238","Sedgewick Rd nr Hamilton Rd SW","","50 58.2770N","1 20.0653W","", +"HA030239","Sedgewick Rd nr East Dr SW","","50 58.4106N","1 20.0215W","", +"HA030240","Sedgewick Rd nr West Dr NE","","50 58.4514N","1 19.9961W","", +"HA030247","Stoke Park Rd os 61 E","","50 58.4854N","1 19.8922W","", +"HA030248","Stoke Park Rd opp 61 W","","50 58.4828N","1 19.9085W","", +"HA030249","Underwood Rd os 28 W","","50 58.4220N","1 19.8427W","", +"HA030250","Underwood Rd os 31 E","","50 58.4235N","1 19.8239W","", +"HA030251","Underwood Rd East Dr N","","50 58.3492N","1 19.7617W","", +"HA030252","Underwood Rd East Dr S","","50 58.3346N","1 19.7500W","", +"HA030253","Underwood Rd nr Shears Rd N","","50 58.1915N","1 19.7366W","", +"HA030254","Underwood Rd nr Hamilton Rd S","","50 58.1801N","1 19.7265W","", +"HA030259","Underwood Rd nr Fair Oak Rd NW","","50 58.0029N","1 19.6804W","", +"HA030260","Fair Oak Rd nr Alan Drayton Way W","","50 57.9770N","1 19.5808W","", +"HA030261","Fair Oak Rd os 207 SE","","50 57.8931N","1 19.3599W","", +"HA030262","Fair Oak Rd os Welcome Inn NW","","50 57.8811N","1 19.3327W","", +"HA030263","Fair Oak Rd nr Weavils Rd NE","","50 57.8917N","1 19.1061W","", +"HA030264","Fair Oak Rd nr Weavils Rd SW","","50 57.8989N","1 19.0573W","", +"HA030265","Fair Oak Rd nr Haig Rd NE","","50 57.9373N","1 18.8765W","", +"HA030266","Fair Oak Rd nr Haig Rd SW","","50 57.9425N","1 18.8533W","", +"HA030267","Fair Oak Rd nr Sandy Ln SE","","50 57.8633N","1 18.4094W","", +"HA030268","Fair Oak Rd opp 365 NW","","50 57.8541N","1 18.4035W","", +"HA030269","Sandy Ln nr New Rd NE","","50 57.9480N","1 18.3141W","", +"HA030272","Sandy Ln opp Victena Rd N","","50 58.0996N","1 18.2272W","", +"HA030273","Sandy Ln nr Winchester Rd NE","","50 58.3074N","1 18.1455W","", +"HA030283","Winchester Rd nr Witt Rd SE","","50 58.1324N","1 17.9379W","", +"HA030289","Fair Oak Rd opp Cricketers Arms W","","50 57.8731N","1 17.8752W","", +"HA030292","Fair Oak Rd os 412 W","","50 57.7887N","1 18.2088W","", +"HA030305","Wildern Ln os Co-Op N","","50 54.8370N","1 18.2418W","", +"HA030306","St Johns Rd os shops NE","","50 54.7840N","1 18.2272W","", +"HA030307","St Johns Rd opp church hall SW","","50 54.7447N","1 18.2423W","", +"HA030308","Lower Northam Rd os Somerfield SW","","50 54.8246N","1 18.1635W","", +"HA030309","Lower Northam Rd nr Cedar Cl NE","","50 54.8460N","1 18.1222W","", +"HA030310","Wildern Ln nr Dean Ct NE","","50 54.9667N","1 18.1912W","", +"HA030311","Wildern Ln opp Wildern School NW","","50 55.0654N","1 18.1804W","", +"HA030312","Wilden Ln os Shamblehurst School SE","","50 55.1310N","1 18.2374W","", +"HA030313","Wildern Ln os Hedge End Junior School N","","50 55.1868N","1 18.2741W","", +"HA030314","Wildern Ln nr Westward Rd S","","50 55.2820N","1 18.2258W","", +"HA030315","Wildern Ln nr Westward Rd N","","50 55.2794N","1 18.2369W","", +"HA030323","Grange Rd nr Botleigh Grange SE","","50 55.1836N","1 17.8371W","", +"HA030326","Grange Rd opp Maypole Retirement Home SE","","50 55.0070N","1 17.5436W","", +"HA030328","Lwr Northam Rd os 116-118 SW","","50 54.9483N","1 17.5505W","", +"HA030329","Lower Northam Rd os 70 SW","","50 54.9029N","1 17.8115W","", +"HA030331","Turnpike Way nr Goodlands Vale NE","","50 54.8790N","1 18.7746W","", +"HA030336","Turnpike Way opp Berrywood Gdns SE","","50 55.1769N","1 18.5193W","", +"HA030337","Hedge End Superstores off Tollbar Way","","50 55.2299N","1 18.7276W","", +"HA030338","Tollbar Way opp McDonalds N","","50 55.4250N","1 18.7802W","", +"HA030339","Tollbar Way os Pizza Hut S","","50 55.4641N","1 18.7327W","", +"HA030342","Tollbar Way nr Wellington Park SW","","50 55.5527N","1 18.6477W","", +"HA030343","Tollbar Way nr Wellington Park NE","","50 55.5699N","1 18.6407W","", +"HA030344","Tollbar Way nr Wellstead Way N","","50 55.8610N","1 18.5006W","", +"HA030345","Maunsell Way nr Peppercorn Way W","","50 56.0512N","1 18.2800W","", +"HA030346","Maunsell Way nr Peppercorn Way E","","50 56.0509N","1 18.2220W","", +"HA030347","Maunsell Way nr Marlborough Gdns SE","","50 55.9900N","1 18.0641W","", +"HA030348","Maunsell Way nr Marlborough Gdns NW","","50 55.9868N","1 18.0667W","", +"HA030349","Maunsell Way nr Martley Gdns NW","","50 55.9116N","1 17.8527W","", +"HA030350","Maunsell Way nr Martley Gdns SE","","50 55.9154N","1 17.8526W","", +"HA030351","Hedge End Station","","50 55.9241N","1 17.6800W","", +"HA030352","Maunsell Way nr Watkin Rd NW","","50 55.8303N","1 17.7045W","", +"HA030353","Maunsell Way nr Watkin Rd SE","","50 55.8243N","1 17.6900W","", +"HA030354","Maunsell Way nr Giles Cl SW","","50 55.6392N","1 17.7714W","", +"HA030355","Maunsell Way nr Giles Cl NE","","50 55.6263N","1 17.7861W","", +"HA030356","Locke Rd nr Walker Gdns NE","","50 55.3750N","1 17.8915W","", +"HA030357","Locke Rd nr Missenden Acres SW","","50 55.3523N","1 17.8969W","", +"HA030377","Moorgreen Rd os 5 N","","50 55.6741N","1 19.6781W","", +"HA030378","Moorgreen Rd nr Botley Rd S","","50 55.6628N","1 19.6715W","", +"HA030379","Botley Rd nr Moorgreen Rd E","","50 55.6384N","1 19.6505W","", +"HA030380","Botley Rd opp Moorgreen Hospital W","","50 55.6308N","1 19.5524W","", +"HA030381","Botley Rd nr Marshall Dr NW","","50 55.5998N","1 19.2336W","", +"HA030382","Botley Rd nr Marshall Dr SE","","50 55.5880N","1 19.1501W","", +"HA030383","High St opp St Brigid ch W","","50 55.6377N","1 19.9109W","", +"HA030384","High St os St Brigid ch E","","50 55.6447N","1 19.9108W","", +"HA030385","High St os Netto E","","50 55.6580N","1 20.1607W","", +"HA030386","High St os 48 W","","50 55.6565N","1 20.1847W","", +"HA030387","High St nr Barbe Baker Ave E","","50 55.7325N","1 20.5430W","", +"HA030388","High St nr Barbe Baker Ave W","","50 55.7255N","1 20.5525W","", +"HA030389","Swaythling Rd nr Barnsland SE","","50 55.9319N","1 20.8049W","", +"HA030390","Swaythling Rd nr Barnsland NW","","50 55.9558N","1 20.8267W","", +"HA030391","Swaythling Rd nr Romill Cl SE","","50 56.1037N","1 21.1261W","", +"HA030395","Bursledon Rd nr Windhover Rbt SE","","50 53.8210N","1 19.3516W","", +"HA030396","Bursledon Rd nr Windhover Rbt NW","","50 53.8287N","1 19.3796W","", +"HA030402","Bursledon Rd nr Foord Rd NE","","50 54.2936N","1 18.5144W","", +"HA030404","Bursledon Rd nr Alexandra Rd NE","","50 54.4397N","1 18.4013W","", +"HA030405","Bursledon Rd opp 43 NE","","50 54.5882N","1 18.3257W","", +"HA030407","St Johns Rd nr Newcliffe Gdns NE","","50 54.6227N","1 18.4106W","", +"HA030408","St Johns Rd nr Newcliffe Gdns SW","","50 54.6249N","1 18.4148W","", +"HA030410","St Johns Rd nr Foord Rd NE","","50 54.3925N","1 18.7272W","", +"HA030413","Heathhouse Ln Bursledon Rd NW","","50 54.2513N","1 18.4801W","", +"HA030414","Heathhouse Ln nr Upper St Helens Rd SE","","50 54.2482N","1 18.4050W","", +"HA030415","Heathhouse Ln nr Sherwood Ave SE","","50 54.2104N","1 18.2093W","", +"HA030416","Heathhouse Ln nr Sherwood Ave NW","","50 54.1957N","1 18.1874W","", +"HA030417","Kings Copse Ave nr Heathhouse Ln NE","","50 54.3072N","1 17.8034W","", +"HA030418","Kings Copse Ave nr Heathhouse Ln SW","","50 54.3055N","1 17.7855W","", +"HA030419","Kings Copse Ave nr Duke Rd NE","","50 54.4362N","1 17.5463W","", +"HA030420","Kings Copse Ave nr Duke Rd SW","","50 54.4453N","1 17.5325W","", +"HA030421","Kings Copse Ave nr Sovereign Dr NE","","50 54.5804N","1 17.4835W","", +"HA030422","Kings Copse Ave nr Sovereign Dr SW","","50 54.5896N","1 17.4757W","", +"HA030423","Kings Copse Ave nr Whitebeam Rd S","","50 54.7728N","1 17.4396W","", +"HA030424","Kings Copse Ave nr Whitebeam Rd N","","50 54.7922N","1 17.4445W","", +"HA030425","Kings Copse Ave nr Broad Oak N","","50 54.9094N","1 17.4512W","", +"HA030426","Kings Copse Ave nr Broad Oak S","","50 54.9255N","1 17.4501W","", +"HA030431","Winchester St nr Woodhouse Ln NW","","50 55.4140N","1 16.6821W","", +"HA030435","Holmesland Ln nr Holmesland Dr N","","50 54.9965N","1 16.7081W","", +"HA030436","High St nr Mortimer Rd SE","","50 54.9033N","1 16.4697W","", +"HA030437","High St nr Mortimer Rd NW","","50 54.9001N","1 16.4766W","", +"HA030438","High St os 25 W","","50 54.8564N","1 16.2981W","", +"HA030439","High St os 22 E","","50 54.8627N","1 16.2715W","", +"HA030440","Winchester St nr Holmesland Dr SE","","50 55.1472N","1 16.4625W","", +"HA030441","High St nr Holmesland Ln SE","","50 54.9735N","1 16.7341W","", +"HA030442","High St nr Holmesland Ln NW","","50 54.9725N","1 16.7503W","", +"HA030443","Broad Oak os Broadway Farm E","","50 54.9486N","1 16.9906W","", +"HA030444","Broad Oak opp Broadway Farm W","","50 54.9532N","1 17.0349W","", +"HA030445","Grange Rd nr footpath to Marls Rd W","","50 54.9727N","1 17.3896W","", +"HA030446","West end Rd opp 273 SW","","50 55.3791N","1 20.6428W","", +"HA030447","West end Rd os 277 NE","","50 55.3870N","1 20.6179W","", +"HA030450","Townhill Way nr Swaythling Rd NE","","50 56.0284N","1 20.9709W","", +"HA030451","Townhill Way nr Swaythling Rd SW","","50 56.0133N","1 20.9694W","", +"HA030452","Townhill Way nr Frome Rd NE","","50 55.9906N","1 21.1703W","", +"HA030453","Townhill Way os Two Brothers ph SW","","50 55.9525N","1 21.1948W","", +"HA030454","Townhill Way nr path to Gatcombe Gdns N","","50 55.8309N","1 21.2588W","", +"HA030456","Townhill Way nr Cerne Cl SW","","50 55.6129N","1 21.1722W","", +"HA030457","Townhill Way nr Cerne Cl NE","","50 55.6007N","1 21.1988W","", +"HA030465","Burnetts Ln os Chalcroft Pk NE","","50 56.4838N","1 18.3453W","", +"HA030466","Burnetts Ln opp Chalcroft Pk SW","","50 56.4827N","1 18.3428W","", +"HA030477","Oakhill opp Crows Nest ph NW","","50 53.3853N","1 18.5561W","", +"HA030478","Oakhill os Crows Nest ph SE","","50 53.3922N","1 18.5414W","", +"HA030483","Portsmouth Rd opp One Stop NE","","50 53.3785N","1 18.9622W","", +"HA030484","Portsmouth Rd opp community cnt SW","","50 53.3706N","1 19.0067W","", +"HA030485","Jurd Way nr Lionheart Way S","","50 53.4000N","1 19.3279W","", +"HA030486","Jurd Way nr Lionheart Way N","","50 53.4351N","1 19.3239W","", +"HA030487","Windhover Tesco access rd","","50 53.6219N","1 19.2521W","", +"HA030488","Hamble Ln os Tesco SW","","50 53.6948N","1 19.2630W","", +"HA030490","Portsmouth Rd nr Beverley Gdns NW","","50 53.3538N","1 19.7414W","", +"HA030491","Portsmouth Rd os Plough ph NW","","50 53.3644N","1 19.8001W","", +"HA030492","Portsmouth Rd nr Grange Rd SE","","50 53.4494N","1 20.1205W","", +"HA030493","Portsmouth Rd nr Grange Rd NW","","50 53.4500N","1 20.1358W","", +"HA030494","Portsmouth Rd opp sports ground NW","","50 53.5113N","1 20.3824W","", +"HA030495","Portsmouth Rd os sports ground SE","","50 53.5178N","1 20.3908W","", +"HA030496","Hamble Ln nr Pound Rd NE","","50 53.2863N","1 19.4421W","", +"HA030498","Hamble Ln nr Cunningham Gdns N","","50 53.1655N","1 19.4541W","", +"HA030500","Hamble Ln opp Broadway N","","50 52.4137N","1 19.7097W","", +"HA030501","Hamble Ln nr Broadway S","","50 52.3975N","1 19.6980W","", +"HA030502","Hamble Ln opp 106 N","","50 52.0730N","1 19.6617W","", +"HA030504","Hamble Ln nr Verdon Ave NE","","50 51.8379N","1 19.6933W","", +"HA030505","Hamble Ln nr Verdon Ave SW","","50 51.8288N","1 19.6942W","", +"HA030506","Hamble Ln opp 42 NW","","50 51.6904N","1 19.6468W","", +"HA030507","Hamble Ln os 34 SE","","50 51.6772N","1 19.6129W","", +"HA030508","Hamble Ln nr Ensign Way NW","","50 51.5634N","1 19.4227W","", +"HA030509","Hamble Ln opp Fire Stn SE","","50 51.5471N","1 19.3215W","", +"HA030510","Hamble Ln nr Copse Ln NW","","50 51.5305N","1 19.2433W","", +"HA030511","High St os village hall NE","","50 51.5323N","1 19.1777W","", +"HA030512","Hamble Square","","50 51.5458N","1 18.9038W","", +"HA030516","Hound Way nr Hamble Ln E","","50 52.5875N","1 19.7985W","", +"HA030517","Hound Way nr Hamble Ln W","","50 52.5882N","1 19.8266W","", +"HA030518","Hound Way nr Hound Rd W","","50 52.5869N","1 20.0790W","", +"HA030519","Hound Way nr Hound Rd E","","50 52.5897N","1 20.0969W","", +"HA030521","Woolston Rd os Hound Post Office NW","","50 52.7047N","1 20.3093W","", +"HA030522","Woolston Rd os 64 SE","","50 52.7318N","1 20.3294W","", +"HA030523","Woolston Rd nr Ingleside W","","50 52.9410N","1 20.5823W","", +"HA030524","Grange Rd nr Woolston Rd NE","","50 52.9449N","1 20.7025W","", +"HA030525","Grange Rd nr Woolston Rd SW","","50 52.9374N","1 20.7086W","", +"HA030526","Grange Rd os Mill House ph SW","","50 52.8437N","1 20.9377W","", +"HA030527","Grange Rd opp Mill House ph NE","","50 52.8330N","1 20.9549W","", +"HA030528","Grange Rd nr St Edwards Rd NE","","50 52.7840N","1 21.0749W","", +"HA030529","Grange Rd nr St Edwards Rd SW","","50 52.7578N","1 21.1197W","", +"HA030530","Grange Rd nr New Rd SW","","50 52.6387N","1 21.3294W","", +"HA030531","Grange Rd nr New Rd NE","","50 52.6366N","1 21.3448W","", +"HA030532","Victoria Rd opp York Rd SE","","50 52.5004N","1 21.3049W","", +"HA030533","Victoria Rd nr Manchester Rd NW","","50 52.4728N","1 21.2856W","", +"HA030534","Station Rd opp Lloyds Bank NE","","50 52.3938N","1 21.1426W","", +"HA030535","Station Rd opp social club SW","","50 52.4162N","1 21.1022W","", +"HA030536","Station Rd nr Denzil Ave E","","50 52.4747N","1 20.9445W","", +"HA030537","Station Rd opp Denzil Ave NW","","50 52.4495N","1 20.8783W","", +"HA030538","St Marys Rd nr Station Rd SW","","50 52.4697N","1 20.6325W","", +"HA030539","St Marys Rd nr Station Rd NE","","50 52.4923N","1 20.6185W","", +"HA030540","Ingleside nr Yaverland S","","50 52.7007N","1 20.5533W","", +"HA030541","Ingleside nr Yaverland N","","50 52.7040N","1 20.5584W","", +"HA030542","Ingleside nr Bowcombe NW","","50 52.8536N","1 20.5819W","", +"HA030546","Winchester Rd nr Oatlands Rd SE","","50 55.5303N","1 16.7349W","", +"HA030548","Winchester Rd nr Madoxford Ln SE","","50 55.7254N","1 16.8659W","", +"HA030564","Botley Rd opp Holiday Inn E","","50 55.6309N","1 19.3902W","", +"HA040001","Bridge Rd opp Spinnaker ph NW","","50 53.0220N","1 17.9891W","", +"HA040002","Bridge Rd opp Swanwick Shore Rd SE","","50 52.9386N","1 17.8402W","", +"HA040005","Bridge Rd nr Chapel Rd NW","","50 52.5871N","1 17.3551W","", +"HA040006","Bridge Rd nr Chapel Rd SE","","50 52.5775N","1 17.2922W","", +"HA040014","A27 Bridge Road opp 39 SE","","50 52.3007N","1 16.0710W","", +"HA040023","Centre Way os community centre E","","50 51.7933N","1 16.3783W","", +"HA040024","Locks Rd nr Church Rd S","","50 51.7547N","1 16.2442W","", +"HA040043","Osborne Rd nr Romford Rd W","","50 50.8968N","1 17.7321W","", +"HA040047","Warsash Rd opp Ferryman ph E","","50 51.2003N","1 17.9645W","", +"HA040048","Brook Ln nr Warsash Rd N","","50 51.2232N","1 18.0076W","", +"HA040075","Hunts Pond Rd nr Lower Church Rd SW","","50 51.7096N","1 15.6020W","", +"HA040076","Church Rd nr Hunts Pond Rd SE","","50 51.6898N","1 15.6245W","", +"HA040078","Hunts Pond Rd nr Church Rd NW","","50 51.6545N","1 15.5799W","", +"HA040082","Abshot Rd nr Talland Rd NE","","50 51.1933N","1 15.8574W","", +"HA040083","Abshot Rd nr Talland Rd SW","","50 51.1809N","1 15.8653W","", +"HA040108","Southampton Hill nr High St NW","","50 51.0295N","1 14.1425W","", +"HA040109","Southampton Hill nr High St SE","","50 51.0356N","1 14.1552W","", +"HA040240","Fareham bus station Stnd A","","50 51.1163N","1 10.7759W","", +"HA040276","The Avenue opp Fareham Coll E","","50 51.1262N","1 11.9716W","", +"HA040277","The Avenue nr Bishopsfield Rd W","","50 51.1043N","1 12.0828W","", +"HA040297","Stubbington Ln nr Eric Rd S","","50 49.3016N","1 12.8879W","", +"HA040298","Stubbington Ln nr William Cl NW","","50 49.1651N","1 12.8084W","", +"HA040471","Hunts Pond Rd nr Admirals Rd SE","","50 52.1849N","1 15.8545W","", +"HA050111","Marine Parade East nr Milvil Rd NW","","50 48.1129N","1 12.2394W","", +"HA050112","Milvil Rd nr Marine Parade East SW","","50 48.1496N","1 12.2371W","", +"HA050135","Gomer Ln opp Bay House School NE","","50 47.2736N","1 9.9580W","", +"HA050136","Gomer Ln os Bay House School SW","","50 47.2823N","1 9.9025W","", +"HA050159","Bury Rd os Hospital SE","","50 47.5570N","1 8.8659W","", +"HA050160","Bury Rd opp Hospital NW","","50 47.5489N","1 8.8575W","", +"HA050182","Gosport Bus Stn stand A","","50 47.6709N","1 7.0564W","", +"HA080007","Romsey Rd nr A36 Salisbury Rd NE","","50 57.1599N","1 32.1672W","", +"HA080008","Romsey Rd nr A36 Salisbury Rd SW","","50 57.1243N","1 32.1803W","", +"HA080019","Salisbury Rd nr Testwood Cres NW","","50 55.9253N","1 30.4309W","", +"HA080020","Salisbury Rd nr Testwood Cres SE","","50 55.8865N","1 30.3272W","", +"HA080021","Salisbury Rd nr Stanley Rd NW","","50 55.7676N","1 30.1508W","", +"HA080022","Salisbury Rd nr Stanley Rd SE","","50 55.7443N","1 30.1110W","", +"HA080023","Salisbury Rd nr Sylvia Cres SE","","50 55.6500N","1 30.0292W","", +"HA080024","Salisbury Rd nr Sylvia Cres NW","","50 55.5938N","1 30.0033W","", +"HA080025","Salisbury Rd nr Hammonds Ln NW","","50 55.4138N","1 29.8055W","", +"HA080026","Salisbury Rd nr Testwood Ln SE","","50 55.3681N","1 29.7121W","", +"HA080027","Salisbury Rd nr Oakmount Ave NW","","50 55.2601N","1 29.5733W","", +"HA080028","Salisbury Rd nr Stannington Cres SE","","50 55.2118N","1 29.4936W","", +"HA080029","Salisbury Rd nr Water Ln NW","","50 55.1885N","1 29.4673W","", +"HA080030","Library Rd nr Testwood Ln E","","50 55.1367N","1 29.2357W","", +"HA080031","Commercial Rd opp RC Church NW","","50 55.1126N","1 29.1549W","", +"HA080032","Commercial Rd opp Red Lion ph W","","50 55.0957N","1 28.9835W","", +"HA080033","Commercial Rd nr bypass jnc NE","","50 55.1299N","1 28.9226W","", +"HA080034","Ringwood Rd os Asda SW","","50 55.0981N","1 29.4120W","", +"HA080043","Water Ln opp Totton Coll SW","","50 55.2235N","1 30.4631W","", +"HA080044","Water Ln os Totton Coll NE","","50 55.2198N","1 30.4794W","", +"HA080049","Calmore Rd nr Shepherds Hey Rd S","","50 55.6314N","1 31.2485W","", +"HA080051","Calmore Rd nr Shepherds Hey Rd N","","50 55.7385N","1 31.1885W","", +"HA080052","Calmore Rd nr The Drove NE","","50 55.7412N","1 31.1918W","", +"HA080054","Calmore Rd nr Cooks Ln S","","50 55.8963N","1 31.1091W","", +"HA080056","Calmore Dr nr Embley Cl S","","50 55.8709N","1 30.5792W","", +"HA080057","Blackwater Dr nr Bearslane Cl SE","","50 55.6830N","1 30.5445W","", +"HA080058","Blackwater Dr nr Mortimer Cl S","","50 55.5333N","1 30.3702W","", +"HA080059","Blackwater Dr nr Calmore Dr NW","","50 55.5154N","1 30.6094W","", +"HA080060","Calmore Dr nr Bowater Way SW","","50 55.5185N","1 30.6862W","", +"HA080061","Calmore Dr nr Appletree Cl NW","","50 55.4656N","1 30.9377W","", +"HA080063","Calmore Dr nr Richmond Cl NE","","50 55.6797N","1 31.0516W","", +"HA080064","Calmore Dr nr Friars Croft NE","","50 55.8319N","1 30.9322W","", +"HA080065","Calmore Dr nr Warren Pl NE","","50 55.9091N","1 30.8187W","", +"HA080068","Loperwood opp Tachbury Mount Hosp E","","50 55.9296N","1 31.8738W","", +"HA080069","Loperwood os Tachbury Mount Hosp W","","50 55.9269N","1 31.8806W","", +"HA080074","Winsor Rd opp Compass Inn NE","","50 55.6841N","1 32.9588W","", +"HA080075","Winsor Rd nr Compass Inn SW","","50 55.6766N","1 32.9708W","", +"HA080090","Romsey Rd A31 nr Southampton Rd A336 SW","","50 55.3804N","1 34.7185W","", +"HA080091","Romsey Rd A31 nr Southampton Rd A336 NE","","50 55.3440N","1 34.7914W","", +"HA080092","Southampton Rd A336 nr Romsey Rd A36 E","","50 55.2214N","1 34.7797W","", +"HA080093","Southampton Rd A336 nr Romsey Rd A36 W","","50 55.2145N","1 34.8028W","", +"HA080094","Southampton Rd A336 nr Fir Tree Rd SE","","50 55.1532N","1 34.4201W","", +"HA080095","Southampton Rd A336 nr Fir Tree Rd NW","","50 55.1484N","1 34.4227W","", +"HA080096","Southampton Rd A336 nr Barneyhayes Ln E","","50 55.1330N","1 34.2001W","", +"HA080097","Southampton Rd A336 nr Barneyhayes Ln W","","50 55.1292N","1 34.2001W","", +"HA080098","Southampton Rd A336 nr Winsor Rd SE","","50 55.0366N","1 33.8015W","", +"HA080099","Southampton Rd A336 nr Winsor Rd NW","","50 55.0354N","1 33.7716W","", +"HA080100","Ringwood Rd A336 nr Woodlands Rd W","","50 54.9311N","1 31.7866W","", +"HA080101","Ringwood Rd A336 nr Woodlands Rd E","","50 54.9265N","1 31.7107W","", +"HA080102","Ringwood Rd A336 nr A326 SE","","50 54.9054N","1 31.3012W","", +"HA080103","Ringwood Rd A336 nr A326 NW","","50 54.8956N","1 31.2885W","", +"HA080104","Ringwood Rd A336 nr Crabbs Way NE","","50 54.9276N","1 31.0697W","", +"HA080105","Ringwood Rd A336 nr Crabbs Way SW","","50 54.9265N","1 31.0526W","", +"HA080107","Ringwood Rd A336 nr Ln rchwood Rd SW","","50 54.9948N","1 30.6089W","", +"HA080108","Ringwood Rd A336 nr Ln rchwood Rd NE","","50 55.0080N","1 30.5473W","", +"HA080109","Ringwood Rd A336 nr Testbourne Ave SW","","50 55.0420N","1 30.2994W","", +"HA080111","Ringwood Rd A336 nr Calmore Rd E","","50 55.0583N","1 30.1926W","", +"HA080112","Ringwood Rd A336 nr Southern Gdns E","","50 55.0528N","1 29.9212W","", +"HA080113","Ringwood Rd nr Bagber Rd E","","50 55.0362N","1 29.6969W","", +"HA080115","Woodlands Rd os White Horse SW","","50 54.9094N","1 31.7492W","", +"HA080120","Woodlands Rd nr Green Cl NE","","50 54.3228N","1 32.3994W","", +"HA080121","Woodlands Rd nr Green Cl SW","","50 54.3109N","1 32.4098W","", +"HA080134","Bourne Rd - nr Paradise Ln N","","50 54.7241N","1 33.2045W","", +"HA080135","Bourne Rd - nr Paradise Ln S","","50 54.7235N","1 33.2002W","", +"HA080200","A35 Totton bypass nr Rushington Rbt SW","","50 54.8024N","1 29.4127W","", +"HA080201","A35 Totton bypass nr Rushington Rbt NE","","50 54.8207N","1 29.4048W","", +"HA080203","Spicers Hill nr Hounsdown Ave S","","50 54.5668N","1 29.7071W","", +"HA080211","A35 Main Rd adj New Inn SW","","50 54.3964N","1 29.8532W","", +"HA080212","A35 Main Rd opp New Inn NE","","50 54.4051N","1 29.8702W","", +"HA080221","Lyndhurst Rd os 159 SW","","50 53.5630N","1 31.3022W","", +"HA080222","Lyndhurst Rd os 124 NE","","50 53.5668N","1 31.3149W","", +"HA080225","Ashdene Rd nr Whartons Ln SW","","50 54.1005N","1 30.8188W","", +"HA080226","Ashdene Rd nr Whartons Ln NE","","50 54.1032N","1 30.8205W","", +"HA080236","Lackford Ave os 108 NE","","50 54.7929N","1 29.8353W","", +"HA080237","Lackford Ave os 87 SW","","50 54.7908N","1 29.8319W","", +"HA080254","Tavells Ln opp Woodpecker Dr NE","","50 53.5396N","1 27.4610W","", +"HA080255","Tavells Ln nr Woodpecker Dr SW","","50 53.5305N","1 27.4748W","", +"HA080260","Main Rd nr Vicarage Rd NE","","50 53.4080N","1 27.1222W","", +"HA080261","Main Rd opp ch SW","","50 53.3878N","1 27.1864W","", +"HA080287","Claypits Ln opp Rowhill Dr NW","","50 51.8677N","1 25.8895W","", +"HA080288","Claypits Ln nr Rowhill Dr SE","","50 51.8605N","1 25.8614W","", +"HA080294","Cumberland Way nr Capella Gdns SW","","50 51.8717N","1 25.2772W","", +"HA080295","Challenger Way nr Corsair Dr SW","","50 51.8519N","1 25.1948W","", +"HA080312","Claypits Ln nr Draper Copse SW","","50 52.0687N","1 25.4087W","", +"HA080313","Claypits Ln nr Draper Copse NE","","50 52.0746N","1 25.3984W","", +"HA080327","Beaulieu Rd os Hythe Hospital NE","","50 51.5495N","1 24.1934W","", +"HA080328","Beaulieu Rd opp Fairview Parade SW","","50 51.5361N","1 24.2115W","", +"HA080335","Beaulieu Rd os The Heath ph SW","","50 51.1048N","1 25.0275W","", +"HA080336","Beaulieu Rd nr Mansell Cl NE","","50 51.0887N","1 25.0414W","", +"HA080357","Prospect Pl os Ferry Terminal SE","","50 52.2422N","1 23.9748W","", +"HA080431","Fawley Rd nr Cedar Rd N","","50 50.8587N","1 23.6380W","", +"HA080432","Fawley Rd nr Hardley Ln track S","","50 50.8246N","1 23.6163W","", +"HA080435","Long Ln nr Main Rd NW","","50 50.3850N","1 23.3365W","", +"HA080436","Long Ln nr Main Rd SE","","50 50.3817N","1 23.3220W","", +"HA080446","Foxcroft Dr nr Studley Ave N","","50 49.7041N","1 23.5388W","", +"HA080447","Foxcroft Dr nr Great Elms Cl S","","50 49.6133N","1 23.5153W","", +"HA080457","Hampton Ln nr Rollestone Rd S","","50 49.4040N","1 22.5026W","", +"HA080458","Hampton Ln nr Rollestone Rd N","","50 49.3971N","1 22.5129W","", +"HA080461","Hampton Ln nr Blackfield Rd SE","","50 49.1011N","1 22.3704W","", +"HA080463","Blackfield Rd nr Hampton Ln NE","","50 49.1170N","1 22.3088W","", +"HA080466","Foresters Rd nr Blackfield Ln SE","","50 49.2670N","1 22.1109W","", +"HA080467","Foresters Rd nr Blackfield Ln NW","","50 49.2621N","1 22.1101W","", +"HA080476","School Rd nr The Square NE","","50 49.6112N","1 21.0337W","", +"HA080487","B3053 Calshot Beach E","","50 48.5782N","1 19.1805W","", +"HA080527","High St os Lyndhurst Park Hotel E","","50 52.3406N","1 34.2898W","", +"HA080528","High St opp Lyndhurst Park Hotel W","","50 52.3332N","1 34.3103W","", +"HA080531","High St opp ch E","","50 52.3577N","1 34.6802W","", +"HA080541","Lyndhurst Rd opp Brockenhurst College N","","50 49.3391N","1 34.3121W","", +"HA080544","Brookley Rd opp rear Forresters Arms NW","","50 49.0933N","1 34.3680W","", +"HA080545","Brookley Rd os front Forresters Arms NE","","50 49.0975N","1 34.3382W","", +"HA080562","Southamtpon Rd A337 opp Hobbler Inn SE","","50 47.4203N","1 33.9713W","", +"HA080563","Southamtpon Rd A337 os Hobbler Inn SE","","50 47.4213N","1 33.9679W","", +"HA080661","Lymington bus station stand C","","50 45.4822N","1 32.4350W","", +"HA081080","Lepe Rd os Whitefield Farm SE","","50 48.2041N","1 21.9175W","", +"HA081165","Ringwood Rd nr Tachbury Ln E","","50 54.9989N","1 32.1529W","", +"HA081166","Ringwood Rd nr Tachbury Ln W","","50 54.9822N","1 32.1454W","", +"HA100009","Knightwood Rd nr Pilgrims Cl SW","","50 58.7492N","1 24.1670W","", +"HA100010","Knightwood Rd nr Chidden Holt NE","","50 58.7834N","1 24.1033W","", +"HA100026","Hool Rd opp Potters Heron S","","51 0.4099N","1 24.7982W","", +"HA100152","A36 Salisbury Rd nr Lower Common Rd SW","","50 58.1106N","1 35.0347W","", +"HA100153","Canada Rd nr Salisbury Rd A36 SW","","50 58.1173N","1 35.1218W","", +"HA100158","A36 Salisbury Rd nr Purley Way SE","","50 58.3542N","1 36.2083W","", +"HA100159","A36 Salisbury Rd nr Purley Way NW","","50 58.3576N","1 36.2604W","", +"HA100220","Romsey bus station Stnd A","","50 59.3000N","1 29.8908W","", +"HA100239","Botley Rd nr Montfort Rd NW","","50 59.1593N","1 27.9639W","", +"HA100240","Botley Rd nr Highwood Ln SE","","50 59.1541N","1 27.8990W","", +"HA100762","Rownhams Rd nr Botley Rd SW","","50 58.6528N","1 26.2716W","", +"HA100763","Botley Rd nr Castle Ln SE","","50 58.6170N","1 26.1233W","", +"HA100770","Chilworth Rd os Chilworth Arms NW","","50 57.8691N","1 25.0062W","", +"HA100771","Chilworth Rd opp Chilworth Arms SE","","50 57.8689N","1 24.9712W","", +"HA100778","Bournemouth Rd nr Chilworth Rd SW","","50 57.4095N","1 24.0603W","", +"HA100779","Bournemouth Rd nr Chilworth Rd NE","","50 57.3778N","1 24.1034W","", +"HA100780","Hilton Hotel A27 nr Chilworth Rbt S","","50 57.2437N","1 24.1487W","", +"HA100783","Fleming Ave nr Bracken Rd E","","50 58.4163N","1 26.3488W","", +"HA100784","Fleming Ave nr Bracken Rd W","","50 58.4105N","1 26.3762W","", +"HA100793","Rownhams Ln M27 bridge SW","","50 57.4282N","1 27.1176W","", +"HA100794","Rownhams Ln M27 bridge NE","","50 57.4288N","1 27.1227W","", +"HA100795","Rownhams Ln nr Routs Way S","","50 57.1877N","1 27.1400W","", +"HA100796","Rownhams Ln nr Routs Way N","","50 57.1915N","1 27.1477W","", +"HA100797","Horns Drove nr Routs Way S","","50 57.2379N","1 27.2496W","", +"HA100798","Horns Drove nr Routs Way N","","50 57.2152N","1 27.2576W","", +"HA100804","Romsey Rd nr Upton Cres SE","","50 57.1080N","1 28.0942W","", +"HA100805","Romsey Rd nr Horns Hill Cl NW","","50 56.8704N","1 27.8270W","", +"HA100806","Romsey Rd nr Horns Hill Cl SE","","50 56.8628N","1 27.8126W","", +"HA100807","Romsey Rd nr Nursling St SE","","50 56.7121N","1 27.6700W","", +"HA100808","Romsey Rd nr Nursling St NW","","50 56.7051N","1 27.6735W","", +"HA110038","Otterbourne Rd nr Badger Farm Rd S","","51 2.2271N","1 19.6870W","", +"HA110040","St Cross Rd nr Grange Rd SW","","51 2.6754N","1 19.4922W","", +"HA110041","St Cross Rd nr Grange Rd NE","","51 2.7067N","1 19.4883W","", +"HA110042","St Cross Rd nr Mead Rd SW","","51 2.9042N","1 19.3955W","", +"HA110043","St Cross Rd nr Mead Rd NE","","51 2.9349N","1 19.3934W","", +"HA110044","St Cross Rd nr Barnes Cl NE","","51 3.0689N","1 19.3392W","", +"HA110045","St Cross Rd nr Kingsgate Rd SW","","51 3.1453N","1 19.2885W","", +"HA110046","St Cross Rd nr Ranelagh Rd NE","","51 3.2885N","1 19.2393W","", +"HA110047","St Cross Rd nr Ranelagh Rd SW","","51 3.3304N","1 19.2138W","", +"HA110048","St Cross Rd nr Romans Rd SW","","51 3.4359N","1 19.1686W","", +"HA110049","St Cross Rd nr Romans Rd NE","","51 3.4494N","1 19.1701W","", +"HA110051","Southgate St nr Archery Ln SW","","51 3.6824N","1 19.0674W","", +"HA110058","Winchester bus station Stnd F","","51 3.7149N","1 18.6200W","", +"HA110067","St Georges St nr Upper Brook St NW","","51 3.7573N","1 18.7735W","", +"HA110108","Winchester Station Stnd C NW","","51 4.0239N","1 19.1489W","", +"HA110112","Jewry St nr High St SW","","51 3.7850N","1 18.9811W","", +"HA110125","Romsey Rd os RHC Hosp SW","","51 3.7269N","1 19.7603W","", +"HA110126","Romsey Rd opp RHC Hosp NE","","51 3.7329N","1 19.7773W","", +"HA110245","Hursley Rd B3043 nr Ln dwell N","","51 0.8332N","1 23.4919W","", +"HA110247","Hursley Rd B3043 nr A3090 N","","51 1.0032N","1 23.4914W","", +"HA110251","A3090 os Hursley PO S","","51 1.5154N","1 23.4265W","", +"HA110252","A3090 os Hursley ch hall NW","","51 1.5469N","1 23.4654W","", +"HA110418","Otterbourne Rd nr Compton St S","","51 1.6882N","1 19.8984W","", +"HA110419","Otterbourne Rd nr Compton St N","","51 1.6781N","1 19.9182W","", +"HA110420","Otterbourne Rd nr Shawford Rd NE","","51 1.4353N","1 19.9260W","", +"HA110421","Otterbourne Rd nr Shawford Rd SW","","51 1.4294N","1 19.9209W","", +"HA110422","Otterbourne Rd nr South Down Rd SW","","51 1.2200N","1 20.1147W","", +"HA110423","Otterbourne Rd nr South Down Rd NE","","51 1.1547N","1 20.1943W","", +"HA110424","Otterbourne Rd nr Highways Rd NE","","51 0.9563N","1 20.3169W","", +"HA110425","Otterbourne Rd nr Highways Rd SW","","51 0.9046N","1 20.3390W","", +"HA110426","Otterbourne Rd nr Sparrowgrove SW","","51 0.7105N","1 20.4615W","", +"HA110427","Otterbourne Rd nr Sparrowgrove NE","","51 0.7272N","1 20.4647W","", +"HA110428","Otterbourne Rd nr Poles Ln NE","","51 0.6068N","1 20.5383W","", +"HA110429","Otterbourne Rd nr Oakwood Ave SW","","51 0.5287N","1 20.5607W","", +"HA110430","Main Rd nr Cranbourne Dr NE","","51 0.2837N","1 20.8524W","", +"HA110431","Main Rd nr Cranbourne Dr SW","","51 0.2386N","1 20.8898W","", +"HA110432","Otterbourne Hill nr Boyatt Ln SW","","50 59.9451N","1 21.2847W","", +"HA110433","Otterbourne Hill nr Boyatt Ln NE","","50 59.9452N","1 21.3026W","", +"HA110549","Durley St nr Manor Rd NE","","50 57.3963N","1 15.0393W","", +"HA110550","Durley St nr Manor Rd SW","","50 57.3930N","1 15.0342W","", +"HA110571","Station Hill opp Railway ph NE","","50 54.9527N","1 15.5557W","", +"HA110572","Station Hill os Railway ph SW","","50 54.9408N","1 15.5567W","", +"HA110611","St Georges Square NE","","50 57.2133N","1 12.8153W","", +"HA110817","Snakemoor Ln nr Winchester Rd NE","","50 56.5788N","1 17.5480W","", +"HA110818","Snakemoor Ln nr Winchester Rd SW","","50 56.5724N","1 17.5549W","", +"HA120018","Bakers Drove nr Rownhams Ln NE","","50 56.9245N","1 27.1534W","", +"HA120154","Portswood Rd opp 743 SW","","50 56.1476N","1 22.8521W","", +"HA120303","St Denys Rd opp 24 NW","","50 55.5106N","1 23.2985W","", +"HA120304","St Denys Rd opp Stanley Rd SE","","50 55.4909N","1 22.9419W","", +"HA120305","St Denys Rd os ch NW","","50 55.4932N","1 22.9777W","", +"HA120306","Cobden Bridge nr Priory Rd E","","50 55.4714N","1 22.8252W","", +"HA120307","Cobden Bridge nr Priory Rd W","","50 55.4660N","1 22.8312W","", +"HA120322","Meggeson Ave os 166-186 SE","","50 55.7194N","1 21.3952W","", +"HA120323","Meggeson Ave opp 17 SE","","50 55.6018N","1 21.3030W","", +"HA120324","Meggeson Ave os path to Roundhill Cl NW","","50 55.5855N","1 21.2904W","", +"HA120416","Bitterne Rd West opp 18 NE","","50 55.0455N","1 23.0058W","", +"HA120417","Bitterne Rd West nr Quayside Rd SW","","50 55.0047N","1 23.0277W","", +"HA120418","Bitterne Rd West os 88 W","","50 55.0748N","1 22.8168W","", +"HA120419","Bitterne Rd West os 115 E","","50 55.0858N","1 22.7586W","", +"HA120420","Bitterne Rd West os 170 W","","50 55.0582N","1 22.5524W","", +"HA120462","Beauworth Ave os 1 SE","","50 55.3711N","1 20.5643W","", +"HA120464","Minstead Ave opp Fritham Rd NW","","50 55.2567N","1 20.3799W","", +"HA120465","Cheriton Ave opp Bramdean Rd NE","","50 55.1544N","1 20.1210W","", +"HA120466","Minstead Ave os Hare and Hounds ph SE","","50 55.1814N","1 20.1266W","", +"HA120481","Millbrook Rd West jnc Waterhouse Ln SE","","50 54.7702N","1 26.1724W","", +"HA120482","Millbrook Rd opp Station SE","","50 54.7181N","1 25.9973W","", +"HA120483","Millbrook Rd West os Station NW","","50 54.7048N","1 26.0375W","", +"HA120546","Town Quay opp Red Funnel NE","","50 53.7708N","1 24.2973W","", +"HA120610","Hinkler Rd opp Kanes Hill Sch NW","","50 54.7336N","1 19.7531W","", +"HA120611","Hinkler Rd os Kanes Hill Sch SE","","50 54.7275N","1 19.7310W","", +"HA120612","Hinkler Rd nr Holcroft Rd S","","50 54.5523N","1 19.6619W","", +"HA120613","Hinkler Rd nr Holcroft Rd N","","50 54.5599N","1 19.6660W","", +"HA120621","Briton St os City Court E","","50 53.8763N","1 24.1330W","", +"HA120625","High St os For Your Eyes Only N","","50 54.0036N","1 24.2380W","", +"HA120626","High St os Ferryman and Firkin S","","50 53.9992N","1 24.2244W","", +"HA120630","Briton St os Coopers Ct W","","50 53.8853N","1 24.1994W","", +"HA120633","Orchard Pl os Bowling Green House NE","","50 53.8291N","1 24.0884W","", +"HA120638","Queens Ter nr Seamen Mission E","","50 53.8707N","1 23.9863W","", +"HA120641","Canute Rd opp Canute Chambers E","","50 53.8219N","1 23.6380W","", +"HA120642","Canute Rd os Canute Chambers W","","50 53.8160N","1 23.6475W","", +"HA120720","Archery Rd opp park NW","","50 53.4728N","1 22.5113W","", +"HA120721","Archery Rd opp 15 SE","","50 53.4891N","1 22.5239W","", +"HA120746","Weston Ln os 1 SW","","50 53.2812N","1 22.2947W","", +"HA120767","Redbridge Ln os Hillyfields Flats NE","","50 56.2501N","1 27.9734W","", +"HA120776","Hinkler Rd os 2 N","","50 54.8772N","1 19.8646W","", +"HA120777","Hinkler Rd os 7B S","","50 54.8577N","1 19.8529W","", +"HA120786","Townhill Way nr Culvery Gdns SE","","50 55.7599N","1 21.1992W","", +"HA120794","Mansbridge Rd nr White Swan ph NE","","50 56.2720N","1 21.6054W","", +"HA120796","Swaythling Rd nr Romill Cl NW","","50 56.0999N","1 21.1321W","", +"HA121017","A33 at Chilworth rbt N","","50 57.1299N","1 24.2655W","", +"HA121024","Millbrook Rd West os Texaco fill stn W","","50 54.7930N","1 26.6501W","", +"HA121056","Thornhill Park Rd os 142 NW","","50 54.8809N","1 19.7561W","", +"HA121057","Thornhill Park Rd nr Moorhill Rd SE","","50 54.8802N","1 19.7348W","", +"HA122972","Redbridge Causeway off-slip NE","","50 55.3349N","1 28.2946W","", +"HA12549A","Southampton Coach Stn Harbour Parade NE","","50 54.3576N","1 24.5604W","", +"HA140020","Common Rd at jnc The Street SE","","51 0.6817N","1 39.0639W","", +"HAA09127","Winchester Station Stnd A SE","","51 4.0330N","1 19.1376W","", +"HAA09198","Hamble School grounds","","50 52.4021N","1 19.5572W","", +"HAA09202","Ingleside nr Bowcombe SE","","50 52.8497N","1 20.5717W","", +"HAA09206","Woolston Rd nr Ingleside W","","50 52.9372N","1 20.5841W","", +"HAA09248","Skys Wood Rd nr Bird Field NE","","50 59.1753N","1 24.5659W","", +"HAA09339","Applemore College grounds","","50 51.6608N","1 25.8442W","", +"HAA09360","Balmoral Way opp Betteridge Dr NE","","50 56.9486N","1 27.8210W","", +"HAA09361","Balmoral Way nr Horns Drove E","","50 57.1215N","1 27.2894W","", +"HAA09362","Balmoral Way nr Hann Rd W","","50 57.1130N","1 27.3271W","", +"HAA09363","Balmoral Way Betteridge Dr SW","","50 56.9437N","1 27.8168W","", +"HAA09424","Southampton Parkway opp Station S","","50 56.9971N","1 21.7961W","", +"HAA09425","Wide Ln os Ln keside Country Park NE","","50 57.2959N","1 21.5793W","", +"HAA09426","Wide Ln opp Ln keside Country Park SW","","50 57.3007N","1 21.5648W","", +"HAA09578","Tollbar Way nr Wellstead Way N","","50 55.8713N","1 18.5056W","", +"HAA10020","Grange Rd nr Woodhouse Ln E","","50 54.9677N","1 17.2907W","", +"HAA10043","Passfield Ave opp Fleming Park SW","","50 58.1896N","1 22.1140W","", +"HAA10044","Passfield Ave os Fleming Park NE","","50 58.1644N","1 22.1314W","", +"HAA10056","Wildern School Grounds","","50 55.0771N","1 18.1554W","", +"HAA10104","Balmoral Way nr Hurricane Dr W","","50 57.0382N","1 27.5860W","", +"HAA10105","Balmoral Way opp Normandy Cl E","","50 57.0379N","1 27.6329W","", +"HAA10110","Passfield Ave nr Cedar Rd N","","50 57.7516N","1 22.2361W","", +"HAA10111","Passfield Ave nr Cedar Rd S","","50 57.7704N","1 22.2213W","", +"HAA13371","Vincents Walk os Primark N","","50 54.2374N","1 24.1651W","", +"HAA13373","Westwood Rd os Cranleigh Hse SW","","50 55.3808N","1 24.0838W","", +"HAA13374","Westwood Rd os Kinterbury Ct NE","","50 55.3948N","1 24.0691W","", +"HAA13375","Westwood Rd os Elm Ct NE","","50 55.4806N","1 23.8708W","", +"HAA13376","Westwood Rd os Pembroke Ct SW","","50 55.4784N","1 23.8572W","", +"HAA13377","Westwood Rd os Albany Park Ct NE","","50 55.3436N","1 24.1902W","", +"HAA13379","Langhorn Rd os 71 SE","","50 56.2844N","1 23.0168W","", +"HAA13380","Langhorn Rd os 5 SE","","50 56.2266N","1 22.8971W","", +"HAA13381","Langhorn Rd nr Portswood Rd NW","","50 56.2065N","1 22.8701W","", +"HAA13383","Frogmore Ln opp Bargain Farm E","","50 56.1725N","1 28.0016W","", +"HAA13385","Franconia Dr nr Mauretania Rd N","","50 56.1489N","1 28.6218W","", +"HAA13386","Wide Ln os 43 NE","","50 56.5967N","1 22.2850W","", +"HAA13387","Leaside Way os St Georges Sch E","","50 56.7226N","1 22.9264W","", +"HAA13388","Lords Hill Way Woburn Flyover W","","50 56.6035N","1 25.9256W","", +"HAA13389","Lords Hill Way nr Tanners Brook SW","","50 56.5360N","1 26.2467W","", +"HAA13545","Milford Rd os Priestlands Sch NE","","50 45.1720N","1 33.1347W","", +"HAA13562","A36 nr Lyndhurst Rd B3076 NW","","50 58.8896N","1 38.2602W","", +"HAA13579","National Oceanography Centre forecourt","","50 53.6076N","1 23.7167W","", +"HAA13580","Town Quay os Red Funnel SW","","50 53.7664N","1 24.2820W","", +"HAA13582","Portland Ter os West Quay 1 NW","","50 54.1855N","1 24.3483W","", +"HAA13583","Portland Ter opp West Quay 2 SE","","50 54.2162N","1 24.3437W","", +"HAA13584","Civic Centre Rd opp Civic Cnt E","","50 54.4080N","1 24.3865W","", +"HAA13647","Castle Way nr Bargate St NW","","50 54.1493N","1 24.3377W","", +"HAA13649","West Quay Rd opp LW SE","","50 54.1883N","1 24.7024W","", +"HAA13650","Wessex Ln os Montefiore Halls N","","50 56.3623N","1 22.5503W","", +"HAA13651","Wessex Ln opp Montefiore Halls S","","50 56.3628N","1 22.5443W","", +"HAA13652","Archery Rd opp 118 NW","","50 53.3084N","1 22.3463W","", +"HAA13653","Archery Rd opp 37 SE","","50 53.3788N","1 22.3923W","", +"HAA13654","Jurds Lake Way nr Weston Ln S","","50 53.2859N","1 22.3748W","", +"HAA13655","Rothschild Cl opp Jurds Ln ke Way E","","50 53.2676N","1 22.3827W","", +"HAA13657","Jurds Lake Way nr Arrow Cl W","","50 53.3836N","1 22.5808W","", +"HAA13658","Jurds Lake Way opp Arrow Cl E","","50 53.3885N","1 22.5927W","", +"HAA13659","Victoria Rd nr Taylor Cl SE","","50 53.3834N","1 22.7446W","", +"HAA13660","Victoria Rd nr Unwin Cl NW","","50 53.3857N","1 22.7659W","", +"HAA13661","Victoria Rd nr Dundonald Cl SW","","50 53.3998N","1 22.8774W","", +"HAA13662","Victoria Rd opp Dundonald Cl NE","","50 53.4004N","1 22.8945W","", +"HAA13663","Victoria Rd nr Swift Rd S","","50 53.4537N","1 22.9816W","", +"HAA13664","Victoria Rd so sewage works NE","","50 53.4683N","1 22.9857W","", +"HAA13665","Kathleen Rd os 111 NE","","50 54.1554N","1 21.0456W","", +"HAA13668","Univ Interchange NW","","50 56.1660N","1 23.8040W","", +"HAA13694","Tollbar Way os Berrywood Vill NE","","50 55.9964N","1 18.4935W","", +"HAA13695","Tollbar Way opp Berrywood Vill SW","","50 55.9952N","1 18.4867W","", +"HAA19442","Hamble Ln nr Satchell Ln S","","50 52.4817N","1 19.6976W","", +"HAA19443","Hamble Ln nr Satchell Ln N","","50 52.4925N","1 19.7137W","", +"HAA19444","Hamble Ln os 92 S","","50 52.0400N","1 19.6528W","", +"HAA19694","Nichol Rd os 54 SW","","51 0.1316N","1 22.7392W","", +"HAA19695","Nichol Rd os 57 NE","","51 0.1306N","1 22.7469W","", +"HAA19700","Rownhams Ln nr The Mews NW","","50 57.0113N","1 27.1430W","", +"HAA19701","Rownhams Ln nr The Mews SE","","50 57.0075N","1 27.1302W","", +"HAA19705","Hook Rd os Potters Heron N","","51 0.4099N","1 24.8050W","", +"HAA40520","Bargate St nr High St E - RTI ghost","","50 54.1706N","1 24.2777W","", +"HAA90784","Lymington New Forest Hospital Entrance","","50 46.1655N","1 32.7721W","", +"HAA91092","Adanac Way nr Ordnance Survey NW","","50 56.1236N","1 28.1611W","", +"MG1031","NOC arival - RTI ghost","","50 53.5977N","1 23.6801W","", +"SN100809","Romsey Rd nr Redbridge Ln NW","","50 56.6174N","1 27.5917W","", +"SN100810","Bakers Droe nr Romsey Rd NE","","50 56.6279N","1 27.5446W","", +"SN120004","Royal South Hants Hospital nr Chapel","","50 54.7772N","1 23.7980W","", +"SN120006","Wimpson Ln os 317 NE","","50 55.7222N","1 27.0019W","", +"SN120007","Wimpson Ln os 336 to 350 SW","","50 55.6915N","1 27.0261W","", +"SN120008","Lords Hill Way path to Dunbar Cl NE","","50 56.6125N","1 26.8949W","", +"SN120009","Lords Hill Way path to Blackbushe Cl SW","","50 56.6081N","1 26.8787W","", +"SN120010","Lords Hill Way path to Pemburey Cl NW","","50 56.6082N","1 26.6660W","", +"SN120011","Lords Hill Way os playing fields SE","","50 56.5944N","1 26.6038W","", +"SN120013","Lords Hill Way nr Tanners Brook NE","","50 56.5579N","1 26.2003W","", +"SN120014","Lords Hill Way Woburn Flyover E","","50 56.6191N","1 25.9229W","", +"SN120017","Bakers Drove nr Ln keside Ave SW","","50 56.7829N","1 27.3378W","", +"SN120019","Buchanan Rd nr Fraser Cl NE","","50 56.7875N","1 26.9406W","", +"SN120023","Buchanan Rd nr Forbes Cl NE","","50 56.8173N","1 26.8600W","", +"SN120024","Matheson Rd os 59 E","","50 56.7718N","1 26.7051W","", +"SN120025","Sutherland Rd os Erskine Ct W","","50 56.7160N","1 26.7758W","", +"SN120026","Sutherland Rd nr 2 SW","","50 56.6636N","1 26.9899W","", +"SN120028","Lobelia Rd nr Lupin Rd SW","","50 56.6138N","1 23.2737W","", +"SN120031","Lobelia Rd nr Bassett Green Rd NE","","50 56.6263N","1 23.2796W","", +"SN120032","Bassett Gn Rd opp 84 E","","50 56.6162N","1 23.0978W","", +"SN120033","Bassett Gn Rd os 88 W","","50 56.6114N","1 23.1260W","", +"SN120034","Bassett Gn Rd opp 54 E","","50 56.6038N","1 22.9083W","", +"SN120039","Lobelia Rd os 32 S","","50 56.5368N","1 23.2876W","", +"SN120040","Mansbridge Rd opp 2 SE","","50 56.4843N","1 22.3591W","", +"SN120041","Lower Brownhill Rd nr Boniface Cres NE","","50 56.0917N","1 27.6729W","", +"SN120042","Lower Brownhill Rd nr Boniface Cres SW","","50 56.0725N","1 27.7269W","", +"SN120043","Lords Hill Way nr Fairisle Rd NE","","50 56.4227N","1 27.1644W","", +"SN120045","Lords Hill opp Sainsburys NE","","50 56.5027N","1 27.0798W","", +"SN120046","Lords Hill Way os Sainsburys 1 SW","","50 56.5153N","1 26.9993W","", +"SN120047","Lords Hill Way os Sainsburys 2 SW","","50 56.5094N","1 27.0156W","", +"SN120048","Lords Hill os library SE","","50 56.3890N","1 26.9812W","", +"SN120049","Lords Hill opp library NW","","50 56.3863N","1 26.9906W","", +"SN120050","Lords Hill Way opp Fairisle Sch SW","","50 56.4108N","1 27.1517W","", +"SN120051","Romsey Rd nr Lords Hill Way NW","","50 56.4548N","1 27.4433W","", +"SN120052","Lower Brownhill Rd opp Corbiere Cl NE","","50 56.1250N","1 27.5351W","", +"SN120053","Lower Brownhill Rd nr Corbiere Cl SW","","50 56.1292N","1 27.4966W","", +"SN120054","Lower Brownhill Rd nr Boniface Cres NE","","50 56.1774N","1 27.3107W","", +"SN120055","Lower Brownhill Rd nr Boniface Cres SW","","50 56.1794N","1 27.2808W","", +"SN120056","Upper Brownhill Rd opp 29 NE","","50 56.2297N","1 27.0770W","", +"SN120057","Upper Brownhill Rd opp 59 NE","","50 56.2610N","1 26.9520W","", +"SN120059","Upper Brownhill Rd os 51 SW","","50 56.2508N","1 26.9768W","", +"SN120061","Upper Brownhill Rd os 95 SW","","50 56.2884N","1 26.8244W","", +"SN120062","Romsey Rd os 489 SW","","50 56.0608N","1 27.0687W","", +"SN120063","Upper Brownhill Rd opp 6 NE","","50 56.3150N","1 26.7353W","", +"SN120065","Aldermoor Rd opp Springford Rd SE","","50 56.4399N","1 26.0130W","", +"SN120066","Aldermoor Rd os 22 SW","","50 56.3312N","1 26.6420W","", +"SN120067","Aldermoor Ave os 47 NW","","50 56.3389N","1 26.4310W","", +"SN120069","Aldermoor Rd opp 44 NE","","50 56.3678N","1 26.5015W","", +"SN120070","Aldermoor Rd os 72 SW","","50 56.3899N","1 26.3919W","", +"SN120071","Aldermoor Rd nr Springford Rd NW","","50 56.4427N","1 26.0352W","", +"SN120072","Aldermoor Ave nr Palm Rd NW","","50 56.1911N","1 26.3294W","", +"SN120073","Aldermoor Ave nr Palm Rd SE","","50 56.1863N","1 26.3414W","", +"SN120076","Palm Rd opp 44 NE","","50 56.1533N","1 26.5451W","", +"SN120077","Palm Rd nr Olive Rd SW","","50 56.1474N","1 26.5537W","", +"SN120078","Coxford Rd opp 12 NE","","50 56.0347N","1 26.6797W","", +"SN120079","Coxford Dro os 4 SW","","50 56.0207N","1 26.6850W","", +"SN120080","Warren Ave os 26 NW","","50 55.9655N","1 26.4218W","", +"SN120081","Warren Ave nr Ln undry Rd SE","","50 55.9963N","1 26.4325W","", +"SN120082","Tremona Rd opp 216 NW","","50 56.0735N","1 25.9936W","", +"SN120083","Coxford Rd opp 247 SW","","50 56.1032N","1 26.0086W","", +"SN120084","Tremona Rd nr 198 SE","","50 56.0467N","1 25.9205W","", +"SN120085","Coxford Rd os 289 NE","","50 56.1926N","1 25.8581W","", +"SN120086","Coxford Rd opp Springford Cres SW","","50 56.2151N","1 25.8296W","", +"SN120087","Aldermoor Rd nr Shops SE","","50 56.4241N","1 25.7587W","", +"SN120088","Aldermoor Rd opp Shops W","","50 56.4266N","1 25.8176W","", +"SN120089","Lords Hill Way nr health centre SE","","50 56.4483N","1 25.7439W","", +"SN120090","Lords Hill Way nr health centre NW","","50 56.4262N","1 25.7468W","", +"SN120091","Coxford Rd os Lyburn Ct NE","","50 56.3280N","1 25.7463W","", +"SN120092","Coxford Rd opp Lyburn Ct SW","","50 56.3344N","1 25.7265W","", +"SN120093","Lordswood Rd opp 48 SW","","50 56.2663N","1 25.4814W","", +"SN120094","Lordswood Rd opp 33 W","","50 56.2314N","1 25.4195W","", +"SN120095","Hill Ln os 177 SE","","50 56.0984N","1 25.1496W","", +"SN120096","Hill Ln os 380 NW","","50 56.1191N","1 25.1733W","", +"SN120097","Winchester Rd os 390 NE","","50 56.0879N","1 25.0849W","", +"SN120098","Winchester Rd os 361A SW","","50 56.0766N","1 25.0902W","", +"SN120099","Hill Ln opp 352 SE","","50 56.0021N","1 25.0945W","", +"SN120100","Hill Ln os 352 NW","","50 55.9995N","1 25.1014W","", +"SN120102","Coxford Rd opp 175 SW","","50 56.0445N","1 26.2467W","", +"SN120108","Highfield Ln nr Highfield Rd SE","","50 55.9575N","1 24.1678W","", +"SN120109","Highfield Ln opp 1 SE","","50 55.9141N","1 24.1180W","", +"SN120111","Winchester Rd nr Bassett Avenue NE","","50 56.4140N","1 24.4967W","", +"SN120112","Winchester Rd nr Butterfield Rd NE","","50 56.2905N","1 24.7126W","", +"SN120113","Winchester Rd opp 478 SW","","50 56.2497N","1 24.7618W","", +"SN120114","Winchester Rd nr Bassett Avenue SW","","50 56.4177N","1 24.4744W","", +"SN120115","Bassett Ave opp 51 S","","50 56.3547N","1 24.4010W","", +"SN120116","Bassett Ave nr Chetwynd Rd S","","50 56.5015N","1 24.3914W","", +"SN120117","Bassett Ave os 49 N","","50 56.3445N","1 24.4096W","", +"SN120118","Bassett Ave nr Burgess Rd N","","50 56.2198N","1 24.3993W","", +"SN120119","Bassett Ave nr Burgess Rd S","","50 56.2090N","1 24.3874W","", +"SN120120","Burgess Rd nr Bassett Ave SW","","50 56.1814N","1 24.2657W","", +"SN120121","Burgess Rd nr Bassett Ave NE","","50 56.1980N","1 24.2484W","", +"SN120123","Violet Rd os Cantell sch SE - RTI ghost","","50 56.4776N","1 23.9442W","", +"SN120124","Glen Eyre Rd opp Hartley Grove Hall SE","","50 56.4744N","1 24.0570W","", +"SN120125","Glen Eyre Rd os Hartley Grove Hall NW","","50 56.4550N","1 24.0572W","", +"SN120126","Glen Eyre Rd os 5 SE","","50 56.3143N","1 23.9805W","", +"SN120127","Burgess Rd os Holmwood Ct NE","","50 56.2499N","1 24.0411W","", +"SN120128","Burgess Rd opp 189 SW","","50 56.2572N","1 23.9940W","", +"SN120129","Violet Rd os 43 SE","","50 56.4123N","1 23.7298W","", +"SN120130","Violet Rd os 58 SE - RTI ghost","","50 56.4110N","1 23.7000W","", +"SN120131","Burgess Rd nr library E","","50 56.2878N","1 23.7579W","", +"SN120134","University Rd opp Stile ph S","","50 56.2614N","1 23.7788W","", +"SN120136","Burgess Rd opp 259 W","","50 56.2894N","1 23.6631W","", +"SN120137","Burgess Rd os 345 E","","50 56.3190N","1 23.3203W","", +"SN120138","Honeysuckle Rd os 96 E","","50 56.3438N","1 23.5266W","", +"SN120139","Burgess Rd os 305 E","","50 56.3142N","1 23.4442W","", +"SN120140","Burgess Rd os 202 W","","50 56.3032N","1 23.5075W","", +"SN120141","Lobelia Rd nr Copperfield Rd N","","50 56.4376N","1 23.3153W","", +"SN120142","Lobelia Rd nr 39 N","","50 56.4904N","1 23.3044W","", +"SN120143","Lobelia Rd nr Bluebell Rd S","","50 56.4327N","1 23.3069W","", +"SN120144","Burgess Rd opp Woodcote Rd E","","50 56.3146N","1 23.2094W","", +"SN120145","Burgess Rd W opp Tulip Rd W","","50 56.3101N","1 23.2752W","", +"SN120146","Burgess Rd os 399 NE","","50 56.3120N","1 23.0343W","", +"SN120147","Burgess Rd os Methodist ch W","","50 56.3043N","1 23.1036W","", +"SN120148","Stoneham Ln opp Mkt Blds NW","","50 56.4267N","1 22.7869W","", +"SN120149","Stoneham Ln os Mkt Blds SE","","50 56.4370N","1 22.7816W","", +"SN120150","High Rd opp 64 N","","50 56.3357N","1 22.8086W","", +"SN120151","High Rd os 52 S","","50 56.3130N","1 22.8046W","", +"SN120153","High Rd os 9 N","","50 56.2208N","1 22.8272W","", +"SN120157","Portswood Rd os B & Q NE","","50 56.0718N","1 22.9111W","", +"SN120158","Portswood Rd os 508 SW","","50 56.0337N","1 22.9475W","", +"SN120159","Portswood Rd os 615-619 NE","","50 55.9458N","1 23.0571W","", +"SN120160","Wessex Ln os Montefiore Halls NE","","50 56.2445N","1 22.6100W","", +"SN120161","Wessex Ln opp Montefiore entrance SW","","50 56.2354N","1 22.6229W","", +"SN120162","Wessex Ln os 7 NE","","50 56.5051N","1 22.5023W","", +"SN120163","Wessex Ln opp 9 SW","","50 56.4997N","1 22.4998W","", +"SN120164","Wide Ln opp 33 SW","","50 56.5747N","1 22.3041W","", +"SN120165","Mansbridge Rd opp Octavia Rd SE","","50 56.4411N","1 22.1530W","", +"SN120171","Meggeson Ave turning circle SW","","50 55.9738N","1 21.7427W","", +"SN120174","Mansel Rd West os Saints ph SE","","50 55.8041N","1 27.7830W","", +"SN120175","Windermere Ave nr Mansel Rd West NE","","50 55.8098N","1 27.7351W","", +"SN120177","Kendal Ave nr Mansel Rd West SW","","50 55.7598N","1 27.7826W","", +"SN120178","Kendal Ave opp ch N","","50 55.6096N","1 27.8544W","", +"SN120179","Kendal Ave nr Perran Rd S","","50 55.5691N","1 27.8463W","", +"SN120180","Kendal Ave os Shops SE","","50 55.4633N","1 27.8227W","", +"SN120181","Kendal Ave opp Shops NW","","50 55.4584N","1 27.8313W","", +"SN120182","Windermere Ave os 142-156 SE","","50 55.8071N","1 27.5106W","", +"SN120183","Windermere Ave os Millbrook Towers NW","","50 55.8148N","1 27.5498W","", +"SN120184","Windermere Ave opp 86 NW","","50 55.7262N","1 27.3911W","", +"SN120185","Windermere Ave os 74 SE","","50 55.7125N","1 27.3571W","", +"SN120186","Windermere Ave os 26-36 SE","","50 55.6612N","1 27.2374W","", +"SN120187","Windermere Ave nr 15-25 NW","","50 55.6542N","1 27.2332W","", +"SN120188","Wimpson Ln opp Bush ph SW","","50 55.7844N","1 26.9320W","", +"SN120194","Rownhams opp Coxford Rd NE","","50 55.8834N","1 26.8719W","", +"SN120196","Romsey Rd nr path to Thorndyke Rd SE","","50 55.8332N","1 26.8554W","", +"SN120203","Romsey Rd os 309 SE","","50 55.6960N","1 26.7119W","", +"SN120204","Romsey Rd opp 273 NW","","50 55.6705N","1 26.6849W","", +"SN120207","Romsey Rd opp 241 NW","","50 55.6172N","1 26.6027W","", +"SN120208","Romsey Rd nr Arliss Rd SE","","50 55.6362N","1 26.6187W","", +"SN120209","Warren Ave os 63 SE","","50 55.8842N","1 26.3605W","", +"SN120210","Warren Ave os 86 NW","","50 55.8491N","1 26.3481W","", +"SN120211","Warren Ave os 148 NW","","50 55.7376N","1 26.2760W","", +"SN120213","Warren Ave opp 170 SE","","50 55.6932N","1 26.2373W","", +"SN120214","Warren Ave os 222 NW","","50 55.6012N","1 26.1880W","", +"SN120216","Romsey Rd opp King Edward Ave SE","","50 55.5254N","1 26.3631W","", +"SN120217","Romsey Rd opp 123 NW","","50 55.5134N","1 26.3368W","", +"SN120218","Tremona Rd opp 130 NE","","50 55.8877N","1 25.9694W","", +"SN120219","Tremona Rd os 120-122 SW","","50 55.8679N","1 25.9858W","", +"SN120220","Anglesea Rd os 19 SW","","50 55.4782N","1 26.0777W","", +"SN120221","Tremona Rd opp 154 NE","","50 55.9317N","1 25.9133W","", +"SN120222","Tremona Rd nr 168 SW","","50 55.9748N","1 25.8889W","", +"SN120223","Dale Rd opp 59 SE","","50 55.8639N","1 25.8390W","", +"SN120224","Dale Rd nr Winchester Rd SE","","50 55.7539N","1 25.7396W","", +"SN120225","Dale Rd opp 16 NW","","50 55.7799N","1 25.7726W","", +"SN120226","Winchester Rd os 170 NE","","50 55.6881N","1 25.8634W","", +"SN120227","Winchester Rd opp 158 SW","","50 55.6742N","1 25.8806W","", +"SN120228","Winchester Rd os 216 NE","","50 55.7553N","1 25.6927W","", +"SN120230","Wilton Rd os 5 NW","","50 55.7576N","1 25.6073W","", +"SN120231","Winchester Rd os Currys SW","","50 55.8075N","1 25.5631W","", +"SN120232","Winchester Rd os Malvern ph NE","","50 55.9114N","1 25.4115W","", +"SN120233","Winchester Rd opp 308 SW","","50 55.9365N","1 25.3489W","", +"SN120234","Bellemoor Rd os 92 SE","","50 55.6816N","1 25.3094W","", +"SN120235","Wilton Rd os 60 SE","","50 55.6545N","1 25.5018W","", +"SN120236","Wilton Rd os 85 NW","","50 55.6209N","1 25.4775W","", +"SN120237","Wilton Rd os 100 SE","","50 55.5613N","1 25.4108W","", +"SN120238","Upper Shirley Ave os 120 NE","","50 55.5203N","1 25.4207W","", +"SN120239","Upper Shirley Ave nr St James Rd SW","","50 55.4643N","1 25.5443W","", +"SN120240","Bellemoor Rd os 123 NW","","50 55.6712N","1 25.2762W","", +"SN120242","Hill Ln os 316 NW","","50 55.8465N","1 25.0452W","", +"SN120243","Hill Ln opp 312 SE","","50 55.8319N","1 25.0326W","", +"SN120245","Hill Ln opp Bellemoor ph SE","","50 55.6523N","1 24.9554W","", +"SN120246","Hill Ln os Tauntons College NW","","50 55.5956N","1 24.9391W","", +"SN120247","Hill Ln opp 230 S","","50 55.4843N","1 24.9029W","", +"SN120248","Hill Ln os 220 N","","50 55.4492N","1 24.9093W","", +"SN120256","University Rd opp sports centre SE","","50 56.0477N","1 23.7679W","", +"SN120257","University Rd os sports centre NW","","50 56.0494N","1 23.7798W","", +"SN120261","Highfield Ln os Highfield ph SE","","50 55.8589N","1 23.9889W","", +"SN120263","Highfield Ln os 68-78 NW","","50 55.8403N","1 23.9354W","", +"SN120264","Highfield Ln opp 104-108 SE","","50 55.7974N","1 23.7711W","", +"SN120265","Highfield Ln os 100 NW","","50 55.7991N","1 23.7959W","", +"SN120266","Welbeck Ave os 63 SE","","50 55.8714N","1 23.4824W","", +"SN120267","Welbeck Ave os 62 NW","","50 55.8638N","1 23.4680W","", +"SN120268","Shaftesbury Ave os Chestnut Ct N","","50 55.7746N","1 23.4444W","", +"SN120269","Shaftesbury Ave os 24 SW","","50 55.7229N","1 23.4519W","", +"SN120270","Highfield Ln opp 132 SE","","50 55.6721N","1 23.5508W","", +"SN120271","Highfield Ln os 132 NW","","50 55.6684N","1 23.5568W","", +"SN120273","St Denys Rd os Pizza Hut SE","","50 55.5843N","1 23.4614W","", +"SN120274","St Denys Rd os Mitre ph NW","","50 55.5852N","1 23.4298W","", +"SN120276","Brookvale Rd opp video shop SE","","50 55.4931N","1 23.6752W","", +"SN120278","Brookvale Rd os video shop NW","","50 55.4872N","1 23.6710W","", +"SN120279","Portswood Rd os Waitrose NE","","50 55.4548N","1 23.6680W","", +"SN120280","Winn Rd os 40 SW","","50 55.5274N","1 23.9445W","", +"SN120281","Winn Rd opp Tennyson Ct NE","","50 55.5488N","1 23.9101W","", +"SN120282","Winn Rd os Bentley Ct NE","","50 55.4587N","1 24.1161W","", +"SN120283","Winn Rd opp Raglan Ct SW","","50 55.4426N","1 24.1385W","", +"SN120284","Portswood Rd nr Grosvenor Rd NE","","50 55.6548N","1 23.3239W","", +"SN120285","Portswood Rd nr Belmont Rd SW","","50 55.6388N","1 23.3625W","", +"SN120287","Portswood Rd opp 603-607 SW","","50 55.9318N","1 23.0573W","", +"SN120289","Portswood Rd opp RC ch N","","50 55.7848N","1 23.1164W","", +"SN120290","Woodmill Ln os 181 W","","50 55.9709N","1 22.2012W","", +"SN120291","Oaktree Rd os Hop ph SW","","50 55.9592N","1 22.2415W","", +"SN120292","Oaktree Rd os 126 NE","","50 55.8722N","1 22.4066W","", +"SN120293","Oaktree Rd opp 134 SW","","50 55.8865N","1 22.3663W","", +"SN120294","St Catherines Rd opp 9 Cobden Rise S","","50 55.4155N","1 22.4768W","", +"SN120295","Oaktree Rd opp 56 SW","","50 55.7562N","1 22.5158W","", +"SN120296","St Catherines Rd os 35 S","","50 55.5261N","1 22.4676W","", +"SN120297","Woodmill Ln os 1-137 SE","","50 55.9006N","1 22.0792W","", +"SN120300","Portswood Rd opp 471 S","","50 55.7486N","1 23.1101W","", +"SN120302","St Denys Rd os 20 SE","","50 55.5176N","1 23.3086W","", +"SN120308","Manor Farm Rd opp Triangle clock NE","","50 55.4764N","1 22.5605W","", +"SN120309","Bitterne Triangle nr clock SE - RTI ghos","","50 55.4603N","1 22.5641W","", +"SN120310","Cobden Bridge nr eastern river-bank W","","50 55.4612N","1 22.6307W","", +"SN120311","Nursery Rd os 9 E","","50 55.6429N","1 22.6044W","", +"SN120312","Oaktree Rd os 48 NE","","50 55.7417N","1 22.5305W","", +"SN120313","St Catherines Rd os 61 SE","","50 55.6144N","1 22.5339W","", +"SN120314","Woodmill Ln os 71 NW","","50 55.7348N","1 21.9355W","", +"SN120315","Witts Hill opp Trent Rd SE","","50 55.5703N","1 21.8532W","", +"SN120316","Witts Hill os shops NW","","50 55.5551N","1 21.8449W","", +"SN120319","Meggeson Ave os 222-252 SE","","50 55.8390N","1 21.5618W","", +"SN120326","South Mill Rd nr King George Ave W","","50 54.9779N","1 26.8314W","", +"SN120329","King Georges Ave os 164 SW","","50 55.1938N","1 26.7503W","", +"SN120330","King Georges Ave os 92 S","","50 55.0394N","1 26.8435W","", +"SN120334","Kendal Ave nr Windrush Rd SE","","50 55.3140N","1 27.5095W","", +"SN120335","Kendal Ave nr Windrush Rd NW","","50 55.3124N","1 27.5334W","", +"SN120338","Cumbrian Way opp 18 E","","50 55.2697N","1 27.2701W","", +"SN120339","Cumbrian Way os 2 NW","","50 55.2701N","1 27.3623W","", +"SN120340","Wimpson Ln os 16 SE","","50 55.1613N","1 27.4028W","", +"SN120341","Wimpson Ln opp 14 NW","","50 55.1549N","1 27.4089W","", +"SN120344","Bursledon Rd os 194-224 SE","","50 54.1993N","1 20.1149W","", +"SN120345","Orpen Rd nr Bursledon Rd SW","","50 54.2284N","1 20.2075W","", +"SN120346","Cumbrian Way os housing office NE","","50 55.2922N","1 27.1282W","", +"SN120347","Cumbrian Way os 42 SW","","50 55.2762N","1 27.1659W","", +"SN120348","Cumbrian Way nr 89 NE","","50 55.3505N","1 27.0097W","", +"SN120349","Cumbrian Way os 80 SW","","50 55.3279N","1 27.0321W","", +"SN120350","Oakley Rd os 148 NW","","50 55.3368N","1 26.8605W","", +"SN120351","Oakley Rd opp 148 SE","","50 55.3411N","1 26.8630W","", +"SN120352","King Georges Ave os 93 N","","50 55.0352N","1 26.8538W","", +"SN120354","King Georges Ave os 169 NE","","50 55.2122N","1 26.7467W","", +"SN120355","Oakley Rd os 94 NE","","50 55.3067N","1 26.6517W","", +"SN120357","Regents Pk Rd opp 80 NE","","50 55.0010N","1 26.4863W","", +"SN120358","Regents Pk Rd os 68 SW","","50 54.9844N","1 26.4968W","", +"SN120360","Oakley Rd opp 74 SE","","50 55.3202N","1 26.5405W","", +"SN120361","Oakley Rd opp sch sports area NW","","50 55.2989N","1 26.4845W","", +"SN120362","Oakley Rd opp 60 SW","","50 55.2943N","1 26.4273W","", +"SN120363","Regents Pk Rd opp 148 NE","","50 55.1283N","1 26.3482W","", +"SN120364","Regents Pk Rd os 138 SW","","50 55.1056N","1 26.3579W","", +"SN120365","Regents Pk Rd opp 206 NE","","50 55.2931N","1 26.1849W","", +"SN120366","Regents Pk Rd os Denison Ct SW","","50 55.2609N","1 26.2118W","", +"SN120367","Shirley High St os precinct 2 SE","","50 55.4135N","1 26.0938W","", +"SN120371","Shirley High St os 50 KFC NW","","50 55.3180N","1 25.9848W","", +"SN120372","Shirley High St opp Emsworth Rd SE","","50 55.2898N","1 25.9382W","", +"SN120373","Shirley Ave os 84 NE","","50 55.4392N","1 25.6078W","", +"SN120374","Shirley Ave os PO NE","","50 55.2650N","1 25.8429W","", +"SN120375","Shirley Ave os 5 SW","","50 55.2762N","1 25.8180W","", +"SN120376","Shirley Rd os 411 SE","","50 55.1953N","1 25.8165W","", +"SN120377","Shirley Rd os police station NW","","50 55.2257N","1 25.8665W","", +"SN120378","Shirley Ave os 73 SW","","50 55.4258N","1 25.6156W","", +"SN120380","Shirley Rd os 330 NW","","50 55.0498N","1 25.6399W","", +"SN120381","Shirley Rd os 297 SE","","50 55.0226N","1 25.5924W","", +"SN120382","Regents Park Rd os 160 SW","","50 55.1663N","1 26.3008W","", +"SN120383","Regents Park Rd opp 174 NW","","50 55.1959N","1 26.2868W","", +"SN120384","St James Rd os 82 SE","","50 55.4034N","1 25.4622W","", +"SN120385","St James Rd os 91 NW","","50 55.3834N","1 25.4428W","", +"SN120386","St James Rd os ch NW","","50 55.2179N","1 25.2554W","", +"SN120387","St James Rd opp 3 SE","","50 55.2352N","1 25.2654W","", +"SN120388","Hill Ln opp Wilton Rd S","","50 55.2884N","1 24.9071W","", +"SN120389","Hill Ln os 202 N","","50 55.2475N","1 24.9272W","", +"SN120390","Raymond Rd os bowling club E","","50 55.1394N","1 24.9849W","", +"SN120391","Hill Ln opp bowling club S","","50 55.1525N","1 24.9199W","", +"SN120392","Hill Ln os 184A N","","50 55.1072N","1 24.9247W","", +"SN120393","Raymond Rd os 14A W","","50 55.1327N","1 25.0584W","", +"SN120394","Hill Ln opp 130 S","","50 54.9330N","1 24.9209W","", +"SN120395","Archers Rd opp 34 NE","","50 54.9861N","1 24.5541W","", +"SN120396","Archers Rd os 54 SW","","50 54.9458N","1 24.6809W","", +"SN120397","Archers Rd os Dorrick Ct W","","50 54.9938N","1 24.4610W","", +"SN120398","The Avenue nr Cowherds ph N","","50 55.3334N","1 24.3107W","", +"SN120399","Winn Rd nr The Avenue W","","50 55.3922N","1 24.2911W","", +"SN120400","The Avenue os Avenue St Andrews ch S","","50 55.2691N","1 24.2850W","", +"SN120401","The Ave os 69A SE","","50 55.1346N","1 24.2449W","", +"SN120402","Carlton Rd opp 54 S","","50 54.9761N","1 24.3827W","", +"SN120403","Lodge Rd os Travelodge W","","50 55.1327N","1 24.1980W","", +"SN120404","The Ave os 35 SE","","50 55.0992N","1 24.1942W","", +"SN120405","The Ave nr Archers Rd NW","","50 54.9518N","1 24.1730W","", +"SN120406","The Ave os 15-16 TGWU office SE","","50 54.9840N","1 24.1427W","", +"SN120407","Lodge Rd os 96 NE","","50 55.1475N","1 24.0322W","", +"SN120408","Lodge Rd os 85 SW","","50 55.1536N","1 23.9519W","", +"SN120409","Bevois Val opp Aldi Store N","","50 55.0667N","1 23.7371W","", +"SN120410","Bevois Valley Rd os 64-68 SW","","50 55.0127N","1 23.7446W","", +"SN120411","Bevois Val opp Forster Rd S","","50 55.1572N","1 23.7154W","", +"SN120412","Portswood Rd opp 31 S","","50 55.2538N","1 23.7201W","", +"SN120413","Portswood Rd os 51 N","","50 55.2905N","1 23.7316W","", +"SN120415","Portswood Rd opp 119 SW","","50 55.4230N","1 23.6829W","", +"SN120430","Garfield Rd os 5 SE","","50 55.0080N","1 22.4498W","", +"SN120431","Bitterne Rd opp 199 SE","","50 55.0151N","1 22.2534W","", +"SN120432","Garfield Rd os 16 SE","","50 54.9919N","1 22.3570W","", +"SN120433","Cross Rd os 24 S","","50 54.9560N","1 22.3020W","", +"SN120434","Chessel Ave opp 100 NW","","50 54.9252N","1 22.2956W","", +"SN120435","Mousehole Ln opp 60A E","","50 55.2456N","1 21.8730W","", +"SN120438","Witts Hill os 108 NE","","50 55.4025N","1 21.6660W","", +"SN120442","Townhill Way opp Bramble Mews NE","","50 55.3006N","1 21.3823W","", +"SN120443","Townhill nr Bramble Mews SW","","50 55.2807N","1 21.3868W","", +"SN120447","West End Rd opp Dean Ct NE","","50 55.2161N","1 21.4090W","", +"SN120449","West End Rd os Dean Ct SW","","50 55.2128N","1 21.4023W","", +"SN120450","West End Rd os 95 NE","","50 55.0754N","1 21.5364W","", +"SN120451","West End Rd os 62 SW","","50 55.0468N","1 21.5454W","", +"SN120457","Bitterne Rd os path to Dean Rd SE","","50 54.8929N","1 21.4118W","", +"SN120459","Bitterne Rd os 567 E","","50 54.8787N","1 20.9955W","", +"SN120460","Somerset Ave nr Sunningdale Gdns NE","","50 54.9096N","1 20.8303W","", +"SN120461","Cheriton Ave opp 100 NE","","50 55.1062N","1 20.1823W","", +"SN120463","Beauworth Ave nr Bentley Green NW","","50 55.2989N","1 20.4919W","", +"SN120467","Beauworth Ave nr Exford Ave SE","","50 55.2901N","1 20.4665W","", +"SN120468","Cheriton Ave os 88 SW","","50 55.0714N","1 20.2305W","", +"SN120469","Cheriton Ave os 9 SE","","50 55.0565N","1 20.4578W","", +"SN120470","Cheriton Ave os 2 NW","","50 55.0674N","1 20.4944W","", +"SN120471","Somerset Ave nr Exford Ave NE","","50 55.0600N","1 20.6071W","", +"SN120472","Somerset Ave opp Exford Arms ph SW","","50 55.0290N","1 20.6588W","", +"SN120473","Somerset Ave os 10 Kingdom Hall SW","","50 54.9202N","1 20.7986W","", +"SN120474","Bitterne Rd opp RC ch W","","50 54.8704N","1 21.3438W","", +"SN120477","Regents Pk Rd os 5 N","","50 54.8386N","1 26.5949W","", +"SN120479","Regents Pk Rd os 8 S","","50 54.8299N","1 26.5865W","", +"SN120494","Waterloo Rd opp 104A SE","","50 54.6770N","1 25.6342W","", +"SN120495","Waterloo Rd os 57 SE","","50 54.6546N","1 25.4723W","", +"SN120496","Shirley Rd opp 214 SE","","50 54.8841N","1 25.4132W","", +"SN120498","Shirley Rd os 178 NW","","50 54.8332N","1 25.3609W","", +"SN120499","Shirley Rd os 99 SE","","50 54.7203N","1 25.2274W","", +"SN120501","Shirley Rd os 78 NW","","50 54.6483N","1 25.1899W","", +"SN120502","Hill Ln opp 74 S","","50 54.7733N","1 24.9306W","", +"SN120503","Waterloo Rd os 68 NW","","50 54.6453N","1 25.4409W","", +"SN120504","Archers Rd opp 47 SW","","50 54.9029N","1 24.8462W","", +"SN120505","Milton Rd os 173 E","","50 54.8285N","1 24.8557W","", +"SN120506","Hill Ln opp Cinnamon Ct N","","50 54.8478N","1 24.9297W","", +"SN120507","Milton Rd opp 171 W","","50 54.8226N","1 24.8592W","", +"SN120508","Newcombe Rd os 76 N","","50 54.8050N","1 24.6981W","", +"SN120509","Newcombe Rd S opp 82 S","","50 54.8147N","1 24.6928W","", +"SN120510","Carlton Rd os 2 N","","50 54.8752N","1 24.3822W","", +"SN120511","Newcombe Rd os 11 S","","50 54.6760N","1 24.6741W","", +"SN120512","Newcombe Rd opp 1 NW","","50 54.6544N","1 24.6718W","", +"SN120513","Handel Rd os 66 Devsonshire Rd E","","50 54.6279N","1 24.5518W","", +"SN120514","Handel Rd opp 2 W","","50 54.6231N","1 24.5758W","", +"SN120515","Shirley Rd opp 44 SE","","50 54.5781N","1 25.0585W","", +"SN120516","Shirley Rd os 32 NW","","50 54.5553N","1 25.0315W","", +"SN120518","Wyndham Pl 1 N","","50 54.4968N","1 24.7796W","", +"SN120519","Blechynden Ter opp Station E","","50 54.4804N","1 24.7329W","", +"SN120520","Southampton Station south forecourt E","","50 54.4289N","1 24.7882W","", +"SN120522","London Rd os Natwest N","","50 54.7105N","1 24.2418W","", +"SN120523","Commercial Rd opp art gallery E","","50 54.5350N","1 24.4352W","", +"SN120525","Above Bar St nr 200 S","","50 54.5639N","1 24.2812W","", +"SN120526","Havelock Rd os police station SE","","50 54.4693N","1 24.4668W","", +"SN120527","Civic Centre Rd os stop AO Civic Ctr E","","50 54.4213N","1 24.3633W","", +"SN120533","New Road South os Palmerston Park W","","50 54.4103N","1 24.2107W","", +"SN120535","London Rd os Ln w Courts N","","50 54.8497N","1 24.1427W","", +"SN120536","London Rd os Nothern Rock SW","","50 54.8194N","1 24.1226W","", +"SN120537","Onslow Rd nr Bevois Castle ph NE","","50 54.9011N","1 23.8587W","", +"SN120538","Onslow Rd os Sikh Centre SW","","50 54.8291N","1 23.9211W","", +"SN120539","St Marys Rd nr Brintons Ter N","","50 54.7000N","1 23.9944W","", +"SN120540","St Marys Rd nr Brintons Ter S","","50 54.7032N","1 23.9824W","", +"SN120542","Brintons Rd os 118 SE","","50 54.5667N","1 23.8801W","", +"SN120543","Brintons Rd opp 54 NW","","50 54.5138N","1 23.7792W","", +"SN120545","New Rd os 4 Carronades W","","50 54.4275N","1 23.9911W","", +"SN120547","Northam Rd os King Alfred ph W","","50 54.4630N","1 23.6493W","", +"SN120548","Northam Rd opp King Alfred ph E","","50 54.4787N","1 23.6559W","", +"SN120551","Northam Rd nr Parsonage Rd SW","","50 54.6656N","1 23.2968W","", +"SN120553","Portland Ter os Asda N","","50 54.3589N","1 24.3991W","", +"SN120556","Chessel Ave opp 8 NW","","50 54.8078N","1 21.9421W","", +"SN120557","Chessel Ave os 52 SE","","50 54.8537N","1 22.1489W","", +"SN120558","Northam Rd nr Radcliffe Rd NE","","50 54.5793N","1 23.3986W","", +"SN120559","Northam Rd nr Radcliffe Rd SW","","50 54.5738N","1 23.3842W","", +"SN120560","Chessel Ave os 39 NW","","50 54.8362N","1 22.1005W","", +"SN120561","Chessel Ave os 2A SE","","50 54.8066N","1 21.9063W","", +"SN120562","Peartree Ave nr 203 NE","","50 54.7812N","1 21.9049W","", +"SN120563","Peartree Ave os 179 NE","","50 54.6834N","1 21.9805W","", +"SN120564","Peartree Ave opp 193 SW","","50 54.7387N","1 21.9277W","", +"SN120565","Peartree Ave opp 121 SW","","50 54.5645N","1 22.1409W","", +"SN120566","Peartree Ave os 107 NE","","50 54.5448N","1 22.1855W","", +"SN120569","Peartree Ave os 51 NE","","50 54.4376N","1 22.3337W","", +"SN120570","Peartree Ave os Leslie Loader House SW","","50 54.4092N","1 22.3529W","", +"SN120571","Peartree Ave os 15 NE","","50 54.3614N","1 22.4081W","", +"SN120575","Maybray King Way nr Bitterne Rd East SE","","50 54.8480N","1 21.3902W","", +"SN120576","Maybray King Way opp leisure centre NW","","50 54.9007N","1 21.4603W","", +"SN120577","Bitterne Rd opp 559 W","","50 54.8729N","1 21.0237W","", +"SN120578","Bursledon Rd os 56-58 NW","","50 54.7496N","1 21.2653W","", +"SN120579","Bursledon Rd os 103 SE","","50 54.7321N","1 21.2143W","", +"SN120587","Spring Rd opp 110 NW","","50 54.5103N","1 21.6091W","", +"SN120588","Spring Rd os 81 NE","","50 54.3998N","1 21.6225W","", +"SN120589","Spring Rd opp 87 SW","","50 54.3847N","1 21.6244W","", +"SN120590","Middle Rd os 188 NE","","50 54.2898N","1 21.5327W","", +"SN120594","Bursledon Rd os 161 SE","","50 54.6164N","1 20.9752W","", +"SN120595","Bursledon Rd opp 155 NW","","50 54.6203N","1 20.9957W","", +"SN120596","Bursledon Rd os 198 NW","","50 54.5390N","1 20.8338W","", +"SN120597","Bursledon Rd opp 214 SE","","50 54.5078N","1 20.7549W","", +"SN120598","Bursledon Rd os 276 NW","","50 54.4320N","1 20.6160W","", +"SN120599","Hinkler Rd opp 1 Carey Rd NE","","50 54.4484N","1 20.5577W","", +"SN120600","Hinkler Rd nr 1 Carey Rd SW","","50 54.4467N","1 20.5509W","", +"SN120601","Bursledon Rd os 17 Carey Rd SW","","50 54.3991N","1 20.5294W","", +"SN120602","Kathleen Rd os 252 SW","","50 54.3827N","1 20.5834W","", +"SN120603","Hinkler Rd opp Byron Rd SW","","50 54.4877N","1 20.4462W","", +"SN120604","Hinkler Rd opp 460 SW","","50 54.5299N","1 20.2758W","", +"SN120605","Hinkler Rd nr Byron Rd NE","","50 54.4956N","1 20.4094W","", +"SN120606","Hinkler Rd opp 366 E","","50 54.5457N","1 20.2047W","", +"SN120607","Hinkler Rd os 361 SE","","50 54.4816N","1 20.0461W","", +"SN120608","Hinkler Rd os Hinkler ph SE","","50 54.4632N","1 20.0224W","", +"SN120609","Warburton Rd os 2-28 NE","","50 54.4094N","1 19.9660W","", +"SN120614","Hinkler Rd opp 202-222 SW","","50 54.4584N","1 19.7486W","", +"SN120615","Hinkler Rd os 202-222 NE","","50 54.4664N","1 19.7425W","", +"SN120622","Queensway opp Debenhams N","","50 54.1247N","1 24.0616W","", +"SN120623","Queensway os Debenhams S","","50 54.1370N","1 24.0486W","", +"SN120627","Queensway opp McCluskys N","","50 53.9117N","1 24.0916W","", +"SN120632","Queensway os McCluskys S","","50 53.8982N","1 24.0841W","", +"SN120635","Platform Rd os Admiralty House W","","50 53.8128N","1 23.9572W","", +"SN120643","Kingsway os Kingsland Ct N","","50 54.3336N","1 23.8754W","", +"SN120652","Itchen Bridge nr Albert Rd North E","","50 53.9295N","1 23.4634W","", +"SN120653","Saltmarsh Rd nr Air Museum SW","","50 53.9034N","1 23.5354W","", +"SN120654","Bridge Rd os 91 NE","","50 54.1029N","1 22.6019W","", +"SN120655","Bridge Rd os 58 SW","","50 54.1196N","1 22.5829W","", +"SN120656","Bridge Rd os 5 SW","","50 53.9770N","1 22.6573W","", +"SN120657","Bridge Rd opp 7 NE","","50 53.9706N","1 22.6685W","", +"SN120659","Woolston Link N","","50 53.8954N","1 22.6405W","", +"SN120660","Portsmouth Rd opp 26 E","","50 53.8844N","1 22.7029W","", +"SN120661","Portsmouth Rd os 26 W","","50 53.8780N","1 22.7030W","", +"SN120662","Radstock Rd opp 34 E","","50 53.9947N","1 22.4318W","", +"SN120664","Portsmouth Rd opp 60 SE","","50 53.8524N","1 22.3570W","", +"SN120665","Portsmouth Rd os Woolston Library W","","50 53.8698N","1 22.4984W","", +"SN120666","Bishops Rd opp 30 NE","","50 54.0445N","1 22.2665W","", +"SN120667","Bishops Rd nr Radstock Rd SW","","50 53.9977N","1 22.2953W","", +"SN120668","Bishops Rd os 61 NE","","50 54.1291N","1 22.1459W","", +"SN120669","Wodehouse Rd opp 15 NW","","50 54.1369N","1 22.0886W","", +"SN120670","Knighton Rd opp 10 N","","50 54.2569N","1 21.9308W","", +"SN120671","Wodehouse Rd os 35 SE","","50 54.1052N","1 22.0250W","", +"SN120672","Knighton Rd os 72 SW","","50 54.1082N","1 21.9798W","", +"SN120673","Sholing Rd os 124 W","","50 54.2778N","1 21.9024W","", +"SN120674","Sholing Rd nr Spring Rd E","","50 54.2797N","1 21.7599W","", +"SN120675","Spring Rd os 1 Southeast Rd SW","","50 54.2860N","1 21.7265W","", +"SN120676","Station Rd os 41 NE","","50 53.8260N","1 21.8744W","", +"SN120677","Station Rd os 69 NE","","50 53.8469N","1 21.7402W","", +"SN120678","Station Rd os 54 SW","","50 53.8323N","1 21.8334W","", +"SN120682","South East Rd os 82 NW","","50 54.1174N","1 21.3790W","", +"SN120684","Kathleen Rd opp Botany Bay Green NE","","50 54.0506N","1 21.2160W","", +"SN120686","South East Rd os 130 NW","","50 54.0390N","1 21.2623W","", +"SN120687","Kathleen Rd os 34 SW","","50 54.0060N","1 21.2516W","", +"SN120689","Kathleen Rd opp St Monica Infant Sch NE","","50 53.9465N","1 21.4069W","", +"SN120690","Kathleen Rd os St Monica Infant Sch SW","","50 53.9394N","1 21.4019W","", +"SN120692","Kathleen Rd os 90 SW","","50 54.1431N","1 21.0603W","", +"SN120693","Kathleen Rd os 157 NE","","50 54.2376N","1 20.8815W","", +"SN120694","Kathleen Rd os 146 SW","","50 54.2237N","1 20.8988W","", +"SN120695","Butts Rd opp 84 NE","","50 53.8831N","1 20.9829W","", +"SN120696","Butts Rd os Bullseye ph SW","","50 53.9260N","1 20.9174W","", +"SN120697","Butts Rd os 265 NE","","50 54.0080N","1 20.8190W","", +"SN120698","Kathleen Rd os 198 NE","","50 54.2995N","1 20.7578W","", +"SN120699","Kathleen Rd os 212 SW","","50 54.3149N","1 20.7175W","", +"SN120700","Bursledon Rd os path to Linacre Rd SE","","50 54.3134N","1 20.3454W","", +"SN120701","Bursledon Rd opp The Range NE","","50 54.3179N","1 20.3846W","", +"SN120703","Orpen Rd nr Bursledon Rd SW","","50 54.1991N","1 20.1738W","", +"SN120704","Butts Rd os 389 NE","","50 54.1627N","1 20.4184W","", +"SN120705","Butts Rd os 388 SW","","50 54.1441N","1 20.4613W","", +"SN120706","Butts Rd os 1 Ln ndseer Rd SW","","50 54.0571N","1 20.7219W","", +"SN120707","Warburton Rd os Dumbleton Towers SE","","50 54.2651N","1 19.9211W","", +"SN120708","Warburton Rd opp Dumbleton Towers NW","","50 54.2750N","1 19.9517W","", +"SN120709","Warburton Rd opp Tatwin Cres S","","50 54.3938N","1 19.9654W","", +"SN120710","Portsmouth Rd os Woolston sch SW","","50 53.7801N","1 22.0730W","", +"SN120711","Victoria Rd os health centre N","","50 53.8243N","1 22.8590W","", +"SN120712","Victoria Rd opp Keswick Rd SW","","50 53.7917N","1 22.8091W","", +"SN120713","Victoria Rd os shipyard N","","50 53.7535N","1 22.8318W","", +"SN120717","Weston Grove Rd os 5 SE","","50 53.6271N","1 22.8028W","", +"SN120718","Weston Gro Rd os St Marks ch NE","","50 53.5909N","1 22.7060W","", +"SN120719","Weston Grove Rd os 41 SE","","50 53.5750N","1 22.6524W","", +"SN120726","Portsmouth Rd opp Woolston sch NE","","50 53.7786N","1 22.0918W","", +"SN120729","Portsmouth Rd os Swan ph SE","","50 53.7392N","1 21.7792W","", +"SN120730","Portsmouth Rd opp 211 NW","","50 53.7382N","1 21.7980W","", +"SN120731","Wrights Hill nr Weston Ln SE","","50 53.6516N","1 21.5466W","", +"SN120732","Wrights Hill opp 22-24 NW","","50 53.6533N","1 21.5790W","", +"SN120733","Weston Ln opp 236 NE","","50 53.6322N","1 21.5571W","", +"SN120734","Weston Ln os 226 SW","","50 53.6118N","1 21.5736W","", +"SN120735","Upper Weston Ln os 275 NE","","50 53.6827N","1 21.3201W","", +"SN120736","Upper Weston Ln os 272 SW","","50 53.6737N","1 21.3501W","", +"SN120737","Newtown Rd os 70 SE","","50 53.5545N","1 21.3560W","", +"SN120738","Newtown Rd opp 74 NW","","50 53.5469N","1 21.3518W","", +"SN120739","Butts Rd nr 43 NE","","50 53.7616N","1 21.1450W","", +"SN120740","Butts Rd opp 17 SW","","50 53.7160N","1 21.1934W","", +"SN120741","Newtown Rd os 152 SE","","50 53.4376N","1 21.2006W","", +"SN120742","Newtown Rd opp 146 NW","","50 53.4512N","1 21.2167W","", +"SN120743","Weston Ln opp 134 NE","","50 53.4481N","1 21.8258W","", +"SN120744","Weston Ln os Leisure Centre SW","","50 53.4560N","1 21.7916W","", +"SN120747","Weston Ln os 61 NE","","50 53.3686N","1 22.0973W","", +"SN120748","Weston Ln opp 23A SW","","50 53.3137N","1 22.2251W","", +"SN120751","Kingsclere Ave opp 7 NE","","50 53.3224N","1 22.0271W","", +"SN120752","Wallace Rd os Kipling Ct SE","","50 53.3355N","1 21.9664W","", +"SN120753","Kingsclere Ave os 96 SE","","50 53.2023N","1 22.0774W","", +"SN120754","Kingsclere Ave nr Poulner Close SE","","50 53.2753N","1 21.7011W","", +"SN120755","Kingsclere Ave os 220 SW","","50 53.2327N","1 21.6078W","", +"SN120756","Kingsclere Ave nr Drayton Ct SW","","50 53.1576N","1 21.6873W","", +"SN120757","Kingsclere Ave opp 169 SW","","50 53.1225N","1 21.7927W","", +"SN120758","Tickleford Dr opp 99-103 NE","","50 53.2152N","1 21.4665W","", +"SN120764","Station Rd opp Squirrel Dr SW","","50 53.8505N","1 21.6224W","", +"SN120766","Kingsway os market S","","50 54.2827N","1 23.8445W","", +"SN120769","Redbridge Ln nr Romsey Rd SW","","50 56.5860N","1 27.5784W","", +"SN120774","Forest Hills Dr opp 84 E","","50 56.0703N","1 21.9335W","", +"SN120775","Forest Hills Dr opp 12 NE","","50 56.0125N","1 22.2092W","", +"SN120778","Thornhill Pk Rd os Baptist ch E","","50 54.8886N","1 20.0718W","", +"SN120779","Thornhill Pk Rd os 74 W","","50 54.8813N","1 20.1069W","", +"SN120780","Thornhill Pk Rd opp 15 W","","50 54.8728N","1 20.3213W","", +"SN120788","Winn Rd os Sovereign Ct NE","","50 55.4171N","1 24.2131W","", +"SN120789","Thornhill Pk Rd opp The Bitterne ph E","","50 54.8784N","1 20.2674W","", +"SN120790","Bitterne Rd opp 645 W","","50 54.8738N","1 20.7045W","", +"SN120791","Mansbridge Rd os 1 Monks Way NW","","50 56.4640N","1 22.2953W","", +"SN120792","Bitterne Rd os 643 E","","50 54.8789N","1 20.7317W","", +"SN120793","Mansbridge Rd opp Howard Cl NW","","50 56.4413N","1 22.1752W","", +"SN120795","Mansbridge Rd nr Itchenside Cl S","","50 56.3359N","1 21.9469W","", +"SN120797","Mansbridge Rd opp White Swan ph W","","50 56.2455N","1 21.7005W","", +"SN120806","Botley Rd opp 39 SW","","50 53.6992N","1 20.7005W","", +"SN120814","Sullivan Rd opp 12 SE","","50 54.0707N","1 20.3591W","", +"SN120818","Montague Ave nr Montague Cl SE","","50 54.0026N","1 20.1553W","", +"SN120819","Montague Ave opp Montague Cl NW","","50 53.9939N","1 20.1366W","", +"SN120820","Botley Rd nr Montague Ave NE","","50 53.8722N","1 20.0863W","", +"SN120821","Botley Rd opp 197 SW","","50 53.8906N","1 20.0024W","", +"SN120822","Botley Rd nr Delius Ave NE","","50 53.8272N","1 20.2499W","", +"SN120823","Botley Rd opp 153 SW","","50 53.8377N","1 20.1977W","", +"SN120824","Botley Rd os Valentine Infant sch NE","","50 53.7691N","1 20.4606W","", +"SN120825","Botley Rd opp Valentine Infant sch SW","","50 53.7658N","1 20.4581W","", +"SN120826","Botley Rd opp 10 NE","","50 53.6702N","1 20.8212W","", +"SN120827","Portsmouth Rd os 442-446 NW","","50 53.6532N","1 20.9579W","", +"SN120828","Sullivan Rd opp Purcell Rd NW","","50 54.0480N","1 20.3577W","", +"SN120829","Portsmouth Rd os 382 NW","","50 53.6873N","1 21.1793W","", +"SN120838","Redbridge Rd os Redbridge Primary sch SE","","50 55.2701N","1 27.9445W","", +"SN120839","Redbridge Rd os 50 SE","","50 55.1550N","1 27.6769W","", +"SN120840","Redbridge Rd os MacDonalds SE","","50 55.0719N","1 27.4483W","", +"SN120841","Redbridge Rd nr First Ave NW","","50 55.0718N","1 27.5259W","", +"SN120842","Redbridge Rd opp 62 SE","","50 55.1607N","1 27.7392W","", +"SN120843","Redbridge Rd nr Redbridge roundabout NW","","50 55.3017N","1 28.1293W","", +"SN120844","Portsmouth Rd opp 382 SE","","50 53.6932N","1 21.1775W","", +"SN120870","Bitterne Rd West os 203 SE","","50 55.0187N","1 22.2312W","", +"SN120871","Bitterne Rd opp 362 SE","","50 54.9136N","1 21.8468W","", +"SN120872","Radstock Rd opp 1 W","","50 53.9955N","1 22.5922W","", +"SN120880","Peartree Ave os Peartree ch SW","","50 54.2577N","1 22.4846W","", +"SN120881","Brunswick Pl opp 21 SE","","50 54.6447N","1 24.1411W","", +"SN120891","Carlton Rd opp 2 S","","50 54.8697N","1 24.3704W","", +"SN120898","St James Rd opp 106 NW","","50 55.4482N","1 25.5615W","", +"SN120899","Houndwell Pl os Debenhams E","","50 54.1697N","1 24.0115W","", +"SN120900","Glen Eyre Rd os 10 NW","","50 56.3224N","1 23.9923W","", +"SN120906","Radstock Rd opp 47 W","","50 53.9819N","1 22.3612W","", +"SN120912","Butts Rd os 64-70 SW","","50 53.8563N","1 21.0080W","", +"SN120913","East Park Ter os tennis courts N","","50 54.4810N","1 24.0997W","", +"SN120914","East Park Ter os Millais Gallery S","","50 54.5127N","1 24.0907W","", +"SN120915","St Marys Rd os Sports Hall S","","50 54.6357N","1 23.9662W","", +"SN120928","King Georges Ave os 221 SW","","50 55.2858N","1 26.6937W","", +"SN120950","Hill Ln os Byron Ct S","","50 54.6708N","1 24.9310W","", +"SN120951","Hill Ln os 52 N","","50 54.7102N","1 24.9434W","", +"SN120953","Mansel Rd West os Holy Family sch NW","","50 55.9210N","1 27.9959W","", +"SN120954","Mansel Rd West os 278 SE","","50 55.9237N","1 27.9908W","", +"SN120961","North East Rd opp High Firs Rd NE","","50 54.4523N","1 20.8734W","", +"SN120962","North East Rd opp 225 SW","","50 54.4683N","1 20.8348W","", +"SN120963","North East Rd opp 151 SW","","50 54.3674N","1 21.0350W","", +"SN120964","North East Rd os 18 SW","","50 54.1581N","1 21.3408W","", +"SN120965","North East Rd opp 65 SW","","50 54.2332N","1 21.2502W","", +"SN120966","North East Rd os 69 NE","","50 54.2439N","1 21.2432W","", +"SN120967","North East Rd opp 166 NE","","50 54.3931N","1 20.9946W","", +"SN120979","Coxford Rd os Princess Anne Hospital NE","","50 56.0899N","1 26.0540W","", +"SN120980","Houndwell Pl opp Debenhams SE","","50 54.1679N","1 23.9791W","", +"SN120981","Olive Rd opp 64 NW","","50 56.2478N","1 26.5747W","", +"SN120983","Olive Rd os 62 SE","","50 56.2461N","1 26.5593W","", +"SN120985","Coxford Rd os 114 SW","","50 56.0268N","1 26.3972W","", +"SN120986","Coxford Rd os 129 NE","","50 56.0338N","1 26.3740W","", +"SN120988","Coxford Rd nr Birch Rd E","","50 55.9978N","1 26.6426W","", +"SN120989","Coxford Rd nr Birch Rd W","","50 55.9919N","1 26.6443W","", +"SN120998","Wide Ln opp Ford works NE","","50 56.7189N","1 22.1305W","", +"SN120999","Wide Ln os Ford works SW","","50 56.6760N","1 22.1720W","", +"SN120P03","Landguard Rd os 28 SW - HR","","50 54.7536N","1 25.0896W","", +"SN120P04","Arthur Rd os 10 S - HR","","50 54.7978N","1 25.1992W","", +"SN120P05","Suffolk Ave os 72 E - HR","","50 54.8895N","1 25.2885W","", +"SN120P06","Paynes Rd opp 6 NE - HR","","50 54.8351N","1 25.4334W","", +"SN120P07","Park Rd os 111 SE - HR","","50 54.8252N","1 25.5009W","", +"SN120P08","Richmond Rd os 49 NE - HR","","50 54.7957N","1 25.7599W","", +"SN120P09","Foundry Ln os 174 SE - HR","","50 54.9612N","1 25.9482W","", +"SN120P10","English Rd nr Imperial Ave SW - HR","","50 55.0963N","1 26.1011W","", +"SN120P11","Dale Valley Rd os 73 SW - HR","","50 56.0234N","1 25.6894W","", +"SN120P12","Coxford Rd os 8 NE - HR","","50 56.5550N","1 25.4958W","", +"SN120P13","Dunvegan Dr nr Balmoral Cl SW - HR","","50 56.7597N","1 25.7657W","", +"SN120P14","Sandpiper Rd opp Winchat Cl SW - HR","","50 56.8484N","1 26.2472W","", +"SN121003","Bargate St nr Castle Way 2 W","","50 54.1637N","1 24.3145W","", +"SN121005","Bassett Ave opp 205 SW","","50 56.8878N","1 24.2951W","", +"SN121006","Bassett Ave nr Ridgemount Ave NE","","50 56.7429N","1 24.3422W","", +"SN121007","Bassett Ave opp 122 NE","","50 56.5721N","1 24.3854W","", +"SN121008","Bassett Ave nr Saxholm Way NE","","50 56.9509N","1 24.2900W","", +"SN121009","Bassett Ave opp 243 SW","","50 56.9940N","1 24.2690W","", +"SN121010","Bassett Ave nr Ridgemount Ave SW","","50 56.7332N","1 24.3338W","", +"SN121014","Bursledon Rd nr Botley Rd SE","","50 54.0121N","1 19.7413W","", +"SN121015","Bursledon Rd nr Botley Rd NW","","50 54.0084N","1 19.7465W","", +"SN121020","Kingsclere Ave nr Hurstbourne Pl NW","","50 53.1153N","1 21.9515W","", +"SN121021","Hanover Bldgs os Echo Shop E","","50 54.1858N","1 24.2050W","", +"SN121022","Havelock Rd os BBC NW","","50 54.4878N","1 24.4930W","", +"SN121025","Millbrook Rd nr Regents Park Rd E","","50 54.8167N","1 26.6387W","", +"SN121026","Millbrook Rd nr King George Ave SE","","50 54.8445N","1 26.9243W","", +"SN121027","Millbrook Rd os Brazier estate NW","","50 54.8410N","1 26.9824W","", +"SN121031","Portland Ter os Marlands S","","50 54.3378N","1 24.3788W","", +"SN121033","Portsmouth Rd opp Veal store SE","","50 53.5763N","1 20.6254W","", +"SN121034","Portsmouth Rd os 459 SE","","50 53.6276N","1 20.8303W","", +"SN121035","Portsmouth Rd os Picador car dealer NW","","50 53.5841N","1 20.6740W","", +"SN121036","Redbridge Hill os 94 W","","50 55.5979N","1 26.8565W","", +"SN121037","Redbridge Hill opp 54 E","","50 55.5978N","1 26.7225W","", +"SN121038","Redbridge Hill opp Walnut Grove E","","50 55.6084N","1 26.9085W","", +"SN121039","Redbridge Hill opp Holy Family ch W","","50 55.6053N","1 27.0357W","", +"SN121040","Redbridge Hill os 42 W","","50 55.5890N","1 26.6807W","", +"SN121041","Redbridge Hill os Holy Family ch E","","50 55.6111N","1 27.0100W","", +"SN121042","Romsey Rd nr Redbridge Ln SE","","50 56.5810N","1 27.5511W","", +"SN121043","Romsey Rd nr path to Viking Cl SE","","50 56.4856N","1 27.4583W","", +"SN121044","Romsey Rd opp 503 NW","","50 56.0966N","1 27.1102W","", +"SN121045","Romsey Rd opp 425 NW","","50 55.8912N","1 26.9188W","", +"SN121046","Romsey Rd os 533 SE","","50 56.1670N","1 27.1657W","", +"SN121047","Stoneham Ln nr Channels Farm Rd NE","","50 56.7282N","1 22.6658W","", +"SN121048","Stoneham Ln os 20 S","","50 56.5548N","1 22.8193W","", +"SN121049","Stoneham Ln os 29 N","","50 56.5543N","1 22.8287W","", +"SN121050","Stoneham Ln os 42 SW","","50 56.6300N","1 22.7534W","", +"SN121051","Stoneham Ln nr Channels Farm Rd SW","","50 56.7255N","1 22.6590W","", +"SN121052","The Avenue nr Oakmount Ave N","","50 55.6255N","1 24.3419W","", +"SN121053","The Avenue nr Highfield Rd N","","50 55.7734N","1 24.3563W","", +"SN121054","The Avenue nr Highfield Rd S","","50 55.7977N","1 24.3474W","", +"SN121055","The Avenue nr Oakmount Ave S","","50 55.6427N","1 24.3349W","", +"SN121059","Burgoyne Rd opp 1-11 E","","50 54.1800N","1 19.8439W","", +"SN121060","Westend Rd opp 216 NE","","50 55.3202N","1 20.9185W","", +"SN121061","West End Rd opp 157 SW","","50 55.2868N","1 21.2151W","", +"SN121062","West End Rd os 218 SW","","50 55.3153N","1 20.9091W","", +"SN121063","West End Rd os 159 NE","","50 55.2910N","1 21.2083W","", +"SN121066","Wimpson Ln nr Cumbrian Way NE","","50 55.3365N","1 27.3632W","", +"SN121067","Wimpson Ln opp 244-258 NE","","50 55.5907N","1 27.1443W","", +"SN121068","Wimpson Ln os 179 NE","","50 55.4794N","1 27.2361W","", +"SN121069","Bargate St nr Castle Way 1 W","","50 54.1620N","1 24.2992W","", +"SN12151A","Burgess Rd os 469 NE","","50 56.3580N","1 22.8441W","", +"SN122001","Tickleford Dr nr Staplehurst Cl NE","","50 53.2945N","1 21.2811W","", +"SN122002","Newtown Rd opp Tenterton Ave NW","","50 53.3640N","1 21.1693W","", +"SN122003","Newtown Rd nr Tickleford Dr SE","","50 53.3299N","1 21.1441W","", +"SN122019","Rownhams Rd N nr Buchanan Rd SW","","50 56.7630N","1 27.0161W","", +"SN12272A","Portswood Rd os 241 nr Somerfield NE","","50 55.5846N","1 23.5229W","", +"SN12275A","Portswood Rd os 170 Superdrug SW","","50 55.5722N","1 23.5265W","", +"SN122769","Redbridge Ln nr Toogoods Way NE","","50 56.5716N","1 27.6050W","", +"SN12367A","Shirley High St os precinct 1 SE","","50 55.4211N","1 26.1040W","", +"SN12367B","Shirley Rd nr MacDonald SE","","50 55.1339N","1 25.7378W","", +"SN12368A","Shirley High St os 104A NE","","50 55.3930N","1 26.0838W","", +"SN12368B","Shirley High St os Iceland NE","","50 55.4071N","1 26.1024W","", +"SN12369A","Park St nr Carlisle Rd NE","","50 55.3492N","1 26.0750W","", +"SN12369B","Park St nr Shirley High St NE","","50 55.3540N","1 26.0655W","", +"SN12370A","Park St os 2 SW","","50 55.3481N","1 26.0656W","", +"SN12426B","Bullar Rd Gyratory 1 SE","","50 55.1031N","1 22.4596W","", +"SN12426C","Bullar Rd Gyratory 2 SE","","50 55.1002N","1 22.4366W","", +"SN12441A","Commercial Rd os gallery 1 W","","50 54.5277N","1 24.3756W","", +"SN12441B","Commercial Rd os gallery 2 W","","50 54.5295N","1 24.4063W","", +"SN12493A","Waterloo Rd opp ch NW","","50 54.6749N","1 25.6632W","", +"SN12518A","Wyndham Pl 2 N","","50 54.5065N","1 24.7795W","", +"SN12524B","Above Bar St os Cenotaph N","","50 54.5710N","1 24.2905W","", +"SN12524D","Above Bar St nr Cenotaph N","","50 54.5996N","1 24.2936W","", +"SN12531A","Above Bar St os 101 N","","50 54.3707N","1 24.2735W","", +"SN12531B","Above Bar St os 109 N","","50 54.3588N","1 24.2719W","", +"SN12532A","Above Bar St os 85 N","","50 54.3443N","1 24.2712W","", +"SN12532B","Above Bar St os 98 S","","50 54.3388N","1 24.2585W","", +"SN12544A","New Rd opp Carronades NE","","50 54.4414N","1 23.9662W","", +"SN12544B","New Rd opp Premier Inn NE","","50 54.4451N","1 23.9533W","", +"SN12550B","Northam Rd opp 210 NE","","50 54.7410N","1 23.2778W","", +"SN12550C","Northam Rd opp 214 NE","","50 54.7464N","1 23.2752W","", +"SN12616B","Pound Tree Rd stand CC E","","50 54.3019N","1 24.1113W","", +"SN12616C","Vincents Walk stand Ci S","","50 54.2341N","1 24.1557W","", +"SN12616D","Pound Tree Rd stand CE W","","50 54.2922N","1 24.1081W","", +"SN12616E","Pound Tree Rd stand CD E","","50 54.3023N","1 24.0866W","", +"SN12617A","Pound Tree Rd stand CA E","","50 54.3021N","1 24.1583W","", +"SN12617B","Above Bar St os 109 N","","50 54.3820N","1 24.2742W","", +"SN12617C","Pound Tree Rd stand CF W","","50 54.2934N","1 24.1413W","", +"SN12618A","Vincents Walk stand CG S","","50 54.2811N","1 24.1517W","", +"SN12618B","Vincents Walk stand CH S","","50 54.2460N","1 24.1530W","", +"SN12618C","Vincents Walk stand CL S","","50 54.2283N","1 24.1669W","", +"SN12619A","Hanover Buildings stand CS S","","50 54.1852N","1 24.1879W","", +"SN12619C","Sussex Pl stand CO os Laura Ashley N","","50 54.2721N","1 24.1954W","", +"SN12619D","Vincents Walk stand CJ S","","50 54.2196N","1 24.1585W","", +"SN12619E","Vincents Walk stand CK S","","50 54.2083N","1 24.1603W","", +"SN12658A","Woolston Link 1 S","","50 53.8948N","1 22.6294W","", +"SN12658B","Woolston Link 2 S","","50 53.8894N","1 22.6295W","", +"SN12921A","West End Rd opp Sainsburys NE","","50 54.9073N","1 21.6881W","", +"SN12921C","Bitterne Rd os 355 E","","50 54.8785N","1 21.7449W","", +"SN12922A","West End Rd os Sainsburys 2 SW","","50 54.8965N","1 21.6849W","", +"SNA09017","Waterloo Rd os Wellington Ct SE","","50 54.6249N","1 25.2542W","", +"SNA09185","Portsmouth Rd opp 63 NW","","50 53.8382N","1 22.3290W","", +"SNA09195","Hill Ln os King Edward School N","","50 55.3391N","1 24.9013W","", +"SNA09196","Wyndham Pl 3 N","","50 54.5157N","1 24.7794W","", +"SNA09197","Tremona Rd os 7 NE","","50 55.7298N","1 26.2138W","", +"SNA09200","Anglesea Rd os No 20 NE","","50 55.4809N","1 26.0819W","", +"SNA09201","Westwood Rd os 14 SW","","50 55.3393N","1 24.1825W","", +"SNA09221","Landguard Rd os 23 NW - HR","","50 54.7470N","1 25.0658W","", +"SNA09222","Arthur Rd os 31 N - HR","","50 54.8373N","1 25.2123W","", +"SNA09223","Howard Rd nr Shirley Rd SW - HR","","50 54.8757N","1 25.3475W","", +"SNA09224","Paynes Rd os 6 SW - HR","","50 54.8324N","1 25.4249W","", +"SNA09225","Richmond Rd os 102 NW - HR","","50 54.8286N","1 25.5316W","", +"SNA09226","Richmond Rd os 124 NW - HR","","50 54.8035N","1 25.9049W","", +"SNA09227","Foundry Ln nr Nelson Rd N - HR","","50 54.8662N","1 25.9349W","", +"SNA09228","Foundry Ln nr Heysham Rd NW - HR","","50 55.1034N","1 26.0079W","", +"SNA09229","English Rd nr Imperial Ave SW - HR","","50 55.0972N","1 26.0712W","", +"SNA09230","Waterhouse Way nr Waterhouse Way NW - HR","","50 55.0862N","1 26.2489W","", +"SNA09231","Waterhouse Way nr 8 SE - HR","","50 55.0977N","1 26.2726W","", +"SNA09233","Foundry Ln nr Heysham Rd SE - HR","","50 55.1045N","1 26.0002W","", +"SNA09234","Foundry Ln nr Salcombe Rd SE - HR","","50 55.0044N","1 25.9588W","", +"SNA09235","Foundry Ln nr Wolseley Rd S - HR","","50 54.8980N","1 25.9200W","", +"SNA09236","Coxford Rd os 424 SW - HR","","50 56.4664N","1 25.5908W","", +"SNA09237","Sandpiper Rd nr Puffin Cl NW - HR","","50 56.8018N","1 25.9753W","", +"SNA09238","Sandpiper Rd nr Woburn Rd SE - HR","","50 56.6945N","1 25.9894W","", +"SNA09239","Dunvegan Dr os 83 E - HR","","50 56.7706N","1 25.5555W","", +"SNA09240","Dunvegan Dr nr Woburn Rd E - HR","","50 56.7572N","1 25.8990W","", +"SNA09241","Sandpiper Rd os 137 SE - HR","","50 56.8647N","1 26.0514W","", +"SNA09242","Sandpiper Rd opp 2 NW - HR","","50 56.6740N","1 26.3424W","", +"SNA09285","Platform Rd os Portcullis House W","","50 53.8147N","1 23.9009W","", +"SNA09298","Bassett Green Rd nr Bassett Green Cl SE","","50 56.7119N","1 23.4595W","", +"SNA09299","Highfield Rd opp Omdurman Rd NE","","50 55.8481N","1 24.1829W","", +"SNA09300","Glen Eyre Rd opp Chamberlain Hall SE","","50 56.5240N","1 24.1528W","", +"SNA09313","Glen Eyre Rd nr Bassett Ave SE","","50 56.7680N","1 24.2889W","", +"SNA09317","Northam Rd nr Britannia Rd NE","","50 54.5696N","1 23.4124W","", +"SNA09318","Northam Rd nr Britannia Rd SW","","50 54.5642N","1 23.3979W","", +"SNA09323","Romsey Rd opp 535 NW","","50 56.1578N","1 27.1649W","", +"SNA09341","Portland Ter opp West Quay 1 SE","","50 54.2319N","1 24.3478W","", +"SNA09343","Portland Ter os West Quay 2 NW","","50 54.2049N","1 24.3532W","", +"SNA09388","Bassett Green Rd os 184 NW","","50 56.8397N","1 23.6526W","", +"SNA09412","Tunstall Rd os Meredith Towers S","","50 54.2482N","1 19.7883W","", +"SNA09436","Wilton Rd os No 177 NW","","50 55.3699N","1 25.2313W","", +"SNA09437","Wilton Rd os No 170 SE","","50 55.3720N","1 25.2227W","", +"SNA09438","Upper Shirley Ave os 121 SW","","50 55.5165N","1 25.4147W","", +"SNA09450","Burgess Rd Opp 40b NE","","50 56.0873N","1 24.7476W","", +"SNA09451","Burgess Rd nr 40b SW","","50 56.0856N","1 24.7340W","", +"SNA09452","Wilton Rd nr South View Rd NW","","50 55.3111N","1 25.1253W","", +"SNA09453","Wilton Rd nr South View Rd SE","","50 55.3171N","1 25.1261W","", +"SNA09454","Wilton Rd os 121 NW","","50 55.5114N","1 25.3695W","", +"SNA09464","Castle Way nr Bargate St SE","","50 54.1449N","1 24.3241W","", +"SNA09572","Shirley Rd nr Nightingale Gr NW","","50 54.9537N","1 25.5173W","", +"SNA09576","Weston Parade SE","","50 53.0884N","1 22.1719W","", +"SNA09577","Weston Parade NW","","50 53.0809N","1 22.1805W","", +"SNA09589","St Marys Rd opp Sports Hall N","","50 54.6368N","1 23.9756W","", +"SNA09593","Mousehole Ln os 60A W","","50 55.2402N","1 21.8765W","", +"SNA13670","Highfield Rd opp campus gate NE","","50 55.7162N","1 24.2503W","", +"SNA13761","Town Quay pier opp Red Funnel NE","","50 53.6935N","1 24.3631W","", +"SNA13762","Town Quay pier os Red Funnel SW","","50 53.6848N","1 24.3564W","", +"SNA13766","Town Quay os Tower House E","","50 53.7735N","1 24.1872W","", +"SNA13767","Town Quay opp Tower House W","","50 53.7633N","1 24.1950W","", +"SNA13768","High St nr Town Quay N","","50 53.8364N","1 24.2513W","", +"SNA13769","High St nr Town Quay S","","50 53.8472N","1 24.2434W","", +"SNA19467","Warburton Rd opp St Colmans RC ch S","","50 54.1548N","1 19.8869W","", +"SNA19469","Commercial St opp RC ch SW","","50 54.8884N","1 21.2830W","", +"SNA19470","Shales Rd opp Balaclava Rd SW","","50 55.0853N","1 21.0890W","", +"SNA19471","Taunton Dr opp Burnham Chase NW","","50 55.0193N","1 20.8621W","", +"SNA19472","Midanbury Ln so Dalmally Gdns S","","50 55.3359N","1 22.1099W","", +"SNA19473","Litchfield Rd opp 65 SW","","50 55.6807N","1 21.6195W","", +"SNA19474","Middle Rd opp 11 SW","","50 53.8881N","1 21.6876W","", +"SNA19476","Middle Rd os 112 SW","","50 54.1164N","1 21.6068W","", +"SNA19477","Middle Rd os 216 SW","","50 54.3338N","1 21.4963W","", +"SNA19478","Middle Rd os 270 SW","","50 54.4456N","1 21.4179W","", +"SNA19479","Kathleen Rd os 253 NE","","50 54.3785N","1 20.6031W","", +"SNA19482","General Hosp West Door","","50 56.0430N","1 26.1613W","", +"SNA19483","Avon Rd os 35 SW","","50 55.4695N","1 21.9707W","", +"SNA19495","Highfield Ave nr Highfield Rd SW","","50 55.9511N","1 24.1704W","", +"SNA19559","Civic Centre Rd os stop AN Civic Ctr E","","50 54.4219N","1 24.3692W","", +"SNA19692","Aldermoor Ave os Holly Oak Ct SW","","50 56.2723N","1 26.3823W","", +"SNA19708","Spring Rd os 98 betting shop SE","","50 54.5649N","1 21.6297W","", +"SNA19709","Central Station northern forecourt","","50 54.4701N","1 24.8243W","", +"SNA19711","Spring Rd opp Freemantle Common SE","","50 54.7279N","1 21.8323W","", +"SNA19712","Spring Rd os Freemantle Common NW","","50 54.7052N","1 21.8232W","", +"SNA19721","Albert Rd North nr Anglesea Terrace S","","50 54.0686N","1 23.4573W","", +"SNA19722","Albert Rd North nr Anglesea Terrace N","","50 54.0719N","1 23.4675W","", +"SNA19739","Albert Rd North nr Itchen Br N","","50 53.9733N","1 23.4867W","", +"SNA19771","Wakefield Rd 81 NE - HR","","50 55.6585N","1 21.5071W","", +"SNA19772","Wakefield Rd opp Wakefield Ct NE - HR","","50 55.5150N","1 21.6055W","", +"SNA19773","Glenfield Ave os 13 SW","","50 55.0087N","1 21.9633W","", +"SNA19774","Upper Deacon Rd opp Caerleon Dr SW","","50 54.7235N","1 20.8397W","", +"SNA19777","Univ Interchange SE","","50 56.1720N","1 23.8135W","", +"SNA19780","Wessex Ln opp Montefiore Halls SW","","50 56.2417N","1 22.5980W","", +"SNA40401","New Road South os East Park E","","50 54.4189N","1 24.2105W","", +"SNA40402","London Rd os HSBC SW","","50 54.6599N","1 24.2757W","", +"SNA40406","Tesco Millbrook inside grounds","","50 55.4017N","1 26.7854W","", +"SNA40501","Rownhams Rd North nr Buchanan Rd NE","","50 56.7679N","1 27.0211W","", +"SNA40502","Rownhams Rd N Sutherland Rd NW","","50 56.5945N","1 27.0872W","", +"SNA40503","Rownhams Rd N Sutherland Rd SE","","50 56.5945N","1 27.0787W","", +"SNA90772","Bedford Pl opp 14 NW","","50 54.7068N","1 24.3639W","", +"SNA90773","Bedford Pl os 24 SE","","50 54.7392N","1 24.3797W","", +"SNA90798","West End Rd os Sainsburys 1 SW","","50 54.9078N","1 21.6676W","", +"SNA90808","Mansbridge Rd nr Itchenside Cl N","","50 56.3214N","1 21.9599W","", +"SNA90830","Chapel Rd nr level crossing SE","","50 54.1397N","1 23.6313W","", +"SNA90831","Chapel Rd opp ch NW","","50 54.1289N","1 23.7330W","", +"SNA90867","William St os works SW","","50 54.5988N","1 23.0041W","", +"SNA90868","Belvidere Rd nr Victoria St NE","","50 54.4374N","1 23.3074W","", +"SNA90869","Belvidere Rd nr Victoria St SW","","50 54.4309N","1 23.3041W","", +"SNA90870","Bedford Pl os 21 SE","","50 54.7224N","1 24.3697W","", +"SNA90871","Millbank St os Forth House NE","","50 54.6097N","1 23.1234W","", +"WIA04208","Salisbury bus station stand E","","51 4.2177N","1 47.6180W","", +"WIA12274","Southampton Rd nr Clarendon Rd NW","","51 2.6910N","1 44.2329W","", +"WIA12275","Southampton Rd nr Clarendon Rd SE","","51 2.6812N","1 44.1833W","", +"WIA12283","Southampton Rd os Whaddon PO SE","","51 2.1298N","1 43.2546W","", +"WIA12284","Southampton Rd opp PO Whaddon NW","","51 2.1347N","1 43.2717W","", +"WIA12295","Common Rd nr The Street W","","51 0.6764N","1 39.0750W","", +"WIA12339","Lyndhurst Rd nr New Rd NW","","50 57.6659N","1 37.9067W","", +"WIA12340","Lyndhurst Rd nr New Rd SE","","50 57.6664N","1 37.8990W","", +"WIA12348","Lyndhurst Rd nr A36 SE","","50 58.7611N","1 38.2407W","", +"WIY42915","A31 Romsey Rd nr Barrow Hill Rd NE","","50 56.1611N","1 33.4041W","", +"WIY42916","A31 Romsey Rd - Barrow Hill Rd SW","","50 56.1584N","1 33.3999W","", +"WIY42982","Lyndhurst Rd nr Beech Grange SE","","50 58.0522N","1 38.0890W","", +"WIY42983","Lyndhurst Rd nr Beech Grange NW","","50 58.0506N","1 38.0959W","", +"haa13647","Castle Way nr Bargate St NW","","50 54.1493N","1 24.3377W","", diff --git a/assets/routes.csv b/assets/routes.csv new file mode 100644 index 0000000..5f25362 --- /dev/null +++ b/assets/routes.csv @@ -0,0 +1,6 @@ +"id","code","label","forward direction","reverse direction" +326,U1,"NOC - Parkway - Eastleigh",C,A +468,U1N,"Leisure World - City Centre -" +329,U2,"Civic Centre - Highfield Campus",C,B +327,U6,"Dock Gate 4 - General Hospital",H,C +354,U9,"Townhill Park - General Hospital" diff --git a/assets/routestops.csv b/assets/routestops.csv new file mode 100644 index 0000000..9edd2f4 --- /dev/null +++ b/assets/routestops.csv @@ -0,0 +1,328 @@ +"route-id","seq","stop-id" +326,1,HAA13579 +326,2,SN120635 +326,3,SNA13767 +326,4,SNA13768 +326,5,HA120625 +326,6,SNA09343 +326,7,SN120553 +326,8,SN120520 +326,9,SN120527 +326,10,SN12524D +326,11,SN120522 +326,12,SN120535 +326,13,SN120405 +326,14,SN120401 +326,15,SN120398 +326,16,SN120788 +326,17,SN120282 +326,18,SN120281 +326,19,SN120276 +326,20,SN12272A +326,21,SN120268 +326,22,SN120267 +326,23,SN120257 +326,24,SNA19777 +326,25,SN120131 +326,26,SN120139 +326,27,SN120137 +326,28,SN120144 +326,29,HAA13379 +326,30,HAA13380 +326,31,SN120160 +326,32,HAA13650 +326,33,SN120162 +326,34,HAA13386 +326,35,SN120998 +326,36,HA030183 +326,37,HA030200 +326,38,HAA09425 +326,39,HA030198 +326,40,HA030203 +326,41,HA030204 +326,42,HA030206 +326,43,HA030212 +326,44,HA030212 +326,45,HA030207 +326,46,HA030205 +326,47,HA030202 +326,48,HA030199 +326,49,HAA09426 +326,50,HA030201 +326,51,HA030183 +326,52,HA030184 +326,53,HAA09424 +326,54,SN120999 +326,55,SN120164 +326,56,SN120163 +326,57,HAA13651 +326,58,SNA19780 +326,59,HAA13381 +326,60,SN120147 +326,61,SN120145 +326,62,SN120140 +326,63,SN120136 +326,64,SN120134 +326,65,HAA13668 +326,66,SN120256 +326,67,SN120266 +326,68,SN120269 +326,69,SN12275A +326,70,SN120278 +326,71,SN120280 +326,72,SN120283 +326,73,SN120399 +326,74,SN120400 +326,75,SN120404 +326,76,SN120406 +326,77,SN120536 +326,78,SNA40402 +326,79,SN120525 +326,80,HAA13584 +326,81,SN120520 +326,82,SN121031 +326,83,HAA13583 +326,84,HA120626 +326,85,SNA13769 +326,86,SNA13766 +326,87,SNA09285 +326,88,MG1031 +468,1,HAA13649 +468,2,SNA13768 +468,3,HA120625 +468,4,haa13647 +468,5,SN120527 +468,6,SN12524D +468,7,SN120522 +468,8,SN120539 +468,9,SN120537 +468,10,SN120409 +468,11,SN120413 +468,12,SN120279 +468,13,SN12272A +468,14,SN120268 +468,15,SN120267 +468,16,SN120257 +468,17,SNA19777 +468,18,SN120131 +468,19,SN120139 +468,20,SN120137 +468,21,SN120144 +468,22,HAA13379 +468,23,HAA13380 +468,24,SN120160 +468,25,HAA13650 +468,26,SN120162 +468,27,HAA13386 +468,28,SN120998 +468,29,HA030183 +329,1,SN120527 +329,2,SN12524D +329,3,SN120522 +329,4,SN120535 +329,5,SN120405 +329,6,SN120401 +329,7,SN120398 +329,8,SN121052 +329,9,SNA13670 +329,10,SNA09299 +329,11,SNA19495 +329,12,SN120121 +329,13,SN120127 +329,14,SN120134 +329,15,SNA19777 +329,16,SN120900 +329,17,SN120125 +329,18,SN120130 +329,19,SN120141 +329,20,SN120142 +329,21,SN120031 +329,22,SNA09298 +329,23,SNA09298 +329,24,SNA09388 +329,25,SN121009 +329,26,SN121005 +329,27,SNA09313 +329,28,SNA09300 +329,29,SN120124 +329,30,SN120126 +329,31,SN120134 +329,32,HAA13668 +329,33,SN120128 +329,34,SN120120 +329,35,SN121054 +329,36,SN121055 +329,37,SN120400 +329,38,SN120404 +329,39,SN120406 +329,40,SN120536 +329,41,SNA40402 +329,42,SN120526 +329,43,SN120527 +327,1,HAA13579 +327,2,SN120635 +327,3,SNA13767 +327,4,SNA13768 +327,5,HA120625 +327,6,SNA09343 +327,7,SN120553 +327,8,SN120527 +327,9,SNA40401 +327,10,SN120913 +327,11,SN120539 +327,12,SN120537 +327,13,SN120409 +327,14,SN120413 +327,15,SN120279 +327,16,SN12272A +327,17,SN120284 +327,18,SN120289 +327,19,SN120159 +327,20,SN120157 +327,21,SN120153 +327,22,SN120150 +327,23,SN120163 +327,24,HAA13651 +327,25,SNA19780 +327,26,HAA13381 +327,27,SN120147 +327,28,SN120145 +327,29,SN120140 +327,30,SN120136 +327,31,SN120134 +327,32,SNA19777 +327,33,SN120128 +327,34,SN120120 +327,35,SN120118 +327,36,SN120117 +327,37,SN120114 +327,38,SN120113 +327,39,SN120098 +327,40,SN120233 +327,41,SN120231 +327,42,SN120225 +327,43,SN120221 +327,44,SNA19482 +327,45,SNA19482 +327,46,SN120979 +327,47,SN120084 +327,48,SN120222 +327,49,SN120223 +327,50,SN120224 +327,51,SN120228 +327,52,SN120232 +327,53,SN120097 +327,54,SN120112 +327,55,SN120111 +327,56,SN120115 +327,57,SN120119 +327,58,SN120121 +327,59,SN120127 +327,60,SN120134 +327,61,HAA13668 +327,62,SN120131 +327,63,SN120139 +327,64,SN120137 +327,65,SN120144 +327,66,SN120146 +327,67,SN12151A +327,68,SN120163 +327,69,HAA13651 +327,70,SN120161 +327,71,HA120154 +327,72,SN120158 +327,73,SN120287 +327,74,SN120300 +327,75,SN120285 +327,76,SN12275A +327,77,SN120415 +327,78,SN120412 +327,79,SN120411 +327,80,SN120410 +327,81,SN120538 +327,82,SN120540 +327,83,SN120914 +327,84,SN120533 +327,85,HAA13584 +327,86,SN121031 +327,87,HAA13583 +327,88,HA120626 +327,89,SNA13769 +327,90,SNA13766 +327,91,HA120633 +327,92,SNA09285 +327,93,MG1031 +354,1,SN120171 +354,2,SN120319 +354,3,HA120322 +354,4,HA120323 +354,5,SN120443 +354,6,SN120438 +354,7,SN120316 +354,8,SN120314 +354,9,SN120297 +354,10,SN120290 +354,11,SN120293 +354,12,SN120295 +354,13,SN120313 +354,14,SN120296 +354,15,SN120294 +354,16,SN120310 +354,17,HA120307 +354,18,HA120305 +354,19,HA120303 +354,20,SN120274 +354,21,SN120268 +354,22,SN120267 +354,23,SN120257 +354,24,SNA19777 +354,25,SN120128 +354,26,SN120120 +354,27,SNA09451 +354,28,SN120099 +354,29,SN120243 +354,30,SN120245 +354,31,SN120247 +354,32,SN120388 +354,33,SNA09452 +354,34,SNA09436 +354,35,SNA09454 +354,36,SN120236 +354,37,SN120230 +354,38,SN120225 +354,39,SN120221 +354,40,SN120082 +354,41,SN120084 +354,42,SN120222 +354,43,SN120223 +354,44,SN120224 +354,45,SN120228 +354,46,SN120235 +354,47,SN120237 +354,48,SNA09437 +354,49,SNA09453 +354,50,SNA09195 +354,51,SN120248 +354,52,SN120246 +354,53,SN120242 +354,54,SN120100 +354,55,SNA09450 +354,56,SN120121 +354,57,SN120127 +354,58,SN120134 +354,59,SNA19777 +354,60,SN120256 +354,61,SN120266 +354,62,SN120269 +354,63,SN120273 +354,64,SN120302 +354,65,HA120304 +354,66,HA120306 +354,67,SN120308 +354,68,SN120311 +354,69,SN120312 +354,70,SN120292 +354,71,SN120291 +354,72,SN120775 +354,73,SN120774 +354,74,SN120171 diff --git a/assets/sites.csv b/assets/sites.csv new file mode 100644 index 0000000..878b401 --- /dev/null +++ b/assets/sites.csv @@ -0,0 +1,22 @@ +Id,Name,Long,Lat,Polygon,source +1,Highfield Campus,,,"-1.3990823 50.9377130,-1.4006918 50.9342877,-1.3979531 50.9330237,-1.3961531 50.9328590,-1.3956357 50.9329379,-1.3954335 50.9331140,-1.3950459 50.9331990,-1.3951385 50.9333849,-1.3946835 50.9334752,-1.3944391 50.9334114,-1.3944644 50.9331512,-1.3939419 50.9330131,-1.3938408 50.9334699,-1.3928043 50.9349887,-1.3925852 50.9349356,-1.3924841 50.9351109,-1.3927200 50.9351640,-1.3923620 50.9357142,-1.3944239 50.9363169,-1.3945234 50.9365712,-1.3951385 50.9371501,-1.3938914 50.9370279,-1.3939167 50.9369164,-1.3936133 50.9368793,-1.3934026 50.9378988,-1.3935543 50.9379095,-1.3936049 50.9381643,-1.3990823 50.9377130",http://os.openstreetmap.org/ +2,Boldrewood Campus,-1.4046552,50.9372223,"-1.4034619 50.9368059,-1.4062591 50.9360660,-1.4064260 50.9376872,-1.4054058 50.9377964,-1.4046488 50.9379783,-1.4041933 50.9379096,-1.4038789 50.9380430,-1.4039815 50.9381360,-1.4037634 50.9382573,-1.4035709 50.9381360,-1.4031090 50.9381320,-1.4030577 50.9374204,-1.4033207 50.9373557,-1.4035389 50.9370363,-1.4034619 50.9368059",http://os.openstreetmap.org/ +3,Avenue Campus,-1.402511,50.928699,"-1.4033313 50.9296693,-1.4011463 50.9289554,-1.4021913 50.9277164,-1.4041790 50.9282737,-1.4033313 50.9296693",http://os.openstreetmap.org/ +4,Winchester School of Art,-1.30954,51.065765,"-1.3104990 51.0653919,-1.3091437 51.0651497,-1.3090241 51.0653251,-1.3086520 51.0651497,-1.3080940 51.0654169,-1.3093961 51.0663689,-1.3104193 51.0665693,-1.3111235 51.0658595,-1.3103661 51.0657009,-1.3104990 51.0653919",http://os.openstreetmap.org/ +5,The University of Southampton Science Park,-1.424618,50.962158,"-1.4200515 50.9655440,-1.4196262 50.9651958,-1.4211360 50.9642985,-1.4215825 50.9638565,-1.4214762 50.9629458,-1.4219441 50.9621556,-1.4223056 50.9607761,-1.4223268 50.9596912,-1.4257080 50.9601733,-1.4286638 50.9603609,-1.4336611 50.9602537,-1.4339588 50.9608296,-1.4332145 50.9610573,-1.4335547 50.9618208,-1.4317047 50.9619547,-1.4303863 50.9628655,-1.4290466 50.9619011,-1.4270477 50.9623699,-1.4290591 50.9643976,-1.4275013 50.9649480,-1.4248037 50.9641822,-1.4237090 50.9641512,-1.4225182 50.9647539,-1.4219015 50.9654101,-1.4211785 50.9656913,-1.4200515 50.9655440",http://os.openstreetmap.org/ +6,National Oceanography Centre Campus,-1.3946555,50.8927263,"-1.3963013 50.8937513,-1.3942781 50.8935386,-1.3933204 50.8934195,-1.3924032 50.8927474,-1.3922278 50.8921944,-1.3935902 50.8912840,-1.3963553 50.8925687,-1.3961530 50.8927134,-1.3967330 50.8930197,-1.3963013 50.8937513",http://os.openstreetmap.org/ +8,Boat House,,,"-1.3800720 50.9347696,-1.3797898 50.9344413,-1.3800286 50.9343866,-1.3802818 50.9341313,-1.3801805 50.9339352,-1.3799562 50.9337528,-1.3802022 50.9334929,-1.3810849 50.9337164,-1.3805061 50.9346875,-1.3800720 50.9347696",http://os.openstreetmap.org/ +18,Southampton General Hospital,,,"-1.4392547 50.9337565,-1.4392547 50.9332940,-1.4381754 50.9326954,-1.4384560 50.9325321,-1.4345488 50.9302464,-1.4317425 50.9323824,-1.4315698 50.9337429,-1.4339012 50.9348312,-1.4341602 50.9355931,-1.4348510 50.9361236,-1.4365564 50.9353482,-1.4357361 50.9342871,-1.4392547 50.9337565",http://os.openstreetmap.org/ +20,Royal South Hants Hospital,,,"-1.3980658 50.9135097,-1.3952237 50.9132480,-1.3955633 50.9117098,-1.3990719 50.9116384,-1.3990467 50.9126851,-1.3983677 50.9127168,-1.3980658 50.9135097",http://os.openstreetmap.org/ +39,Recreation Facilities at Wide Lane,,,"-1.3664622 50.9482380,-1.3647258 50.9494535,-1.3650860 50.9505474,-1.3647001 50.9509444,-1.3632810 50.9513658,-1.3626464 50.9517979,-1.3602112 50.9547041,-1.3641899 50.9548553,-1.3689403 50.9544880,-1.3680314 50.9529215,-1.3682886 50.9492590,-1.3664622 50.9482380",http://os.openstreetmap.org/ +45,Belgrave Industrial Site,-1.3840253,50.9309864,"-1.3841191 50.9303904,-1.3845444 50.9304838,-1.3839286 50.9315982,-1.3835033 50.9315048,-1.3841191 50.9303904" +56,Highfield Hall,-1.402286,50.930084,"-1.4030286 50.9305226,-1.4014071 50.9299818,-1.4017779 50.9296106,-1.4032176 50.9301239,-1.4030286 50.9305226",http://os.openstreetmap.org/ +57,Glen Eyre Hall,-1.401615,50.943504,"-1.4016517 50.9418655,-1.4013481 50.9423883,-1.4011390 50.9423458,-1.3990076 50.9432298,-1.3990615 50.9439693,-1.3995269 50.9439608,-1.3999721 50.9440756,-1.4009299 50.9442286,-1.4017056 50.9443178,-1.4023532 50.9443476,-1.4026162 50.9443433,-1.4030614 50.9442243,-1.4035470 50.9439311,-1.4034863 50.9430811,-1.4033919 50.9428303,-1.4031626 50.9425668,-1.4027106 50.9422481,-1.4016517 50.9418655",http://os.openstreetmap.org/ +58,South Hill Hall,-1.402248,50.94146,"-1.4030801 50.9407406,-1.4032299 50.9407878,-1.4027057 50.9419262,-1.4018819 50.9416725,-1.4014232 50.9415428,-1.4012828 50.9413835,-1.4030801 50.9407406",http://os.openstreetmap.org/ +59,Chamberlain Hall,-1.403273,50.941608,"-1.4027057 50.9419262,-1.4032299 50.9422742,-1.4036418 50.9421090,-1.4039226 50.9413540,-1.4032299 50.9407878,-1.4027057 50.9419262",http://os.openstreetmap.org/ +60,Hartley Grove,-1.401696,50.940693,"-1.4012828 50.9413835,-1.4030801 50.9407406,-1.4021815 50.9398971,-1.4008429 50.9404220,-1.4012828 50.9413835",http://os.openstreetmap.org/ +62,Bencraft Hall,-1.390811,50.945885,"-1.3917348 50.9458870,-1.3908607 50.9464318,-1.3900583 50.9459207,-1.3909324 50.9453760,-1.3917348 50.9458870",http://os.openstreetmap.org/ +63,Connaught Hall,-1.374632,50.937965,"-1.3756787 50.9387817,-1.3757050 50.9376211,-1.3754814 50.9374885,-1.3750604 50.9370408,-1.3738765 50.9373973,-1.3743632 50.9387983,-1.3756787 50.9387817",http://os.openstreetmap.org/ +64,Montefiore Hall,-1.377164,50.938297,"-1.3789171 50.9373740,-1.3786071 50.9367713,-1.3783302 50.9367713,-1.3781653 50.9369750,-1.3778355 50.9371869,-1.3772750 50.9373490,-1.3760088 50.9376358,-1.3759626 50.9395765,-1.3768859 50.9396638,-1.3766683 50.9402373,-1.3770376 50.9403287,-1.3779213 50.9390778,-1.3789171 50.9373740",http://os.openstreetmap.org/ +65,Stoneham Hall,-1.3765588,50.9369483,"-1.3780071 50.9367009,-1.3776782 50.9369745,-1.3771652 50.9371569,-1.3759155 50.9374636,-1.3755866 50.9372564,-1.3754551 50.9369414,-1.3775730 50.9363445,-1.3780071 50.9367009",http://os.openstreetmap.org/ +70,Erasmus Park,-1.3000948,51.0687982,"-1.3005228 51.0677314,-1.3005750 51.0683404,-1.3004482 51.0688089,-1.2999040 51.0697038,-1.2994641 51.0696101,-1.2999561 51.0686450,-1.3000605 51.0683311,-1.3000531 51.0680125,-1.3005228 51.0677314" \ No newline at end of file diff --git a/project.properties b/project.properties index 5a70945..f049142 100644 --- a/project.properties +++ b/project.properties @@ -8,4 +8,4 @@ # project structure. # Project target. -target=android-7 +target=android-10 diff --git a/res/values/strings.xml b/res/values/strings.xml index 948c10e..842e597 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -92,7 +92,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< About Version - 0.2.1 (alpha) + 0.2.2 (alpha) Copyright © 2012, Christopher Baines License -- cgit v1.2.3 From 08f3ae85b14a11c3010a94b584fcb6eef9350943 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 2 Feb 2012 10:40:47 +0000 Subject: More changes, not sure what. --- AndroidManifest.xml | 1 - project.properties | 2 +- src/net/cbaines/suma/DataHandler.java | 2 +- src/net/cbaines/suma/SouthamptonUniversityMapActivity.java | 6 ++++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bc4a89b..653da30 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -5,7 +5,6 @@ android:versionName="0.2.2 (alpha)" > - diff --git a/project.properties b/project.properties index f049142..5a70945 100644 --- a/project.properties +++ b/project.properties @@ -8,4 +8,4 @@ # project structure. # Project target. -target=android-10 +target=android-7 diff --git a/src/net/cbaines/suma/DataHandler.java b/src/net/cbaines/suma/DataHandler.java index f6263da..f564d19 100644 --- a/src/net/cbaines/suma/DataHandler.java +++ b/src/net/cbaines/suma/DataHandler.java @@ -81,7 +81,7 @@ public class DataHandler extends DefaultHandler { @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { if (localName.equals("trkpt")) { - Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " + atts.getValue("lon")); + // Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " + atts.getValue("lon")); _data.addPoint(Util.csLatLongToGeoPoint(atts.getValue("lat"), atts.getValue("lon"))); } } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index 927f41e..52b3e1f 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -138,8 +138,10 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity) getLastNonConfigurationInstance(); // SensorManager mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); This code in the following constructor causes problems in - // some emulators, disable there sensors to fix. + // some emulators, disable sensors to fix. + Log.i(TAG, "Starting creating myLocationOverlay"); myLocationOverlay = new MyLocationOverlay(instance, mapView); + Log.i(TAG, "Finished creating myLocationOverlay"); while (databaseThread.isAlive()) { Thread.yield(); @@ -241,7 +243,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Thu, 2 Feb 2012 13:25:54 +0000 Subject: Slightly better working view dialog. --- res/layout/view_child_row.xml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/res/layout/view_child_row.xml b/res/layout/view_child_row.xml index 687cbee..bd4b3d5 100644 --- a/res/layout/view_child_row.xml +++ b/res/layout/view_child_row.xml @@ -1,24 +1,23 @@ + android:paddingLeft="50dp" > + android:textSize="18dp" /> -- cgit v1.2.3 From 43dfbdb57dd39f24a824c9c33c8886481ba25cb9 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 2 Feb 2012 13:47:55 +0000 Subject: Beginings of management of non Uni-Link data. --- gen/net/cbaines/suma/R.java | 85 +++++++++++++++------------ res/values/strings.xml | 21 +++++-- res/xml/preferences.xml | 22 +++++-- src/net/cbaines/suma/PreferencesActivity.java | 6 -- 4 files changed, 80 insertions(+), 54 deletions(-) diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index 8b15d5f..2945b23 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -129,44 +129,46 @@ public final class R { public static final int U9=0x7f07000d; /** About Strings */ - public static final int about=0x7f07002c; - public static final int about_android_market=0x7f070039; - public static final int about_android_market_summary=0x7f07003a; - public static final int about_copyright=0x7f07002f; - public static final int about_copyright_summary=0x7f070030; - public static final int about_data=0x7f070037; - public static final int about_data_summary=0x7f070038; - public static final int about_database=0x7f070043; - public static final int about_database_summary=0x7f070044; - public static final int about_developer=0x7f070035; - public static final int about_developer_summary=0x7f070036; - public static final int about_donate=0x7f070045; - public static final int about_donate_summary=0x7f070046; + public static final int about=0x7f070033; + public static final int about_android_market=0x7f070040; + public static final int about_android_market_summary=0x7f070041; + public static final int about_copyright=0x7f070036; + public static final int about_copyright_summary=0x7f070037; + public static final int about_data=0x7f07003e; + public static final int about_data_summary=0x7f07003f; + public static final int about_database=0x7f07004a; + public static final int about_database_summary=0x7f07004b; + public static final int about_developer=0x7f07003c; + public static final int about_developer_summary=0x7f07003d; + public static final int about_donate=0x7f07004c; + public static final int about_donate_summary=0x7f07004d; public static final int about_help_message=0x7f070015; - public static final int about_license=0x7f070031; - public static final int about_license_summary=0x7f070032; - public static final int about_map_data=0x7f07003b; - public static final int about_map_data_summary=0x7f07003c; - public static final int about_map_icons=0x7f07003d; - public static final int about_map_icons_summary=0x7f07003e; - public static final int about_map_tiles=0x7f070041; - public static final int about_map_tiles_summary=0x7f070042; - public static final int about_menu_instruction_text=0x7f070025; - public static final int about_osm_map=0x7f07003f; - public static final int about_osm_map_summary=0x7f070040; - public static final int about_project=0x7f070033; - public static final int about_project_summary=0x7f070034; - public static final int about_version=0x7f07002d; - public static final int about_version_summary=0x7f07002e; + public static final int about_license=0x7f070038; + public static final int about_license_summary=0x7f070039; + public static final int about_map_data=0x7f070042; + public static final int about_map_data_summary=0x7f070043; + public static final int about_map_icons=0x7f070044; + public static final int about_map_icons_summary=0x7f070045; + public static final int about_map_tiles=0x7f070048; + public static final int about_map_tiles_summary=0x7f070049; + /** About Messages + */ + public static final int about_menu_instruction_text=0x7f07002c; + public static final int about_osm_map=0x7f070046; + public static final int about_osm_map_summary=0x7f070047; + public static final int about_project=0x7f07003a; + public static final int about_project_summary=0x7f07003b; + public static final int about_version=0x7f070034; + public static final int about_version_summary=0x7f070035; public static final int app_name=0x7f070004; public static final int bitcoin_error_message=0x7f07001a; public static final int building_non_residential=0x7f070007; public static final int building_residential=0x7f070006; - public static final int bustimes_favourite_checkbox_label=0x7f070026; + public static final int bustimes_favourite_checkbox_label=0x7f07002d; public static final int credits_help_message=0x7f070018; public static final int donate_button=0x7f070019; - public static final int donate_dialog_error_title=0x7f070028; - public static final int donate_dialog_message=0x7f070027; + public static final int donate_dialog_error_title=0x7f07002f; + public static final int donate_dialog_message=0x7f07002e; public static final int favourites_dialog_message=0x7f07001c; public static final int favourites_help_message=0x7f070016; public static final int find_help_message=0x7f070011; @@ -180,14 +182,15 @@ public final class R { public static final int menu_favourites=0x7f07000f; public static final int menu_find=0x7f070000; public static final int menu_find_my_location=0x7f070003; - public static final int menu_next_stop=0x7f07002a; + public static final int menu_next_stop=0x7f070031; public static final int menu_preferences=0x7f070001; - public static final int menu_previous_stop=0x7f070029; - public static final int menu_refresh_stop=0x7f07002b; + public static final int menu_previous_stop=0x7f070030; + public static final int menu_refresh_stop=0x7f070032; public static final int menu_view=0x7f070002; public static final int pref_bus_stop=0x7f070008; public static final int preferences=0x7f07001b; - public static final int preferences_catagory_bus_times=0x7f070021; + public static final int preferences_catagory_data=0x7f070028; + public static final int preferences_catagory_live_bus_times=0x7f070021; /** Preferences Messages */ public static final int preferences_catagory_positioning=0x7f07001d; @@ -195,9 +198,15 @@ public final class R { public static final int preferences_gps_disabled=0x7f070020; public static final int preferences_gps_enabled=0x7f07001f; public static final int preferences_help_message=0x7f070012; - public static final int preferences_live_bus_times=0x7f070022; - public static final int preferences_live_bus_times_disabled=0x7f070024; - public static final int preferences_live_bus_times_enabled=0x7f070023; + public static final int preferences_non_uni_link=0x7f070029; + public static final int preferences_non_uni_link_disabled=0x7f07002b; + public static final int preferences_non_uni_link_enabled=0x7f07002a; + public static final int preferences_non_uni_link_live_bus_times=0x7f070025; + public static final int preferences_non_uni_link_live_bus_times_disabled=0x7f070027; + public static final int preferences_non_uni_link_live_bus_times_enabled=0x7f070026; + public static final int preferences_uni_link_live_bus_times=0x7f070022; + public static final int preferences_uni_link_live_bus_times_disabled=0x7f070024; + public static final int preferences_uni_link_live_bus_times_enabled=0x7f070023; public static final int view_help_message=0x7f070014; } public static final class xml { diff --git a/res/values/strings.xml b/res/values/strings.xml index 842e597..69d6861 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -77,10 +77,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< GPS GPS Enabled GPS Disabled - Bus Times - Live Bus Times - Live Bus Times Enabled - Live Bus Times Disabled + Live Bus Times + Uni-Link + Uni-Link Enabled + Uni-Link Disabled + Non Uni-Link + Non Uni-Link Enabled + Non Uni-Link Disabled + Data + Non Uni-Link Bus Stops + Non Uni-Link Bus Stops Enabled + Non Uni-Link Bus Stops Disabled + + Expand the items below to learn more about each feature of the application. Favourite Loading bitcoin client @@ -88,8 +97,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Previous Next Refresh - - + + About Version 0.2.2 (alpha) diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 8aec00c..e0609f6 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -12,12 +12,26 @@ + android:title="@string/preferences_catagory_live_bus_times" > + android:summaryOff="@string/preferences_uni_link_live_bus_times_disabled" + android:summaryOn="@string/preferences_uni_link_live_bus_times_enabled" + android:title="@string/preferences_uni_link_live_bus_times" /> + + + + \ No newline at end of file diff --git a/src/net/cbaines/suma/PreferencesActivity.java b/src/net/cbaines/suma/PreferencesActivity.java index b7c1d89..d5df6a1 100644 --- a/src/net/cbaines/suma/PreferencesActivity.java +++ b/src/net/cbaines/suma/PreferencesActivity.java @@ -23,12 +23,6 @@ import android.os.Bundle; import android.preference.PreferenceActivity; public class PreferencesActivity extends PreferenceActivity { - boolean CheckboxPreference; - String ListPreference; - String editTextPreference; - String ringtonePreference; - String secondEditTextPreference; - String customPref; @Override protected void onCreate(Bundle savedInstanceState) { -- cgit v1.2.3 From 6fe849cc34a06a3f5d7662ea6a4566a870b3edfa Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 2 Feb 2012 18:39:00 +0000 Subject: Improvements to the Preference management, begin allowing more bus data, need to rethink the data storage and retreval, perhaps using more semantic web stuff... --- assets/data.db | Bin 141312 -> 140288 bytes res/raw/org.rdf | 6168 ++++++++++++++++++++ res/xml/preferences.xml | 4 +- src/net/cbaines/suma/BuildingActivity.java | 88 + src/net/cbaines/suma/BusStop.java | 6 +- src/net/cbaines/suma/BusStopActivity.java | 10 +- src/net/cbaines/suma/BusStopOverlay.java | 9 +- src/net/cbaines/suma/DataManager.java | 72 +- src/net/cbaines/suma/Preferences.java | 12 + src/net/cbaines/suma/PreferencesActivity.java | 23 +- .../suma/SouthamptonUniversityMapActivity.java | 42 +- 11 files changed, 6378 insertions(+), 56 deletions(-) create mode 100644 res/raw/org.rdf create mode 100644 src/net/cbaines/suma/BuildingActivity.java create mode 100644 src/net/cbaines/suma/Preferences.java diff --git a/assets/data.db b/assets/data.db index 05569fa..f941f32 100644 Binary files a/assets/data.db and b/assets/data.db differ diff --git a/res/raw/org.rdf b/res/raw/org.rdf new file mode 100644 index 0000000..db580f9 --- /dev/null +++ b/res/raw/org.rdf @@ -0,0 +1,6168 @@ + + + + + + + + + + + + + + + + 2011-11-30T09:43:54Z + + + 2011-11-30T09:43:55Z + + + + + + + + + + + + + + + 2011-11-30T09:43:55Z + + + 2011-11-30T09:43:56Z + + + + + + + + + + + + + + + + + + 2011-11-30 + + + This list of organisations and organisational units is taken from the table used by the "MUD" directory, so may not be authoritative. The University organisation is currently changing so these identifiers should be treated with caution. + + + + + + + + + + + + Organisation + + + + + + + + + Generated by OpenOrg Grinder using the org.xsl transform by Christopher Gutteridge. See http://wiki.openorg.ecs.soton.ac.uk/wiki/OpenOrg_Grinder. Generated at 2011-11-30T09:43:56+00:00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2011-11-30T09:43:56Z + + + 2011-11-30T09:43:56Z + + + + + + + + + + + + University of Southampton + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Human Development & Health + + + AF + + + + + + + + + + + + + + + + + + + + + + + + Aeronautics, Astronautics & Comp. Eng + + + AK + + + + + + + + + + + + + + + + + + Civil Maritime & Env. Eng & Sci Unit + + + AT + + + + + + + + + + + + + + + + + + + + + Legal Services & Research Governance + + + BB + + + + + + + + + + + + + + + Health & Safety + + + BH + + + 13 + + + + + + Centre for Biological Sciences + + + BJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Centre for Innovation & Leadership + + + BN + + + + + + + + + + + + + + + Engineering Science Unit + + + BX + + + + + + + + + + + + + + + + + + + + + LATEU + + + BZ + + + + + + + + + + + + + + + Social Sciences + + + CC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Development & Alumni Relations + + + CD + + + + + + + + + + + + + + + + + + + + + + + + Southampton Education School + + + CJ + + + + + + + + + + + + + + + + + + + + + + + + + + + Cancer Sciences + + + CM + + + + + + + + + + + + + + + + + + Chaplaincy + + + CY + + + + + + + + + + + + Human Resources + + + DD + + + + + + + + + + + + + + + + + + + + + Faculty Hub + + + DF + + + + + + + + + + + + + + + Communications + + + DK + + + + + + + + + + + + + + + + + + + + + Chemistry + + + EB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Optoelectronics Research Centre + + + EH + + + + + + + + + + + + + + + + + + + + + Student Services + + + EW + + + + + + 10 + + + + + + + + + Faculty of Business and Law + + + F1 + + + + + + + + + + + + + + + + + + Graphics, Fine Art & Media + + + F1FH010000 + + + + + + Fashion & Textile Design + + + F1FH020000 + + + + + + Technical Services + + + F1FH030000 + + + + + + Research Centre + + + F1FH040000 + + + + + + International Studies + + + F1FH050000 + + + + + + Law + + + F1JJ010000 + + + + + + Management Science + + + F1TR010000 + + + + + + Knowledge & Information Systems + + + F1TR020000 + + + + + + Marketing + + + F1TR030000 + + + + + + Organisational Behaviour + + + F1TR040000 + + + + + + Strategy & Innovation + + + F1TR050000 + + + + + + Accounting + + + F1TR060000 + + + + + + Finance + + + F1TR070000 + + + + + + Academic Related + + + F1TR080000 + + + + + + + + + Faculty of Engineering and the Environment + + + F2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aerodynamics &Flight Mech Research Group + + + F2AK010000 + + + + + + Astronautics + + + F2AK020000 + + + + + + Computational Engineering & Design + + + F2AK030000 + + + + + + Energy & Climate Change Group + + + F2AT010000 + + + + + + Environment Research Group + + + F2AT020000 + + + + + + Fluid / Structure Interactions Research + + + F2AT030000 + + + + + + Infrastructure Research Group + + + F2AT040000 + + + + + + Tranportation Research Group + + + F2AT050000 + + + + + + Bioengineering Research Group + + + F2BX010000 + + + + + + Electro-Mechanical Research Group + + + F2BX020000 + + + + + + Energy Technology Research Group + + + F2BX030000 + + + + + + Engineering Materials & Surface Engineer + + + F2BX040000 + + + + + + nCATS Research Group + + + F2BX050000 + + + + + + General + + + F2DF010000 + + + + + + Signal Processing & Control Research Grp + + + F2KR010000 + + + + + + Dynamics Research Group + + + F2KR020000 + + + + + + Fluid Dynamics & Acoustics Research Grp + + + F2KR030000 + + + + + + Human Sciences Research Group + + + F2KR040000 + + + + + + Research Institute for Industry + + + F2LH010000 + + + + + + ISVR Consulting + + + F2LH020000 + + + + + + Wolfson Unit MTIA + + + F2LH030000 + + + + + + SOECIC + + + F2LH040000 + + + + + + + + + Faculty of Health Sciences + + + F3 + + + + + + + + + + + + + + + Leadership & Health Systems + + + F3BN010000 + + + + + + Advancing Clinical & Expert Practice + + + F3BN020000 + + + + + + Researcher Development + + + F3BN030000 + + + + + + Family, Child & Psycho-Social Health + + + F3KE020000 + + + + + + Physical & Rehabilitation Health + + + F3KE030000 + + + + + + Bio-Behavioural Sciences + + + F3KE040000 + + + 15 + + + + + + + + + Faculty of Humanities + + + F4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CLS + + + F4GC010000 + + + 13 + + + + + + + + + Faculty of Medicine + + + F5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Human Genetics + + + F5AF010000 + + + + + + Bone & Joint + + + F5AF020000 + + + + + + Epidermiology + + + F5AF030000 + + + + + + Human Nutrition & Metabolism + + + F5AF040000 + + + + + + Maternal, Fetal & Neonatal Physiology + + + F5AF050000 + + + + + + Tissue Infection & Repair + + + F5FC010000 + + + + + + Allergy & Inflammation Research + + + F5FC020000 + + + + + + Clinical Neurosciences + + + F5FC030000 + + + + + + Medical Education Development Unit + + + F5RA010000 + + + + + + Centre for Learning Anatomical Sciences + + + F5RA020000 + + + + + + NETSCC + + + F5VB020000 + + + 12 + + + + + + + + + Faculty of Natural and Environmental Sciences + + + F6 + + + + + + + + + + + + + + + + + + + + + Biological Sciences Technical + + + F6BJ010000 + + + + + + Biological Sciences Research + + + F6BJ020000 + + + + + + Academic + + + F6BJ030000 + + + + + + Molecular and Cellular + + + F6BJ110000 + + + + + + Environmental + + + F6BJ120000 + + + + + + Biomedicine + + + F6BJ130000 + + + + + + Biological Sciences Education/Training + + + F6BJ140000 + + + + + + Support Staff - Technical + + + F6BJ150000 + + + + + + Chemical Biology Group + + + F6EB010000 + + + + + + Electrochemistry & Surface Science Group + + + F6EB020000 + + + + + + Structure & Materials Group + + + F6EB030000 + + + + + + Synthetic Chemistry Group + + + F6EB040000 + + + + + + Support Staff + + + F6EB050000 + + + + + + Chemistry Technical + + + F6EB070000 + + + + + + Computational Systems Chemistry + + + F6EB080000 + + + + + + Electrochemistry + + + F6EB090000 + + + + + + Chemistry Education / Training + + + F6EB110000 + + + + + + Magnetic Resonance + + + F6EB120000 + + + + + + Molecular Assembly, Function & Structure + + + F6EB130000 + + + + + + Molecular Diagnostics & Thereputics + + + F6EB140000 + + + + + + Chemistry Research + + + F6EB150000 + + + + + + Ocean & Earth Science Technical + + + F6HN010000 + + + + + + Coastal & Shelf Research + + + F6HN020000 + + + + + + Geochemistry + + + F6HN030000 + + + + + + Geology & Geophysics + + + F6HN040000 + + + + + + Ocean Biochemistry & Ecosystems + + + F6HN060000 + + + + + + Paleooceanography & Palaeoclimate + + + F6HN070000 + + + + + + Physical Oceanography + + + F6HN080000 + + + + + + + + + Faculty of Physical and Applied Science + + + F7 + + + + + + + + + + + + + + + + + + ORC Research + + + F7EH010000 + + + + + + ORC - Enterprise + + + F7EH020000 + + + + + + Technical Support Staff + + + F7EH040000 + + + + + + ECML + + + F7FP010000 + + + + + + IT Innovation + + + F7FP020000 + + + + + + + + + MECH + + + F7FP030000 + + + + + + NANO + + + F7FP040000 + + + + + + + + + EEE + + + F7FP050000 + + + + + + + + + Comms, Signal Processing & Control + + + F7FP060000 + + + + + + + + + Electronic & Software Systems + + + F7FP070000 + + + + + + + + + Agents, Interactions & Complexity + + + F7FP080000 + + + + + + + + + Web & Internet Science + + + F7FP090000 + + + + + + + + + Theory Group + + + F7WF010000 + + + + + + Astronomy Group + + + F7WF020000 + + + + + + Quantum, Light & Matter Group + + + F7WF030000 + + + + + + Support Staff + + + F7WF040000 + + + + + + + + + Faculty of Social and Human Sciences + + + F8 + + + + + + + + + + + + + + + + + + + + + + + + + + + Social Statistics & Demography + + + F8CC010000 + + + + + + + + + + + + Centre for Population Change (CPC) + + + F8CC010600 + + + + + + ESRC National Centre - Research Methods + + + F8CC010700 + + + + + + Social Work Studies + + + F8CC020000 + + + + + + + + + SWAP + + + F8CC020300 + + + + + + Economics + + + F8CC030000 + + + + + + Politics & International Relations + + + F8CC040000 + + + + + + Sociology & Social Policy + + + F8CC050000 + + + + + + Gerontology + + + F8CC060000 + + + + + + Centre for Contemporary China + + + F8CC070000 + + + + + + Third Sector Research Centre + + + F8CC080000 + + + + + + Leadership School Improve &Effectiveness + + + F8CJ010000 + + + + + + Lifelong & Work-Related Learning + + + F8CJ020000 + + + + + + Mathematics & Science Education + + + F8CJ030000 + + + + + + Social Justice & Inclusive Education + + + F8CJ040000 + + + + + + Teaching Only Staff + + + F8CJ050000 + + + + + + Technical Staff + + + F8CJ060000 + + + + + + Clinical Neuroscience + + + F8JW010000 + + + + + + + + + + + + + + + Developmental Brain-Behaviour Lab + + + F8JW010100 + + + + + + Emotion & Motivation Lab + + + F8JW010200 + + + + + + Animal Behaviour + + + F8JW010300 + + + + + + Cognition + + + F8JW020000 + + + + + + + + + + + + + + + Centre for Visual Cognition + + + F8JW020100 + + + + + + Memory & Associated Learning Lab + + + F8JW020200 + + + + + + CBT + + + F8JW020300 + + + + + + Human Wellbeing + + + F8JW030000 + + + + + + + + + + + + + + + Centre for Apps. of Health Psychology + + + F8JW030100 + + + + + + Centre for Research on Self & Identity + + + F8JW030200 + + + + + + Centre for Sexual Health Research + + + F8JW030300 + + + + + + Technical Staff + + + F8JW040000 + + + + + + Professional Training + + + F8JW050000 + + + + + + Applied Mathematics + + + F8PJ010000 + + + + + + Operational Research + + + F8PJ020000 + + + + + + Pure Mathematics + + + F8PJ030000 + + + + + + Statistics + + + F8PJ040000 + + + + + + Earth Surface Dynamics + + + F8WR010000 + + + + + + Economy, Society & Space + + + F8WR020000 + + + + + + GeoData Institute + + + F8WR030000 + + + + + + Global Env Change & Earth Observation + + + F8WR040000 + + + + + + Palaeoenvironment Laboratory (PLUS) + + + F8WR050000 + + + + + + Population, Health & Wellbeing (PHeW) + + + F8WR060000 + + + + + + Technical Staff + + + F8WR070000 + + + + + + Research Groups + + + F8WT010000 + + + + + + + + + DUMMY + + + F8WT010100 + + + + + + + + + + + + + + + Academic & Research + + + F8WT010101 + + + + + + Maths + + + F8WT010103 + + + + + + Social Sciences + + + F8WT010104 + + + + + + Infection, Inflammation & Immunity + + + FC + + + + + + + + + + + + + + + + + + Winchester School of Art + + + FH + + + + + + + + + + + + + + + + + + + + + + + + Philosophy + + + FJ + + + + + + + + + + + + Electronics & Computer Science + + + FP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Royal Naval Unit + + + FX + + + + + + + + + Modern Languages + + + GC + + + + + + + + + + + + Strategy, Planning and Governance + + + GR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Student & Academic Administration + + + GX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ocean and Earth Science + + + HN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + iSolutions + + + JF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Southampton Law School + + + JJ + + + + + + + + + + + + Institute for Life Sciences + + + JL + + + + + + + + + Psychology + + + JW + + + + + + + + + + + + + + + + + + + + + + + + + + + Professional Practice in Health Sciences + + + KE + + + + + + + + + + + + + + + + + + + + + Inst. Sound & Vibration Research + + + KR + + + + + + + + + + + + + + + + + + + + + + + + + + + Library + + + KX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Primary Care & Population Sciences + + + LG + + + + + + Enterprise + + + LH + + + + + + + + + + + + + + + + + + + + + Humanities: Central Faculty + + + LN + + + + + + Film + + + LT + + + + + + Archaeology + + + MH + + + + + + + + + + + + Education Hub + + + MM + + + + + + + + + + + + Music + + + NC + + + + + + + + + + + + International Office + + + NP + + + + + + + + + Professional Services - COO + + + P1 + + + + + + + + + + + + + + + + + + + + + + + + + + + Legal Services + + + P1BB010000 + + + + + + + + + General Office + + + P1BB010100 + + + + + + Research Governance Office + + + P1BB020000 + + + + + + B37 Office + + + P1BB030000 + + + + + + HR - Professional Services + + + P1GRDD0200 + + + + + + + + + + + + + + + + + + Employee Relations + + + P1GRDD0210 + + + + + + HR Systems + + + P1GRDD0220 + + + + + + Organisational Development & Design + + + P1GRDD0230 + + + + + + Recruitment, Reward & Talent + + + P1GRDD0240 + + + + + + + + + + + + + + + Reward + + + P1GRDD0241 + + + + + + Temp Bank + + + P1GRDD0242 + + + + + + Recruitment + + + P1GRDD0243 + + + + + + Development + + + P1GRDD0300 + + + + + + + + + Professional Development Unit + + + P1GRDD0310 + + + + + + Equality & Diversity + + + P1GRDD0400 + + + + + + Director's Office + + + P1GRDD0500 + + + + + + Professional Services - Registrar + + + P2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Secretariat + + + P2GR010000 + + + + + + Turner Sims Concert Hall + + + P2GR020000 + + + + + + John Hansard Gallery + + + P2GR030000 + + + + + + Planning & Performance + + + P2GR040000 + + + + + + Transition Project Team + + + P2GR050000 + + + + + + Malaysia Campus Project Team + + + P2GR060000 + + + + + + Vice Chancellor Administration + + + P2GR080000 + + + + + + FOO - Faculty of Business & Law + + + P2TX010000 + + + + + + + + + + + + + + + + + + Faculty Secretariat + + + P2TX010100 + + + + + + Faculty Administration Team + + + P2TX010200 + + + + + + Faculty Resource Team + + + P2TX010300 + + + + + + Faculty Environment Team + + + P2TX010400 + + + + + + FOO - Faculty of Engineering & The Env. + + + P2TX020000 + + + + + + + + + + + + + + + + + + Faculty Secretariat + + + P2TX020100 + + + + + + Faculty Admin for Grants & Projects + + + P2TX020200 + + + + + + Faculty Resource Team + + + P2TX020300 + + + + + + Academic Environment Team + + + P2TX020400 + + + + + + FOO - Faculty of Health Sciences + + + P2TX030000 + + + + + + + + + + + + + + + + + + + + + Faculty Seretariat + + + P2TX030100 + + + + + + Faculty Administration Team + + + P2TX030200 + + + + + + Faculty Resource Team + + + P2TX030300 + + + + + + Faculty Envionment Team + + + P2TX030400 + + + + + + Regional Centre Admin / Reception + + + P2TX030500 + + + + + + FOO - Faculty of Humanities + + + P2TX040000 + + + + + + + + + + + + Faculty Secretariat + + + P2TX040100 + + + + + + Subject Centre - LLAS + + + P2TX040500 + + + + + + FOO - Faculty of Medicine + + + P2TX050000 + + + + + + FOO - Faculty of Natural & Env. Science + + + P2TX060000 + + + + + + + + + + + + + + + + + + Faculty Administration Team + + + P2TX060200 + + + + + + Academic Environment Team + + + P2TX060300 + + + + + + Faculty Resource Team + + + P2TX060400 + + + + + + Externally Funded Projects + + + P2TX060500 + + + + + + FOO - Faculty of Physical & Applied Sci. + + + P2TX070000 + + + + + + + + + + + + + + + Research Administration + + + P2TX070400 + + + + + + Externally Funded Projects + + + P2TX070500 + + + + + + Trading / Enterprise + + + P2TX070600 + + + + + + FOO - Faculty of Social & Human Sciences + + + P2TX080000 + + + + + + + + + + + + + + + Faculty Secretariat + + + P2TX080100 + + + + + + Academic Environment Team + + + P2TX080300 + + + + + + Externally Funded Sci Leaning Cntr SWAP + + + P2TX080400 + + + + + + Mathematics + + + PJ + + + + + + + + + + + + + + + + + + + + + Vice Chancellors Office + + + PK + + + + + + + + + Administration + + + PKBZ010000 + + + + + + Quality Enhancement + + + PKBZ020000 + + + + + + Donor Relations + + + PKCD030000 + + + + + + Annual Giving + + + PKCD050000 + + + + + + Alumni Relations + + + PKCD080000 + + + + + + Major Gift Fundraising + + + PKCD090000 + + + + + + Research, Analytics & Data + + + PKCD100000 + + + + + + Marketing + + + PKGRDK0300 + + + + + + Digital Media + + + PKGRDK0400 + + + + + + Corporate Communications + + + PKGRDK0500 + + + + + + Public Affairs + + + PKGRDK0600 + + + + + + Recruitment, Outreach & Admissions + + + PKGX050000 + + + + + + + + + + + + Outreach + + + PKGX050100 + + + + + + Admissions + + + PKGX050300 + + + + + + Student Administration + + + PKGX060000 + + + + + + + + + + + + Curriculum & Timetabling + + + PKGX060100 + + + + + + Exams, Award & Graduation + + + PKGX060200 + + + + + + Student Information & Records + + + PKGX070000 + + + + + + + + + + + + + + + Business Change + + + PKGX070100 + + + + + + Student Data & Management + + + PKGX070200 + + + + + + Student Records + + + PKGX070300 + + + + + + SAA - Faculty of Business & Law + + + PKGX080000 + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX080100 + + + + + + Student Administration Team + + + PKGX080200 + + + + + + Assessment & Quality Team + + + PKGX080300 + + + + + + Satellite Student & Admin Office + + + PKGX080400 + + + + + + SAA Fac of Engineering & the Environment + + + PKGX090000 + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX090100 + + + + + + Student Admin & Assessment Team + + + PKGX090200 + + + + + + Graduate School Team + + + PKGX090300 + + + + + + Curriculum & Quality Team + + + PKGX090400 + + + + + + SAA - Faculty of Health Sciences + + + PKGX100000 + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX100100 + + + + + + Student Admin & Assessment Team + + + PKGX100200 + + + + + + Curriculum, Quality & Placements Team + + + PKGX100300 + + + + + + SAA - Faculty of Social & Human Sciences + + + PKGX110000 + + + + + + + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX110100 + + + + + + Student Administration Team + + + PKGX110200 + + + + + + Assessment Team + + + PKGX110300 + + + + + + Curriculum & Quality Team + + + PKGX110400 + + + + + + Professional Development + + + PKGX110500 + + + + + + Graduate School + + + PKGX110600 + + + + + + SAA - Faculty of Humanities + + + PKGX120000 + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX120100 + + + + + + Student Administration & Assessment Team + + + PKGX120200 + + + + + + Curriculum & Quality Team + + + PKGX120300 + + + + + + SAA - Fac of Natural & Environmental Sci + + + PKGX130000 + + + + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX130100 + + + + + + Student Administration & Assessment Team + + + PKGX130200 + + + + + + Curriculum & Quality Team + + + PKGX130400 + + + + + + Doctoral Training Centre + + + PKGX130500 + + + + + + NOC - Campus Administration + + + PKGX130600 + + + + + + SAA - Fac of Physical & Applied Sciences + + + PKGX140000 + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX140100 + + + + + + Student Administration & Assessment Team + + + PKGX140200 + + + + + + Curriculum & Quality Team + + + PKGX140300 + + + + + + Doctoral Training Centre + + + PKGX140400 + + + + + + SAA - Faculty of Medicine + + + PKGX150000 + + + + + + + + + + + + + + + + + + + + + Recruitment & Admissions Team + + + PKGX150100 + + + + + + Student Administration + + + PKGX150200 + + + + + + Placements Timetabling Curriculum & Qual + + + PKGX150300 + + + + + + Graduate School + + + PKGX150400 + + + + + + Student Assessment + + + PKGX150500 + + + + + + Director's Office + + + PKGX160000 + + + + + + Service Delivery + + + PKJF110000 + + + + + + + + + + + + + + + + + + Service Desk + + + PKJF110100 + + + + + + Switchboard + + + PKJF110200 + + + + + + ServiceLine Response Team + + + PKJF110300 + + + + + + Coaching & Training + + + PKJF110400 + + + + + + Business Support + + + PKJF120000 + + + + + + + + + + + + + + + Logistics & Distribution / H&S + + + PKJF120100 + + + + + + Admin & Financial Management + + + PKJF120200 + + + + + + Print Centre + + + PKJF120300 + + + + + + E-Learning & Enablement + + + PKJF130000 + + + + + + + + + + + + + + + Managed Learning Environment + + + PKJF130100 + + + + + + E-Learning Enablement + + + PKJF130200 + + + + + + E-Learning Innovation & Production + + + PKJF130300 + + + + + + Research Support + + + PKJF140000 + + + + + + + + + + + + Technical Innovation + + + PKJF140100 + + + + + + HPC Support + + + PKJF140200 + + + + + + Account Management + + + PKJF150000 + + + + + + Service Management & Security + + + PKJF160000 + + + + + + Programme Management + + + PKJF170000 + + + + + + + + + + + + Business & System Analysis + + + PKJF170100 + + + + + + Project Management & Resourcing + + + PKJF170200 + + + + + + Development + + + PKJF180000 + + + + + + + + + + + + + + + Enterprise & Systems Development + + + PKJF180100 + + + + + + Web Systems Development + + + PKJF180200 + + + + + + COTS Systems Development + + + PKJF180300 + + + + + + Operations + + + PKJF190000 + + + + + + + + + + + + + + + Data Centre Operations + + + PKJF190100 + + + + + + Enterprise Systems & Desktop Operations + + + PKJF190200 + + + + + + Applications & Database Operations + + + PKJF190300 + + + + + + ICT Facilities + + + PKJF200000 + + + + + + Hartley Library + + + PKKX020000 + + + + + + Bibliographical Services + + + PKKX070000 + + + + + + Acquisitions + + + PKKX080000 + + + + + + Loans + + + PKKX090000 + + + + + + Digitisation Unit + + + PKKX200000 + + + + + + Librarian's Office + + + PKKX300000 + + + + + + Archives & Special Collections + + + PKKX400000 + + + + + + Faculty Liaison & Site Services + + + PKKX500000 + + + + + + Directorate + + + PKRR010000 + + + + + + Management Accounts + + + PKRR020000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Company & Tax + + + PKRR020600 + + + + + + FFM Team - Business & Law + + + PKRR020700 + + + + + + FFM Team - Engineering + + + PKRR020800 + + + + + + FFM Team - Health Sciences + + + PKRR020900 + + + + + + FFM Team - Humanities + + + PKRR021000 + + + + + + FFM Team - Medicine + + + PKRR021100 + + + + + + FFM Team - Natural & Env Sciences + + + PKRR021200 + + + + + + FFM Team - Physical & App Science + + + PKRR021300 + + + + + + FFM Team - Social & Human Sciences + + + PKRR021400 + + + + + + PSFM Team - CFO + + + PKRR021500 + + + + + + PSFM Team - R & COO + + + PKRR021600 + + + + + + Procurement + + + PKRR030000 + + + + + + + + + + + + + + + Central Procurement + + + PKRR030100 + + + + + + Purchase to Pay + + + PKRR030200 + + + + + + Accounts Payable + + + PKRR030300 + + + + + + Financial Accounts + + + PKRR040000 + + + + + + + + + + + + + + + + + + + + + + + + Student Fees + + + PKRR040300 + + + + + + Payroll & Pensions + + + PKRR040500 + + + + + + Income & Credit Control + + + PKRR040700 + + + + + + Systems Team + + + PKRR040900 + + + + + + Insurance Services + + + PKRR041000 + + + + + + Financial Accounts & Treasury + + + PKRR041100 + + + + + + Planning & Systems + + + PKTD010000 + + + + + + + + + + + + + + + Office Management + + + PKTD010100 + + + + + + Planning + + + PKTD010200 + + + + + + IT & Systems + + + PKTD010300 + + + + + + Facilities + + + PKTD020000 + + + + + + + + + + + + + + + + + + Building Maintenance + + + PKTD020100 + + + + + + + + + + + + + + + + + + Hall & Satellite Campuses + + + PKTD020101 + + + + + + Repairs Service + + + PKTD020102 + + + + + + Locksmiths + + + PKTD020103 + + + + + + Winchester School of Art BM + + + PKTD020104 + + + + + + Helpdesk + + + PKTD020200 + + + + + + Campus Services + + + PKTD020300 + + + + + + + + + + + + + + + Post & Portering + + + PKTD020301 + + + + + + External Services + + + PKTD020302 + + + + + + Domestic Services + + + PKTD020303 + + + + + + Security + + + PKTD020400 + + + + + + Faculty Projects Team + + + PKTD030000 + + + + + + Engineering + + + PKTD040000 + + + + + + + + + + + + + + + + + + + + + M/E Design Team + + + PKTD040100 + + + + + + Electrical Engineering + + + PKTD040200 + + + + + + Utilities + + + PKTD040300 + + + + + + Controls Engineering + + + PKTD040400 + + + + + + Mechanical Engineering + + + PKTD040500 + + + + + + Directorate + + + PKTD050000 + + + + + + + + + Transport + + + PKTD050100 + + + + + + PMU Programme Management Unit + + + PKTD060000 + + + + + + Catering + + + PKTD070000 + + + + + + + + + + + + + + + Halls Catering + + + PKTD070100 + + + + + + Central Catering + + + PKTD070200 + + + + + + Conference & Hospitality + + + PKTD070300 + + + + + + RIS HUB + + + PKTW040000 + + + + + + + + + + + + + + + Legal / IP + + + PKTW040200 + + + + + + Specialist Support Hub + + + PKTW040300 + + + + + + Incubation + + + PKTW040400 + + + + + + RIS Faculty + + + PKTW050000 + + + + + + + + + + + + Research & Enterprise Development + + + PKTW050100 + + + + + + Research Support Team + + + PKTW050200 + + + + + + Projects + + + PKTW060000 + + + + + + + + + SETSquared + + + PKTW060100 + + + + + + English + + + PL + + + + + + Medical Education + + + RA + + + + + + + + + + + + + + + + + + History + + + RG + + + + + + + + + + + + Finance + + + RR + + + + + + + + + + + + + + + + + + + + + Engineering Development Trust + + + SF + + + + + + University Health Service + + + SH + + + + + + + + + Students Union + + + SU + + + + + + + + + + + + + + + Estates & Facilities + + + TD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Southampton Management School + + + TR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Research & Innovation Services + + + TW + + + + + + + + + + + + + + + + + + Faculty Operating Offices + + + TX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Wessex Institute + + + VB + + + + + + + + + Foundation Year + + + VL + + + + + + Physics & Astronomy + + + WF + + + + + + + + + + + + + + + + + + + + + Biomedical Research Facility (BRF) + + + WN + + + + + + Geography & Environment + + + WR + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Statistical Sciences Research Institute + + + WT + + + + + + + + + + + + Central Unit + + + XX + + + + + + + + + + + + + + + + + + + + + + + + School Mathematics Project + + + ZA + + diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index e0609f6..f4cdd9f 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -14,7 +14,7 @@ android:orderingFromXml="true" android:title="@string/preferences_catagory_live_bus_times" > @@ -28,7 +28,7 @@ android:orderingFromXml="true" android:title="@string/preferences_catagory_data" > diff --git a/src/net/cbaines/suma/BuildingActivity.java b/src/net/cbaines/suma/BuildingActivity.java new file mode 100644 index 0000000..7637439 --- /dev/null +++ b/src/net/cbaines/suma/BuildingActivity.java @@ -0,0 +1,88 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package net.cbaines.suma; + +import java.io.InputStream; +import java.util.HashSet; + +import android.content.Context; +import android.os.Bundle; + +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.hp.hpl.jena.util.FileManager; +import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; + +public class BuildingActivity extends OrmLiteBaseActivity { + + final static String TAG = "BusTimeActivity"; + + private boolean dataChanged; + + private Context instance; + + private HashSet routes = new HashSet(); + + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.bustimes); + + final DatabaseHelper helper = getHelper(); + + // create an empty model + Model model = ModelFactory.createDefaultModel(); + + // use the FileManager to find the input file + InputStream in = getResources().openRawResource(R.raw.u9); + if (in == null) { + throw new IllegalArgumentException("File not found"); + } + + // read the RDF/XML file + model.read(in, null); + + + + instance = this; + + } + + public void onResume() { + super.onResume(); + + } + + public void onPause() { + + super.onPause(); + } + + public void finish() { + setResult(RESULT_OK, getIntent()); + + super.finish(); + } + + @Override + public Object onRetainNonConfigurationInstance() { + return null; + } + +} diff --git a/src/net/cbaines/suma/BusStop.java b/src/net/cbaines/suma/BusStop.java index c19e682..1e9faaa 100644 --- a/src/net/cbaines/suma/BusStop.java +++ b/src/net/cbaines/suma/BusStop.java @@ -35,6 +35,7 @@ public class BusStop extends POI { public static final String DESCRIPTION_FIELD_NAME = "description"; public static final String BAY_FIELD_NAME = "bay"; public static final String ROUTES_FIELD_NAME = "bay"; + public static final String UNI_LINK_FIELD_NAME = "uniLink"; /** * Description e.g. "Bournemouth Rd os Asda S" @@ -52,7 +53,10 @@ public class BusStop extends POI { * Used to speed up accessing the relevent uni link routes for a bus stop, this is not a uni link stop */ @DatabaseField(canBeNull = false) - public byte routes; + byte routes; + + @DatabaseField(canBeNull = false) + boolean uniLink; public BusStop(String location, String description, String bay, GeoPoint point) { this.id = location; diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 93f4ae6..d84bbdd 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -53,7 +53,7 @@ import com.j256.ormlite.dao.Dao; import com.j256.ormlite.stmt.PreparedQuery; import com.j256.ormlite.stmt.QueryBuilder; -public class BusStopActivity extends OrmLiteBaseActivity implements OnCheckedChangeListener { +public class BusStopActivity extends OrmLiteBaseActivity implements OnCheckedChangeListener, Preferences { final static String TAG = "BusTimeActivity"; @@ -199,7 +199,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme super.onResume(); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); - if (sharedPrefs.getBoolean("liveBusTimesEnabled", false)) { + if (sharedPrefs.getBoolean(UNI_LINK_BUS_TIMES, false) || sharedPrefs.getBoolean(NON_UNI_LINK_BUS_TIMES, false)) { Log.i(TAG, "Live Times enabled"); timetable = (Timetable) getLastNonConfigurationInstance(); @@ -287,7 +287,11 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme protected Timetable doInBackground(String... activity) { Timetable newTimetable = null; try { - newTimetable = DataManager.getTimetable(instance, busStopID, true); + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(instance); + + newTimetable = DataManager.getTimetable(instance, busStopID, sharedPrefs.getBoolean(SouthamptonUniversityMapActivity.UNI_LINK_BUS_TIMES, + SouthamptonUniversityMapActivity.UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT), sharedPrefs.getBoolean( + SouthamptonUniversityMapActivity.NON_UNI_LINK_BUS_TIMES, SouthamptonUniversityMapActivity.NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT)); } catch (SQLException e) { errorMessage = "Error message regarding SQL?"; e.printStackTrace(); diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java index 639f851..834b6dc 100644 --- a/src/net/cbaines/suma/BusStopOverlay.java +++ b/src/net/cbaines/suma/BusStopOverlay.java @@ -45,7 +45,7 @@ import com.j256.ormlite.dao.Dao; public class BusStopOverlay extends Overlay implements RouteColorConstants { - private List busStops; + List busStops; private final Point mCurScreenCoords = new Point(); private final Point mTouchScreenPoint = new Point(); @@ -68,9 +68,8 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { private boolean[] routes = new boolean[5]; - public BusStopOverlay(Context context) throws SQLException { + public BusStopOverlay(Context context, List busStops) throws SQLException { super(context); - final long startTime = System.currentTimeMillis(); this.context = context; @@ -84,9 +83,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { paint.setStyle(Style.FILL); paint.setStrokeWidth(6); - Log.i(TAG, "Begining to load bus stops in to overlay " + (System.currentTimeMillis() - startTime)); - busStops = busStopDao.queryForAll(); - Log.i(TAG, "Finished loading bus stops in to overlay " + (System.currentTimeMillis() - startTime)); + this.busStops = busStops; } void setRoutes(int route, boolean visible) { diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 9fd08c1..d4d0968 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -331,42 +331,42 @@ public class DataManager { e.printStackTrace(); } - // TODO: Seperate non unilink stuff in to a different table - if (onlyUniLink) { - - long sizeBeforeRemoval = busStopDao.countOf(); - - // Removing busstops not used by unilink busses - for (Iterator busStopIter = busStopDao.iterator(); busStopIter.hasNext();) { - BusStop stop = busStopIter.next(); - // Log.i(TAG, "Looking at stop " + stop.id); - - /* - * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); routeStopsQueryBuilder.where().eq(columnName, value) - * - * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where password is null - * deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) accountDao.delete(deleteBuilder.prepare()); - */ - - QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); - routeStopsQueryBuilder.setCountOf(true); - routeStopsQueryBuilder.where().eq(RouteStops.STOP_ID_FIELD_NAME, stop); - - PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); - long num = routeStopsDao.countOf(routeStopsPreparedQuery); - // long num = routeStopsDao.query(routeStopsPreparedQuery).size(); - // Log.i(TAG, "Number is " + num); - if (num == 0) { - // Log.i(TAG, "Removing " + stop.id); + long sizeBeforeRemoval = busStopDao.countOf(); + + // Removing busstops not used by unilink busses + for (Iterator busStopIter = busStopDao.iterator(); busStopIter.hasNext();) { + BusStop stop = busStopIter.next(); + // Log.i(TAG, "Looking at stop " + stop.id); + + /* + * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); routeStopsQueryBuilder.where().eq(columnName, value) + * + * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where password is null + * deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) accountDao.delete(deleteBuilder.prepare()); + */ + + QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + routeStopsQueryBuilder.setCountOf(true); + routeStopsQueryBuilder.where().eq(RouteStops.STOP_ID_FIELD_NAME, stop); + + PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); + long num = routeStopsDao.countOf(routeStopsPreparedQuery); + // long num = routeStopsDao.query(routeStopsPreparedQuery).size(); + // Log.i(TAG, "Number is " + num); + if (num == 0) { + // Log.i(TAG, "Removing " + stop.id); + stop.uniLink = false; + if (onlyUniLink) { busStopIter.remove(); } + } else { + stop.uniLink = true; } + } - long sizeAfterRemoval = busStopDao.countOf(); - - Log.i(TAG, "Removed " + (sizeBeforeRemoval - sizeAfterRemoval) + " stops (from " + sizeBeforeRemoval + ") now have " + sizeAfterRemoval); + long sizeAfterRemoval = busStopDao.countOf(); - } + Log.i(TAG, "Removed " + (sizeBeforeRemoval - sizeAfterRemoval) + " stops (from " + sizeBeforeRemoval + ") now have " + sizeAfterRemoval); Log.i(TAG, "Finished loading bus data"); } @@ -546,8 +546,8 @@ public class DataManager { } - public static Timetable getTimetable(Context context, String busStop, boolean onlyUniLink) throws SQLException, ClientProtocolException, IOException, - JSONException { + public static Timetable getTimetable(Context context, String busStop, boolean keepUniLink, boolean keepNonUniLink) throws SQLException, + ClientProtocolException, IOException, JSONException { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -571,7 +571,11 @@ public class DataManager { for (int stopNum = 0; stopNum < stopsArray.length(); stopNum++) { JSONObject stopObj = stopsArray.getJSONObject(stopNum); - if (onlyUniLink && !stopObj.getString("name").startsWith("U")) { + if (!keepNonUniLink && !stopObj.getString("name").startsWith("U")) { + continue; + } + + if (!keepUniLink && stopObj.getString("name").startsWith("U")) { continue; } diff --git a/src/net/cbaines/suma/Preferences.java b/src/net/cbaines/suma/Preferences.java new file mode 100644 index 0000000..e2c79a0 --- /dev/null +++ b/src/net/cbaines/suma/Preferences.java @@ -0,0 +1,12 @@ +package net.cbaines.suma; + +public interface Preferences { + static final String GPS_ENABLED = "GPSEnabled"; + static final boolean GPS_ENABLED_BY_DEFAULT = true; + static final String UNI_LINK_BUS_TIMES = "uniLinkLiveBusTimesEnabled"; + static final boolean UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = true; + static final String NON_UNI_LINK_BUS_TIMES = "nonUniLinkLiveBusTimesEnabled"; + static final boolean NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = false; + static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStop"; + static final boolean NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = false; +} diff --git a/src/net/cbaines/suma/PreferencesActivity.java b/src/net/cbaines/suma/PreferencesActivity.java index d5df6a1..0d61c6d 100644 --- a/src/net/cbaines/suma/PreferencesActivity.java +++ b/src/net/cbaines/suma/PreferencesActivity.java @@ -19,15 +19,34 @@ package net.cbaines.suma; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; import android.os.Bundle; import android.preference.PreferenceActivity; +import android.preference.PreferenceManager; -public class PreferencesActivity extends PreferenceActivity { +public class PreferencesActivity extends PreferenceActivity implements Preferences { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); + final Editor editor = sharedPrefs.edit(); + if (!sharedPrefs.contains(GPS_ENABLED)) { + editor.putBoolean(GPS_ENABLED, GPS_ENABLED_BY_DEFAULT); + } + if (!sharedPrefs.contains(UNI_LINK_BUS_TIMES)) { + editor.putBoolean(UNI_LINK_BUS_TIMES, UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT); + } + if (!sharedPrefs.contains(NON_UNI_LINK_BUS_TIMES)) { + editor.putBoolean(NON_UNI_LINK_BUS_TIMES, NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT); + } + if (!sharedPrefs.contains(NON_UNI_LINK_BUS_STOPS)) { + editor.putBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT); + } + editor.commit(); + addPreferencesFromResource(R.xml.preferences); } - } \ No newline at end of file diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index 52b3e1f..a5a255e 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -26,6 +26,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.List; import org.osmdroid.DefaultResourceProxyImpl; import org.osmdroid.ResourceProxy; @@ -73,7 +74,7 @@ import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; import com.j256.ormlite.dao.Dao; public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, - OnChildClickListener, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener { + OnChildClickListener, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { private boolean useBundledDatabase = true; @@ -90,18 +91,18 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity pastOverlays; private ScaleBarOverlay scaleBarOverlay; - private final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; private MyLocationOverlay myLocationOverlay; private BuildingNumOverlay residentialBuildingOverlay; - private final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; private BuildingNumOverlay nonResidentialBuildingOverlay; - private final boolean RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; private BusStopOverlay busStopOverlay; - private final boolean BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; private HashMap siteOverlays = new HashMap(21); - private final boolean SITE_OVERLAY_ENABLED_BY_DEFAULT = false; + private static final boolean SITE_OVERLAY_ENABLED_BY_DEFAULT = false; private HashMap routeOverlays = new HashMap(5); - private final boolean ROUTE_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean ROUTE_OVERLAY_ENABLED_BY_DEFAULT = true; private String[] busRoutes; private String[] buildingTypes; @@ -686,7 +687,16 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity busStops; + Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); + if (activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT)) { + busStops = getHelper().getBusStopDao().queryForAll(); + } else { + busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); + } + Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); + + busStopOverlay = new BusStopOverlay(instance, busStops); } catch (SQLException e) { e.printStackTrace(); } @@ -1085,6 +1095,22 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Tue, 7 Feb 2012 21:38:32 +0000 Subject: Switched the bus stop locations for the two wessex lane stops to match the live data. --- assets/bus_stops.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/bus_stops.csv b/assets/bus_stops.csv index b5fdcb6..b002a42 100644 --- a/assets/bus_stops.csv +++ b/assets/bus_stops.csv @@ -725,7 +725,7 @@ "SN120158","Portswood Rd os 508 SW","","50 56.0337N","1 22.9475W","", "SN120159","Portswood Rd os 615-619 NE","","50 55.9458N","1 23.0571W","", "SN120160","Wessex Ln os Montefiore Halls NE","","50 56.2445N","1 22.6100W","", -"SN120161","Wessex Ln opp Montefiore entrance SW","","50 56.2354N","1 22.6229W","", +"SN120161","Wessex Ln opp Montefiore entrance SW","","50 56.2417N","1 22.5980W","", "SN120162","Wessex Ln os 7 NE","","50 56.5051N","1 22.5023W","", "SN120163","Wessex Ln opp 9 SW","","50 56.4997N","1 22.4998W","", "SN120164","Wide Ln opp 33 SW","","50 56.5747N","1 22.3041W","", @@ -1376,7 +1376,7 @@ "SNA19773","Glenfield Ave os 13 SW","","50 55.0087N","1 21.9633W","", "SNA19774","Upper Deacon Rd opp Caerleon Dr SW","","50 54.7235N","1 20.8397W","", "SNA19777","Univ Interchange SE","","50 56.1720N","1 23.8135W","", -"SNA19780","Wessex Ln opp Montefiore Halls SW","","50 56.2417N","1 22.5980W","", +"SNA19780","Wessex Ln opp Montefiore Halls SW","","50 56.2354N","1 22.6229W","", "SNA40401","New Road South os East Park E","","50 54.4189N","1 24.2105W","", "SNA40402","London Rd os HSBC SW","","50 54.6599N","1 24.2757W","", "SNA40406","Tesco Millbrook inside grounds","","50 55.4017N","1 26.7854W","", -- cgit v1.2.3 From 7a7d4e326f7698bd5930e70cf01d3d6d1fcd3fcb Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 7 Feb 2012 21:41:25 +0000 Subject: Fixed a problem, that relates to a bug report on the Android Market. --- src/net/cbaines/suma/BusStopActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index d84bbdd..b711770 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -237,7 +237,8 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme public void onPause() { if (mHandler != null) { // BusTimes are enabled mHandler.removeCallbacks(refreshData); - timetableTask.cancel(true); + if (timetableTask != null) // Could happen if the handler has not created the timetableTask yet + timetableTask.cancel(true); Log.i(TAG, "Stoping refreshing timetable data"); } -- cgit v1.2.3 From 0b4b69ee80d109887389dd0b9e83d71b2cb0fb19 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 8 Feb 2012 12:14:06 +0000 Subject: Some hacks because not using git properly :( --- assets/data.db | Bin 140288 -> 140288 bytes src/net/cbaines/suma/BuildingActivity.java | 88 --------------------- src/net/cbaines/suma/Preferences.java | 2 + .../suma/SouthamptonUniversityMapActivity.java | 4 +- 4 files changed, 4 insertions(+), 90 deletions(-) delete mode 100644 src/net/cbaines/suma/BuildingActivity.java diff --git a/assets/data.db b/assets/data.db index f941f32..4e890a9 100644 Binary files a/assets/data.db and b/assets/data.db differ diff --git a/src/net/cbaines/suma/BuildingActivity.java b/src/net/cbaines/suma/BuildingActivity.java deleted file mode 100644 index 7637439..0000000 --- a/src/net/cbaines/suma/BuildingActivity.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Southampton University Map App - * Copyright (C) 2011 Christopher Baines - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package net.cbaines.suma; - -import java.io.InputStream; -import java.util.HashSet; - -import android.content.Context; -import android.os.Bundle; - -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.util.FileManager; -import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; - -public class BuildingActivity extends OrmLiteBaseActivity { - - final static String TAG = "BusTimeActivity"; - - private boolean dataChanged; - - private Context instance; - - private HashSet routes = new HashSet(); - - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.bustimes); - - final DatabaseHelper helper = getHelper(); - - // create an empty model - Model model = ModelFactory.createDefaultModel(); - - // use the FileManager to find the input file - InputStream in = getResources().openRawResource(R.raw.u9); - if (in == null) { - throw new IllegalArgumentException("File not found"); - } - - // read the RDF/XML file - model.read(in, null); - - - - instance = this; - - } - - public void onResume() { - super.onResume(); - - } - - public void onPause() { - - super.onPause(); - } - - public void finish() { - setResult(RESULT_OK, getIntent()); - - super.finish(); - } - - @Override - public Object onRetainNonConfigurationInstance() { - return null; - } - -} diff --git a/src/net/cbaines/suma/Preferences.java b/src/net/cbaines/suma/Preferences.java index e2c79a0..46a521b 100644 --- a/src/net/cbaines/suma/Preferences.java +++ b/src/net/cbaines/suma/Preferences.java @@ -7,6 +7,8 @@ public interface Preferences { static final boolean UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = true; static final String NON_UNI_LINK_BUS_TIMES = "nonUniLinkLiveBusTimesEnabled"; static final boolean NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = false; + static final String UNI_LINK_BUS_STOPS = "uniLinkBusStop"; + static final boolean UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = true; static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStop"; static final boolean NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = false; } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index a5a255e..d6a22d8 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -76,7 +76,7 @@ import com.j256.ormlite.dao.Dao; public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, OnChildClickListener, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { - private boolean useBundledDatabase = true; + private boolean useBundledDatabase = false; private MapView mapView; private MapController mapController; @@ -689,7 +689,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity busStops; Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); - if (activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT)) { + if (activityPrefs.getBoolean(UNI_LINK_BUS_STOPS, UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT)) { busStops = getHelper().getBusStopDao().queryForAll(); } else { busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); -- cgit v1.2.3 From 72aad0e9de176d41999587166a1914bcf7410e54 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 8 Feb 2012 12:18:06 +0000 Subject: Fixed a bug where the BusStopActivity would crash. --- src/net/cbaines/suma/BusStopActivity.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index b711770..6c46d03 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -265,11 +265,10 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme e.printStackTrace(); } } else { - Log.i(TAG, "Route radio button made " + checked); - - displayTimetable(timetable); - + if (timetable != null) { // If there is a timetable to display + displayTimetable(timetable); + } } } -- cgit v1.2.3 From cccc62990e9b3736d7b5b86acd7acf7dcd8de8c3 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 8 Feb 2012 12:26:56 +0000 Subject: Moved the route movement stuff to a branch. --- gen/net/cbaines/suma/R.java | 4 +++- res/menu/stop_menu.xml | 8 ++++---- src/net/cbaines/suma/BusStopActivity.java | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index c18db21..ba914fb 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -84,8 +84,10 @@ public final class R { public static final int menu_favourites=0x7f0a0028; public static final int menu_find=0x7f0a0023; public static final int menu_find_my_location=0x7f0a0025; + public static final int menu_next_stop=0x7f0a002b; public static final int menu_preferences=0x7f0a0024; - public static final int menu_refresh_stop=0x7f0a0029; + public static final int menu_previous_stop=0x7f0a0029; + public static final int menu_refresh_stop=0x7f0a002a; public static final int menu_view=0x7f0a0026; public static final int radio_u1=0x7f0a0006; public static final int radio_u1n=0x7f0a0007; diff --git a/res/menu/stop_menu.xml b/res/menu/stop_menu.xml index 408e536..c44efa2 100644 --- a/res/menu/stop_menu.xml +++ b/res/menu/stop_menu.xml @@ -1,17 +1,17 @@ - + android:title="@string/menu_previous_stop"/> - + android:title="@string/menu_next_stop"/> \ No newline at end of file diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 6c46d03..1f99b8a 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -334,7 +334,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection - if (false) { // (item.getItemId() == R.id.menu_previous_stop || item.getItemId() == R.id.menu_next_stop) { + if (item.getItemId() == R.id.menu_previous_stop || item.getItemId() == R.id.menu_next_stop) { Log.v(TAG, "Got a request for the stop movement"); Log.v(TAG, routes.size() + " routes avalible from this stop"); @@ -343,7 +343,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme for (BusRoute route : routes) { try { - if (false) { // (item.getItemId() == R.id.menu_next_stop) { + if (item.getItemId() == R.id.menu_next_stop) { busStops.add(route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, 1)); } else { busStops.add(route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, -1)); -- cgit v1.2.3 From f2ac73dde202d0999e210956747a510712129027 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 8 Feb 2012 12:38:08 +0000 Subject: Basic route movement working, need to code the dialog box next... --- src/net/cbaines/suma/BusRoute.java | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index 5af89e7..96cf0ce 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -121,20 +121,18 @@ public class BusRoute { if (forwardDirection != null) { - if (direction == null) { - return null; - } + if (direction != null) { - if (forwardDirection.equals(direction)) { + if (forwardDirection.equals(direction)) { - } else if (reverseDirection.equals(direction)) { - moveAmount = -moveAmount; - } else { - Log.e("BusRoute", "Direction (" + direction + ") doesnt match either the forward direction (" + forwardDirection + ") or reverse direction (" - + reverseDirection + ")"); - return null; + } else if (reverseDirection.equals(direction)) { + moveAmount = -moveAmount; + } else { + Log.e("BusRoute", "Direction (" + direction + ") doesnt match either the forward direction (" + forwardDirection + + ") or reverse direction (" + reverseDirection + ")"); + return null; + } } - } try { @@ -147,12 +145,12 @@ public class BusRoute { List routeStopsFound = routeStopsDao.query(routeStopsPreparedQuery); Log.v("BusRoute", "Found " + routeStopsFound.size() + " stops"); - + int stopIndex = 0; - + for (RouteStops routeStop : routeStopsFound) { if (routeStop.stop.id.equals(stop.id)) { - stopIndex = routeStop.sequence -1; + stopIndex = routeStop.sequence - 1; } } -- cgit v1.2.3 From 2b1ff25e6c6422ee0e52fe1e8e59794002d92ce0 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 8 Feb 2012 12:57:41 +0000 Subject: More stuff. --- gen/net/cbaines/suma/R.java | 98 +++++++++++++++++---------------- res/layout/bus_stop_dialog.xml | 15 +++++ src/net/cbaines/suma/BusStopDialog.java | 98 +++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 48 deletions(-) create mode 100644 res/layout/bus_stop_dialog.xml create mode 100644 src/net/cbaines/suma/BusStopDialog.java diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index ba914fb..c08b7d0 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -54,61 +54,63 @@ public final class R { public static final int u9_radio_button=0x7f02001d; } public static final class id { - public static final int busStopID=0x7f0a000c; - public static final int busStopLoadBar=0x7f0a0011; - public static final int busStopMessage=0x7f0a000e; - public static final int busStopName=0x7f0a0004; - public static final int busStopTimes=0x7f0a000f; - public static final int busTimeContentLayout=0x7f0a000d; - public static final int centerLoadBar=0x7f0a0010; - public static final int check1=0x7f0a0021; - public static final int childname=0x7f0a0020; - public static final int donateBitcoinAddress=0x7f0a0018; + public static final int busStopID=0x7f0a000e; + public static final int busStopListItems=0x7f0a0005; + public static final int busStopLoadBar=0x7f0a0013; + public static final int busStopMessage=0x7f0a0010; + public static final int busStopName=0x7f0a0006; + public static final int busStopTimes=0x7f0a0011; + public static final int busTimeContentLayout=0x7f0a000f; + public static final int centerLoadBar=0x7f0a0012; + public static final int check1=0x7f0a0022; + public static final int childname=0x7f0a0021; + public static final int donateBitcoinAddress=0x7f0a0019; public static final int donateButton=0x7f0a0003; - public static final int donateDialogErrorMessage=0x7f0a0017; - public static final int donateDialogMessage=0x7f0a0014; - public static final int donateDialogMessageLayout=0x7f0a0016; - public static final int donateDialogProgress=0x7f0a0015; - public static final int favouriteCheckBox=0x7f0a000b; - public static final int favouriteDialogMessage=0x7f0a0019; - public static final int favouriteListItems=0x7f0a001a; - public static final int findContentLayout=0x7f0a001c; - public static final int findListItems=0x7f0a001e; - public static final int findLoadBar=0x7f0a001d; + public static final int donateDialogErrorMessage=0x7f0a0018; + public static final int donateDialogMessage=0x7f0a0015; + public static final int donateDialogMessageLayout=0x7f0a0017; + public static final int donateDialogProgress=0x7f0a0016; + public static final int favouriteCheckBox=0x7f0a000d; + public static final int favouriteDialogMessage=0x7f0a001a; + public static final int favouriteListItems=0x7f0a001b; + public static final int findContentLayout=0x7f0a001d; + public static final int findListItems=0x7f0a001f; + public static final int findLoadBar=0x7f0a001e; public static final int helpExpandableListView=0x7f0a0002; - public static final int layout_root=0x7f0a0012; - public static final int linearLayout1=0x7f0a0005; - public static final int linearLayout2=0x7f0a0013; - public static final int mapview=0x7f0a001f; - public static final int menu_about=0x7f0a0027; - public static final int menu_favourites=0x7f0a0028; - public static final int menu_find=0x7f0a0023; - public static final int menu_find_my_location=0x7f0a0025; - public static final int menu_next_stop=0x7f0a002b; - public static final int menu_preferences=0x7f0a0024; - public static final int menu_previous_stop=0x7f0a0029; - public static final int menu_refresh_stop=0x7f0a002a; - public static final int menu_view=0x7f0a0026; - public static final int radio_u1=0x7f0a0006; - public static final int radio_u1n=0x7f0a0007; - public static final int radio_u2=0x7f0a0008; - public static final int radio_u6=0x7f0a0009; - public static final int radio_u9=0x7f0a000a; - public static final int searchBar=0x7f0a001b; + public static final int layout_root=0x7f0a0004; + public static final int linearLayout1=0x7f0a0007; + public static final int linearLayout2=0x7f0a0014; + public static final int mapview=0x7f0a0020; + public static final int menu_about=0x7f0a0028; + public static final int menu_favourites=0x7f0a0029; + public static final int menu_find=0x7f0a0024; + public static final int menu_find_my_location=0x7f0a0026; + public static final int menu_next_stop=0x7f0a002c; + public static final int menu_preferences=0x7f0a0025; + public static final int menu_previous_stop=0x7f0a002a; + public static final int menu_refresh_stop=0x7f0a002b; + public static final int menu_view=0x7f0a0027; + public static final int radio_u1=0x7f0a0008; + public static final int radio_u1n=0x7f0a0009; + public static final int radio_u2=0x7f0a000a; + public static final int radio_u6=0x7f0a000b; + public static final int radio_u9=0x7f0a000c; + public static final int searchBar=0x7f0a001c; public static final int textView1=0x7f0a0000; public static final int textView2=0x7f0a0001; - public static final int view_list=0x7f0a0022; + public static final int view_list=0x7f0a0023; } public static final class layout { public static final int about_dialog=0x7f030000; - public static final int bustimes=0x7f030001; - public static final int donate_dialog=0x7f030002; - public static final int favourite_dialog=0x7f030003; - public static final int find=0x7f030004; - public static final int main=0x7f030005; - public static final int view_child_row=0x7f030006; - public static final int view_dialog=0x7f030007; - public static final int view_group_row=0x7f030008; + public static final int bus_stop_dialog=0x7f030001; + public static final int bustimes=0x7f030002; + public static final int donate_dialog=0x7f030003; + public static final int favourite_dialog=0x7f030004; + public static final int find=0x7f030005; + public static final int main=0x7f030006; + public static final int view_child_row=0x7f030007; + public static final int view_dialog=0x7f030008; + public static final int view_group_row=0x7f030009; } public static final class menu { public static final int map_menu=0x7f090000; diff --git a/res/layout/bus_stop_dialog.xml b/res/layout/bus_stop_dialog.xml new file mode 100644 index 0000000..24148c6 --- /dev/null +++ b/res/layout/bus_stop_dialog.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/src/net/cbaines/suma/BusStopDialog.java b/src/net/cbaines/suma/BusStopDialog.java new file mode 100644 index 0000000..670fc96 --- /dev/null +++ b/src/net/cbaines/suma/BusStopDialog.java @@ -0,0 +1,98 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package net.cbaines.suma; + +import java.sql.SQLException; +import java.util.ArrayList; + +import android.app.Dialog; +import android.content.Context; +import android.util.Log; +import android.view.View; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.AdapterView.OnItemLongClickListener; +import android.widget.ListView; +import android.widget.TextView; + +import com.j256.ormlite.android.apptools.OpenHelperManager; +import com.j256.ormlite.dao.Dao; + +public class BusStopDialog extends Dialog { + + private static final String TAG = "BusStopDialog"; + private ListView listItems; + + private final Context context; + + protected POIArrayAdapter adapter; + + private ArrayList busStops; + + public BusStopDialog(Context context) { + super(context); + + this.context = context; + + setContentView(R.layout.bus_stop_dialog); + setTitle("Favourite Items"); + + busStops = new ArrayList(); + + listItems = (ListView) findViewById(R.id.favouriteListItems); + + refresh(); + } + + public void refresh() { + + DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + + try { + + if (busStops.size() == 0) { + Log.e(TAG, "Error"); + } else { + listItems.post(new Runnable() { + public void run() { + adapter = new POIArrayAdapter(context, busStops); + + listItems.setVisibility(View.VISIBLE); + listItems.setAdapter(adapter); + + } + }); + + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + void setOnItemClickListener(OnItemClickListener item) { + listItems.setOnItemClickListener(item); + + } + + void setOnItemLongClickListener(OnItemLongClickListener item) { + listItems.setOnItemLongClickListener(item); + } + +} -- cgit v1.2.3 From 409ab7c3e764a877116e7f05dd9fd5a5eaf2ccf0 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 8 Feb 2012 14:21:28 +0000 Subject: Preference changes and other stuff... --- assets/data.db | Bin 140288 -> 140288 bytes src/net/cbaines/suma/BuildingActivity.java | 3 +- src/net/cbaines/suma/DataManager.java | 6 +- src/net/cbaines/suma/Preferences.java | 4 + .../suma/SouthamptonUniversityMapActivity.java | 203 +++++++++++---------- src/net/cbaines/suma/Stop.java | 8 +- src/net/cbaines/suma/StopView.java | 13 +- 7 files changed, 138 insertions(+), 99 deletions(-) diff --git a/assets/data.db b/assets/data.db index f941f32..d5c05ce 100644 Binary files a/assets/data.db and b/assets/data.db differ diff --git a/src/net/cbaines/suma/BuildingActivity.java b/src/net/cbaines/suma/BuildingActivity.java index 7637439..df6dea2 100644 --- a/src/net/cbaines/suma/BuildingActivity.java +++ b/src/net/cbaines/suma/BuildingActivity.java @@ -1,4 +1,5 @@ /* + * Southampton University Map App * Copyright (C) 2011 Christopher Baines * @@ -57,8 +58,6 @@ public class BuildingActivity extends OrmLiteBaseActivity { // read the RDF/XML file model.read(in, null); - - instance = this; diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index d4d0968..536cc64 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -430,6 +430,7 @@ public class DataManager { String time = stopObj.getString("time"); GregorianCalendar calender = new GregorianCalendar(); + boolean live = true; if (!time.equals("Due")) { Log.v(TAG, "Time: " + time + " current time " + calender.getTime()); @@ -438,6 +439,7 @@ public class DataManager { String[] minAndHour = time.split(":"); calender.set(Calendar.HOUR_OF_DAY, Integer.parseInt(minAndHour[0])); calender.set(Calendar.MINUTE, Integer.parseInt(minAndHour[1])); + live = false; } else { // Log.i(TAG, "Parsing " + time.substring(0, time.length() - 1) + " for min"); calender.add(Calendar.MINUTE, Integer.parseInt(time.substring(0, time.length() - 1))); @@ -534,7 +536,7 @@ public class DataManager { busDao.update(bus); - stop = new Stop(bus, busStop, calender.getTime(), now); + stop = new Stop(bus, busStop, calender.getTime(), now, live); return stop; @@ -574,7 +576,7 @@ public class DataManager { if (!keepNonUniLink && !stopObj.getString("name").startsWith("U")) { continue; } - + if (!keepUniLink && stopObj.getString("name").startsWith("U")) { continue; } diff --git a/src/net/cbaines/suma/Preferences.java b/src/net/cbaines/suma/Preferences.java index e2c79a0..c92a86c 100644 --- a/src/net/cbaines/suma/Preferences.java +++ b/src/net/cbaines/suma/Preferences.java @@ -1,12 +1,16 @@ package net.cbaines.suma; public interface Preferences { + // Preferences static final String GPS_ENABLED = "GPSEnabled"; static final boolean GPS_ENABLED_BY_DEFAULT = true; static final String UNI_LINK_BUS_TIMES = "uniLinkLiveBusTimesEnabled"; static final boolean UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = true; static final String NON_UNI_LINK_BUS_TIMES = "nonUniLinkLiveBusTimesEnabled"; static final boolean NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = false; + static final String UNI_LINK_BUS_STOPS = "uniLinkBusStop"; + static final boolean UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = true; static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStop"; static final boolean NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = false; + } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index a5a255e..1d99921 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -90,25 +90,51 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity overlays = new HashMap(); private HashMap pastOverlays; + // Overlays + + // Scale Bar Overlay + private static final String SCALE_BAR_OVERLAY = "scaleBarOverlay"; private ScaleBarOverlay scaleBarOverlay; private static final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; + + // My Location Overlay + private static final String MY_LOCATION_OVERLAY = "myLocationOverlay"; private MyLocationOverlay myLocationOverlay; + private static final boolean MY_LOCATION_OVERLAY_ENABLED_BY_DEFAULT = true; + + // Residential Building Overlay + private static final String RESIDENTIAL_BUILDINGS = "residentialBuildingOverlay"; private BuildingNumOverlay residentialBuildingOverlay; - private static final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; - private BuildingNumOverlay nonResidentialBuildingOverlay; private static final boolean RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; - private BusStopOverlay busStopOverlay; - private static final boolean BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; + + // Non-Residential Building Overlay + private static final String NON_RESIDENTIAL_BUILDINGS = "nonResidentialBuildingOverlay"; + private BuildingNumOverlay nonResidentialBuildingOverlay; + private static final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; + + // Uni-Link Bus Stop Overlay + private static final String UNI_LINK_BUS_STOPS = "uniLinkBusStopOverlay"; + private BusStopOverlay uniLinkBusStopOverlay; + private static final boolean UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; + + // Uni-Link Bus Stop Overlay + private static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStopOverlay"; + private BusStopOverlay nonUniLinkBusStopOverlay; + private static final boolean NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; + + // Site Overlays private HashMap siteOverlays = new HashMap(21); - private static final boolean SITE_OVERLAY_ENABLED_BY_DEFAULT = false; + + // Route Overlays private HashMap routeOverlays = new HashMap(5); + + // View + private static final String RESIDENTIAL_BUILDING_OVERLAY = "Buildings:Residential"; + private static final String NON_RESIDENTIAL_BUILDING_OVERLAY = "Buildings:Non-Residential"; + private static final boolean SITE_OVERLAY_ENABLED_BY_DEFAULT = false; private static final boolean ROUTE_OVERLAY_ENABLED_BY_DEFAULT = true; - private String[] busRoutes; - private String[] buildingTypes; - private String[] other; - private String[] groupHeadings; - private String[] siteNames; + private static final int UNI_LINK_BUS_STOP_OVERLAY_RANK = 4; private FavouriteDialog favDialog; @@ -188,20 +214,12 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity sites = new ArrayList(size); - - try { - sites.addAll(getHelper().getSiteDao().queryForAll()); - } catch (SQLException e) { - e.printStackTrace(); - } - siteNames = new String[size]; - for (int i = 0; i < size; i++) { - siteNames[i] = sites.get(i).name; - } - } catch (SQLException e1) { - e1.printStackTrace(); - } - - busRoutes = getResources().getStringArray(R.array.uniLinkBusRoutes); - buildingTypes = getResources().getStringArray(R.array.buildingTypes); - other = getResources().getStringArray(R.array.utilityOverlays); - groupHeadings = getResources().getStringArray(R.array.preferencesHeadings); - Log.i(TAG, "Finished the database thread " + (System.currentTimeMillis() - startTime)); } @@ -388,12 +382,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity busStops; Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); - if (activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT)) { + if (activityPrefs.getBoolean(UNI_LINK_BUS_STOPS, UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT)) { busStops = getHelper().getBusStopDao().queryForAll(); } else { busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); } Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); - busStopOverlay = new BusStopOverlay(instance, busStops); + uniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); } catch (SQLException e) { e.printStackTrace(); } } - overlays.put("BusStops", busStopOverlay); + overlays.put("BusStops", uniLinkBusStopOverlay); Log.v(TAG, "Applyed the site overlay, now sorting them"); synchronized (mapView.getOverlays()) { - mapView.getOverlays().add(busStopOverlay); + mapView.getOverlays().add(uniLinkBusStopOverlay); Collections.sort(mapView.getOverlays(), comparator); } } - busStopOverlay.setRoutes(0, activityPrefs.getBoolean("Bus Stops:U1", BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - busStopOverlay.setRoutes(1, activityPrefs.getBoolean("Bus Stops:U1N", BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - busStopOverlay.setRoutes(2, activityPrefs.getBoolean("Bus Stops:U2", BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - busStopOverlay.setRoutes(3, activityPrefs.getBoolean("Bus Stops:U6", BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - busStopOverlay.setRoutes(4, activityPrefs.getBoolean("Bus Stops:U9", BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean("Bus Stops:U1", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean("Bus Stops:U1N", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean("Bus Stops:U2", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(3, activityPrefs.getBoolean("Bus Stops:U6", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(4, activityPrefs.getBoolean("Bus Stops:U9", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); mapView.postInvalidate(); @@ -854,7 +843,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity sites = new ArrayList(size); + + try { + sites.addAll(getHelper().getSiteDao().queryForAll()); + } catch (SQLException e) { + e.printStackTrace(); + } + siteNames = new String[size]; + for (int i = 0; i < size; i++) { + siteNames[i] = sites.get(i).name; + } + } catch (SQLException e1) { + e1.printStackTrace(); + } + + busRoutes = getResources().getStringArray(R.array.uniLinkBusRoutes); + buildingTypes = getResources().getStringArray(R.array.buildingTypes); + other = getResources().getStringArray(R.array.utilityOverlays); + groupHeadings = getResources().getStringArray(R.array.preferencesHeadings); + } public void setOnItemClickListener(OnChildClickListener onChildClickListener) { @@ -1236,7 +1254,8 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Wed, 8 Feb 2012 15:25:29 +0000 Subject: Lots of changes related to the dialogs... --- gen/net/cbaines/suma/R.java | 20 ++-- res/layout/favourite_dialog.xml | 22 ---- res/layout/poi_dialog.xml | 22 ++++ src/net/cbaines/suma/BusStopActivity.java | 41 ++++++- src/net/cbaines/suma/BusStopDialog.java | 98 --------------- src/net/cbaines/suma/FavouriteDialog.java | 133 --------------------- src/net/cbaines/suma/POIDialog.java | 96 +++++++++++++++ .../suma/SouthamptonUniversityMapActivity.java | 42 +++++-- 8 files changed, 198 insertions(+), 276 deletions(-) delete mode 100644 res/layout/favourite_dialog.xml create mode 100644 res/layout/poi_dialog.xml delete mode 100644 src/net/cbaines/suma/BusStopDialog.java delete mode 100644 src/net/cbaines/suma/FavouriteDialog.java create mode 100644 src/net/cbaines/suma/POIDialog.java diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index c08b7d0..130b154 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -71,16 +71,16 @@ public final class R { public static final int donateDialogMessageLayout=0x7f0a0017; public static final int donateDialogProgress=0x7f0a0016; public static final int favouriteCheckBox=0x7f0a000d; - public static final int favouriteDialogMessage=0x7f0a001a; - public static final int favouriteListItems=0x7f0a001b; - public static final int findContentLayout=0x7f0a001d; - public static final int findListItems=0x7f0a001f; - public static final int findLoadBar=0x7f0a001e; + public static final int favouriteDialogMessage=0x7f0a001f; + public static final int favouriteListItems=0x7f0a0020; + public static final int findContentLayout=0x7f0a001b; + public static final int findListItems=0x7f0a001d; + public static final int findLoadBar=0x7f0a001c; public static final int helpExpandableListView=0x7f0a0002; public static final int layout_root=0x7f0a0004; public static final int linearLayout1=0x7f0a0007; public static final int linearLayout2=0x7f0a0014; - public static final int mapview=0x7f0a0020; + public static final int mapview=0x7f0a001e; public static final int menu_about=0x7f0a0028; public static final int menu_favourites=0x7f0a0029; public static final int menu_find=0x7f0a0024; @@ -95,7 +95,7 @@ public final class R { public static final int radio_u2=0x7f0a000a; public static final int radio_u6=0x7f0a000b; public static final int radio_u9=0x7f0a000c; - public static final int searchBar=0x7f0a001c; + public static final int searchBar=0x7f0a001a; public static final int textView1=0x7f0a0000; public static final int textView2=0x7f0a0001; public static final int view_list=0x7f0a0023; @@ -105,9 +105,9 @@ public final class R { public static final int bus_stop_dialog=0x7f030001; public static final int bustimes=0x7f030002; public static final int donate_dialog=0x7f030003; - public static final int favourite_dialog=0x7f030004; - public static final int find=0x7f030005; - public static final int main=0x7f030006; + public static final int find=0x7f030004; + public static final int main=0x7f030005; + public static final int poi_dialog=0x7f030006; public static final int view_child_row=0x7f030007; public static final int view_dialog=0x7f030008; public static final int view_group_row=0x7f030009; diff --git a/res/layout/favourite_dialog.xml b/res/layout/favourite_dialog.xml deleted file mode 100644 index 44cb02a..0000000 --- a/res/layout/favourite_dialog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/res/layout/poi_dialog.xml b/res/layout/poi_dialog.xml new file mode 100644 index 0000000..44cb02a --- /dev/null +++ b/res/layout/poi_dialog.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 1f99b8a..b50e340 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -21,12 +21,14 @@ package net.cbaines.suma; import java.io.IOException; import java.sql.SQLException; +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import org.apache.http.client.ClientProtocolException; import org.json.JSONException; +import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -40,6 +42,8 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemClickListener; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; @@ -53,7 +57,7 @@ import com.j256.ormlite.dao.Dao; import com.j256.ormlite.stmt.PreparedQuery; import com.j256.ormlite.stmt.QueryBuilder; -public class BusStopActivity extends OrmLiteBaseActivity implements OnCheckedChangeListener, Preferences { +public class BusStopActivity extends OrmLiteBaseActivity implements OnCheckedChangeListener, Preferences, OnItemClickListener { final static String TAG = "BusTimeActivity"; @@ -90,6 +94,9 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme private CheckBox U6RouteRadioButton; private CheckBox U9RouteRadioButton; + private static final int POI_DIALOG_ID = 0; + private POIDialog busDialog; + private HashSet routes = new HashSet(); public void onCreate(Bundle savedInstanceState) { @@ -339,7 +346,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme Log.v(TAG, routes.size() + " routes avalible from this stop"); - HashSet busStops = new HashSet(); + ArrayList busStops = new ArrayList(); for (BusRoute route : routes) { try { @@ -357,7 +364,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme if (busStops.size() == 1) { Intent i = new Intent(this, BusStopActivity.class); - BusStop stop = busStops.iterator().next(); + BusStop stop = (BusStop) busStops.iterator().next(); if (stop == null) { Log.e(TAG, "stop == null"); } @@ -368,7 +375,16 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme i.putExtra("busStopName", stop.description); startActivity(i); } else { - // Show dialog + showDialog(POI_DIALOG_ID); + if (busDialog == null) { + Log.e(TAG, "Very wierd, just tried to launch the favourite's dialog, but its null?"); + return false; + } + + busDialog.setMessage(""); + busDialog.setItems(busStops); + busDialog.setTitle("Choose Bus Stop"); + Log.i(TAG, "Showing dialog"); } @@ -445,4 +461,21 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme } } } + + @Override + protected Dialog onCreateDialog(int id) { + switch (id) { + case POI_DIALOG_ID: + busDialog = new POIDialog(instance); + busDialog.setOnItemClickListener(this); + return busDialog; + } + return null; + } + + @Override + public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) { + // TODO Auto-generated method stub + + } } diff --git a/src/net/cbaines/suma/BusStopDialog.java b/src/net/cbaines/suma/BusStopDialog.java deleted file mode 100644 index 670fc96..0000000 --- a/src/net/cbaines/suma/BusStopDialog.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Southampton University Map App - * Copyright (C) 2011 Christopher Baines - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package net.cbaines.suma; - -import java.sql.SQLException; -import java.util.ArrayList; - -import android.app.Dialog; -import android.content.Context; -import android.util.Log; -import android.view.View; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.AdapterView.OnItemLongClickListener; -import android.widget.ListView; -import android.widget.TextView; - -import com.j256.ormlite.android.apptools.OpenHelperManager; -import com.j256.ormlite.dao.Dao; - -public class BusStopDialog extends Dialog { - - private static final String TAG = "BusStopDialog"; - private ListView listItems; - - private final Context context; - - protected POIArrayAdapter adapter; - - private ArrayList busStops; - - public BusStopDialog(Context context) { - super(context); - - this.context = context; - - setContentView(R.layout.bus_stop_dialog); - setTitle("Favourite Items"); - - busStops = new ArrayList(); - - listItems = (ListView) findViewById(R.id.favouriteListItems); - - refresh(); - } - - public void refresh() { - - DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); - - try { - - if (busStops.size() == 0) { - Log.e(TAG, "Error"); - } else { - listItems.post(new Runnable() { - public void run() { - adapter = new POIArrayAdapter(context, busStops); - - listItems.setVisibility(View.VISIBLE); - listItems.setAdapter(adapter); - - } - }); - - } - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - void setOnItemClickListener(OnItemClickListener item) { - listItems.setOnItemClickListener(item); - - } - - void setOnItemLongClickListener(OnItemLongClickListener item) { - listItems.setOnItemLongClickListener(item); - } - -} diff --git a/src/net/cbaines/suma/FavouriteDialog.java b/src/net/cbaines/suma/FavouriteDialog.java deleted file mode 100644 index ca39574..0000000 --- a/src/net/cbaines/suma/FavouriteDialog.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Southampton University Map App - * Copyright (C) 2011 Christopher Baines - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package net.cbaines.suma; - -import java.sql.SQLException; -import java.util.ArrayList; - - -import android.app.Dialog; -import android.content.Context; -import android.util.Log; -import android.view.View; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.AdapterView.OnItemLongClickListener; -import android.widget.ListView; -import android.widget.TextView; - -import com.j256.ormlite.android.apptools.OpenHelperManager; -import com.j256.ormlite.dao.Dao; - -public class FavouriteDialog extends Dialog { - - private static final String TAG = "FavouriteDialog"; - private ListView listItems; - - private final Context context; - - private final TextView message; - - protected POIArrayAdapter adapter; - - private ArrayList favouriteItems; - - public FavouriteDialog(Context context) { - super(context); - - this.context = context; - - setContentView(R.layout.favourite_dialog); - setTitle("Favourite Items"); - - message = (TextView) findViewById(R.id.favouriteDialogMessage); - - favouriteItems = new ArrayList(); - - listItems = (ListView) findViewById(R.id.favouriteListItems); - - refresh(); - } - - public void refresh() { - - DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); - - try { - - Dao buildingDao = helper.getBuildingDao(); - Dao busStopDao = helper.getBusStopDao(); - - final ArrayList newFavouriteItems = new ArrayList(); - - newFavouriteItems.addAll(buildingDao.queryForEq(POI.FAVOURITE_FIELD_NAME, true)); - newFavouriteItems.addAll(busStopDao.queryForEq(POI.FAVOURITE_FIELD_NAME, true)); - - Log.i(TAG, "There are " + newFavouriteItems.size() + " favourites"); - if (newFavouriteItems.size() == 0) { - Log.i(TAG, "Favourite dialog has no favourites, displaying message"); - message.post(new Runnable() { - public void run() { - message.setText(R.string.favourites_dialog_message); - message.setVisibility(View.VISIBLE); - } - }); - listItems.post(new Runnable() { - public void run() { - listItems.setVisibility(View.GONE); - adapter = null; - favouriteItems.clear(); - } - }); - - } else { - message.post(new Runnable() { - public void run() { - message.setVisibility(View.GONE); - } - }); - - listItems.post(new Runnable() { - public void run() { - favouriteItems = newFavouriteItems; - adapter = new POIArrayAdapter(context, favouriteItems); - - listItems.setVisibility(View.VISIBLE); - listItems.setAdapter(adapter); - - } - }); - - } - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - void setOnItemClickListener(OnItemClickListener item) { - listItems.setOnItemClickListener(item); - - } - - void setOnItemLongClickListener(OnItemLongClickListener item) { - listItems.setOnItemLongClickListener(item); - } - -} diff --git a/src/net/cbaines/suma/POIDialog.java b/src/net/cbaines/suma/POIDialog.java new file mode 100644 index 0000000..8107d06 --- /dev/null +++ b/src/net/cbaines/suma/POIDialog.java @@ -0,0 +1,96 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package net.cbaines.suma; + +import java.util.List; + +import android.app.Dialog; +import android.content.Context; +import android.view.View; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.AdapterView.OnItemLongClickListener; +import android.widget.ListView; +import android.widget.TextView; + +public class POIDialog extends Dialog { + + private static final String TAG = "POIDialog"; + private ListView listItems; + + private final Context context; + + private final TextView message; + + protected POIArrayAdapter adapter; + + public POIDialog(Context context) { + super(context); + + this.context = context; + + setContentView(R.layout.poi_dialog); + + message = (TextView) findViewById(R.id.favouriteDialogMessage); + listItems = (ListView) findViewById(R.id.favouriteListItems); + + } + + void setMessage(final String text) { + message.post(new Runnable() { + public void run() { + if (text == null || text.length() == 0) { + message.setVisibility(View.GONE); + } else { + message.setText(text); + message.setVisibility(View.VISIBLE); + } + } + }); + } + + void setItems(final List items) { + listItems.post(new Runnable() { + public void run() { + if (items != null) { + adapter = new POIArrayAdapter(context, items); + + listItems.setVisibility(View.VISIBLE); + listItems.setAdapter(adapter); + } else { + listItems.setVisibility(View.GONE); + } + } + }); + } + + void setTitle(String title) { + setTitle(title); + } + + void setOnItemClickListener(OnItemClickListener item) { + listItems.setOnItemClickListener(item); + + } + + void setOnItemLongClickListener(OnItemLongClickListener item) { + listItems.setOnItemLongClickListener(item); + } + +} diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index 4bfb3de..3580c60 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -136,7 +136,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity newFavouriteItems = new ArrayList(); + + try { + Dao buildingDao = getHelper().getBuildingDao(); + Dao busStopDao = getHelper().getBusStopDao(); + + newFavouriteItems.addAll(buildingDao.queryForEq(POI.FAVOURITE_FIELD_NAME, true)); + newFavouriteItems.addAll(busStopDao.queryForEq(POI.FAVOURITE_FIELD_NAME, true)); + } catch (SQLException e) { + e.printStackTrace(); + } + + Log.i(TAG, "There are " + newFavouriteItems.size() + " favourites"); + if (newFavouriteItems.size() == 0) { + Log.i(TAG, "Favourite dialog has no favourites, displaying message"); + favDialog.setMessage(getResources().getString(R.string.favourites_dialog_message)); + favDialog.setItems(null); + } else { + favDialog.setMessage(""); + favDialog.setItems(newFavouriteItems); + } + } + @Override public boolean onSearchRequested() { Intent i = new Intent(SouthamptonUniversityMapActivity.this, FindActivity.class); @@ -850,7 +875,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Wed, 8 Feb 2012 16:55:28 +0000 Subject: Bus stop movement is now working, needs more testing though. --- src/net/cbaines/suma/BusStopActivity.java | 33 +++++++++++++++++++++++++++---- src/net/cbaines/suma/POIDialog.java | 4 ---- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index b50e340..b2eff62 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -350,10 +350,14 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme for (BusRoute route : routes) { try { + BusStop tmpStop; if (item.getItemId() == R.id.menu_next_stop) { - busStops.add(route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, 1)); + tmpStop = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, 1); } else { - busStops.add(route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, -1)); + tmpStop = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, -1); + } + if (!busStops.contains(tmpStop)) { + busStops.add(tmpStop); } } catch (SQLException e) { e.printStackTrace(); @@ -474,8 +478,29 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme } @Override - public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) { - // TODO Auto-generated method stub + public void onItemClick(AdapterView parent, View view, int position, long id) { + Log.i(TAG, "OnItemClick pos " + position + " id " + id); + + String poiId = busDialog.adapter.getItemStringId(position); + + Log.i(TAG, "POI " + poiId + " selected"); + + Intent i = new Intent(this, BusStopActivity.class); + try { + busStop = busStopDao.queryForId(poiId); + + if (busStop == null) { + Log.e(TAG, "stop == null"); + } + if (busStop.id == null) { + Log.e(TAG, "stop.id == null"); + } + i.putExtra("busStopID", busStop.id); + i.putExtra("busStopName", busStop.description); + startActivity(i); + } catch (SQLException e) { + e.printStackTrace(); + } } } diff --git a/src/net/cbaines/suma/POIDialog.java b/src/net/cbaines/suma/POIDialog.java index 8107d06..67be966 100644 --- a/src/net/cbaines/suma/POIDialog.java +++ b/src/net/cbaines/suma/POIDialog.java @@ -80,10 +80,6 @@ public class POIDialog extends Dialog { }); } - void setTitle(String title) { - setTitle(title); - } - void setOnItemClickListener(OnItemClickListener item) { listItems.setOnItemClickListener(item); -- cgit v1.2.3 From bb6e47db6fc1152bacf15095e1ea0ef907848b07 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 8 Feb 2012 16:59:30 +0000 Subject: Fixed fav dialog title. --- gen/net/cbaines/suma/R.java | 125 +++++++++++---------- res/values/strings.xml | 2 + .../suma/SouthamptonUniversityMapActivity.java | 1 + 3 files changed, 66 insertions(+), 62 deletions(-) diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index 130b154..27ce28c 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -134,85 +134,86 @@ public final class R { public static final int U9=0x7f07000d; /** About Strings */ - public static final int about=0x7f070033; - public static final int about_android_market=0x7f070040; - public static final int about_android_market_summary=0x7f070041; - public static final int about_copyright=0x7f070036; - public static final int about_copyright_summary=0x7f070037; - public static final int about_data=0x7f07003e; - public static final int about_data_summary=0x7f07003f; - public static final int about_database=0x7f07004a; - public static final int about_database_summary=0x7f07004b; - public static final int about_developer=0x7f07003c; - public static final int about_developer_summary=0x7f07003d; - public static final int about_donate=0x7f07004c; - public static final int about_donate_summary=0x7f07004d; - public static final int about_help_message=0x7f070015; - public static final int about_license=0x7f070038; - public static final int about_license_summary=0x7f070039; - public static final int about_map_data=0x7f070042; - public static final int about_map_data_summary=0x7f070043; - public static final int about_map_icons=0x7f070044; - public static final int about_map_icons_summary=0x7f070045; - public static final int about_map_tiles=0x7f070048; - public static final int about_map_tiles_summary=0x7f070049; + public static final int about=0x7f070034; + public static final int about_android_market=0x7f070041; + public static final int about_android_market_summary=0x7f070042; + public static final int about_copyright=0x7f070037; + public static final int about_copyright_summary=0x7f070038; + public static final int about_data=0x7f07003f; + public static final int about_data_summary=0x7f070040; + public static final int about_database=0x7f07004b; + public static final int about_database_summary=0x7f07004c; + public static final int about_developer=0x7f07003d; + public static final int about_developer_summary=0x7f07003e; + public static final int about_donate=0x7f07004d; + public static final int about_donate_summary=0x7f07004e; + public static final int about_help_message=0x7f070016; + public static final int about_license=0x7f070039; + public static final int about_license_summary=0x7f07003a; + public static final int about_map_data=0x7f070043; + public static final int about_map_data_summary=0x7f070044; + public static final int about_map_icons=0x7f070045; + public static final int about_map_icons_summary=0x7f070046; + public static final int about_map_tiles=0x7f070049; + public static final int about_map_tiles_summary=0x7f07004a; /** About Messages */ - public static final int about_menu_instruction_text=0x7f07002c; - public static final int about_osm_map=0x7f070046; - public static final int about_osm_map_summary=0x7f070047; - public static final int about_project=0x7f07003a; - public static final int about_project_summary=0x7f07003b; - public static final int about_version=0x7f070034; - public static final int about_version_summary=0x7f070035; + public static final int about_menu_instruction_text=0x7f07002d; + public static final int about_osm_map=0x7f070047; + public static final int about_osm_map_summary=0x7f070048; + public static final int about_project=0x7f07003b; + public static final int about_project_summary=0x7f07003c; + public static final int about_version=0x7f070035; + public static final int about_version_summary=0x7f070036; public static final int app_name=0x7f070004; - public static final int bitcoin_error_message=0x7f07001a; + public static final int bitcoin_error_message=0x7f07001b; public static final int building_non_residential=0x7f070007; public static final int building_residential=0x7f070006; - public static final int bustimes_favourite_checkbox_label=0x7f07002d; - public static final int credits_help_message=0x7f070018; - public static final int donate_button=0x7f070019; - public static final int donate_dialog_error_title=0x7f07002f; - public static final int donate_dialog_message=0x7f07002e; - public static final int favourites_dialog_message=0x7f07001c; - public static final int favourites_help_message=0x7f070016; - public static final int find_help_message=0x7f070011; - public static final int findmylocation_help_message=0x7f070013; + public static final int bustimes_favourite_checkbox_label=0x7f07002e; + public static final int credits_help_message=0x7f070019; + public static final int donate_button=0x7f07001a; + public static final int donate_dialog_error_title=0x7f070030; + public static final int donate_dialog_message=0x7f07002f; + public static final int favourites_dialog_message=0x7f07001d; + public static final int favourites_dialog_title=0x7f070010; + public static final int favourites_help_message=0x7f070017; + public static final int find_help_message=0x7f070012; + public static final int findmylocation_help_message=0x7f070014; public static final int legal_message=0x7f070005; - public static final int licence_help_message=0x7f070017; + public static final int licence_help_message=0x7f070018; /** Help Messages */ - public static final int map_help_message=0x7f070010; + public static final int map_help_message=0x7f070011; public static final int menu_about=0x7f07000e; public static final int menu_favourites=0x7f07000f; public static final int menu_find=0x7f070000; public static final int menu_find_my_location=0x7f070003; - public static final int menu_next_stop=0x7f070031; + public static final int menu_next_stop=0x7f070032; public static final int menu_preferences=0x7f070001; - public static final int menu_previous_stop=0x7f070030; - public static final int menu_refresh_stop=0x7f070032; + public static final int menu_previous_stop=0x7f070031; + public static final int menu_refresh_stop=0x7f070033; public static final int menu_view=0x7f070002; public static final int pref_bus_stop=0x7f070008; - public static final int preferences=0x7f07001b; - public static final int preferences_catagory_data=0x7f070028; - public static final int preferences_catagory_live_bus_times=0x7f070021; + public static final int preferences=0x7f07001c; + public static final int preferences_catagory_data=0x7f070029; + public static final int preferences_catagory_live_bus_times=0x7f070022; /** Preferences Messages */ - public static final int preferences_catagory_positioning=0x7f07001d; - public static final int preferences_gps=0x7f07001e; - public static final int preferences_gps_disabled=0x7f070020; - public static final int preferences_gps_enabled=0x7f07001f; - public static final int preferences_help_message=0x7f070012; - public static final int preferences_non_uni_link=0x7f070029; - public static final int preferences_non_uni_link_disabled=0x7f07002b; - public static final int preferences_non_uni_link_enabled=0x7f07002a; - public static final int preferences_non_uni_link_live_bus_times=0x7f070025; - public static final int preferences_non_uni_link_live_bus_times_disabled=0x7f070027; - public static final int preferences_non_uni_link_live_bus_times_enabled=0x7f070026; - public static final int preferences_uni_link_live_bus_times=0x7f070022; - public static final int preferences_uni_link_live_bus_times_disabled=0x7f070024; - public static final int preferences_uni_link_live_bus_times_enabled=0x7f070023; - public static final int view_help_message=0x7f070014; + public static final int preferences_catagory_positioning=0x7f07001e; + public static final int preferences_gps=0x7f07001f; + public static final int preferences_gps_disabled=0x7f070021; + public static final int preferences_gps_enabled=0x7f070020; + public static final int preferences_help_message=0x7f070013; + public static final int preferences_non_uni_link=0x7f07002a; + public static final int preferences_non_uni_link_disabled=0x7f07002c; + public static final int preferences_non_uni_link_enabled=0x7f07002b; + public static final int preferences_non_uni_link_live_bus_times=0x7f070026; + public static final int preferences_non_uni_link_live_bus_times_disabled=0x7f070028; + public static final int preferences_non_uni_link_live_bus_times_enabled=0x7f070027; + public static final int preferences_uni_link_live_bus_times=0x7f070023; + public static final int preferences_uni_link_live_bus_times_disabled=0x7f070025; + public static final int preferences_uni_link_live_bus_times_enabled=0x7f070024; + public static final int view_help_message=0x7f070015; } public static final class xml { public static final int about=0x7f050000; diff --git a/res/values/strings.xml b/res/values/strings.xml index 3bde7e1..40efa7a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -17,6 +17,8 @@ U9 About Favourites + Favourites + You can drag the map to move it, you can use pinch motions to zoom in and out, this can also be done with the buttons at the bottom of the screen. Taping the building markers will show you there full name, and tapping the bus stop markers will show the live times at that stop. Presing and holding a marker, will add the item to the favourites list. diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index 3580c60..a7dd875 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -904,6 +904,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Wed, 8 Feb 2012 17:47:58 +0000 Subject: Messed up commit, tested the bus stop movement, it works :). Begin intergrating more data.... --- assets/data.db | Bin 140288 -> 140288 bytes assets/routes.csv | 52 +- assets/routestops.csv | 2967 ++++++++++++++++++++ src/net/cbaines/suma/BusRoute.java | 2 +- src/net/cbaines/suma/BusStopActivity.java | 5 +- src/net/cbaines/suma/POIDialog.java | 2 +- .../suma/SouthamptonUniversityMapActivity.java | 12 +- 7 files changed, 3021 insertions(+), 19 deletions(-) diff --git a/assets/data.db b/assets/data.db index d5c05ce..353266d 100644 Binary files a/assets/data.db and b/assets/data.db differ diff --git a/assets/routes.csv b/assets/routes.csv index 5f25362..b536ee7 100644 --- a/assets/routes.csv +++ b/assets/routes.csv @@ -1,6 +1,48 @@ -"id","code","label","forward direction","reverse direction" -326,U1,"NOC - Parkway - Eastleigh",C,A +"id","code","label" +427,1,"Southampton - Winchester" +464,1,"City - Weston" +333,10,"Lordshill - City Centre - Thor" +438,10s,"Southampton - Totton - Cadnam" +449,11s,"City-Sholing Loop" +437,12s,"Southampton - Totton - Cadnam" +472,14,"Southampton City Centre - Bitt" +339,16,"Hamble - City" +340,17s,"Lordshill - City - Weston" +376,18,"Thornhill - City - Millbrook" +428,2,"Southampton - Fair Oak" +331,21,"RSH Hospital - City - Nursling" +429,3,"Southampton - Botley" +323,3,"City - Townhill Park" +446,4,"City - Totton" +432,4,"Southampton - Romsey" +424,46,"Southampton - Winchester" +447,5,"Lordshill - City" +421,56,"Southampton - Lymington" +384,6,"Southampton - Lymington" +452,612,"Woolston - Barton Peveril" +448,7,"City-Swaythling" +494,7,"Southampton - Bishops Waltham" +409,72,"Southampton - Gosport" +466,78C,"Southampton - Fareham" +431,8,"Southampton - Hythe" +412,80,"Southampton - Fareham" +480,8A,"City - Hedge End" +341,8s,"Lordshill - City - Midanbury" +434,9,"Southampton - Calshot" +399,9s,"City - Harefield" +433,A,"Eastleigh - Hamble" +357,BSH,"Bitterne Shoppa Hoppa" +455,LINK,"Town Quay - Southampton Centra" +473,N12,"Leisure World - Totton" +462,N16,"City - Hamble" +441,N18,"City - Townhill" +442,N19,"City - Lords Hill" +495,N3,"Soton - Hedge End" +474,S1,"Shirley to Lordshill Centre" +479,S2,"City - Shirley via Tesco" +326,U1,"NOC - Parkway - Eastleigh" 468,U1N,"Leisure World - City Centre -" -329,U2,"Civic Centre - Highfield Campus",C,B -327,U6,"Dock Gate 4 - General Hospital",H,C -354,U9,"Townhill Park - General Hospital" +329,U2,"Civic Centre - Highfield Campu" +327,U6,"Dock Gate 4 - General Hospital" +354,U9,"Townhill Park - General Hospit" +423,X7,"Southampton - Salisbury" diff --git a/assets/routestops.csv b/assets/routestops.csv index 9edd2f4..8f966b1 100644 --- a/assets/routestops.csv +++ b/assets/routestops.csv @@ -1,4 +1,2900 @@ "route-id","seq","stop-id" +427,1,HAA13649 +427,2,SNA13768 +427,3,HA120625 +427,4,SN121021 +427,5,SN12532A +427,6,SN12524D +427,7,SN120522 +427,8,SN120535 +427,9,SN120405 +427,10,SN120401 +427,11,SN120398 +427,12,SN121052 +427,13,SN121053 +427,14,SN120118 +427,15,SN120117 +427,16,SN121007 +427,17,SN121006 +427,18,SN121008 +427,19,HA121017 +427,20,HA100779 +427,21,HA030002 +427,22,HA030107 +427,23,HA030013 +427,24,HA030015 +427,25,HA030067 +427,26,HA030071 +427,27,HA030181 +427,28,HA030180 +427,29,HA110433 +427,30,HA110430 +427,31,HA110428 +427,32,HA110427 +427,33,HA110424 +427,34,HA110423 +427,35,HA110420 +427,36,HA110419 +427,37,HA110041 +427,38,HA110043 +427,39,HA110044 +427,40,HA110046 +427,41,HA110049 +427,42,HA110050 +427,43,HA110100 +427,44,HA110111 +427,45,HA110113 +427,46,HA110058 +427,47,HA110103 +427,48,HA110125 +427,49,HA110009 +427,50,HA110058 +427,51,HA110066 +427,52,HA110112 +427,53,HA110051 +427,54,HA110048 +427,55,HA110047 +427,56,HA110045 +427,57,HA110042 +427,58,HA110040 +427,59,HA110038 +427,60,HA110418 +427,61,HA110421 +427,62,HA110422 +427,63,HA110425 +427,64,HA110426 +427,65,HA110429 +427,66,HA110431 +427,67,HA110432 +427,68,HA030179 +427,69,HA030072 +427,70,HA030066 +427,71,HA030068 +427,72,HA030069 +427,73,HA030014 +427,74,HA030012 +427,75,HA030108 +427,76,HA030001 +427,77,HA100778 +427,78,HA100780 +427,79,SN121009 +427,80,SN121005 +427,81,SN121010 +427,82,SN120116 +427,83,SN120115 +427,84,SN120119 +427,85,SN121054 +427,86,SN121055 +427,87,SN120400 +427,88,SN120404 +427,89,SN120406 +427,90,SN120536 +427,91,HAA40520 +464,1,SN12619D +464,2,SNA09464 +464,3,HA120626 +464,4,HA120630 +464,5,HA120638 +464,6,HA120641 +464,7,SN120652 +464,8,SN12658A +464,9,SN120661 +464,10,SN120712 +464,11,HAA13663 +464,12,HAA13662 +464,13,HAA13659 +464,14,HAA13658 +464,15,SN120717 +464,16,SN120719 +464,17,HA120721 +464,18,HAA13653 +464,19,HA120746 +464,20,HAA13654 +464,21,SN120747 +464,22,SN120752 +464,23,SN120754 +464,24,SN120755 +464,25,SN120756 +464,26,SN120757 +464,27,SN121020 +464,28,SN120753 +464,29,SN120751 +464,30,SN120758 +464,31,SN122001 +464,32,SN122003 +464,33,HA030525 +464,34,HA030527 +464,35,HA030529 +464,36,HA030530 +464,37,HA030532 +464,38,HA030535 +464,39,HA030536 +464,40,HA030539 +464,41,HA030541 +464,42,HA030542 +464,43,HA030523 +464,44,HA030522 +464,45,HA030519 +464,46,HA030516 +464,47,HA030501 +464,48,HA030505 +464,49,HA030507 +464,50,HA030509 +464,51,HA030511 +464,52,HA030512 +464,53,SN120752 +464,54,SN120754 +464,55,SN120755 +464,56,SN120756 +464,57,SN120757 +464,58,SN121020 +464,59,SN120753 +464,60,SN120751 +464,61,SN120748 +464,62,HAA13652 +464,63,HA120720 +464,64,HAA13655 +464,65,HAA13657 +464,66,HAA13660 +464,67,HAA13661 +464,68,HAA13664 +464,69,SN120713 +464,70,SN120718 +464,71,SN120711 +464,72,SN120660 +464,73,SN120659 +464,74,SN120653 +464,75,HA120642 +464,76,SN120635 +464,77,HA120633 +464,78,HA120621 +464,79,HA120625 +464,80,HAA13647 +464,81,HAA13371 +333,1,SN120467 +333,2,HA120465 +333,3,HA120466 +333,4,SN120468 +333,5,SN120470 +333,6,SN120472 +333,7,SN120473 +333,8,SN120792 +333,9,SN120789 +333,10,SN120778 +333,11,HA120777 +333,12,HA120611 +333,13,HA120612 +333,14,SN120614 +333,15,SN120607 +333,16,SN120604 +333,17,SN120603 +333,18,SN120600 +333,19,SN120598 +333,20,SN120962 +333,21,SN120963 +333,22,SN120965 +333,23,SN120602 +333,24,SN120699 +333,25,SN120694 +333,26,SN120692 +333,27,SN120687 +333,28,SN120690 +333,29,SN120964 +333,30,SN120764 +333,31,SN120678 +333,32,SN120726 +333,33,SNA09185 +333,34,SN120665 +333,35,SN120659 +333,36,SN120653 +333,37,HA120642 +333,38,SN120635 +333,39,HA120633 +333,40,SN120627 +333,41,SN120622 +333,42,HAA13371 +333,43,SN12617B +333,44,SN12441A +333,45,SN12518A +333,46,SN120516 +333,47,SN120501 +333,48,SN120498 +333,49,SN120380 +333,50,SN120377 +333,51,SN120371 +333,52,SN12368A +333,53,SN120217 +333,54,SN120214 +333,55,SN120211 +333,56,SN120210 +333,57,SN120080 +333,58,SN120986 +333,59,SN120979 +333,60,SN120085 +333,61,SN120091 +333,62,SN120090 +333,63,HAA13388 +333,64,HAA13389 +333,65,SN120010 +333,66,SN120009 +333,67,SN120047 +333,68,SN120088 +333,69,SN120071 +333,70,SN120070 +333,71,SN120066 +333,72,SN120061 +333,73,SN120049 +333,74,SN120045 +333,75,SN120045 +333,76,SN120008 +333,77,SN120013 +333,78,SN120011 +333,79,SN120047 +333,80,SN120048 +333,81,SN120063 +333,82,SN120069 +333,83,SN120065 +333,84,SN120087 +333,85,SN120089 +333,86,SN120014 +333,87,SN120092 +333,88,SN120086 +333,89,SN120083 +333,90,SN120102 +333,91,SN120985 +333,92,SN120081 +333,93,SN120209 +333,94,SN120213 +333,95,SN120216 +333,96,SN120367 +333,97,SN120372 +333,98,SN120376 +333,99,SN12367B +333,100,SN120381 +333,101,SN120496 +333,102,SN120499 +333,103,SN120515 +333,104,SN120519 +333,105,SN120523 +333,106,SN12532B +333,107,SN12619E +333,108,SN120623 +333,109,SN120632 +333,110,HA120638 +333,111,HA120641 +333,112,SN120652 +333,113,SN12658A +333,114,SN120664 +333,115,SN120710 +333,116,SN120676 +333,117,SN120677 +333,118,SN120689 +333,119,SN120682 +333,120,SN120966 +333,121,SN120967 +333,122,SN120961 +333,123,SN120684 +333,124,HAA13665 +333,125,SN120693 +333,126,SN120698 +333,127,SNA19479 +333,128,SN120599 +333,129,SN120597 +333,130,SN120605 +333,131,SN120606 +333,132,SN120608 +333,133,SN120615 +333,134,HA120613 +333,135,HA120610 +333,136,HA120776 +333,137,SN120779 +333,138,SN120780 +333,139,SN120790 +333,140,SN120460 +333,141,SN120471 +333,142,SN120469 +333,143,HA120465 +333,144,HA120462 +333,145,SN120467 +438,1,HAA13582 +438,2,SN120553 +438,3,SN121022 +438,4,SN120518 +438,5,SN120516 +438,6,SN120503 +438,7,SN12493A +438,8,HA120483 +438,9,HA121024 +438,10,SN121027 +438,11,SN120841 +438,12,SN120842 +438,13,SN120843 +438,14,HA080031 +438,15,HA080043 +438,16,HA080103 +438,17,HA080115 +438,18,HA080121 +438,19,HA080135 +438,20,HA080093 +438,21,HA080052 +438,22,HA080069 +438,23,HA080075 +438,24,HA080090 +438,25,HA080091 +438,26,HA080074 +438,27,HA080092 +438,28,HA080134 +438,29,HA080120 +438,30,HA080101 +438,31,HA080051 +438,32,HA080068 +438,33,HA080102 +438,34,HA080044 +438,35,HA080030 +438,36,HA122972 +438,37,SN120838 +438,38,SN120839 +438,39,SN120840 +438,40,SN121026 +438,41,SN121025 +438,42,HA120481 +438,43,HA120482 +438,44,SN120494 +438,45,SN120495 +438,46,SNA09017 +438,47,SN120515 +438,48,SN120519 +438,49,SNA09341 +449,1,SN12617A +449,2,SN12544B +449,3,SN120548 +449,4,SN120558 +449,5,SN12550B +449,6,HA120416 +449,7,HA120419 +449,8,SN120870 +449,9,SN120871 +449,10,SN12921A +449,11,SN120575 +449,12,SN120579 +449,13,SN120594 +449,14,SN120597 +449,15,SN120601 +449,16,SN120700 +449,17,SN120703 +449,18,SN120705 +449,19,SN120706 +449,20,SN120696 +449,21,SN120912 +449,22,SN120814 +449,23,SN120818 +449,24,SN120821 +449,25,SN120823 +449,26,SN120825 +449,27,SN120806 +449,28,SN120827 +449,29,SN120829 +449,30,SN120736 +449,31,SN120740 +449,32,SN120732 +449,33,SN120730 +449,34,SN120726 +449,35,SNA09185 +449,36,SN120665 +449,37,SN120659 +449,38,SN120653 +449,39,HA120642 +449,40,SN120635 +449,41,HA120633 +449,42,HA120621 +449,43,HA120625 +449,44,HAA13647 +449,45,HAA13371 +449,46,SN12616C +449,47,SNA09464 +449,48,HA120626 +449,49,HA120630 +449,50,HA120638 +449,51,HA120641 +449,52,SN120652 +449,53,SN12658B +449,54,SN120664 +449,55,SN120710 +449,56,SN120729 +449,57,SN120731 +449,58,SN120735 +449,59,SN120739 +449,60,SN120695 +449,61,SN120697 +449,62,SN120844 +449,63,SN120826 +449,64,SN120824 +449,65,SN120822 +449,66,SN120820 +449,67,SN120819 +449,68,SN120828 +449,69,SN120345 +449,70,SN120704 +449,71,SN120701 +449,72,SN120598 +449,73,SN120596 +449,74,SN120595 +449,75,SN120578 +449,76,SN120576 +449,77,SNA90798 +449,78,SN120431 +449,79,HA120420 +449,80,HA120418 +449,81,HA120417 +449,82,SN120551 +449,83,SN120559 +449,84,SN120547 +449,85,SN120545 +449,86,SN120533 +449,87,SN12532B +449,88,SN12617A +437,1,HAA13582 +437,2,SN120553 +437,3,SN121022 +437,4,SN120518 +437,5,SN120516 +437,6,SN120503 +437,7,SN12493A +437,8,HA120483 +437,9,HA121024 +437,10,SN121027 +437,11,SN120841 +437,12,SN120842 +437,13,SN120843 +437,14,HA080031 +437,15,HA080029 +437,16,HA080019 +437,17,HA080057 +437,18,HA080057 +437,19,HA080020 +437,20,HA080023 +437,21,HA080030 +437,22,HA122972 +437,23,SN120838 +437,24,SN120839 +437,25,SN120840 +437,26,SN121026 +437,27,SN121025 +437,28,HA120481 +437,29,HA120482 +437,30,SN120494 +437,31,SN120495 +437,32,SNA09017 +437,33,SN120515 +437,34,SN120519 +437,35,SNA09341 +472,1,HAA13582 +472,2,SN120527 +472,3,SN120522 +472,4,SN120535 +472,5,SN120405 +472,6,SN120401 +472,7,HAA13377 +472,8,HAA13374 +472,9,HAA13375 +472,10,SN120276 +472,11,SN12272A +472,12,SN120271 +472,13,SN120265 +472,14,SN120263 +472,15,SN120109 +472,16,SNA19495 +472,17,SN120121 +472,18,SN120127 +472,19,SN120900 +472,20,SN120125 +472,21,SN120123 +472,22,SN120130 +472,23,SN120139 +472,24,SN120137 +472,25,SN120144 +472,26,SN120146 +472,27,SN120151 +472,28,SN120160 +472,29,HAA13650 +472,30,SN120162 +472,31,SN120040 +472,32,SN120165 +472,33,SN120795 +472,34,HA120794 +472,35,HA030391 +472,36,HA030451 +472,37,HA030453 +472,38,HA120786 +472,39,HA030456 +472,40,HA120324 +472,41,SNA19473 +472,42,SN120315 +472,43,SNA19483 +472,44,SNA19472 +472,45,SN120435 +472,46,SNA19773 +472,47,SN120871 +472,48,SN12921A +472,49,SN12921A +472,50,SN120450 +472,51,SN120447 +472,52,SNA09593 +472,53,SN120316 +472,54,HA120322 +472,55,HA120323 +472,56,HA030457 +472,57,HA030454 +472,58,HA030452 +472,59,HA030450 +472,60,HA120796 +472,61,SN120797 +472,62,SNA90808 +472,63,SN120793 +472,64,SN120791 +472,65,SN120163 +472,66,HAA13651 +472,67,SNA19780 +472,68,SN120153 +472,69,SN120150 +472,70,SN120147 +472,71,SN120145 +472,72,SN120140 +472,73,SN120129 +472,74,SN120124 +472,75,SN120126 +472,76,SN120128 +472,77,SN120120 +472,78,SN120108 +472,79,SN120261 +472,80,SN120264 +472,81,SN120270 +472,82,SN12275A +472,83,SN120278 +472,84,HAA13376 +472,85,HAA13373 +472,86,SNA09201 +472,87,SN120400 +472,88,SN120404 +472,89,SN120406 +472,90,SN120536 +472,91,SNA40402 +472,92,HAA13583 +339,1,SN120891 +339,2,SNA90773 +339,3,SN12532B +339,4,SN120525 +339,5,SN12617A +339,6,SN120980 +339,7,SNA90830 +339,8,SNA09464 +339,9,HA120626 +339,10,HA120630 +339,11,HA120638 +339,12,HA120641 +339,13,SN120652 +339,14,SNA19721 +339,15,SN12658B +339,16,SN120661 +339,17,SN120712 +339,18,SN120717 +339,19,SN120719 +339,20,HA120721 +339,21,HAA13653 +339,22,SN120664 +339,23,SN120710 +339,24,SN120729 +339,25,SN120731 +339,26,SN120737 +339,27,SN120741 +339,28,SN122003 +339,29,HA030525 +339,30,HA030527 +339,31,HA030529 +339,32,HA030530 +339,33,HA030532 +339,34,SNA09576 +339,35,HA030535 +339,36,HA030536 +339,37,HA030539 +339,38,HA030541 +339,39,HA030542 +339,40,HA030523 +339,41,HA030522 +339,42,HA030519 +339,43,HA030516 +339,44,HAA19442 +339,45,HA030501 +339,46,HAA19444 +339,47,HA030505 +339,48,HA030507 +339,49,HA030509 +339,50,HA030511 +339,51,HA030512 +339,52,HA030512 +339,53,HA030510 +339,54,HA030508 +339,55,HA030506 +339,56,HA030504 +339,57,HA030502 +339,58,HA030500 +339,59,HAA19443 +339,60,HAA09198 +339,61,HA030517 +339,62,HA030518 +339,63,HA030521 +339,64,HAA09206 +339,65,HAA09202 +339,66,HA030540 +339,67,HA030538 +339,68,HA030537 +339,69,HA030534 +339,70,HA030533 +339,71,HA030531 +339,72,HA030528 +339,73,HA030526 +339,74,HA030524 +339,75,HA030493 +339,76,HA030494 +339,77,SN121035 +339,78,SN120827 +339,79,SN120829 +339,80,SN120739 +339,81,SN120695 +339,82,SN120686 +339,83,SN120682 +339,84,SN120590 +339,85,SN122002 +339,86,SN120742 +339,87,SN120738 +339,88,SN120732 +339,89,SN120730 +339,90,SN120726 +339,91,SNA09185 +339,92,SNA09577 +339,93,HAA13652 +339,94,HA120720 +339,95,SN120718 +339,96,SN120713 +339,97,SN120711 +339,98,SN120660 +339,99,SN120659 +339,100,SN120653 +339,101,SN120665 +339,102,HA120642 +339,103,SN120635 +339,104,HA120633 +339,105,HA120621 +339,106,HA120625 +339,107,SNA19739 +339,108,SNA19722 +339,109,SNA90831 +339,110,SN12617A +339,111,HAA13647 +339,112,SN12617B +339,113,SN12524B +339,114,SN120522 +339,115,SN120535 +339,116,SN120405 +339,117,SN120401 +339,118,SN120398 +339,119,SN121052 +339,120,SN121053 +339,121,SN120121 +339,122,SN120127 +339,123,SN120131 +339,124,SN120139 +339,125,SN120137 +339,126,SN120141 +339,127,SN120142 +339,128,SN120031 +339,129,HAA13387 +340,1,HAA13371 +340,2,SN12617B +340,3,SN12441B +340,4,SN12518A +340,5,SN120516 +340,6,SN120501 +340,7,SN120498 +340,8,SNA09572 +340,9,SN120380 +340,10,SN120377 +340,11,SN120371 +340,12,SN12370A +340,13,SN120361 +340,14,SN120355 +340,15,SN120350 +340,16,SN120349 +340,17,SN120347 +340,18,SN120339 +340,19,SN120335 +340,20,SN120181 +340,21,SN120178 +340,22,SN120174 +340,23,SN120953 +340,24,HAA91092 +340,25,SN120041 +340,26,SN120052 +340,27,SN120054 +340,28,SN120056 +340,29,SN120057 +340,30,SN120049 +340,31,SN120045 +340,32,SN120175 +340,33,SN120182 +340,34,SN120185 +340,35,SN120186 +340,36,SN120006 +340,37,SN120188 +340,38,SN120194 +340,39,SN120988 +340,40,SN120986 +340,41,SN120979 +340,42,SN120085 +340,43,SN120091 +340,44,SN120090 +340,45,HAA13388 +340,46,HAA13389 +340,47,SN120010 +340,48,SN120009 +340,49,SN120046 +340,50,SN120046 +340,51,SN120048 +340,52,SN120055 +340,53,SN120059 +340,54,SN120042 +340,55,SN120053 +340,56,SN120045 +340,57,SN120008 +340,58,SN120011 +340,59,SN120013 +340,60,SN120014 +340,61,SN120089 +340,62,SN120092 +340,63,SN120086 +340,64,SN120083 +340,65,SN120102 +340,66,SN120985 +340,67,SN120989 +340,68,SN120188 +340,69,SN120007 +340,70,SN120187 +340,71,SN120184 +340,72,SN120183 +340,73,SN120954 +340,74,HAA91092 +340,75,SN120177 +340,76,SN120179 +340,77,SN120180 +340,78,SN120334 +340,79,SN120338 +340,80,SN120346 +340,81,SN120348 +340,82,SN120351 +340,83,SN120360 +340,84,SN120362 +340,85,SN12369A +340,86,SN120372 +340,87,SN120376 +340,88,SN12367B +340,89,SN120381 +340,90,SN120496 +340,91,SN120499 +340,92,SN120515 +340,93,SN120519 +340,94,HAA13583 +340,95,HAA13371 +376,1,SN120183 +376,2,SN120177 +376,3,SN120179 +376,4,SN120180 +376,5,SN120334 +376,6,SN121066 +376,7,SN121068 +376,8,SN121067 +376,9,SN121041 +376,10,SN121038 +376,11,SN121037 +376,12,SN120216 +376,13,SN12367A +376,14,SN120372 +376,15,SN120376 +376,16,SN12367B +376,17,SN120381 +376,18,SN120496 +376,19,SN120499 +376,20,SN120515 +376,21,SN120519 +376,22,SN120523 +376,23,SN12532B +376,24,SN121069 +376,25,SNA19559 +376,26,SN12544A +376,27,SN120548 +376,28,SN120558 +376,29,SN12550C +376,30,HA120416 +376,31,HA120419 +376,32,SN12426B +376,33,SN120870 +376,34,SN120871 +376,35,SN12921C +376,36,SN120575 +376,37,SN120579 +376,38,SN120594 +376,39,SN120597 +376,40,SN120599 +376,41,SN120605 +376,42,SN120606 +376,43,SN120608 +376,44,SN120709 +376,45,SN120707 +376,46,SNA09412 +376,47,SN121059 +376,48,SN121059 +376,49,SN120708 +376,50,SN120609 +376,51,SN120607 +376,52,SN120604 +376,53,SN120603 +376,54,SN120600 +376,55,SN120598 +376,56,SN120596 +376,57,SN120595 +376,58,SN120578 +376,59,SN120576 +376,60,SNA90798 +376,61,SN120431 +376,62,HA120420 +376,63,HA120418 +376,64,HA120417 +376,65,SN120551 +376,66,SNA09318 +376,67,SN120547 +376,68,SN120766 +376,69,SN120899 +376,70,SN12618C +376,71,SN12617B +376,72,SN12441B +376,73,SN12518A +376,74,SN120516 +376,75,SN120501 +376,76,SN120498 +376,77,SN120380 +376,78,SN120377 +376,79,SN120371 +376,80,SN12368B +376,81,SN120217 +376,82,SN121040 +376,83,SN121036 +376,84,SN121039 +376,85,SN120187 +376,86,SN120184 +376,87,SN120183 +376,88,SN120177 +376,89,SN120179 +376,90,SN120180 +428,1,HAA13649 +428,2,SNA13768 +428,3,HA120625 +428,4,HAA13647 +428,5,SN12619A +428,6,SN12531B +428,7,SN12524D +428,8,SN120522 +428,9,SN120535 +428,10,SN120405 +428,11,SN120403 +428,12,SN120407 +428,13,SN120413 +428,14,SN120279 +428,15,SN12272A +428,16,SN120284 +428,17,SN120289 +428,18,SN120159 +428,19,SN120157 +428,20,SN120153 +428,21,SN120150 +428,22,SN120148 +428,23,SN121049 +428,24,SN121047 +428,25,HA030186 +428,26,HA030188 +428,27,HA030191 +428,28,HA030124 +428,29,HA030122 +428,30,HA030134 +428,31,HA030132 +428,32,HA030130 +428,33,HA030128 +428,34,HA030219 +428,35,HA030221 +428,36,HA030223 +428,37,HA030225 +428,38,HA030204 +428,39,HA030206 +428,40,HA030209 +428,41,HA030234 +428,42,HA030236 +428,43,HA030238 +428,44,HA030240 +428,45,HA030247 +428,46,HA030250 +428,47,HA030252 +428,48,HA030254 +428,49,HA030260 +428,50,HA030261 +428,51,HA030263 +428,52,HA030265 +428,53,HA030267 +428,54,HA030269 +428,55,HA030272 +428,56,HA030273 +428,57,HA030283 +428,58,HA030289 +428,59,HA030289 +428,60,HA030292 +428,61,HA030268 +428,62,HA030266 +428,63,HA030264 +428,64,HA030262 +428,65,HA030259 +428,66,HA030253 +428,67,HA030251 +428,68,HA030249 +428,69,HA030248 +428,70,HA030239 +428,71,HA030237 +428,72,HA030235 +428,73,HA030233 +428,74,HA030208 +428,75,HA030205 +428,76,HA030224 +428,77,HA030222 +428,78,HA030220 +428,79,HA030218 +428,80,HA030217 +428,81,HA030131 +428,82,HA030133 +428,83,HA030123 +428,84,HA030125 +428,85,HA030190 +428,86,HA030189 +428,87,HA030187 +428,88,SN121051 +428,89,SN121050 +428,90,SN121048 +428,91,SN120149 +428,92,SN120151 +428,93,HA120154 +428,94,SN120158 +428,95,SN120287 +428,96,SN120300 +428,97,SN120285 +428,98,SN12275A +428,99,SN120415 +428,100,SN120412 +428,101,SN120408 +428,102,SN120404 +428,103,SN120406 +428,104,SN120536 +428,105,HAA40520 +331,1,SN120004 +331,2,SN120542 +331,3,SN120766 +331,4,SN120899 +331,5,SN12617C +331,6,SN12531A +331,7,SN12441B +331,8,SNA09196 +331,9,SN120516 +331,10,SN120503 +331,11,SN12493A +331,12,HA120483 +331,13,SN120477 +331,14,SN120357 +331,15,SN120363 +331,16,SN120383 +331,17,SN120365 +331,18,SN12369B +331,19,SN12368A +331,20,SNA09200 +331,21,SN120226 +331,22,SN120367 +331,23,SN120372 +331,24,SN120374 +331,25,SN120373 +331,26,SN120238 +331,27,SN120236 +331,28,SN120234 +331,29,SN120096 +331,30,SN120094 +331,31,SN120P11 +331,32,SN120221 +331,33,SN120225 +331,34,SN120082 +331,35,SN120085 +331,36,SN120091 +331,37,SN120P12 +331,38,SN120P13 +331,39,SNA09237 +331,40,SN120P14 +331,41,SNA09238 +331,42,HAA13389 +331,43,SN120010 +331,44,SN120009 +331,45,SN120047 +331,46,SN120050 +331,47,SN120051 +331,48,SN120769 +331,49,HAA13383 +331,50,HAA13385 +331,51,HA120767 +331,52,HAA13385 +331,53,HA120767 +331,54,SN122769 +331,55,SN121042 +331,56,SN121043 +331,57,SN100810 +331,58,SN120017 +331,59,HA120018 +331,60,SN120019 +331,61,SN120023 +331,62,SN120024 +331,63,SN120025 +331,64,SN120026 +331,65,SNA40503 +331,66,SN120045 +331,67,SN120043 +331,68,SN120008 +331,69,SN120011 +331,70,SN120013 +331,71,SNA09242 +331,72,SNA09241 +331,73,SNA09240 +331,74,SNA09239 +331,75,SNA09236 +331,76,SN120092 +331,77,SN120086 +331,78,SN120083 +331,79,SN120084 +331,80,SN120222 +331,81,SN120223 +331,82,SN120224 +331,83,SN120227 +331,84,SN120220 +331,85,SN120095 +331,86,SN120240 +331,87,SN120235 +331,88,SN120237 +331,89,SN120239 +331,90,SN120378 +331,91,SN120375 +331,92,SN120371 +331,93,SN12370A +331,94,SN12367A +331,95,SN120366 +331,96,SN120382 +331,97,SN120364 +331,98,SN120358 +331,99,SN120479 +331,100,HA120481 +331,101,HA120482 +331,102,SN120494 +331,103,SN120495 +331,104,SNA09017 +331,105,SN120515 +331,106,SN120519 +331,107,SN120523 +331,108,SN12532B +331,109,SN12616E +331,110,SN120643 +331,111,SN120543 +331,112,SN120004 +429,1,SN121003 +429,2,SNA19559 +429,3,SN12544A +429,4,SN120548 +429,5,SN120558 +429,6,SN12550C +429,7,HA120416 +429,8,HA120419 +429,9,SN12426B +429,10,SN120870 +429,11,SN120871 +429,12,SN12921C +429,13,SN120457 +429,14,SN120459 +429,15,SN120792 +429,16,SN120789 +429,17,SN120778 +429,18,HA121057 +429,19,HA030331 +429,20,HA030337 +429,21,HA030309 +429,22,HA030419 +429,23,HA030439 +429,24,HA110571 +429,25,HA110572 +429,26,HA030438 +429,27,HA030437 +429,28,HA030442 +429,29,HA030443 +429,30,HA030445 +429,31,HA030426 +429,32,HA030423 +429,33,HA030422 +429,34,HA030420 +429,35,HA030418 +429,36,HA030416 +429,37,HA030413 +429,38,HA030402 +429,39,HA030404 +429,40,HA030405 +429,41,HA030306 +429,42,HA030310 +429,43,HA030311 +429,44,HA030313 +429,45,HA030337 +429,46,HA030315 +429,47,HA030336 +429,48,HA121056 +429,49,SN120779 +429,50,SN120780 +429,51,SN120790 +429,52,SN120577 +429,53,SN120474 +429,54,SN120576 +429,55,SNA90798 +429,56,SN120431 +429,57,HA120420 +429,58,HA120418 +429,59,HA120417 +429,60,SN120551 +429,61,SNA09318 +429,62,SN120547 +429,63,HAA40520 +429,64,HAA13582 +429,65,SN121022 +429,66,SN120522 +429,67,SN120535 +429,68,SN120405 +429,69,SN120402 +429,70,SN120891 +323,1,SN12616D +323,2,SN12531B +323,3,SN12524B +323,4,SN120539 +323,5,SN120537 +323,6,SN120409 +323,7,SN120413 +323,8,SN120279 +323,9,SN120273 +323,10,SN120302 +323,11,HA120304 +323,12,HA120306 +323,13,SN120308 +323,14,SN120311 +323,15,SN120312 +323,16,SN120292 +323,17,SN120291 +323,18,SN120775 +323,19,SN120774 +323,20,SN120171 +323,21,SN120171 +323,22,SN120319 +323,23,HA120322 +323,24,HA120323 +323,25,SN120443 +323,26,SN120438 +323,27,SN120316 +323,28,SN120314 +323,29,SN120297 +323,30,SN120290 +323,31,SN120293 +323,32,SN120295 +323,33,SN120313 +323,34,SN120296 +323,35,SN120294 +323,36,SN120310 +323,37,HA120307 +323,38,HA120305 +323,39,HA120303 +323,40,SN12275A +323,41,SN120415 +323,42,SN120412 +323,43,SN120411 +323,44,SN120410 +323,45,SN120538 +323,46,SN120540 +323,47,SN120881 +323,48,SN120525 +323,49,SN12616D +446,1,SN12618A +446,2,SN12441B +446,3,SNA09196 +446,4,SN120951 +446,5,SN120506 +446,6,SN120392 +446,7,SN120389 +446,8,SNA09195 +446,9,SN120248 +446,10,SN120246 +446,11,SN120242 +446,12,SN120100 +446,13,SN120096 +446,14,SN120094 +446,15,SN120092 +446,16,SN120086 +446,17,SN120083 +446,18,SN120084 +446,19,SN120222 +446,20,SN120219 +446,21,SN120213 +446,22,SN120216 +446,23,SN12367A +446,24,SN12370A +446,25,SN120361 +446,26,SN120355 +446,27,SNA40406 +446,28,SN120350 +446,29,SN120349 +446,30,SN120347 +446,31,SN120339 +446,32,SN120340 +446,33,SN120841 +446,34,SN120842 +446,35,SN120843 +446,36,HA080032 +446,37,HA080031 +446,38,HA080034 +446,39,HA080034 +446,40,HA080030 +446,41,HA080033 +446,42,HA122972 +446,43,SN120838 +446,44,SN120839 +446,45,SN120840 +446,46,SN120341 +446,47,SN120338 +446,48,SN120346 +446,49,SN120348 +446,50,SN120351 +446,51,SNA40406 +446,52,SN120360 +446,53,SN120362 +446,54,SN12369B +446,55,SN12368B +446,56,SN120217 +446,57,SN120214 +446,58,SNA09197 +446,59,SN120218 +446,60,SN120221 +446,61,SN120082 +446,62,SN120085 +446,63,SN120091 +446,64,SN120093 +446,65,SN120095 +446,66,SN120099 +446,67,SN120243 +446,68,SN120245 +446,69,SN120247 +446,70,SN120388 +446,71,SN120391 +446,72,SN120394 +446,73,SN120502 +446,74,SN120950 +446,75,SN120519 +446,76,SN120523 +446,77,SN12532B +446,78,SN12618A +432,1,SN12618C +432,2,SN12617B +432,3,SN12441A +432,4,SN12518A +432,5,SN120516 +432,6,SN120501 +432,7,SN120498 +432,8,SN120380 +432,9,SN120377 +432,10,SN120371 +432,11,SN12368B +432,12,SN120217 +432,13,SN120207 +432,14,SN120204 +432,15,SN121045 +432,16,SN121044 +432,17,SNA09323 +432,18,SN120056 +432,19,SN120057 +432,20,SN120049 +432,21,SN120050 +432,22,SN120051 +432,23,SN100809 +432,24,HA100808 +432,25,HA100794 +432,26,HA100783 +432,27,HA100239 +432,28,HA100220 +432,29,HA100220 +432,30,HA100240 +432,31,HA100784 +432,32,HA100793 +432,33,HA100807 +432,34,SN121042 +432,35,SN121043 +432,36,SN120043 +432,37,SN120048 +432,38,SN120059 +432,39,SN121046 +432,40,SN120062 +432,41,SN120196 +432,42,SN120203 +432,43,SN120208 +432,44,SN120216 +432,45,SN120367 +432,46,SN120372 +432,47,SN120376 +432,48,SN12367B +432,49,SN120381 +432,50,SN120496 +432,51,SN120499 +432,52,SN120515 +432,53,SN120519 +432,54,SN12619A +424,1,SN12618C +424,2,SN12617B +424,3,SN12441A +424,4,SNA09196 +424,5,SN120516 +424,6,SN120501 +424,7,SN120498 +424,8,SN120380 +424,9,SN120377 +424,10,SN120371 +424,11,SN12368B +424,12,SN120217 +424,13,SN120214 +424,14,SNA09197 +424,15,SN120218 +424,16,SN120221 +424,17,SN120082 +424,18,SN120102 +424,19,SN120985 +424,20,SN120981 +424,21,SN120061 +424,22,SN120049 +424,23,SN120045 +424,24,SNA40502 +424,25,SNA40501 +424,26,HAA19700 +424,27,SN120050 +424,28,SN120051 +424,29,SN100809 +424,30,HA100808 +424,31,HA100805 +424,32,HA100804 +424,33,HAA09360 +424,34,HAA10105 +424,35,HAA09361 +424,36,HA100798 +424,37,HA100794 +424,38,HA100796 +424,39,HA100763 +424,40,HA100771 +424,41,HA030001 +424,42,HA100010 +424,43,HAA09248 +424,44,HA030039 +424,45,HA030047 +424,46,HAA19695 +424,47,HA110245 +424,48,HAA19705 +424,49,HA110252 +424,50,HA110247 +424,51,HA110126 +424,52,HAA09127 +424,53,HA110058 +424,54,HA110058 +424,55,HA110108 +424,56,HA110125 +424,57,HA110251 +424,58,HA100026 +424,59,HAA19694 +424,60,HA030046 +424,61,HA030040 +424,62,HA100009 +424,63,HA100771 +424,64,HA100780 +424,65,SN121009 +424,66,SN121005 +424,67,SN121010 +424,68,SN120116 +424,69,SN120115 +424,70,SN120119 +424,71,SN121054 +424,72,SN121055 +424,73,SN120400 +424,74,SN120404 +424,75,SN120406 +424,76,HAA09248 +424,77,HA030002 +424,78,HA100770 +424,79,HA100762 +424,80,HA100793 +424,81,HA100795 +424,82,HAA19701 +424,83,SN122019 +424,84,SNA40503 +424,85,HA100797 +424,86,HAA09362 +424,87,HAA10104 +424,88,HAA09363 +424,89,HA100804 +424,90,HA100806 +424,91,HA100807 +424,92,SN121042 +424,93,SN121043 +424,94,SN120043 +424,95,SN120048 +424,96,SN120047 +424,97,SN120063 +424,98,SN120983 +424,99,SN120081 +424,100,SN120209 +424,101,SNA09197 +424,102,SN120218 +424,103,SN120221 +424,104,SN120082 +424,105,SN120986 +424,106,SN120979 +424,107,SN120084 +424,108,SN120222 +424,109,SN120219 +424,110,SN120213 +424,111,SN120216 +424,112,SN120367 +424,113,SN120372 +424,114,SN120376 +424,115,SN12367B +424,116,SN120381 +424,117,SN120496 +424,118,SN120499 +424,119,SN120515 +424,120,SN120519 +424,121,SN120523 +424,122,SN12532B +424,123,SN120536 +424,124,SN12618C +447,1,SN12618A +447,2,SN12531A +447,3,SN12524B +447,4,SNA90772 +447,5,SN120510 +447,6,SN120397 +447,7,SN120396 +447,8,SN120504 +447,9,SN120392 +447,10,SN120393 +447,11,SN120386 +447,12,SN120385 +447,13,SN120898 +447,14,SN120238 +447,15,SN120236 +447,16,SN120230 +447,17,SN120225 +447,18,SN120221 +447,19,SN120082 +447,20,SN120085 +447,21,SN120091 +447,22,SN120090 +447,23,HAA13388 +447,24,HAA13389 +447,25,SN120010 +447,26,SN120009 +447,27,SN120046 +447,28,SN120046 +447,29,SN120045 +447,30,SN120050 +447,31,SNA40503 +447,32,SN120051 +447,33,SN120008 +447,34,SN120011 +447,35,SN100810 +447,36,SN120013 +447,37,SN120017 +447,38,HA120018 +447,39,SN120014 +447,40,SN120019 +447,41,SN120089 +447,42,SN120092 +447,43,SN120023 +447,44,SN120024 +447,45,SN120086 +447,46,SN120025 +447,47,SN120083 +447,48,SN120026 +447,49,SN120084 +447,50,SN120222 +447,51,SN120223 +447,52,SN120224 +447,53,SN120228 +447,54,SN120235 +447,55,SN120237 +447,56,SNA09438 +447,57,SN120239 +447,58,SN120384 +447,59,SN120387 +447,60,SN120390 +447,61,SN120394 +447,62,SN120395 +447,63,SN120402 +447,64,SN120891 +447,65,SNA90773 +447,66,SN120525 +447,67,SN12532B +447,68,SN12618A +421,1,HA080661 +421,2,HAA13545 +421,3,HAA90784 +421,4,HA080562 +421,5,HA080545 +421,6,HA080541 +421,7,HA080531 +421,8,HA080544 +421,9,HA080527 +421,10,HA080222 +421,11,HA080226 +421,12,HA080236 +421,13,HA080030 +421,14,HA080212 +421,15,HA080033 +421,16,HA122972 +421,17,SN120838 +421,18,SN120839 +421,19,SN120840 +421,20,SN121026 +421,21,SN121025 +421,22,HA120481 +421,23,HA120482 +421,24,SN120494 +421,25,SN120495 +421,26,SNA09017 +421,27,SN120515 +421,28,SN120519 +421,29,SN120526 +421,30,SNA09341 +421,31,HAA13582 +421,32,SN120553 +421,33,SN121022 +421,34,SN120518 +421,35,SN120516 +421,36,SN120503 +421,37,SN12493A +421,38,HA120483 +421,39,HA121024 +421,40,SN121027 +421,41,SN120841 +421,42,SN120842 +421,43,SN120843 +421,44,HA080032 +421,45,HA080031 +421,46,HA080237 +421,47,HA080225 +421,48,HA080221 +421,49,HA080211 +421,50,HA080528 +421,51,HA080544 +421,52,HA080563 +421,53,HAA90784 +421,54,HA080661 +384,1,HAA13582 +384,2,SN120553 +384,3,SN121022 +384,4,SN120518 +384,5,SN120516 +384,6,SN120503 +384,7,SN12493A +384,8,HA120483 +384,9,HA121024 +384,10,SN121027 +384,11,SN120841 +384,12,SN120842 +384,13,SN120843 +384,14,HA080032 +384,15,HA080031 +384,16,HA080237 +384,17,HA080233 +384,18,HA080225 +384,19,HA080221 +384,20,HA080528 +384,21,HAA13538 +384,22,HA080563 +384,23,HAA90784 +384,24,HA080661 +384,25,HA080661 +384,26,HAA13545 +384,27,HAA90784 +384,28,HA080562 +384,29,HAA13538 +384,30,HA080531 +384,31,HA080527 +384,32,HA080222 +384,33,HA080226 +384,34,HA080233 +384,35,HA080236 +384,36,HA080030 +384,37,HA080033 +384,38,HA122972 +384,39,SN120838 +384,40,SN120839 +384,41,SN120840 +384,42,SN121026 +384,43,SN121025 +384,44,HA120481 +384,45,HA120482 +384,46,SN120494 +384,47,SN120495 +384,48,SNA09017 +384,49,SN120515 +384,50,SN120519 +384,51,SN120526 +384,52,SNA09341 +452,1,SN120734 +452,2,SN120744 +452,3,SN120748 +452,4,HAA13652 +452,5,HA120720 +452,6,SN120718 +452,7,SN120713 +452,8,SN120660 +452,9,SN120664 +452,10,SN120710 +452,11,SN120676 +452,12,SN120677 +452,13,SN120689 +452,14,SN120697 +452,15,SN120704 +452,16,SN120344 +452,17,SN120708 +452,18,SN120609 +452,19,SN120615 +452,20,HA120613 +452,21,HA120610 +452,22,HA120776 +452,23,SN120779 +452,24,SN120780 +452,25,SN120790 +452,26,SN120577 +452,27,SN120474 +452,28,SN120576 +452,29,SNA90798 +452,30,SN120431 +452,31,SN120310 +452,32,HA120307 +452,33,HA120305 +452,34,HA030191 +452,35,HA030193 +452,36,HA030193 +452,37,HA030199 +452,38,HA030200 +452,39,HA030201 +452,40,HA120304 +452,41,HA120306 +452,42,SN120309 +452,43,SN12426B +452,44,SN120870 +452,45,SN120457 +452,46,SN120459 +452,47,SN120792 +452,48,SN120789 +452,49,SN120778 +452,50,HA120777 +452,51,HA120611 +452,52,HA120612 +452,53,SN120614 +452,54,SN120709 +452,55,SN120707 +452,56,SNA19467 +452,57,SN120703 +452,58,SN120705 +452,59,SN120706 +452,60,SN120696 +452,61,SN120687 +452,62,SN120690 +452,63,SN120764 +452,64,SN120678 +452,65,SN120726 +452,66,SNA09185 +452,67,SN120665 +452,68,SN120661 +452,69,SN120712 +452,70,SN120717 +452,71,SN120719 +452,72,HA120721 +452,73,HAA13653 +452,74,HA120746 +452,75,SN120747 +452,76,SN120743 +452,77,SN120733 +448,1,SN12616D +448,2,SN12531B +448,3,SN12524B +448,4,SN120522 +448,5,SN120535 +448,6,SN120405 +448,7,SN120403 +448,8,SN120407 +448,9,SN120413 +448,10,SN120279 +448,11,SN12272A +448,12,SN120284 +448,13,SN120289 +448,14,SN120159 +448,15,SN120157 +448,16,SN120153 +448,17,SN120150 +448,18,SN120148 +448,19,SN121049 +448,20,SN120033 +448,21,SN120028 +448,22,SN120039 +448,23,SN120143 +448,24,SN120138 +448,25,SN120139 +448,26,SN120137 +448,27,SN120136 +448,28,SN120128 +448,29,SN120120 +448,30,SN120118 +448,31,SN120117 +448,32,SN120114 +448,33,SN120113 +448,34,SN120098 +448,35,SN120096 +448,36,SN120094 +448,37,SN120092 +448,38,SN120086 +448,39,SN120083 +448,40,SN120084 +448,41,SN120222 +448,42,SN120223 +448,43,SN120224 +448,44,SN120227 +448,45,SN120216 +448,46,SN12367A +448,47,SN12370A +448,48,SN120361 +448,49,SN120355 +448,50,SNA40406 +448,51,HAA13387 +448,52,SN120033 +448,53,SN120039 +448,54,SN120028 +448,55,SN120138 +448,56,SN120143 +448,57,SN120128 +448,58,SN120136 +448,59,SN121054 +448,60,SN120120 +448,61,SNA40406 +448,62,SN120360 +448,63,SN120362 +448,64,SN12369B +448,65,SN120217 +448,66,SN120226 +448,67,SN120225 +448,68,SN120221 +448,69,SN120082 +448,70,SN120085 +448,71,SN120091 +448,72,SN120093 +448,73,SN120095 +448,74,SN120097 +448,75,SN120112 +448,76,SN120111 +448,77,SN120115 +448,78,SN120119 +448,79,SN120121 +448,80,SN120127 +448,81,SN120131 +448,82,SN120139 +448,83,SN120137 +448,84,SN120141 +448,85,SN120142 +448,86,SN120031 +448,87,SN120032 +448,88,SN120034 +448,89,SN121048 +448,90,SN120149 +448,91,SN120151 +448,92,HA120154 +448,93,SN120158 +448,94,SN120287 +448,95,SN120300 +448,96,SN120285 +448,97,SN12275A +448,98,SN120415 +448,99,SN120412 +448,100,SN120408 +448,101,SN120400 +448,102,SN121055 +448,103,SN120404 +448,104,SN120406 +448,105,SN120536 +448,106,SNA40402 +448,107,SN120525 +448,108,SN12532B +448,109,SN12616D +494,1,SN121003 +494,2,SNA19559 +494,3,SN12544A +494,4,SN120548 +494,5,SN120558 +494,6,SN12550C +494,7,HA120416 +494,8,HA120419 +494,9,SN12426B +494,10,SN120870 +494,11,SN120871 +494,12,SN12921A +494,13,SN120450 +494,14,SN120447 +494,15,SN121063 +494,16,SN121060 +494,17,HA030447 +494,18,HA030385 +494,19,HA030377 +494,20,HA030465 +494,21,HA110817 +494,22,HA110549 +494,23,HA110611 +494,24,HA110611 +494,25,HA110550 +494,26,HA110818 +494,27,HA030466 +494,28,HA030378 +494,29,HA030386 +494,30,HA030446 +494,31,SN121062 +494,32,SN121061 +494,33,SN120449 +494,34,SN120451 +494,35,SNA90798 +494,36,SN120431 +494,37,HA120420 +494,38,HA120418 +494,39,HA120417 +494,40,SN120551 +494,41,SNA09318 +494,42,SN120547 +494,43,SN120545 +494,44,SN120533 +494,45,SN12532B +494,46,SN121003 +409,1,HA050182 +409,2,HA050160 +409,3,HA050136 +409,4,HA050111 +409,5,HA040298 +409,6,HA040108 +409,7,HA040023 +409,8,HA040047 +409,9,HA040005 +409,10,HA030477 +409,11,HA030484 +409,12,HA030486 +409,13,HA030491 +409,14,HA030493 +409,15,HA030494 +409,16,SN121035 +409,17,SN120827 +409,18,SN120829 +409,19,SN120730 +409,20,SN120726 +409,21,SNA09185 +409,22,SN120665 +409,23,SN120659 +409,24,SN120653 +409,25,HA120642 +409,26,SN120635 +409,27,HA120633 +409,28,SN120627 +409,29,SN120622 +409,30,SNA09464 +409,31,HAA13582 +409,32,SN121022 +409,33,SN120519 +409,34,SN120519 +409,35,SN120526 +409,36,SN121031 +409,37,HAA13583 +409,38,SNA09464 +409,39,HA120626 +409,40,HA120630 +409,41,HA120638 +409,42,HA120641 +409,43,SN120652 +409,44,SN12658B +409,45,SN120664 +409,46,SN120710 +409,47,SN120729 +409,48,SN120844 +409,49,SN121034 +409,50,SN121033 +409,51,HA030495 +409,52,HA030492 +409,53,HA030490 +409,54,HA030485 +409,55,HA030483 +409,56,HA030478 +409,57,HA040006 +409,58,HA040048 +409,59,HA040024 +409,60,HA040109 +409,61,HA040297 +409,62,HA050112 +409,63,HA050135 +409,64,HA050159 +409,65,HA050182 +466,1,HA040240 +466,2,HA040276 +466,3,HA040108 +466,4,HA040082 +466,5,HA040075 +466,6,HA040043 +466,7,HA040047 +466,8,HA040005 +466,9,HA040001 +466,10,HA030477 +466,11,HA030484 +466,12,HA030487 +466,13,HA030396 +466,14,SN121015 +466,15,SN120345 +466,16,SN120701 +466,17,SN120598 +466,18,SN120596 +466,19,SN120595 +466,20,SN120578 +466,21,SN120576 +466,22,SN120431 +466,23,HA120420 +466,24,HA120418 +466,25,HA120417 +466,26,SN120551 +466,27,SN120559 +466,28,SN120547 +466,29,SN120402 +466,30,SN120891 +466,31,HAA13583 +466,32,SNA09464 +466,33,SN120891 +466,34,SN120548 +466,35,SNA09317 +466,36,SN12550C +466,37,HA120416 +466,38,HA120419 +466,39,SN12426C +466,40,SN120870 +466,41,SN120575 +466,42,SN120579 +466,43,SN120594 +466,44,SN120597 +466,45,SN120601 +466,46,SN120700 +466,47,SN120344 +466,48,SN121014 +466,49,HA030395 +466,50,HA030488 +466,51,HA030487 +466,52,HA030483 +466,53,HA040002 +466,54,HA030478 +466,55,HA040006 +466,56,HA040043 +466,57,HA040048 +466,58,HA040076 +466,59,HA040083 +466,60,HA040109 +466,61,HA040277 +466,62,HA040240 +431,1,HAA13582 +431,2,SN120553 +431,3,SN121022 +431,4,SN120518 +431,5,HA120483 +431,6,SN120841 +431,7,HA080031 +431,8,HA080200 +431,9,HA080203 +431,10,HA080254 +431,11,HA080261 +431,12,HA080312 +431,13,HA080288 +431,14,HAA09339 +431,15,HA080295 +431,16,HA080327 +431,17,HA080357 +431,18,HA080357 +431,19,HA080328 +431,20,HA080294 +431,21,HAA09339 +431,22,HA080287 +431,23,HA080313 +431,24,HA080260 +431,25,HA080255 +431,26,HA080201 +431,27,HA080030 +431,28,SN120840 +431,29,HA120482 +431,30,SN120519 +431,31,SNA09341 +412,1,HA040240 +412,2,HA040276 +412,3,HA040078 +412,4,HA040082 +412,5,HA040023 +412,6,HA040471 +412,7,HA040005 +412,8,HA030477 +412,9,HA030484 +412,10,HA030486 +412,11,HA030491 +412,12,HA030493 +412,13,HA030494 +412,14,SN121035 +412,15,SN120827 +412,16,SN120829 +412,17,SN120730 +412,18,SN120726 +412,19,SNA09185 +412,20,SN120665 +412,21,SN120659 +412,22,SN120653 +412,23,HA120642 +412,24,SN120635 +412,25,HA120633 +412,26,SN120627 +412,27,SN120622 +412,28,HAA13582 +412,29,SN121022 +412,30,SN120519 +412,31,SN120519 +412,32,SN120526 +412,33,SN121031 +412,34,HAA13583 +412,35,SNA09464 +412,36,HA120626 +412,37,HA120630 +412,38,HA120638 +412,39,HA120641 +412,40,SN120652 +412,41,SN12658B +412,42,SN120664 +412,43,SN120710 +412,44,SN120729 +412,45,SN120844 +412,46,SN121034 +412,47,SN121033 +412,48,HA030495 +412,49,HA030492 +412,50,HA030490 +412,51,HA030485 +412,52,HA030483 +412,53,HA030478 +412,54,HA040006 +412,55,HA040014 +412,56,HA040024 +412,57,HA040083 +412,58,HA040109 +412,59,HA040277 +412,60,HA040240 +480,1,SN120519 +480,2,SN120523 +480,3,SN12532B +480,4,SN12618B +480,5,SN120980 +480,6,SNA90830 +480,7,SNA19721 +480,8,SN120652 +480,9,SN12658B +480,10,SN120661 +480,11,SN120657 +480,12,SN120654 +480,13,SN120571 +480,14,SN120569 +480,15,SN120566 +480,16,SN120563 +480,17,SN120562 +480,18,SN12921A +480,19,SN120450 +480,20,SN120447 +480,21,SN120442 +480,22,HA030457 +480,23,HA030454 +480,24,HA030452 +480,25,HA030450 +480,26,HA030389 +480,27,HA030387 +480,28,HA030385 +480,29,HA030384 +480,30,HA030379 +480,31,HA030564 +480,32,HA030382 +480,33,HA030339 +480,34,HA030337 +480,35,HA030338 +480,36,HA030343 +480,37,HAA09578 +480,38,HAA13694 +480,39,HA030346 +480,40,HA030347 +480,41,HA030350 +480,42,HA030351 +480,43,HA030353 +480,44,HA030354 +480,45,HA030357 +480,46,HA030356 +480,47,HA030355 +480,48,HA030352 +480,49,HA030351 +480,50,HA030349 +480,51,HA030348 +480,52,HA030345 +480,53,HAA13695 +480,54,HA030344 +480,55,HA030342 +480,56,HA030339 +480,57,HA030337 +480,58,HA030338 +480,59,HA030381 +480,60,HA030380 +480,61,HA030383 +480,62,HA030386 +480,63,HA030388 +480,64,HA030390 +480,65,HA030451 +480,66,HA030453 +480,67,HA120786 +480,68,HA030456 +480,69,SN120443 +480,70,SN120449 +480,71,SN120451 +480,72,SN12922A +480,73,SN120564 +480,74,SN120565 +480,75,SN120570 +480,76,SN120880 +480,77,SN120655 +480,78,SN120656 +480,79,SN120660 +480,80,SN120659 +480,81,SNA19739 +480,82,SNA19722 +480,83,SNA90831 +480,84,SN120899 +480,85,HAA13371 +480,86,SN12617B +480,87,SN121022 +480,88,SN12518A +480,89,SN12524B +341,1,SN120171 +341,2,SN120319 +341,3,HA120322 +341,4,HA120323 +341,5,HA030457 +341,6,HA030454 +341,7,HA030452 +341,8,HA030450 +341,9,HA030451 +341,10,HA030453 +341,11,HA120786 +341,12,HA030456 +341,13,SN120443 +341,14,SN120449 +341,15,SN120451 +341,16,SN12922A +341,17,SNA19711 +341,18,SNA19708 +341,19,SN120589 +341,20,SN120675 +341,21,SN120673 +341,22,SN120672 +341,23,SN120667 +341,24,SN120669 +341,25,SN120906 +341,26,SN120872 +341,27,SN120656 +341,28,SN120660 +341,29,SN120659 +341,30,SN120653 +341,31,HA120642 +341,32,SN120635 +341,33,HA120633 +341,34,SN120627 +341,35,SN120622 +341,36,HAA13371 +341,37,SN12617B +341,38,SN12441A +341,39,SN12518A +341,40,SN120516 +341,41,SN120501 +341,42,SN120498 +341,43,SNA09572 +341,44,SN120380 +341,45,SN120377 +341,46,SN120371 +341,47,SN12368A +341,48,SN120217 +341,49,SN120207 +341,50,SN120204 +341,51,SN120194 +341,52,SN120078 +341,53,SN120076 +341,54,SN120072 +341,55,SN120067 +341,56,SN120981 +341,57,SN120061 +341,58,SN120066 +341,59,SN120047 +341,60,SN120047 +341,61,SN120048 +341,62,SN120063 +341,63,SN120069 +341,64,SNA19692 +341,65,SN120073 +341,66,SN120077 +341,67,SN120983 +341,68,SN120079 +341,69,SN120196 +341,70,SN120203 +341,71,SN120208 +341,72,SN120216 +341,73,SN120367 +341,74,SN120372 +341,75,SN120376 +341,76,SN12367B +341,77,SN120381 +341,78,SN120496 +341,79,SN120499 +341,80,SN120515 +341,81,SN120519 +341,82,SN120523 +341,83,SN12532B +341,84,SN12618B +341,85,SN120623 +341,86,SN120632 +341,87,HA120638 +341,88,HA120641 +341,89,SN120652 +341,90,SN12658A +341,91,SN120661 +341,92,SN120657 +341,93,SN120662 +341,94,SN120666 +341,95,SN120668 +341,96,SN120671 +341,97,SN120670 +341,98,SN120674 +341,99,SN120588 +341,100,SN120587 +341,101,SNA19712 +341,102,SN12921A +341,103,SN120450 +341,104,SN120447 +341,105,SN120438 +341,106,SN120316 +341,107,SN120314 +341,108,SN120297 +341,109,SN120290 +341,110,SN120775 +341,111,SN120774 +341,112,SN120171 +434,1,SN120536 +434,2,SNA40402 +434,3,SN120525 +434,4,SN12532B +434,5,HAA13582 +434,6,SN120553 +434,7,SN121022 +434,8,SN120518 +434,9,HA120483 +434,10,HA121024 +434,11,SN120841 +434,12,HA080200 +434,13,HA080254 +434,14,HA080261 +434,15,HA080287 +434,16,HA080335 +434,17,HA080357 +434,18,HA080432 +434,19,HA080436 +434,20,HA080457 +434,21,HA080447 +434,22,HA080463 +434,23,HA080466 +434,24,HA080476 +434,25,HA081080 +434,26,HA080487 +434,27,HA080487 +434,28,HA080476 +434,29,HA081080 +434,30,HA080467 +434,31,HA080461 +434,32,HA080458 +434,33,HA080446 +434,34,HA080435 +434,35,HA080431 +434,36,HA080357 +434,37,HA080336 +434,38,HA080287 +434,39,HA080101 +434,40,SN120840 +434,41,SN121025 +434,42,HA120482 +434,43,SN120519 +434,44,SNA09341 +399,1,SN12616B +399,2,SN12544B +399,3,SN120548 +399,4,SN120558 +399,5,SN12550B +399,6,HA120416 +399,7,HA120419 +399,8,SN120870 +399,9,SN12426C +399,10,SN120430 +399,11,SN120433 +399,12,SN120557 +399,13,SN120561 +399,14,SN12921A +399,15,SN120871 +399,16,SN120450 +399,17,SN120447 +399,18,SN121063 +399,19,SN121060 +399,20,HA030447 +399,21,HA120462 +399,22,SN120467 +399,23,HA120466 +399,24,SN120468 +399,25,SN120470 +399,26,SN120472 +399,27,SN120473 +399,28,SN120792 +399,29,SN120789 +399,30,SN120778 +399,31,HA120777 +399,32,HA120611 +399,33,HA120612 +399,34,SN120614 +399,35,SN120709 +399,36,SN120707 +399,37,SNA09412 +399,38,SN121059 +399,39,SN121059 +399,40,SN120708 +399,41,SN120609 +399,42,SN120615 +399,43,HA120613 +399,44,HA120610 +399,45,HA120776 +399,46,SN120779 +399,47,SN120780 +399,48,SN120790 +399,49,SN120460 +399,50,SN120471 +399,51,SN120469 +399,52,SN120461 +399,53,HA120465 +399,54,HA120464 +399,55,SN120463 +399,56,HA030446 +399,57,SN121062 +399,58,SN121061 +399,59,SN120449 +399,60,SN120451 +399,61,SNA90798 +399,62,SN120556 +399,63,SN120560 +399,64,SN120434 +399,65,SN120432 +399,66,HA120420 +399,67,SN120431 +399,68,HA120418 +399,69,HA120417 +399,70,SN120551 +399,71,SNA09318 +399,72,SN120547 +399,73,SN120545 +399,74,SN120533 +399,75,SN12532B +399,76,SN12616B +433,1,HA030212 +433,2,HA030215 +433,3,HA030217 +433,4,HAA10043 +433,5,HAA10111 +433,6,HA030193 +433,7,HA030195 +433,8,HA030196 +433,9,HA030199 +433,10,HAA09426 +433,11,HA030201 +433,12,SN120999 +433,13,SN120164 +433,14,SN120040 +433,15,SN120165 +433,16,SN120795 +433,17,HA120794 +433,18,HA030391 +433,19,HA030389 +433,20,HA030387 +433,21,HA030385 +433,22,HA030384 +433,23,HA030379 +433,24,HA030564 +433,25,HA030382 +433,26,HA030339 +433,27,HA030337 +433,28,HA030314 +433,29,HA030312 +433,30,HA030307 +433,31,HA030407 +433,32,HA030309 +433,33,HA030414 +433,34,HA030415 +433,35,HA030417 +433,36,HA030419 +433,37,HA030421 +433,38,HA030424 +433,39,HA030425 +433,40,HAA10020 +433,41,HA030444 +433,42,HA030441 +433,43,HA030436 +433,44,HA030439 +433,45,HA030431 +433,46,HA030548 +433,47,HA030548 +433,48,HA030546 +433,49,HA030440 +433,50,HA030438 +433,51,HA030437 +433,52,HA030442 +433,53,HA030443 +433,54,HA030445 +433,55,HA030426 +433,56,HA030423 +433,57,HA030422 +433,58,HA030420 +433,59,HA030418 +433,60,HA030416 +433,61,HA030413 +433,62,HA030410 +433,63,HA030408 +433,64,HA030306 +433,65,HA030308 +433,66,HA030305 +433,67,HA030310 +433,68,HAA10056 +433,69,HA030311 +433,70,HA030313 +433,71,HA030315 +433,72,HA030337 +433,73,HA030338 +433,74,HA030381 +433,75,HA030380 +433,76,HA030383 +433,77,HA030386 +433,78,HA030388 +433,79,HA030390 +433,80,HA120796 +433,81,SN120797 +433,82,SNA90808 +433,83,SN120793 +433,84,SN120791 +433,85,HAA13386 +433,86,SN120998 +433,87,HA030200 +433,88,HAA09425 +433,89,HA030198 +433,90,HA030197 +433,91,HA030194 +433,92,HA030192 +433,93,HAA10110 +433,94,HAA10044 +433,95,HA030216 +433,96,HA030214 +433,97,HA030213 +433,98,HA030212 +357,1,SN12921A +357,2,SN120474 +357,3,SN120871 +357,4,SN120450 +357,5,SN120447 +357,6,SN120438 +357,7,SNA19772 +357,8,SNA19771 +357,9,SNA19473 +357,10,SN120315 +357,11,SNA19483 +357,12,SNA19472 +357,13,SN120435 +357,14,SNA19773 +357,15,SN120578 +357,16,SN120575 +357,17,SN120579 +357,18,SNA19774 +357,19,SN120790 +357,20,SN120460 +357,21,SNA19471 +357,22,SNA19470 +357,23,SNA19469 +357,24,SNA19478 +357,25,SNA19477 +357,26,SNA19476 +357,27,SNA19474 +357,28,SN120689 +357,29,SN120684 +357,30,HAA13665 +357,31,SN120693 +357,32,SN120698 +357,33,SNA19479 +357,34,SN120598 +357,35,SN120596 +357,36,SN120595 +455,1,SNA13761 +455,2,HA120546 +455,3,SNA13768 +455,4,HA120625 +455,5,SNA09343 +455,6,SN120553 +455,7,SN121022 +455,8,SNA19709 +455,9,SN120520 +455,10,SN120520 +455,11,SN121031 +455,12,HAA13583 +455,13,HA120626 +455,14,SNA13769 +455,15,HAA13580 +455,16,SNA13762 +473,1,SN120536 +473,2,SNA40402 +473,3,SN120525 +473,4,SN12532B +473,5,HAA13582 +473,6,SN120553 +473,7,SN121022 +473,8,SN120518 +473,9,SN120516 +473,10,SN120503 +473,11,SN12493A +473,12,HA120483 +473,13,HA121024 +473,14,SN121027 +473,15,SN120841 +473,16,SN120842 +473,17,SN120843 +473,18,HA080032 +473,19,HA080031 +473,20,HA080029 +473,21,HA080027 +473,22,HA080025 +473,23,HA080024 +473,24,HA080021 +473,25,HA080019 +473,26,HA080056 +473,27,HA080057 +473,28,HA080058 +473,29,HA080059 +473,30,HA080060 +473,31,HA080061 +473,32,HA080063 +473,33,HA080064 +473,34,HA080065 +473,35,HA080054 +473,36,HA080051 +473,37,HA080049 +473,38,HA080102 +473,39,HA080104 +473,40,HA080108 +473,41,HA080111 +462,1,SN120536 +462,2,SNA40402 +462,3,SN120525 +462,4,SN12532B +462,5,SN12619E +462,6,HAA13582 +462,7,SN120553 +462,8,HAA13649 +462,9,SNA13768 +462,10,HA120630 +462,11,HA120638 +462,12,HA120641 +462,13,SN120652 +462,14,SN12658B +462,15,SN120664 +462,16,SN120710 +462,17,SN120729 +462,18,SN120731 +462,19,SN120734 +462,20,SN120744 +462,21,SN120748 +462,22,HA030483 +462,23,HA030512 +462,24,HA030541 +462,25,HA030539 +462,26,HA030532 +462,27,HA030524 +441,1,HAA13648 +441,2,SN120536 +441,3,SNA40402 +441,4,SN120525 +441,5,SN12532B +441,6,SN12619E +441,7,SN121069 +441,8,HAA13582 +441,9,SNA19559 +441,10,SN12544A +441,11,SN120548 +441,12,SN120558 +441,13,SN12550C +441,14,HA120416 +441,15,HA120419 +441,16,SN12426B +441,17,SN120870 +441,18,SN120871 +441,19,SN12921C +441,20,SN120575 +441,21,SN120579 +441,22,SN120594 +441,23,SN120597 +441,24,SN120599 +441,25,SN120605 +441,26,SN120606 +441,27,SN120608 +441,28,SN120709 +441,29,SN120707 +441,30,SNA09412 +441,31,SN121059 +441,32,SNA19467 +441,33,SN120703 +441,34,SN120705 +441,35,SN120706 +441,36,SN120696 +441,37,SN120912 +441,38,SN120740 +442,1,HAA13649 +442,2,SNA13768 +442,3,HA120625 +442,4,HAA13647 +442,5,HAA40520 +442,6,SN12618C +442,7,SN12617B +442,8,SNA40401 +442,9,SN120913 +442,10,SN120536 +442,11,SNA40402 +442,12,SN12441B +442,13,SN12518A +442,14,SN120516 +442,15,SN120501 +442,16,SN120498 +442,17,SN120380 +442,18,SN120377 +442,19,SN120371 +442,20,SN12368B +442,21,SN120217 +442,22,SN121040 +442,23,SN121036 +442,24,SN121039 +442,25,SN120187 +442,26,SN120184 +442,27,SN120183 +442,28,SN120177 +442,29,SN120179 +442,30,SN120180 +442,31,SN120334 +442,32,SN121066 +442,33,SN121068 +442,34,SN121067 +442,35,SN120006 +442,36,SN120194 +442,37,SN120988 +442,38,SN120986 +442,39,SN120979 +442,40,SN120085 +442,41,SN120091 +442,42,SN120090 +442,43,HAA13388 +442,44,HAA13389 +442,45,SN120010 +442,46,SN120009 +442,47,SN120046 +495,1,HAA13649 +495,2,SNA13768 +495,3,HA120625 +495,4,HAA13647 +495,5,HAA40520 +495,6,SN12619C +495,7,SN12617B +495,8,SN12524B +495,9,SN120522 +495,10,SN120881 +495,11,SN120537 +495,12,SN120409 +495,13,HA120304 +495,14,HA120306 +495,15,SN120309 +495,16,SN120435 +495,17,SN120442 +495,18,HA030457 +495,19,HA120786 +495,20,HA030454 +495,21,HA030452 +495,22,HA030450 +495,23,HA030389 +495,24,HA030387 +495,25,HA030385 +495,26,HA030384 +495,27,HA030379 +495,28,HA030564 +495,29,HA030382 +495,30,HA030343 +495,31,HAA13694 +495,32,HA030346 +495,33,HA030347 +495,34,HA030350 +495,35,HA030353 +495,36,HA030354 +495,37,HA030357 +495,38,HA030323 +495,39,HA030326 +495,40,HA030445 +495,41,HA030444 +495,42,HA030435 +495,43,HA030440 +495,44,HA030438 +495,45,HA030436 +495,46,HA030442 +495,47,HA030443 +495,48,HA030328 +495,49,HA030329 +495,50,HA030308 +474,1,SN120367 +474,2,SN120372 +474,3,SN120374 +474,4,SN120373 +474,5,SN120238 +474,6,SN120236 +474,7,SN120230 +474,8,SN120225 +474,9,SN120221 +474,10,SN120082 +474,11,SN120085 +474,12,SN120091 +474,13,SN120P12 +474,14,SN120P13 +474,15,SNA09237 +474,16,SN120P14 +474,17,SNA09238 +474,18,HAA13389 +474,19,SN120010 +474,20,SN120009 +474,21,SN120047 +474,22,SN120047 +474,23,SN120008 +474,24,SN120011 +474,25,SN120013 +474,26,SNA09242 +474,27,SNA09241 +474,28,SNA09240 +474,29,SNA09239 +474,30,SNA09236 +474,31,SN120092 +474,32,SN120086 +474,33,SN120083 +474,34,SN120084 +474,35,SN120222 +474,36,SN120223 +474,37,SN120224 +474,38,SN120228 +474,39,SN120235 +474,40,SN120237 +474,41,SN120239 +474,42,SN120378 +474,43,SN120375 +474,44,SN120371 +474,45,SN12370A +479,1,SNA90867 +479,2,SNA90869 +479,3,SNA90831 +479,4,SN120899 +479,5,SN12617C +479,6,SN12531A +479,7,SN12524B +479,8,SNA90772 +479,9,SN120514 +479,10,SN120512 +479,11,SN120508 +479,12,SN120507 +479,13,SN120502 +479,14,SNA09221 +479,15,SNA09222 +479,16,SNA09223 +479,17,SNA09224 +479,18,SNA09225 +479,19,SNA09226 +479,20,SNA09227 +479,21,SN120P09 +479,22,SNA09228 +479,23,SNA09229 +479,24,SNA09230 +479,25,SN120364 +479,26,SN120358 +479,27,SN120326 +479,28,SN120352 +479,29,SN120354 +479,30,SN120928 +479,31,SNA40406 +479,32,SNA40406 +479,33,SN120216 +479,34,SN12367A +479,35,SN12370A +479,36,SN120361 +479,37,SN120355 +479,38,SN120329 +479,39,SN120330 +479,40,SN120357 +479,41,SNA09231 +479,42,SN120P10 +479,43,SNA09233 +479,44,SNA09234 +479,45,SNA09235 +479,46,SN120P08 +479,47,SN120P07 +479,48,SN120P06 +479,49,SN120P05 +479,50,SN120P04 +479,51,SN120P03 +479,52,SN120505 +479,53,SN120509 +479,54,SN120511 +479,55,SN120513 +479,56,SNA90870 +479,57,SN120525 +479,58,SN12441B +479,59,SN120526 +479,60,SN12532B +479,61,SN12616E +479,62,SN120980 +479,63,SNA90830 +479,64,SNA90868 +479,65,SNA90871 +479,66,SNA90867 326,1,HAA13579 326,2,SN120635 326,3,SNA13767 @@ -326,3 +3222,74 @@ 354,72,SN120775 354,73,SN120774 354,74,SN120171 +423,1,WIA04208 +423,2,WIA12275 +423,3,WIA12283 +423,4,HA140020 +423,5,WIA12348 +423,6,WIA12340 +423,7,HA100158 +423,8,WIY42982 +423,9,HA100152 +423,10,HA080008 +423,11,HA080020 +423,12,HA080022 +423,13,HA080023 +423,14,HA080026 +423,15,WIY42916 +423,16,HA080092 +423,17,HA080094 +423,18,HA080096 +423,19,HA080099 +423,20,HA081165 +423,21,HA080101 +423,22,HA080102 +423,23,HA080104 +423,24,HA080108 +423,25,HA080111 +423,26,HA080112 +423,27,HA080113 +423,28,HA080030 +423,29,HA080028 +423,30,HA080033 +423,31,SN120840 +423,32,HA120482 +423,33,SN120519 +423,34,SN120526 +423,35,SNA09341 +423,36,HAA13582 +423,37,SN120553 +423,38,SN121022 +423,39,SN120518 +423,40,HA120483 +423,41,SN120841 +423,42,HA080032 +423,43,HA080031 +423,44,HA080034 +423,45,HA080029 +423,46,HA080027 +423,47,HA080025 +423,48,HA080024 +423,49,HA080021 +423,50,HA080109 +423,51,HA080107 +423,52,HA080105 +423,53,HA080103 +423,54,HA080100 +423,55,HA081166 +423,56,HA080098 +423,57,HA080097 +423,58,HA080095 +423,59,HA080093 +423,60,WIY42915 +423,61,HA080007 +423,62,HA080019 +423,63,HA100153 +423,64,HA100159 +423,65,WIA12339 +423,66,HAA13562 +423,67,WIA12295 +423,68,WIY42983 +423,69,WIA12284 +423,70,WIA12274 +423,71,WIA04208 diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index 96cf0ce..b25b5d0 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -156,7 +156,7 @@ public class BusRoute { if (moveAmount > 0) { Log.v("BusStop", "stopIndex " + stopIndex); - int stopWanted = (stopIndex + moveAmount) % (routeStopsFound.size() + 1); + int stopWanted = (stopIndex + moveAmount) % (routeStopsFound.size()); Log.v("BusStop", "stopWanted " + stopWanted); busStopDao.refresh(routeStopsFound.get(stopWanted).stop); diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index b2eff62..f3f5cce 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -206,7 +206,8 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme super.onResume(); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); - if (sharedPrefs.getBoolean(UNI_LINK_BUS_TIMES, false) || sharedPrefs.getBoolean(NON_UNI_LINK_BUS_TIMES, false)) { + if (sharedPrefs.getBoolean(UNI_LINK_BUS_TIMES, UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT) + || sharedPrefs.getBoolean(NON_UNI_LINK_BUS_TIMES, NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT)) { Log.i(TAG, "Live Times enabled"); timetable = (Timetable) getLastNonConfigurationInstance(); @@ -303,7 +304,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme errorMessage = "Error message regarding SQL?"; e.printStackTrace(); } catch (ClientProtocolException e) { - errorMessage = "Insert error message here!"; + errorMessage = "ClientProtocolException!?!"; e.printStackTrace(); } catch (IOException e) { errorMessage = "Error fetching bus times from server, are you connected to the internet?"; diff --git a/src/net/cbaines/suma/POIDialog.java b/src/net/cbaines/suma/POIDialog.java index 67be966..20304bb 100644 --- a/src/net/cbaines/suma/POIDialog.java +++ b/src/net/cbaines/suma/POIDialog.java @@ -31,7 +31,7 @@ import android.widget.TextView; public class POIDialog extends Dialog { - private static final String TAG = "POIDialog"; + // private static final String TAG = "POIDialog"; private ListView listItems; private final Context context; diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index a7dd875..c67ceea 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -76,7 +76,7 @@ import com.j256.ormlite.dao.Dao; public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, OnChildClickListener, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { - private boolean useBundledDatabase = false; + private boolean useBundledDatabase = true; private MapView mapView; private MapController mapController; @@ -93,32 +93,26 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Wed, 8 Feb 2012 18:11:17 +0000 Subject: Begun the process of adding more of the bus data. --- src/net/cbaines/suma/BusRoute.java | 9 ++-- src/net/cbaines/suma/DataManager.java | 54 ++++++---------------- .../suma/SouthamptonUniversityMapActivity.java | 7 ++- 3 files changed, 24 insertions(+), 46 deletions(-) diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index b25b5d0..2dacfd2 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -63,10 +63,13 @@ public class BusRoute { @DatabaseField(canBeNull = true) String reverseDirection; + @DatabaseField(canBeNull = false) + boolean uniLink; + BusRoute() { } - public BusRoute(Integer id, String code, String label, String forwardDirection, String reverseDirection) { + public BusRoute(Integer id, String code, String label, String forwardDirection, String reverseDirection, boolean uniLink) { this.id = id.intValue(); this.code = code; this.label = label; @@ -74,8 +77,8 @@ public class BusRoute { this.reverseDirection = reverseDirection; } - public BusRoute(Integer id, String code, String label) { - this(id, code, label, null, null); + public BusRoute(Integer id, String code, String label, boolean uniLink) { + this(id, code, label, null, null, uniLink); } public String toString() { diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 536cc64..770e649 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -62,9 +62,9 @@ import com.j256.ormlite.table.TableUtils; public class DataManager { - final static String TAG = "DataManager"; + private final static String TAG = "DataManager"; - final static String busStopUrl = "http://data.southampton.ac.uk/bus-stop/"; + private final static String busStopUrl = "http://data.southampton.ac.uk/bus-stop/"; private static DatabaseHelper helper; private static Dao busRoutes; @@ -256,10 +256,17 @@ public class DataManager { String[] dataBits = strLine.split(","); BusRoute route; + + boolean uniLink = false; + int id = Integer.parseInt(dataBits[0]); + if (id == 326 || id == 468 || id == 327 || id == 329 || id == 354) { + uniLink = true; + } + if (dataBits.length > 3) { - route = new BusRoute(Integer.parseInt(dataBits[0]), dataBits[1], dataBits[2].replace("\"", ""), dataBits[3], dataBits[4]); + route = new BusRoute(id, dataBits[1], dataBits[2].replace("\"", ""), dataBits[3], dataBits[4], uniLink); } else { - route = new BusRoute(Integer.parseInt(dataBits[0]), dataBits[1], dataBits[2].replace("\"", "")); + route = new BusRoute(id, dataBits[1], dataBits[2].replace("\"", ""), uniLink); } // Log.i(TAG, "Loaded route " + route.id + " " + route.code + " " + route.label); busRouteDao.create(route); @@ -317,6 +324,8 @@ public class DataManager { stop.routes = (byte) (stop.routes | (1 << 3)); } else if (route.id == 354) { // U9 stop.routes = (byte) (stop.routes | (1 << 4)); + } else { + stop.routes = 0; } Log.v(TAG, "Stop routes " + stop.routes); @@ -331,43 +340,6 @@ public class DataManager { e.printStackTrace(); } - long sizeBeforeRemoval = busStopDao.countOf(); - - // Removing busstops not used by unilink busses - for (Iterator busStopIter = busStopDao.iterator(); busStopIter.hasNext();) { - BusStop stop = busStopIter.next(); - // Log.i(TAG, "Looking at stop " + stop.id); - - /* - * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); routeStopsQueryBuilder.where().eq(columnName, value) - * - * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where password is null - * deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) accountDao.delete(deleteBuilder.prepare()); - */ - - QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); - routeStopsQueryBuilder.setCountOf(true); - routeStopsQueryBuilder.where().eq(RouteStops.STOP_ID_FIELD_NAME, stop); - - PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); - long num = routeStopsDao.countOf(routeStopsPreparedQuery); - // long num = routeStopsDao.query(routeStopsPreparedQuery).size(); - // Log.i(TAG, "Number is " + num); - if (num == 0) { - // Log.i(TAG, "Removing " + stop.id); - stop.uniLink = false; - if (onlyUniLink) { - busStopIter.remove(); - } - } else { - stop.uniLink = true; - } - } - - long sizeAfterRemoval = busStopDao.countOf(); - - Log.i(TAG, "Removed " + (sizeBeforeRemoval - sizeAfterRemoval) + " stops (from " + sizeBeforeRemoval + ") now have " + sizeAfterRemoval); - Log.i(TAG, "Finished loading bus data"); } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index c67ceea..f624a43 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -76,7 +76,7 @@ import com.j256.ormlite.dao.Dao; public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, OnChildClickListener, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { - private boolean useBundledDatabase = true; + private boolean useBundledDatabase = false; private MapView mapView; private MapController mapController; @@ -384,6 +384,9 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Wed, 8 Feb 2012 21:13:31 +0000 Subject: Some more progress on adding non Uni-Link data. --- src/net/cbaines/suma/BusStopActivity.java | 5 +- src/net/cbaines/suma/BusStopOverlay.java | 94 ++++++++++--------- src/net/cbaines/suma/DataManager.java | 102 ++++++++++++++++----- .../suma/SouthamptonUniversityMapActivity.java | 30 +++++- 4 files changed, 158 insertions(+), 73 deletions(-) diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index f3f5cce..4c9ce52 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -170,10 +170,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme } else { U9RouteRadioButton.setVisibility(View.GONE); } - } else { - Log.e(TAG, "Error unknown route " + route.code); - } - + } } busStopDao = helper.getBusStopDao(); diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java index 834b6dc..59212ef 100644 --- a/src/net/cbaines/suma/BusStopOverlay.java +++ b/src/net/cbaines/suma/BusStopOverlay.java @@ -119,20 +119,21 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { boolean drawing = false; - for (int i = 0; i < 5; i++) { - if ((stopRoutes & (1 << i)) != 0) { - routeNum++; - if (routes[i]) { - drawing = true; + if (stop.uniLink) { + + for (int i = 0; i < 5; i++) { + if ((stopRoutes & (1 << i)) != 0) { + routeNum++; + if (routes[i]) { + drawing = true; + } } } - } - if (!drawing) - continue; + if (!drawing) + continue; - int yOfsetPerMarker = (int) (10 * scale); - int markerYSize = (int) (8 * scale); + } pj.toMapPixels(stop.point, mCurScreenCoords); @@ -141,50 +142,53 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { } else { Overlay.drawAt(canvas, marker, mCurScreenCoords.x, mCurScreenCoords.y, false); } - // Log.i(TAG, "Got " + routes.size() + " routes " + routes); - int makersPlaced = 0; + if (stop.uniLink) { - float rectLeft = mCurScreenCoords.x + (8.8f * scale); - float rectRight = rectLeft + markerYSize; + int makersPlaced = 0; + int yOfsetPerMarker = (int) (10 * scale); + int markerYSize = (int) (8 * scale); - if (routeNum == 5) { - markerYSize = (int) (5 * scale); - yOfsetPerMarker = (int) (7 * scale); - } else if (routeNum == 4) { - markerYSize = (int) (6.5f * scale); - yOfsetPerMarker = (int) (8 * scale); - } + float rectLeft = mCurScreenCoords.x + (8.8f * scale); + float rectRight = rectLeft + markerYSize; - for (int i = 0; i < 5; i++) { - if ((stopRoutes & (1 << i)) != 0) { - - // Log.i(TAG, "Route " + route + " is " + routes.get(route)); - - // Log.i(TAG, "Index is " + busRoutes.indexOf(route) + " busRoutes " + busRoutes); - - if (i == 0) { - paint.setColor(U1); - } else if (i == 1) { - paint.setColor(U1N); - } else if (i == 2) { - paint.setColor(U2); - } else if (i == 3) { - paint.setColor(U6); - } else if (i == 4) { - paint.setColor(U9); - } else { - Log.e(TAG, "Unknown route code"); - } + if (routeNum == 5) { + markerYSize = (int) (5 * scale); + yOfsetPerMarker = (int) (7 * scale); + } else if (routeNum == 4) { + markerYSize = (int) (6.5f * scale); + yOfsetPerMarker = (int) (8 * scale); + } - canvas.drawRect(rectLeft, mCurScreenCoords.y + ((yOfsetPerMarker * makersPlaced) - (45 * scale)), rectRight, mCurScreenCoords.y - + (yOfsetPerMarker * makersPlaced) - ((45 * scale) - markerYSize), paint); + for (int i = 0; i < 5; i++) { + if ((stopRoutes & (1 << i)) != 0) { + + // Log.i(TAG, "Route " + route + " is " + routes.get(route)); + + // Log.i(TAG, "Index is " + busRoutes.indexOf(route) + " busRoutes " + busRoutes); + + if (i == 0) { + paint.setColor(U1); + } else if (i == 1) { + paint.setColor(U1N); + } else if (i == 2) { + paint.setColor(U2); + } else if (i == 3) { + paint.setColor(U6); + } else if (i == 4) { + paint.setColor(U9); + } else { + Log.e(TAG, "Unknown route code"); + } - makersPlaced++; + canvas.drawRect(rectLeft, mCurScreenCoords.y + ((yOfsetPerMarker * makersPlaced) - (45 * scale)), rectRight, mCurScreenCoords.y + + (yOfsetPerMarker * makersPlaced) - ((45 * scale) - markerYSize), paint); + + makersPlaced++; + } } } } - } @Override diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 770e649..aad8b86 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -29,6 +29,7 @@ import java.util.Date; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; @@ -263,11 +264,19 @@ public class DataManager { uniLink = true; } - if (dataBits.length > 3) { - route = new BusRoute(id, dataBits[1], dataBits[2].replace("\"", ""), dataBits[3], dataBits[4], uniLink); - } else { - route = new BusRoute(id, dataBits[1], dataBits[2].replace("\"", ""), uniLink); + route = new BusRoute(id, dataBits[1], dataBits[2].replace("\"", ""), uniLink); + + if (id == 326) { + route.forwardDirection = "C"; + route.reverseDirection = "A"; + } else if (id == 329) { + route.forwardDirection = "C"; + route.reverseDirection = "B"; + } else if (id == 327) { + route.forwardDirection = "H"; + route.reverseDirection = "C"; } + // Log.i(TAG, "Loaded route " + route.id + " " + route.code + " " + route.label); busRouteDao.create(route); @@ -340,6 +349,34 @@ public class DataManager { e.printStackTrace(); } + for (Iterator busStopIter = busStopDao.iterator(); busStopIter.hasNext();) { + BusStop stop = busStopIter.next(); + // Log.i(TAG, "Looking at stop " + stop.id); + + /* + * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); routeStopsQueryBuilder.where().eq(columnName, value) + * + * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where password is null + * deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) accountDao.delete(deleteBuilder.prepare()); + */ + + QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + routeStopsQueryBuilder.setCountOf(true); + routeStopsQueryBuilder.where().eq(RouteStops.STOP_ID_FIELD_NAME, stop); + + PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); + long num = routeStopsDao.countOf(routeStopsPreparedQuery); + // long num = routeStopsDao.query(routeStopsPreparedQuery).size(); + // Log.i(TAG, "Number is " + num); + if (num == 0) { + // Log.i(TAG, "Removing " + stop.id); + stop.uniLink = false; + } else { + stop.uniLink = true; + } + busStopDao.update(stop); + } + Log.i(TAG, "Finished loading bus data"); } @@ -425,29 +462,48 @@ public class DataManager { BusRoute route; String dir = null; - if (name.equals("U1N")) { - route = busRoutes.queryForId(468); - } else if (name.startsWith("U9")) { - route = busRoutes.queryForId(354); - } else { - if (name.startsWith("U1")) { - route = busRoutes.queryForId(326); - } else if (name.startsWith("U2")) { - route = busRoutes.queryForId(329); - } else if (name.startsWith("U6")) { - route = busRoutes.queryForId(327); + if (name.contains("U")) { + if (name.equals("U1N")) { + route = busRoutes.queryForId(468); + } else if (name.startsWith("U9")) { + route = busRoutes.queryForId(354); } else { - Log.e(TAG, "Error detecting route " + name); - return null; + if (name.startsWith("U1")) { + route = busRoutes.queryForId(326); + } else if (name.startsWith("U2")) { + route = busRoutes.queryForId(329); + } else if (name.startsWith("U6")) { + route = busRoutes.queryForId(327); + } else { + Log.e(TAG, "Error finding Uni-Link route " + name); + return null; + } + + if (route.forwardDirection.equals(name.substring(2))) { + dir = route.forwardDirection; + } else if (route.reverseDirection.equals(name.substring(2))) { + dir = route.reverseDirection; + } else { + Log.e(TAG, "Error detecting direction for " + name); + return null; + } } - if (route.forwardDirection.equals(name.substring(2))) { - dir = route.forwardDirection; - } else if (route.reverseDirection.equals(name.substring(2))) { - dir = route.reverseDirection; - } else { - Log.e(TAG, "Error detecting direction for " + name); + } else { + Log.v(TAG, "Route not Uni-Link"); + List routes = (List) busRoutes.queryForEq(BusRoute.CODE_FIELD_NAME, name); + if (routes.size() != 1) { + Log.e(TAG, "Found more than one non Uni-Link route?"); + for (BusRoute routeT : routes) { + Log.i(TAG, "Route: " + routeT); + } return null; + } else { + route = routes.get(0); + if (route == null) { + Log.e(TAG, "Could not find database entry for " + name); + return null; + } } } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index f624a43..323c7db 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -114,7 +114,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity siteOverlays = new HashMap(21); @@ -696,6 +696,34 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity busStops; + Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); + + busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, false); + + Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); + + nonUniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + overlays.put("BusStops", nonUniLinkBusStopOverlay); + + Log.v(TAG, "Applyed the site overlay, now sorting them"); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().add(nonUniLinkBusStopOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } + } + uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean("Bus Stops:U1", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean("Bus Stops:U1N", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean("Bus Stops:U2", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); -- cgit v1.2.3 From 2ada92db0a557de0cb1b169534e3207582b44ec9 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 13 Feb 2012 07:44:37 +0000 Subject: Added route labels to the POIView, and some more improvements in the preferences system. --- src/net/cbaines/suma/BusStopActivity.java | 8 +- src/net/cbaines/suma/DataManager.java | 214 ++++++------- src/net/cbaines/suma/POIView.java | 83 ++++- src/net/cbaines/suma/Preferences.java | 6 +- .../suma/SouthamptonUniversityMapActivity.java | 346 ++++++++++----------- 5 files changed, 363 insertions(+), 294 deletions(-) diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 4c9ce52..52f1b92 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -170,7 +170,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme } else { U9RouteRadioButton.setVisibility(View.GONE); } - } + } } busStopDao = helper.getBusStopDao(); @@ -309,6 +309,12 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme } catch (JSONException e) { errorMessage = "Error parsing bus times"; e.printStackTrace(); + } catch (Exception e) { + if (THROW_ERROR_ON_EXCEPTION) { + throw new RuntimeException(e.getMessage()); + } else { + Log.e(TAG, e.getMessage()); + } } return newTimetable; } diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index aad8b86..f642d56 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -424,7 +424,7 @@ public class DataManager { Log.i(TAG, "Loaded sites from csv"); } - private static Stop getStop(Context context, JSONObject stopObj, BusStop busStop) throws SQLException { + private static Stop getStop(Context context, JSONObject stopObj, BusStop busStop) throws SQLException, JSONException { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -435,145 +435,135 @@ public class DataManager { if (busStopDao == null) busStopDao = helper.getBusStopDao(); - try { - String time = stopObj.getString("time"); - - GregorianCalendar calender = new GregorianCalendar(); - boolean live = true; - if (!time.equals("Due")) { + String time = stopObj.getString("time"); - Log.v(TAG, "Time: " + time + " current time " + calender.getTime()); + GregorianCalendar calender = new GregorianCalendar(); + boolean live = true; + if (!time.equals("Due")) { - if (time.contains(":")) { - String[] minAndHour = time.split(":"); - calender.set(Calendar.HOUR_OF_DAY, Integer.parseInt(minAndHour[0])); - calender.set(Calendar.MINUTE, Integer.parseInt(minAndHour[1])); - live = false; - } else { - // Log.i(TAG, "Parsing " + time.substring(0, time.length() - 1) + " for min"); - calender.add(Calendar.MINUTE, Integer.parseInt(time.substring(0, time.length() - 1))); - } + Log.v(TAG, "Time: " + time + " current time " + calender.getTime()); - Log.v(TAG, "Date: " + calender.getTime()); + if (time.contains(":")) { + String[] minAndHour = time.split(":"); + calender.set(Calendar.HOUR_OF_DAY, Integer.parseInt(minAndHour[0])); + calender.set(Calendar.MINUTE, Integer.parseInt(minAndHour[1])); + live = false; + } else { + // Log.i(TAG, "Parsing " + time.substring(0, time.length() - 1) + " for min"); + calender.add(Calendar.MINUTE, Integer.parseInt(time.substring(0, time.length() - 1))); } - String name = stopObj.getString("name"); + Log.v(TAG, "Date: " + calender.getTime()); + } - BusRoute route; - String dir = null; + String name = stopObj.getString("name"); - if (name.contains("U")) { - if (name.equals("U1N")) { - route = busRoutes.queryForId(468); - } else if (name.startsWith("U9")) { - route = busRoutes.queryForId(354); - } else { - if (name.startsWith("U1")) { - route = busRoutes.queryForId(326); - } else if (name.startsWith("U2")) { - route = busRoutes.queryForId(329); - } else if (name.startsWith("U6")) { - route = busRoutes.queryForId(327); - } else { - Log.e(TAG, "Error finding Uni-Link route " + name); - return null; - } + BusRoute route; + String dir = null; - if (route.forwardDirection.equals(name.substring(2))) { - dir = route.forwardDirection; - } else if (route.reverseDirection.equals(name.substring(2))) { - dir = route.reverseDirection; - } else { - Log.e(TAG, "Error detecting direction for " + name); - return null; - } + if (name.contains("U")) { + if (name.equals("U1N")) { + route = busRoutes.queryForId(468); + } else if (name.startsWith("U9")) { + route = busRoutes.queryForId(354); + } else { + if (name.startsWith("U1")) { + route = busRoutes.queryForId(326); + } else if (name.startsWith("U2")) { + route = busRoutes.queryForId(329); + } else if (name.startsWith("U6")) { + route = busRoutes.queryForId(327); + } else { + throw new RuntimeException("Error finding Uni-Link route " + name); } - } else { - Log.v(TAG, "Route not Uni-Link"); - List routes = (List) busRoutes.queryForEq(BusRoute.CODE_FIELD_NAME, name); - if (routes.size() != 1) { - Log.e(TAG, "Found more than one non Uni-Link route?"); - for (BusRoute routeT : routes) { - Log.i(TAG, "Route: " + routeT); - } - return null; + if (route.forwardDirection.equals(name.substring(2))) { + dir = route.forwardDirection; + } else if (route.reverseDirection.equals(name.substring(2))) { + dir = route.reverseDirection; } else { - route = routes.get(0); - if (route == null) { - Log.e(TAG, "Could not find database entry for " + name); - return null; - } + throw new RuntimeException("Error detecting direction for " + name); } } - String destString = stopObj.getString("dest"); - BusStop destStop; - - if (destString.equals("Central Station")) { - destStop = busStopDao.queryForId("SNA19709"); - } else if (destString.equals("Civic Centre")) { - destStop = busStopDao.queryForId("SN120527"); - } else if (destString.equals("City DG4")) { - destStop = busStopDao.queryForId("HAA13579"); - } else if (destString.equals("Central Station")) { - destStop = busStopDao.queryForId("SN120520"); - } else if (destString.equals("Airport")) { - destStop = busStopDao.queryForId("HA030184"); - } else if (destString.equals("City, Town Quay")) { - destStop = busStopDao.queryForId("SNA13766"); - } else if (destString.equals("Dock Gate 4")) { - destStop = busStopDao.queryForId("MG1031"); - } else if (destString.equals("Eastleigh")) { - destStop = busStopDao.queryForId("HA030212"); - } else if (destString.equals("Crematorium")) { - destStop = busStopDao.queryForId("SN121009"); - } else if (destString.equals("General Hosp")) { - destStop = busStopDao.queryForId("SNA19482"); + } else { + Log.v(TAG, "Route not Uni-Link"); + List routes = (List) busRoutes.queryForEq(BusRoute.CODE_FIELD_NAME, name); + if (routes.size() != 1) { + Log.e(TAG, "Found more than one non Uni-Link route?"); + for (BusRoute routeT : routes) { + Log.i(TAG, "Route: " + routeT); + } + throw new RuntimeException("Found more than one non Uni-Link route?"); } else { - Log.e(TAG, "Unknown end dest " + destString + " for route " + route.code); - return null; + route = routes.get(0); + if (route == null) { + throw new RuntimeException("Could not find database entry for " + name); + } } + } - Date now = new Date(System.currentTimeMillis()); + String destString = stopObj.getString("dest"); + BusStop destStop; + + if (destString.equals("Central Station")) { + destStop = busStopDao.queryForId("SNA19709"); + } else if (destString.equals("Civic Centre")) { + destStop = busStopDao.queryForId("SN120527"); + } else if (destString.equals("City DG4")) { + destStop = busStopDao.queryForId("HAA13579"); + } else if (destString.equals("Central Station")) { + destStop = busStopDao.queryForId("SN120520"); + } else if (destString.equals("Airport")) { + destStop = busStopDao.queryForId("HA030184"); + } else if (destString.equals("City, Town Quay")) { + destStop = busStopDao.queryForId("SNA13766"); + } else if (destString.equals("City Centre")) { + destStop = busStopDao.queryForId("SNA13766"); + } else if (destString.equals("Dock Gate 4")) { + destStop = busStopDao.queryForId("MG1031"); + } else if (destString.equals("Eastleigh")) { + destStop = busStopDao.queryForId("HA030212"); + } else if (destString.equals("Crematorium")) { + destStop = busStopDao.queryForId("SN121009"); + } else if (destString.equals("General Hosp")) { + destStop = busStopDao.queryForId("SNA19482"); + } else { + throw new RuntimeException("Unknown end dest " + destString + " for route " + route.code); + } - String busID = null; - Stop stop; - Bus bus; - if (stopObj.has("vehicle")) { - busID = stopObj.getString("vehicle"); + Date now = new Date(System.currentTimeMillis()); - QueryBuilder busQueryBuilder = busDao.queryBuilder(); - busQueryBuilder.where().eq(Bus.ID_FIELD_NAME, busID); - PreparedQuery busPreparedQuery = busQueryBuilder.prepare(); + String busID = null; + Stop stop; + Bus bus; + if (stopObj.has("vehicle")) { + busID = stopObj.getString("vehicle"); - bus = busDao.queryForFirst(busPreparedQuery); + QueryBuilder busQueryBuilder = busDao.queryBuilder(); + busQueryBuilder.where().eq(Bus.ID_FIELD_NAME, busID); + PreparedQuery busPreparedQuery = busQueryBuilder.prepare(); - if (bus == null) { - bus = new Bus(busID, route, dir); - bus.destination = destStop; - } else { - bus.destination = destStop; - bus.route = route; - bus.direction = dir; - } + bus = busDao.queryForFirst(busPreparedQuery); + if (bus == null) { + bus = new Bus(busID, route, dir); + bus.destination = destStop; } else { - bus = new Bus(null, route, dir); + bus.destination = destStop; + bus.route = route; + bus.direction = dir; } - busDao.update(bus); - - stop = new Stop(bus, busStop, calender.getTime(), now, live); + } else { + bus = new Bus(null, route, dir); + } - return stop; + busDao.update(bus); - } catch (Exception e) { - // TODO Auto-generated catch block - Log.e(TAG, "Error parsing stop " + stopObj, e); - return null; - } + stop = new Stop(bus, busStop, calender.getTime(), now, live); + return stop; } public static Timetable getTimetable(Context context, String busStop, boolean keepUniLink, boolean keepNonUniLink) throws SQLException, diff --git a/src/net/cbaines/suma/POIView.java b/src/net/cbaines/suma/POIView.java index 733cd0f..0fb1496 100644 --- a/src/net/cbaines/suma/POIView.java +++ b/src/net/cbaines/suma/POIView.java @@ -23,6 +23,7 @@ import android.content.Context; import android.util.Log; import android.view.Display; import android.view.Gravity; +import android.view.View; import android.view.WindowManager; import android.widget.LinearLayout; import android.widget.TextView; @@ -34,6 +35,12 @@ public class POIView extends LinearLayout { private final TextView name; private final TextView dist; + private TextView u1; + private TextView u1n; + private TextView u2; + private TextView u6; + private TextView u9; + private LayoutParams textLayoutParams; final int width; @@ -52,18 +59,67 @@ public class POIView extends LinearLayout { this.setOrientation(HORIZONTAL); name = new TextView(context); - name.setTextSize(22f); + name.setTextSize(16f); name.setGravity(Gravity.LEFT); dist = new TextView(context); - dist.setTextSize(22f); + dist.setTextSize(16f); dist.setGravity(Gravity.RIGHT); + u1 = new TextView(context); + u1.setText(R.string.U1); + u1.setBackgroundResource(R.drawable.u1_back_selected); + u1n = new TextView(context); + u1n.setText(R.string.U1N); + u1n.setBackgroundResource(R.drawable.u1n_back_selected); + u2 = new TextView(context); + u2.setText(R.string.U2); + u2.setBackgroundResource(R.drawable.u2_back_selected); + u6 = new TextView(context); + u6.setText(R.string.U6); + u6.setBackgroundResource(R.drawable.u6_back_selected); + u9 = new TextView(context); + u9.setText(R.string.U9); + u9.setBackgroundResource(R.drawable.u9_back_selected); + textLayoutParams = new LayoutParams(width - (width / 4), LayoutParams.WRAP_CONTENT); LayoutParams distLayoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); setPOIAndDist(poi, distInM); + LayoutParams busRouteLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); + addView(u1, busRouteLayoutParams); + addView(u1n, busRouteLayoutParams); + addView(u2, busRouteLayoutParams); + addView(u6, busRouteLayoutParams); + addView(u9, busRouteLayoutParams); + + u1.setVisibility(View.GONE); + u1n.setVisibility(View.GONE); + u2.setVisibility(View.GONE); + u6.setVisibility(View.GONE); + u9.setVisibility(View.GONE); + + if (poi.type == POI.BUS_STOP) { + BusStop busStop = (BusStop) poi; + + if ((busStop.routes & (1 << 0)) != 0) { + u1.setVisibility(View.VISIBLE); + } + if ((busStop.routes & (1 << 1)) != 0) { + u1n.setVisibility(View.VISIBLE); + } + if ((busStop.routes & (1 << 2)) != 0) { + u2.setVisibility(View.VISIBLE); + } + if ((busStop.routes & (1 << 3)) != 0) { + u6.setVisibility(View.VISIBLE); + } + if ((busStop.routes & (1 << 4)) != 0) { + u9.setVisibility(View.VISIBLE); + } + } + addView(name, textLayoutParams); addView(dist, distLayoutParams); } @@ -76,6 +132,12 @@ public class POIView extends LinearLayout { // Log.i(TAG, "Looking at poi " + poi.id); + u1.setVisibility(View.GONE); + u1n.setVisibility(View.GONE); + u2.setVisibility(View.GONE); + u6.setVisibility(View.GONE); + u9.setVisibility(View.GONE); + if (poi.type == POI.BUILDING) { Building building = (Building) poi; // Log.i(TAG, "Its a building of name " + building.name); @@ -87,6 +149,23 @@ public class POIView extends LinearLayout { // Log.i(TAG, "Its a bus stop of description " + busStop.description); name.setText(busStop.description + " (" + busStop.id + ")"); + + if ((busStop.routes & (1 << 0)) != 0) { + u1.setVisibility(View.VISIBLE); + } + if ((busStop.routes & (1 << 1)) != 0) { + u1n.setVisibility(View.VISIBLE); + } + if ((busStop.routes & (1 << 2)) != 0) { + u2.setVisibility(View.VISIBLE); + } + if ((busStop.routes & (1 << 3)) != 0) { + u6.setVisibility(View.VISIBLE); + } + if ((busStop.routes & (1 << 4)) != 0) { + u9.setVisibility(View.VISIBLE); + } + } else if (poi.type == POI.SITE) { Site site = (Site) poi; diff --git a/src/net/cbaines/suma/Preferences.java b/src/net/cbaines/suma/Preferences.java index c92a86c..df44729 100644 --- a/src/net/cbaines/suma/Preferences.java +++ b/src/net/cbaines/suma/Preferences.java @@ -8,9 +8,9 @@ public interface Preferences { static final boolean UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = true; static final String NON_UNI_LINK_BUS_TIMES = "nonUniLinkLiveBusTimesEnabled"; static final boolean NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = false; - static final String UNI_LINK_BUS_STOPS = "uniLinkBusStop"; - static final boolean UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = true; - static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStop"; + static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStops"; static final boolean NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = false; + static final boolean THROW_ERROR_ON_EXCEPTION = false; + } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index 323c7db..a313d12 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -74,7 +74,7 @@ import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; import com.j256.ormlite.dao.Dao; public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, - OnChildClickListener, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { + OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { private boolean useBundledDatabase = false; @@ -93,40 +93,52 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity siteOverlays = new HashMap(21); + private static final boolean SITE_OVERLAYS_ENABLED_BY_DEFAULT = false; + private static final int SITE_OVERLAYS_RANK = 1; // Route Overlays + private static final String ROUTE_OVERLAYS = "routeOverlays"; private HashMap routeOverlays = new HashMap(5); - - // View - private static final String RESIDENTIAL_BUILDING_OVERLAY = "Buildings:Residential"; - private static final String NON_RESIDENTIAL_BUILDING_OVERLAY = "Buildings:Non-Residential"; - private static final boolean SITE_OVERLAY_ENABLED_BY_DEFAULT = false; - private static final boolean ROUTE_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final boolean ROUTE_OVERLAYS_ENABLED_BY_DEFAULT = true; + private static final int ROUTE_OVERLAYS_RANK = 1; private POIDialog favDialog; @@ -374,12 +386,13 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity busStops; Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); - if (activityPrefs.getBoolean(UNI_LINK_BUS_STOPS, UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT)) { + if (activityPrefs.getBoolean(UNI_LINK_BUS_STOP_OVERLAY, UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { busStops = getHelper().getBusStopDao().queryForAll(); } else { busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); @@ -686,7 +693,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity busStops; - Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); + Log.v(TAG, "Begin fetching non Uni-Link BusStops at " + (System.currentTimeMillis() - startTime)); busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, false); - Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); + Log.v(TAG, "Finished fetching non Uni-Link BusStops at " + (System.currentTimeMillis() - startTime)); nonUniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); } catch (SQLException e) { @@ -714,7 +742,7 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity { - private final SharedPreferences prefs; + // private final SharedPreferences prefs; OverlayRankComparator(SharedPreferences prefs) { - this.prefs = prefs; + // this.prefs = prefs; } public int compare(Overlay arg0, Overlay arg1) { return getRank(arg1) - getRank(arg0); } - private final int getRank(Overlay arg0) { // TODO: Dont hardcode the rank values - if (arg0 == scaleBarOverlay) { - return prefs.getInt("mScaleBarOverlay", 1); - } else if (arg0 == myLocationOverlay) { - return prefs.getInt("myLocationOverlay", 0); - } else if (arg0 == uniLinkBusStopOverlay) { - return prefs.getInt("busStopOverlay", 2); - } else if (arg0 == residentialBuildingOverlay) { - return prefs.getInt("residentialBuildingOverlay", 4); - } else if (arg0 == nonResidentialBuildingOverlay) { - return prefs.getInt("nonResidentialBuildingOverlay", 3); - } else if (siteOverlays != null && siteOverlays.values().contains(arg0)) { - return prefs.getInt("siteOverlays", 6); - } else if (routeOverlays != null && routeOverlays.values().contains(arg0)) { - return prefs.getInt("routeOverlays", 5); + private final int getRank(Overlay overlay) { // TODO: Dont hardcode the rank values + if (overlay == scaleBarOverlay) { + return SCALE_BAR_OVERLAY_RANK; + } else if (overlay == myLocationOverlay) { + return MY_LOCATION_OVERLAY_RANK; + } else if (overlay == uniLinkBusStopOverlay) { + return UNI_LINK_BUS_STOP_OVERLAY_RANK; + } else if (overlay == nonUniLinkBusStopOverlay) { + return NON_UNI_LINK_BUS_STOP_OVERLAY_RANK; + } else if (overlay == residentialBuildingOverlay) { + return RESIDENTIAL_BUILDING_OVERLAY_RANK; + } else if (overlay == nonResidentialBuildingOverlay) { + return NON_RESIDENTIAL_BUILDING_OVERLAY_RANK; + } else if (siteOverlays != null && siteOverlays.values().contains(overlay)) { + return SITE_OVERLAYS_RANK; + } else if (routeOverlays != null && routeOverlays.values().contains(overlay)) { + return ROUTE_OVERLAYS_RANK; } else { + Log.e(TAG, "Trying to rank unknown overlay " + overlay); return -1; } } @@ -1084,43 +1104,31 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Mon, 13 Feb 2012 10:25:15 +0000 Subject: Improvements to the POIView, use this http://mobile.tutsplus.com/tutorials/android/android-sdk_table-layout/ next to make the layout better. --- res/layout/poi_dialog.xml | 4 +- src/net/cbaines/suma/BuildingActivity.java | 8 +-- src/net/cbaines/suma/BusRoutesView.java | 78 ++++++++++++++++++++++++++++ src/net/cbaines/suma/POIView.java | 81 +++--------------------------- 4 files changed, 89 insertions(+), 82 deletions(-) create mode 100644 src/net/cbaines/suma/BusRoutesView.java diff --git a/res/layout/poi_dialog.xml b/res/layout/poi_dialog.xml index 44cb02a..cf97083 100644 --- a/res/layout/poi_dialog.xml +++ b/res/layout/poi_dialog.xml @@ -4,7 +4,9 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" - android:padding="10dp" > + android:paddingBottom="10dp" + android:paddingLeft="10dp" + android:paddingRight="10dp" > { @@ -48,7 +44,7 @@ public class BuildingActivity extends OrmLiteBaseActivity { final DatabaseHelper helper = getHelper(); // create an empty model - Model model = ModelFactory.createDefaultModel(); + // Model model = ModelFactory.createDefaultModel(); // use the FileManager to find the input file InputStream in = getResources().openRawResource(R.raw.u9); @@ -57,7 +53,7 @@ public class BuildingActivity extends OrmLiteBaseActivity { } // read the RDF/XML file - model.read(in, null); + // model.read(in, null); instance = this; diff --git a/src/net/cbaines/suma/BusRoutesView.java b/src/net/cbaines/suma/BusRoutesView.java new file mode 100644 index 0000000..f5af076 --- /dev/null +++ b/src/net/cbaines/suma/BusRoutesView.java @@ -0,0 +1,78 @@ +package net.cbaines.suma; + +import android.R.color; +import android.content.Context; +import android.view.View; +import android.widget.TableLayout; +import android.widget.TextView; + +public class BusRoutesView extends TableLayout { + + private TextView u1; + private TextView u1n; + private TextView u2; + private TextView u6; + private TextView u9; + + public BusRoutesView(Context context, final byte routes) { + super(context); + + u1 = new TextView(context); + u1.setText(R.string.U1); + u1.setBackgroundResource(R.drawable.u1_back_selected); + // /u1.setTextColor(color.white); + + u1n = new TextView(context); + u1n.setText(R.string.U1N); + u1n.setBackgroundResource(R.drawable.u1n_back_selected); + // u1n.setTextColor(color.white); + + u2 = new TextView(context); + u2.setText(R.string.U2); + u2.setBackgroundResource(R.drawable.u2_back_selected); + // u2.setTextColor(color.white); + + u6 = new TextView(context); + u6.setText(R.string.U6); + u6.setBackgroundResource(R.drawable.u6_back_selected); + // u6.setTextColor(color.white); + + u9 = new TextView(context); + u9.setText(R.string.U9); + u9.setBackgroundResource(R.drawable.u9_back_selected); + // u9.setTextColor(color.white); + + } + + void setRoutes(byte routes) { + + removeView(u1); + removeView(u1n); + removeView(u2); + removeView(u6); + removeView(u9); + + LayoutParams busRouteLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); + + if ((routes & (1 << 0)) != 0) { + addView(u1, busRouteLayoutParams); + u1.setVisibility(View.VISIBLE); + } + if ((routes & (1 << 1)) != 0) { + u1n.setVisibility(View.VISIBLE); + addView(u1n, busRouteLayoutParams); + } + if ((routes & (1 << 2)) != 0) { + u2.setVisibility(View.VISIBLE); + addView(u2, busRouteLayoutParams); + } + if ((routes & (1 << 3)) != 0) { + u6.setVisibility(View.VISIBLE); + addView(u6, busRouteLayoutParams); + } + if ((routes & (1 << 4)) != 0) { + u9.setVisibility(View.VISIBLE); + addView(u9, busRouteLayoutParams); + } + } +} diff --git a/src/net/cbaines/suma/POIView.java b/src/net/cbaines/suma/POIView.java index 0fb1496..d312f37 100644 --- a/src/net/cbaines/suma/POIView.java +++ b/src/net/cbaines/suma/POIView.java @@ -27,6 +27,7 @@ import android.view.View; import android.view.WindowManager; import android.widget.LinearLayout; import android.widget.TextView; +import android.widget.TableLayout.LayoutParams; public class POIView extends LinearLayout { @@ -34,12 +35,7 @@ public class POIView extends LinearLayout { private final TextView name; private final TextView dist; - - private TextView u1; - private TextView u1n; - private TextView u2; - private TextView u6; - private TextView u9; + private final BusRoutesView routes; private LayoutParams textLayoutParams; @@ -66,60 +62,15 @@ public class POIView extends LinearLayout { dist.setTextSize(16f); dist.setGravity(Gravity.RIGHT); - u1 = new TextView(context); - u1.setText(R.string.U1); - u1.setBackgroundResource(R.drawable.u1_back_selected); - u1n = new TextView(context); - u1n.setText(R.string.U1N); - u1n.setBackgroundResource(R.drawable.u1n_back_selected); - u2 = new TextView(context); - u2.setText(R.string.U2); - u2.setBackgroundResource(R.drawable.u2_back_selected); - u6 = new TextView(context); - u6.setText(R.string.U6); - u6.setBackgroundResource(R.drawable.u6_back_selected); - u9 = new TextView(context); - u9.setText(R.string.U9); - u9.setBackgroundResource(R.drawable.u9_back_selected); + routes = new BusRoutesView(context, (byte) 0); textLayoutParams = new LayoutParams(width - (width / 4), LayoutParams.WRAP_CONTENT); LayoutParams distLayoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); - - setPOIAndDist(poi, distInM); - LayoutParams busRouteLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); - addView(u1, busRouteLayoutParams); - addView(u1n, busRouteLayoutParams); - addView(u2, busRouteLayoutParams); - addView(u6, busRouteLayoutParams); - addView(u9, busRouteLayoutParams); - - u1.setVisibility(View.GONE); - u1n.setVisibility(View.GONE); - u2.setVisibility(View.GONE); - u6.setVisibility(View.GONE); - u9.setVisibility(View.GONE); - - if (poi.type == POI.BUS_STOP) { - BusStop busStop = (BusStop) poi; - if ((busStop.routes & (1 << 0)) != 0) { - u1.setVisibility(View.VISIBLE); - } - if ((busStop.routes & (1 << 1)) != 0) { - u1n.setVisibility(View.VISIBLE); - } - if ((busStop.routes & (1 << 2)) != 0) { - u2.setVisibility(View.VISIBLE); - } - if ((busStop.routes & (1 << 3)) != 0) { - u6.setVisibility(View.VISIBLE); - } - if ((busStop.routes & (1 << 4)) != 0) { - u9.setVisibility(View.VISIBLE); - } - } + setPOIAndDist(poi, distInM); + addView(routes, busRouteLayoutParams); addView(name, textLayoutParams); addView(dist, distLayoutParams); } @@ -132,12 +83,6 @@ public class POIView extends LinearLayout { // Log.i(TAG, "Looking at poi " + poi.id); - u1.setVisibility(View.GONE); - u1n.setVisibility(View.GONE); - u2.setVisibility(View.GONE); - u6.setVisibility(View.GONE); - u9.setVisibility(View.GONE); - if (poi.type == POI.BUILDING) { Building building = (Building) poi; // Log.i(TAG, "Its a building of name " + building.name); @@ -150,21 +95,7 @@ public class POIView extends LinearLayout { name.setText(busStop.description + " (" + busStop.id + ")"); - if ((busStop.routes & (1 << 0)) != 0) { - u1.setVisibility(View.VISIBLE); - } - if ((busStop.routes & (1 << 1)) != 0) { - u1n.setVisibility(View.VISIBLE); - } - if ((busStop.routes & (1 << 2)) != 0) { - u2.setVisibility(View.VISIBLE); - } - if ((busStop.routes & (1 << 3)) != 0) { - u6.setVisibility(View.VISIBLE); - } - if ((busStop.routes & (1 << 4)) != 0) { - u9.setVisibility(View.VISIBLE); - } + routes.setRoutes(busStop.routes); } else if (poi.type == POI.SITE) { -- cgit v1.2.3 From 9c9fb6a6b1b5fe4c98ab77709007464d14deb756 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 13 Feb 2012 12:33:49 +0000 Subject: Improved route display for the BusRoutesView. --- src/net/cbaines/suma/BusRoutesView.java | 78 ++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/src/net/cbaines/suma/BusRoutesView.java b/src/net/cbaines/suma/BusRoutesView.java index f5af076..05e51b2 100644 --- a/src/net/cbaines/suma/BusRoutesView.java +++ b/src/net/cbaines/suma/BusRoutesView.java @@ -3,10 +3,12 @@ package net.cbaines.suma; import android.R.color; import android.content.Context; import android.view.View; +import android.widget.LinearLayout; import android.widget.TableLayout; +import android.widget.TableRow; import android.widget.TextView; -public class BusRoutesView extends TableLayout { +public class BusRoutesView extends LinearLayout { private TextView u1; private TextView u1n; @@ -14,65 +16,109 @@ public class BusRoutesView extends TableLayout { private TextView u6; private TextView u9; + private LinearLayout bottomRow; + private LinearLayout topRow; + public BusRoutesView(Context context, final byte routes) { super(context); u1 = new TextView(context); u1.setText(R.string.U1); u1.setBackgroundResource(R.drawable.u1_back_selected); - // /u1.setTextColor(color.white); + u1.setPadding(1, 1, 1, 1); u1n = new TextView(context); u1n.setText(R.string.U1N); u1n.setBackgroundResource(R.drawable.u1n_back_selected); - // u1n.setTextColor(color.white); + u1n.setPadding(1, 1, 1, 1); u2 = new TextView(context); u2.setText(R.string.U2); u2.setBackgroundResource(R.drawable.u2_back_selected); - // u2.setTextColor(color.white); + u2.setPadding(1, 1, 1, 1); u6 = new TextView(context); u6.setText(R.string.U6); u6.setBackgroundResource(R.drawable.u6_back_selected); - // u6.setTextColor(color.white); + u6.setPadding(1, 1, 1, 1); u9 = new TextView(context); u9.setText(R.string.U9); u9.setBackgroundResource(R.drawable.u9_back_selected); - // u9.setTextColor(color.white); + u9.setPadding(1, 1, 1, 1); + + this.setOrientation(LinearLayout.VERTICAL); + + topRow = new LinearLayout(context); + bottomRow = new LinearLayout(context); + + addView(topRow); + addView(bottomRow); } void setRoutes(byte routes) { - removeView(u1); - removeView(u1n); - removeView(u2); - removeView(u6); - removeView(u9); + topRow.removeView(u1); + topRow.removeView(u1n); + topRow.removeView(u2); + topRow.removeView(u6); + topRow.removeView(u9); + + bottomRow.removeView(u1); + bottomRow.removeView(u1n); + bottomRow.removeView(u2); + bottomRow.removeView(u6); + bottomRow.removeView(u9); + + boolean top = true; LayoutParams busRouteLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); if ((routes & (1 << 0)) != 0) { - addView(u1, busRouteLayoutParams); + if (top) { + topRow.addView(u1, busRouteLayoutParams); + } else { + bottomRow.addView(u1, busRouteLayoutParams); + } u1.setVisibility(View.VISIBLE); + top = !top; } if ((routes & (1 << 1)) != 0) { + if (top) { + topRow.addView(u1n, busRouteLayoutParams); + } else { + bottomRow.addView(u1n, busRouteLayoutParams); + } u1n.setVisibility(View.VISIBLE); - addView(u1n, busRouteLayoutParams); + top = !top; } if ((routes & (1 << 2)) != 0) { + if (top) { + topRow.addView(u2, busRouteLayoutParams); + } else { + bottomRow.addView(u2, busRouteLayoutParams); + } u2.setVisibility(View.VISIBLE); - addView(u2, busRouteLayoutParams); + top = !top; } if ((routes & (1 << 3)) != 0) { + if (top) { + topRow.addView(u6, busRouteLayoutParams); + } else { + bottomRow.addView(u6, busRouteLayoutParams); + } u6.setVisibility(View.VISIBLE); - addView(u6, busRouteLayoutParams); + top = !top; } if ((routes & (1 << 4)) != 0) { + if (top) { + topRow.addView(u9, busRouteLayoutParams); + } else { + bottomRow.addView(u9, busRouteLayoutParams); + } u9.setVisibility(View.VISIBLE); - addView(u9, busRouteLayoutParams); + top = !top; } } } -- cgit v1.2.3 From ab8408070361aec1e5df48f8e67f66689ae9d606 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 13 Feb 2012 22:13:56 +0000 Subject: Improvements to non Uni-Link routes, and BusRoutesView display. --- src/net/cbaines/suma/Bus.java | 6 +- src/net/cbaines/suma/BusRoutesView.java | 13 ++-- src/net/cbaines/suma/BusStopActivity.java | 2 +- src/net/cbaines/suma/DataManager.java | 110 +++++++++++++++++------------- src/net/cbaines/suma/Stop.java | 22 +++--- 5 files changed, 83 insertions(+), 70 deletions(-) diff --git a/src/net/cbaines/suma/Bus.java b/src/net/cbaines/suma/Bus.java index d8d96f3..bddba70 100644 --- a/src/net/cbaines/suma/Bus.java +++ b/src/net/cbaines/suma/Bus.java @@ -98,7 +98,11 @@ public class Bus { } String getName() { - return route.code + direction; + if (direction != null) { + return route.code + direction; + } else { + return route.code; + } } @Override diff --git a/src/net/cbaines/suma/BusRoutesView.java b/src/net/cbaines/suma/BusRoutesView.java index 05e51b2..b7c1095 100644 --- a/src/net/cbaines/suma/BusRoutesView.java +++ b/src/net/cbaines/suma/BusRoutesView.java @@ -1,11 +1,8 @@ package net.cbaines.suma; -import android.R.color; import android.content.Context; import android.view.View; import android.widget.LinearLayout; -import android.widget.TableLayout; -import android.widget.TableRow; import android.widget.TextView; public class BusRoutesView extends LinearLayout { @@ -25,27 +22,27 @@ public class BusRoutesView extends LinearLayout { u1 = new TextView(context); u1.setText(R.string.U1); u1.setBackgroundResource(R.drawable.u1_back_selected); - u1.setPadding(1, 1, 1, 1); + u1.setPadding(5, 1, 5, 1); u1n = new TextView(context); u1n.setText(R.string.U1N); u1n.setBackgroundResource(R.drawable.u1n_back_selected); - u1n.setPadding(1, 1, 1, 1); + u1n.setPadding(5, 1, 5, 1); u2 = new TextView(context); u2.setText(R.string.U2); u2.setBackgroundResource(R.drawable.u2_back_selected); - u2.setPadding(1, 1, 1, 1); + u2.setPadding(5, 1, 5, 1); u6 = new TextView(context); u6.setText(R.string.U6); u6.setBackgroundResource(R.drawable.u6_back_selected); - u6.setPadding(1, 1, 1, 1); + u6.setPadding(5, 1, 5, 1); u9 = new TextView(context); u9.setText(R.string.U9); u9.setBackgroundResource(R.drawable.u9_back_selected); - u9.setPadding(1, 1, 1, 1); + u9.setPadding(5, 1, 5, 1); this.setOrientation(LinearLayout.VERTICAL); diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 52f1b92..421a0eb 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -313,7 +313,7 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme if (THROW_ERROR_ON_EXCEPTION) { throw new RuntimeException(e.getMessage()); } else { - Log.e(TAG, e.getMessage()); + Log.e(TAG, e.getMessage(), e.getCause()); } } return newTimetable; diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index f642d56..84731ff 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -28,8 +28,10 @@ import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; @@ -68,7 +70,7 @@ public class DataManager { private final static String busStopUrl = "http://data.southampton.ac.uk/bus-stop/"; private static DatabaseHelper helper; - private static Dao busRoutes; + private static Dao busRouteDao; private static Dao busDao; private static Dao busStopDao; @@ -424,12 +426,12 @@ public class DataManager { Log.i(TAG, "Loaded sites from csv"); } - private static Stop getStop(Context context, JSONObject stopObj, BusStop busStop) throws SQLException, JSONException { + private static Stop getStop(Context context, JSONObject stopObj, Set routes, BusStop busStop) throws SQLException, JSONException { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); - if (busRoutes == null) - busRoutes = helper.getBusRouteDao(); + if (busRouteDao == null) + busRouteDao = helper.getBusRouteDao(); if (busDao == null) busDao = helper.getBusDao(); if (busStopDao == null) @@ -458,53 +460,50 @@ public class DataManager { String name = stopObj.getString("name"); - BusRoute route; - String dir = null; + BusRoute route = null; + String dir = ""; - if (name.contains("U")) { - if (name.equals("U1N")) { - route = busRoutes.queryForId(468); - } else if (name.startsWith("U9")) { - route = busRoutes.queryForId(354); - } else { - if (name.startsWith("U1")) { - route = busRoutes.queryForId(326); - } else if (name.startsWith("U2")) { - route = busRoutes.queryForId(329); - } else if (name.startsWith("U6")) { - route = busRoutes.queryForId(327); - } else { - throw new RuntimeException("Error finding Uni-Link route " + name); - } - - if (route.forwardDirection.equals(name.substring(2))) { - dir = route.forwardDirection; - } else if (route.reverseDirection.equals(name.substring(2))) { - dir = route.reverseDirection; + for (BusRoute tempRoute : routes) { + if (name.contains("U")) { + if (name.equals("U1N")) { + if (tempRoute.code.equals(name)) { + route = tempRoute; + dir = null; + } } else { - throw new RuntimeException("Error detecting direction for " + name); - } - } - - } else { - Log.v(TAG, "Route not Uni-Link"); - List routes = (List) busRoutes.queryForEq(BusRoute.CODE_FIELD_NAME, name); - if (routes.size() != 1) { - Log.e(TAG, "Found more than one non Uni-Link route?"); - for (BusRoute routeT : routes) { - Log.i(TAG, "Route: " + routeT); + if (tempRoute.code.equals(name.substring(0, 2))) { + route = tempRoute; + if (route.forwardDirection.equals(name.substring(2))) { + dir = route.forwardDirection; + } else if (route.reverseDirection.equals(name.substring(2))) { + dir = route.reverseDirection; + } else { + Log.e(TAG, "Error detecting direction for " + name); + dir = null; + return null; + } + } } - throw new RuntimeException("Found more than one non Uni-Link route?"); } else { - route = routes.get(0); - if (route == null) { - throw new RuntimeException("Could not find database entry for " + name); + if (tempRoute.code.equals(name)) { + route = tempRoute; + dir = null; } } } + if (route == null) { + Log.e(TAG, "Route not found (route == null) " + name); + return null; + } + + if (dir != null && dir.equals("")) { + Log.e(TAG, "Error detecting direction for " + name); + return null; + } + String destString = stopObj.getString("dest"); - BusStop destStop; + BusStop destStop = null; if (destString.equals("Central Station")) { destStop = busStopDao.queryForId("SNA19709"); @@ -528,8 +527,10 @@ public class DataManager { destStop = busStopDao.queryForId("SN121009"); } else if (destString.equals("General Hosp")) { destStop = busStopDao.queryForId("SNA19482"); + } else if (destString.equals("Wessex Lane")) { + destStop = busStopDao.queryForId("SNA19780"); } else { - throw new RuntimeException("Unknown end dest " + destString + " for route " + route.code); + Log.e(TAG, "Unknown end dest " + destString + " for route " + route.code); } Date now = new Date(System.currentTimeMillis()); @@ -571,8 +572,8 @@ public class DataManager { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); - if (busRoutes == null) - busRoutes = helper.getBusRouteDao(); + if (busRouteDao == null) + busRouteDao = helper.getBusRouteDao(); if (busStopDao == null) busStopDao = helper.getBusStopDao(); @@ -581,8 +582,23 @@ public class DataManager { String file = getFileFromServer(busStopUrl + busStop + ".json"); JSONObject data = new JSONObject(file); - JSONArray stopsArray = data.getJSONArray("stops"); + JSONObject routesObject = data.getJSONObject("routes"); + + HashSet busRoutes = new HashSet(); + for (Iterator keyIter = routesObject.keys(); keyIter.hasNext();) { + String key = keyIter.next(); + + Log.i(TAG, "Route Key: " + key); + + BusRoute route = busRouteDao.queryForId(Integer.parseInt(key.substring(key.length() - 3, key.length()))); + + if (route != null) { + busRoutes.add(route); + } else { + throw new RuntimeException("Route not found " + key.substring(key.length() - 3, key.length()) + " " + key); + } + } Log.i(TAG, "Number of entries " + data.length()); @@ -604,7 +620,7 @@ public class DataManager { Log.e(TAG, "BusStopObj == null"); } - Stop stop = getStop(context, stopObj, busStopObj); + Stop stop = getStop(context, stopObj, busRoutes, busStopObj); if (stop == null) { Log.w(TAG, "Null stop, skiping"); diff --git a/src/net/cbaines/suma/Stop.java b/src/net/cbaines/suma/Stop.java index 7947bed..b2452bd 100644 --- a/src/net/cbaines/suma/Stop.java +++ b/src/net/cbaines/suma/Stop.java @@ -31,16 +31,10 @@ import android.text.format.DateUtils; */ public class Stop { - public static final String ID_FIELD_NAME = "id"; - public static final String BUS_FIELD_NAME = "bus"; - public static final String BUS_STOP_FIELD_NAME = "busStop"; - public static final String ARIVAL_TIME_FIELD_NAME = "arivalTime"; - public static final String FETCH_TIME_FIELD_NAME = "timeOfFetch"; - - /** - * A generated id for the bus - */ - int id; + // public static final String BUS_FIELD_NAME = "bus"; + // public static final String BUS_STOP_FIELD_NAME = "busStop"; + // public static final String ARIVAL_TIME_FIELD_NAME = "arivalTime"; + // public static final String FETCH_TIME_FIELD_NAME = "timeOfFetch"; /** * The Bus stopping at the stop @@ -67,6 +61,11 @@ public class Stop { */ boolean live; + /** + * Assumed to be the number of seconds since this data was fetched from the ROMANSE system? + */ + int age; + /** * * @param bus @@ -101,7 +100,6 @@ public class Stop { result = prime * result + ((arivalTime == null) ? 0 : arivalTime.hashCode()); result = prime * result + ((bus == null) ? 0 : bus.hashCode()); result = prime * result + ((busStop == null) ? 0 : busStop.hashCode()); - result = prime * result + id; return result; } @@ -138,8 +136,6 @@ public class Stop { return false; } else if (!busStop.equals(other.busStop)) return false; - if (id != other.id) - return false; return true; } -- cgit v1.2.3 From 7e042d5406098591f3b0f8b94e47ffe3df40b34b Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 13 Feb 2012 22:26:10 +0000 Subject: Modified the stop toast making it shorter. --- src/net/cbaines/suma/StopView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/cbaines/suma/StopView.java b/src/net/cbaines/suma/StopView.java index 62cbc7e..68be1f6 100644 --- a/src/net/cbaines/suma/StopView.java +++ b/src/net/cbaines/suma/StopView.java @@ -88,7 +88,7 @@ public class StopView extends LinearLayout implements OnClickListener { if (stop.live) { onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } else { - onClickMessage = "Timetabled unidentified bus (" + stop.bus.getName() + ") at " + onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } } -- cgit v1.2.3 From 6805fb9c3ceb2d5973f7155022eeadf65fcd58cd Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 14 Feb 2012 11:42:58 +0000 Subject: Stuff moving towards getting BusActivity working. --- AndroidManifest.xml | 4 +- gen/net/cbaines/suma/R.java | 113 ++++++------ res/layout/bus_activity.xml | 114 ++++++++++++ src/net/cbaines/suma/Bus.java | 7 +- src/net/cbaines/suma/BusActivity.java | 247 ++++++++++++++++++++++++++ src/net/cbaines/suma/BusSpecificStopView.java | 137 ++++++++++++++ src/net/cbaines/suma/BusStopActivity.java | 7 +- src/net/cbaines/suma/DataManager.java | 72 +++++++- src/net/cbaines/suma/DatabaseHelper.java | 2 +- src/net/cbaines/suma/Preferences.java | 3 - src/net/cbaines/suma/StopView.java | 36 +++- 11 files changed, 675 insertions(+), 67 deletions(-) create mode 100644 res/layout/bus_activity.xml create mode 100644 src/net/cbaines/suma/BusActivity.java create mode 100644 src/net/cbaines/suma/BusSpecificStopView.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index c606279..21e3c2a 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -27,7 +27,9 @@ - + + + diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index 27ce28c..5d5d3ee 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -54,63 +54,76 @@ public final class R { public static final int u9_radio_button=0x7f02001d; } public static final class id { - public static final int busStopID=0x7f0a000e; - public static final int busStopListItems=0x7f0a0005; - public static final int busStopLoadBar=0x7f0a0013; - public static final int busStopMessage=0x7f0a0010; - public static final int busStopName=0x7f0a0006; - public static final int busStopTimes=0x7f0a0011; - public static final int busTimeContentLayout=0x7f0a000f; - public static final int centerLoadBar=0x7f0a0012; - public static final int check1=0x7f0a0022; - public static final int childname=0x7f0a0021; - public static final int donateBitcoinAddress=0x7f0a0019; + public static final int busActivityBusID=0x7f0a0005; + public static final int busActivityCenterLoadBar=0x7f0a000e; + public static final int busActivityContentLayout=0x7f0a000b; + public static final int busActivityHeaderLayout=0x7f0a0004; + public static final int busActivityLoadBar=0x7f0a000f; + public static final int busActivityMessage=0x7f0a000c; + public static final int busActivityTimes=0x7f0a000d; + public static final int busActivityU1=0x7f0a0006; + public static final int busActivityU1N=0x7f0a0007; + public static final int busActivityU2=0x7f0a0008; + public static final int busActivityU6=0x7f0a0009; + public static final int busActivityU9=0x7f0a000a; + public static final int busStopID=0x7f0a001a; + public static final int busStopListItems=0x7f0a0011; + public static final int busStopLoadBar=0x7f0a001f; + public static final int busStopMessage=0x7f0a001c; + public static final int busStopName=0x7f0a0012; + public static final int busStopTimes=0x7f0a001d; + public static final int busTimeContentLayout=0x7f0a001b; + public static final int centerLoadBar=0x7f0a001e; + public static final int check1=0x7f0a002e; + public static final int childname=0x7f0a002d; + public static final int donateBitcoinAddress=0x7f0a0025; public static final int donateButton=0x7f0a0003; - public static final int donateDialogErrorMessage=0x7f0a0018; - public static final int donateDialogMessage=0x7f0a0015; - public static final int donateDialogMessageLayout=0x7f0a0017; - public static final int donateDialogProgress=0x7f0a0016; - public static final int favouriteCheckBox=0x7f0a000d; - public static final int favouriteDialogMessage=0x7f0a001f; - public static final int favouriteListItems=0x7f0a0020; - public static final int findContentLayout=0x7f0a001b; - public static final int findListItems=0x7f0a001d; - public static final int findLoadBar=0x7f0a001c; + public static final int donateDialogErrorMessage=0x7f0a0024; + public static final int donateDialogMessage=0x7f0a0021; + public static final int donateDialogMessageLayout=0x7f0a0023; + public static final int donateDialogProgress=0x7f0a0022; + public static final int favouriteCheckBox=0x7f0a0019; + public static final int favouriteDialogMessage=0x7f0a002b; + public static final int favouriteListItems=0x7f0a002c; + public static final int findContentLayout=0x7f0a0027; + public static final int findListItems=0x7f0a0029; + public static final int findLoadBar=0x7f0a0028; public static final int helpExpandableListView=0x7f0a0002; - public static final int layout_root=0x7f0a0004; - public static final int linearLayout1=0x7f0a0007; - public static final int linearLayout2=0x7f0a0014; - public static final int mapview=0x7f0a001e; - public static final int menu_about=0x7f0a0028; - public static final int menu_favourites=0x7f0a0029; - public static final int menu_find=0x7f0a0024; - public static final int menu_find_my_location=0x7f0a0026; - public static final int menu_next_stop=0x7f0a002c; - public static final int menu_preferences=0x7f0a0025; - public static final int menu_previous_stop=0x7f0a002a; - public static final int menu_refresh_stop=0x7f0a002b; - public static final int menu_view=0x7f0a0027; - public static final int radio_u1=0x7f0a0008; - public static final int radio_u1n=0x7f0a0009; - public static final int radio_u2=0x7f0a000a; - public static final int radio_u6=0x7f0a000b; - public static final int radio_u9=0x7f0a000c; - public static final int searchBar=0x7f0a001a; + public static final int layout_root=0x7f0a0010; + public static final int linearLayout1=0x7f0a0013; + public static final int linearLayout2=0x7f0a0020; + public static final int mapview=0x7f0a002a; + public static final int menu_about=0x7f0a0034; + public static final int menu_favourites=0x7f0a0035; + public static final int menu_find=0x7f0a0030; + public static final int menu_find_my_location=0x7f0a0032; + public static final int menu_next_stop=0x7f0a0038; + public static final int menu_preferences=0x7f0a0031; + public static final int menu_previous_stop=0x7f0a0036; + public static final int menu_refresh_stop=0x7f0a0037; + public static final int menu_view=0x7f0a0033; + public static final int radio_u1=0x7f0a0014; + public static final int radio_u1n=0x7f0a0015; + public static final int radio_u2=0x7f0a0016; + public static final int radio_u6=0x7f0a0017; + public static final int radio_u9=0x7f0a0018; + public static final int searchBar=0x7f0a0026; public static final int textView1=0x7f0a0000; public static final int textView2=0x7f0a0001; - public static final int view_list=0x7f0a0023; + public static final int view_list=0x7f0a002f; } public static final class layout { public static final int about_dialog=0x7f030000; - public static final int bus_stop_dialog=0x7f030001; - public static final int bustimes=0x7f030002; - public static final int donate_dialog=0x7f030003; - public static final int find=0x7f030004; - public static final int main=0x7f030005; - public static final int poi_dialog=0x7f030006; - public static final int view_child_row=0x7f030007; - public static final int view_dialog=0x7f030008; - public static final int view_group_row=0x7f030009; + public static final int bus_activity=0x7f030001; + public static final int bus_stop_dialog=0x7f030002; + public static final int bustimes=0x7f030003; + public static final int donate_dialog=0x7f030004; + public static final int find=0x7f030005; + public static final int main=0x7f030006; + public static final int poi_dialog=0x7f030007; + public static final int view_child_row=0x7f030008; + public static final int view_dialog=0x7f030009; + public static final int view_group_row=0x7f03000a; } public static final class menu { public static final int map_menu=0x7f090000; diff --git a/res/layout/bus_activity.xml b/res/layout/bus_activity.xml new file mode 100644 index 0000000..1468be5 --- /dev/null +++ b/res/layout/bus_activity.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/net/cbaines/suma/Bus.java b/src/net/cbaines/suma/Bus.java index bddba70..ac2d223 100644 --- a/src/net/cbaines/suma/Bus.java +++ b/src/net/cbaines/suma/Bus.java @@ -19,6 +19,9 @@ package net.cbaines.suma; +import android.os.Parcel; +import android.os.Parcelable; + import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; @@ -53,13 +56,13 @@ public class Bus { /** * The direction which the bus is travelling. */ - @DatabaseField(canBeNull = false) + @DatabaseField(canBeNull = true) String direction; /** * The destination the bus is travelling towards. */ - @DatabaseField(canBeNull = false, foreign = true) + @DatabaseField(canBeNull = true, foreign = true) BusStop destination; Bus() { diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java new file mode 100644 index 0000000..44faaa7 --- /dev/null +++ b/src/net/cbaines/suma/BusActivity.java @@ -0,0 +1,247 @@ +package net.cbaines.suma; + +import java.io.IOException; +import java.sql.SQLException; +import java.util.Iterator; +import java.util.List; + +import org.apache.http.client.ClientProtocolException; +import org.json.JSONException; + +import android.content.Context; +import android.content.SharedPreferences; +import android.os.AsyncTask; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.util.Log; +import android.view.Gravity; +import android.view.View; +import android.widget.CheckBox; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; + +public class BusActivity extends OrmLiteBaseActivity { + final static String TAG = "BusActivity"; + + private CheckBox U1RouteRadioButton; + private CheckBox U1NRouteRadioButton; + private CheckBox U2RouteRadioButton; + private CheckBox U6RouteRadioButton; + private CheckBox U9RouteRadioButton; + + private TextView busIDTextView; + + private ProgressBar progBar; + private TextView busContentMessage; + private LinearLayout busActivityContentLayout; + + private Bus bus; + private BusStop busStop; + + protected Timetable timetable; + private Timetable visibleTimetable; + + private Context instance; + + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.bus_activity); + instance = this; + + String busID = getIntent().getExtras().getString("busID"); + String busStopID = getIntent().getExtras().getString("busStopID"); + final DatabaseHelper helper = getHelper(); + + try { + List buses = helper.getBusDao().queryForEq(Bus.ID_FIELD_NAME, busID); + bus = null; + if (buses.size() == 0) { + Log.e(TAG, "Bus " + busID + " not found!"); + } else if (buses.size() == 1) { + bus = buses.get(0); + } else if (buses.size() > 1) { + Log.e(TAG, "Found more than one bus? " + busID); + } + + List busStops = helper.getBusStopDao().queryForEq(BusStop.ID_FIELD_NAME, busStopID); + busStop = null; + if (busStops.size() == 0) { + Log.e(TAG, "BusStop " + busStopID + " not found!"); + } else if (busStops.size() == 1) { + busStop = busStops.get(0); + } else if (busStops.size() > 1) { + Log.e(TAG, "Found more than one busStop? " + busStopID); + } + + U1RouteRadioButton = (CheckBox) findViewById(R.id.radio_u1); + U1NRouteRadioButton = (CheckBox) findViewById(R.id.radio_u1n); + U2RouteRadioButton = (CheckBox) findViewById(R.id.radio_u2); + U6RouteRadioButton = (CheckBox) findViewById(R.id.radio_u6); + U9RouteRadioButton = (CheckBox) findViewById(R.id.radio_u9); + + busIDTextView = (TextView) findViewById(R.id.busActivityBusID); + + progBar = (ProgressBar) findViewById(R.id.busActivityCenterLoadBar); + busContentMessage = (TextView) findViewById(R.id.busActivityMessage); + busActivityContentLayout = (LinearLayout) findViewById(R.id.busActivityContentLayout); + + if (bus.id != null) { + Log.i(TAG, "Bus id is not null (" + bus.id + ") setting busIDTextView"); + busIDTextView.setText(bus.id); + } else { + Log.w(TAG, "Bus id is null?"); + // Might not ever happen + busIDTextView.setText("Unidentified"); + } + + if (bus.route.uniLink) { + Log.i(TAG, "Bus is uniLink"); + if (bus.route.code.equals("U1")) { + U1RouteRadioButton.setVisibility(View.VISIBLE); + U1NRouteRadioButton.setVisibility(View.GONE); + U2RouteRadioButton.setVisibility(View.GONE); + U6RouteRadioButton.setVisibility(View.GONE); + U9RouteRadioButton.setVisibility(View.GONE); + } else if (bus.route.code.equals("U1N")) { + U1RouteRadioButton.setVisibility(View.GONE); + U1NRouteRadioButton.setVisibility(View.VISIBLE); + U2RouteRadioButton.setVisibility(View.GONE); + U6RouteRadioButton.setVisibility(View.GONE); + U9RouteRadioButton.setVisibility(View.GONE); + } else if (bus.route.code.equals("U2")) { + U1RouteRadioButton.setVisibility(View.GONE); + U1NRouteRadioButton.setVisibility(View.GONE); + U2RouteRadioButton.setVisibility(View.VISIBLE); + U6RouteRadioButton.setVisibility(View.GONE); + U9RouteRadioButton.setVisibility(View.GONE); + } else if (bus.route.code.equals("U6")) { + U1RouteRadioButton.setVisibility(View.GONE); + U1NRouteRadioButton.setVisibility(View.GONE); + U2RouteRadioButton.setVisibility(View.GONE); + U6RouteRadioButton.setVisibility(View.VISIBLE); + U9RouteRadioButton.setVisibility(View.GONE); + } else if (bus.route.code.equals("U9")) { + U1RouteRadioButton.setVisibility(View.GONE); + U1NRouteRadioButton.setVisibility(View.GONE); + U2RouteRadioButton.setVisibility(View.GONE); + U6RouteRadioButton.setVisibility(View.GONE); + U9RouteRadioButton.setVisibility(View.VISIBLE); + } else { + Log.e(TAG, "Route not found " + bus.route.code); + } + } + + } catch (NumberFormatException e) { + e.printStackTrace(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + private class GetTimetableTask extends AsyncTask { + String errorMessage; + + protected void onPreExecute() { + progBar.setVisibility(View.VISIBLE); + } + + protected Timetable doInBackground(String... busStopID) { + Timetable newTimetable = null; + try { + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(instance); + + newTimetable = DataManager.getTimetable(instance, bus, busStop, 10); + } catch (SQLException e) { + errorMessage = "Error message regarding SQL?"; + e.printStackTrace(); + } catch (ClientProtocolException e) { + errorMessage = "ClientProtocolException!?!"; + e.printStackTrace(); + } catch (IOException e) { + errorMessage = "Error fetching bus times from server, are you connected to the internet?"; + e.printStackTrace(); + } catch (JSONException e) { + errorMessage = "Error parsing bus times"; + e.printStackTrace(); + } catch (Exception e) { + Log.e(TAG, e.getMessage(), e.getCause()); + } + return newTimetable; + } + + protected void onPostExecute(Timetable newTimetable) { + Log.i(TAG, "Got timetable"); + if (newTimetable == null) { + Log.i(TAG, "Its null"); + + progBar.setVisibility(View.GONE); + busContentMessage.setText(errorMessage); + busContentMessage.setVisibility(View.VISIBLE); + } else { + progBar.setVisibility(View.GONE); + timetable = newTimetable; + displayTimetable(timetable); + } + } + } + + private void displayTimetable(Timetable timetable) { + visibleTimetable = (Timetable) timetable.clone(); + + Log.i(TAG, "It contains " + visibleTimetable.size() + " stops"); + + if (timetable.size() == 0) { + busContentMessage.setText("No Busses"); + busContentMessage.setVisibility(View.VISIBLE); + busActivityContentLayout.setGravity(Gravity.CENTER); + } else { + + for (Iterator stopIter = visibleTimetable.iterator(); stopIter.hasNext();) { + Stop stop = stopIter.next(); + Log.i(TAG, "Begin filtering, looking at " + stop + " with route " + stop.bus.route.code); + if (stop.bus.route.code.equals("U1")) { + if (!U1RouteRadioButton.isChecked()) { + stopIter.remove(); + } + } else if (stop.bus.route.code.equals("U1N")) { + if (!U1NRouteRadioButton.isChecked()) { + stopIter.remove(); + } + } else if (stop.bus.route.code.equals("U2")) { + if (!U2RouteRadioButton.isChecked()) { + stopIter.remove(); + } + } else if (stop.bus.route.code.equals("U6")) { + if (!U6RouteRadioButton.isChecked()) { + stopIter.remove(); + } + } else if (stop.bus.route.code.equals("U9")) { + if (!U9RouteRadioButton.isChecked()) { + stopIter.remove(); + } + } + } + + if (visibleTimetable.size() == 0) { + busActivityContentLayout.setGravity(Gravity.CENTER); + busContentMessage.setText("No Busses (With the current enabled routes)"); + busContentMessage.setVisibility(View.VISIBLE); + busTimeList.setVisibility(View.GONE); + } else { + busTimeList.setVisibility(View.VISIBLE); + busContentMessage.setVisibility(View.GONE); + TimetableAdapter adapter; + if ((adapter = (TimetableAdapter) busTimeList.getAdapter()) != null) { + adapter.updateTimetable(visibleTimetable); + } else { + adapter = new TimetableAdapter(this, visibleTimetable); + busTimeList.setAdapter(adapter); + } + busActivityContentLayout.setGravity(Gravity.TOP); + } + } + } +} diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java new file mode 100644 index 0000000..1997e4a --- /dev/null +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -0,0 +1,137 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package net.cbaines.suma; + +import java.sql.SQLException; +import java.text.DateFormat; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.view.Gravity; +import android.view.View; +import android.view.View.OnClickListener; +import android.view.View.OnLongClickListener; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import com.j256.ormlite.android.apptools.OpenHelperManager; +import com.j256.ormlite.dao.Dao; + +public class BusSpecificStopView extends LinearLayout implements OnClickListener, OnLongClickListener { + + // private final ImageView icon; + + // private static final String TAG = "StopView"; + + private final TextView location; + private final TextView time; + private String onClickMessage = ""; + private final Context context; + + private Stop stop; + + public BusSpecificStopView(Context context, Stop stop) { + super(context); + + this.context = context; + + this.setOrientation(HORIZONTAL); + + location = new TextView(context); + location.setTextSize(22f); + + time = new TextView(context); + time.setTextSize(22f); + time.setGravity(Gravity.RIGHT); + + setStop(stop); + + addView(location, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); + addView(time, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); + } + + public void setStop(Stop stop) { + + // Log.i(TAG, "Time of arival " + stop.arivalTime); + + this.stop = stop; + + location.setText(stop.busStop.description); + time.setText(stop.getTimeToArival()); + + DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + + try { + Dao busDao = helper.getBusDao(); + + busDao.refresh(stop.bus); + + if (stop.bus.id != null) { + if (stop.live) { + onClickMessage = "Bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } else { + onClickMessage = "Timetabled bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } + } else { + if (stop.live) { + onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } else { + onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + + this.setOnClickListener(this); + this.setOnLongClickListener(this); + } + + public void onClick(View v) { + Toast.makeText(context, onClickMessage, Toast.LENGTH_SHORT).show(); + + } + + @Override + public boolean onLongClick(View v) { + DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + + try { + Dao busDao = helper.getBusDao(); + + busDao.refresh(stop.bus); + + if (stop.bus.id != null) { + Intent i = new Intent(context, BusActivity.class); + i.putExtra("busID", stop.bus.id); + ((Activity) context).startActivityForResult(i, 0); + } else { + Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT).show(); + } + + } catch (SQLException e) { + e.printStackTrace(); + } + return false; + } + +} diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 421a0eb..5928033 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -310,12 +310,9 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme errorMessage = "Error parsing bus times"; e.printStackTrace(); } catch (Exception e) { - if (THROW_ERROR_ON_EXCEPTION) { - throw new RuntimeException(e.getMessage()); - } else { - Log.e(TAG, e.getMessage(), e.getCause()); - } + Log.e(TAG, e.getMessage(), e.getCause()); } + return newTimetable; } diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 84731ff..634415d 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.sql.SQLException; +import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; @@ -550,18 +551,19 @@ public class DataManager { if (bus == null) { bus = new Bus(busID, route, dir); bus.destination = destStop; + busDao.create(bus); } else { bus.destination = destStop; bus.route = route; bus.direction = dir; + busDao.update(bus); } } else { bus = new Bus(null, route, dir); + busDao.create(bus); } - busDao.update(bus); - stop = new Stop(bus, busStop, calender.getTime(), now, live); return stop; @@ -636,6 +638,72 @@ public class DataManager { return timetable; } + public static Timetable getTimetable(Context context, Bus bus, BusStop startStop, int num) throws SQLException, ClientProtocolException, IOException, + JSONException { + + if (helper == null) + helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + if (busRouteDao == null) + busRouteDao = helper.getBusRouteDao(); + if (busStopDao == null) + busStopDao = helper.getBusStopDao(); + + Timetable timetable = new Timetable(); + + List busStops = new ArrayList(num); + busStops.add(startStop); + + BusRoute route = bus.route; + + for (int i = 0; i < num; i++) { + BusStop nextStop = route.moveInRoute(context, busStops.get(i), bus.direction, 1); + + if (nextStop != null) { + busStops.add(nextStop); + } else { + Log.e(TAG, "nextStop is null"); + } + } + + for (BusStop busStop : busStops) { + + String file = getFileFromServer(busStopUrl + busStop + ".json"); + + JSONObject data = new JSONObject(file); + JSONArray stopsArray = data.getJSONArray("stops"); + + HashSet busRoutes = new HashSet(); + busRoutes.add(bus.route); + + Log.i(TAG, "Number of entries " + data.length()); + + Log.i(TAG, "Stops: " + data.getJSONArray("stops")); + + for (int stopNum = 0; stopNum < stopsArray.length(); stopNum++) { + JSONObject stopObj = stopsArray.getJSONObject(stopNum); + + if (stopObj.getString("vehicle").equals(bus.id)) { + + Stop stop = getStop(context, stopObj, busRoutes, busStop); + + if (stop == null) { + Log.w(TAG, "Null stop, skiping"); + continue; + } + + Log.i(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); + + timetable.add(stop); + + } + } + } + + timetable.fetchTime = new Date(System.currentTimeMillis()); + + return timetable; + } + static PathOverlay getRoutePath(InputStream routeResource, int colour, ResourceProxy resProxy) { PathOverlay data = null; diff --git a/src/net/cbaines/suma/DatabaseHelper.java b/src/net/cbaines/suma/DatabaseHelper.java index a72faca..2d8f9d2 100644 --- a/src/net/cbaines/suma/DatabaseHelper.java +++ b/src/net/cbaines/suma/DatabaseHelper.java @@ -40,7 +40,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { private static final String DATABASE_PATH = "/data/data/net.cbaines.suma/databases/"; private static final String DATABASE_NAME = "data.db"; - private static final int DATABASE_VERSION = 38; + private static final int DATABASE_VERSION = 39; private static final String TAG = "DatabaseHelper"; diff --git a/src/net/cbaines/suma/Preferences.java b/src/net/cbaines/suma/Preferences.java index df44729..d73d0ce 100644 --- a/src/net/cbaines/suma/Preferences.java +++ b/src/net/cbaines/suma/Preferences.java @@ -10,7 +10,4 @@ public interface Preferences { static final boolean NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = false; static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStops"; static final boolean NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = false; - - static final boolean THROW_ERROR_ON_EXCEPTION = false; - } diff --git a/src/net/cbaines/suma/StopView.java b/src/net/cbaines/suma/StopView.java index 68be1f6..0fe3aa1 100644 --- a/src/net/cbaines/suma/StopView.java +++ b/src/net/cbaines/suma/StopView.java @@ -22,10 +22,13 @@ package net.cbaines.suma; import java.sql.SQLException; import java.text.DateFormat; +import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; +import android.view.View.OnLongClickListener; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; @@ -33,7 +36,7 @@ import android.widget.Toast; import com.j256.ormlite.android.apptools.OpenHelperManager; import com.j256.ormlite.dao.Dao; -public class StopView extends LinearLayout implements OnClickListener { +public class StopView extends LinearLayout implements OnClickListener, OnLongClickListener { // private final ImageView icon; @@ -44,6 +47,8 @@ public class StopView extends LinearLayout implements OnClickListener { private String onClickMessage = ""; private final Context context; + private Stop stop; + public StopView(Context context, Stop stop) { super(context); @@ -68,6 +73,8 @@ public class StopView extends LinearLayout implements OnClickListener { // Log.i(TAG, "Time of arival " + stop.arivalTime); + this.stop = stop; + name.setText(stop.bus.getName()); time.setText(stop.getTimeToArival()); @@ -88,8 +95,7 @@ public class StopView extends LinearLayout implements OnClickListener { if (stop.live) { onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } else { - onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " - + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } } } catch (SQLException e) { @@ -97,6 +103,7 @@ public class StopView extends LinearLayout implements OnClickListener { } this.setOnClickListener(this); + this.setOnLongClickListener(this); } public void onClick(View v) { @@ -104,4 +111,27 @@ public class StopView extends LinearLayout implements OnClickListener { } + @Override + public boolean onLongClick(View v) { + DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + + try { + Dao busDao = helper.getBusDao(); + + busDao.refresh(stop.bus); + + if (stop.bus.id != null) { + Intent i = new Intent(context, BusActivity.class); + i.putExtra("busID", stop.bus.id); + ((Activity) context).startActivityForResult(i, 0); + } else { + Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT).show(); + } + + } catch (SQLException e) { + e.printStackTrace(); + } + return false; + } + } -- cgit v1.2.3 From 663b57be020d4e6ef1cc7eaa9f5fca5ad7846653 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 14 Feb 2012 15:27:30 +0000 Subject: More changes to support the BusActivity. --- gen/net/cbaines/suma/R.java | 2 +- res/layout/bus_activity.xml | 2 +- src/net/cbaines/suma/BusActivity.java | 95 ++++++++++++++-------- .../cbaines/suma/BusSpecificTimetableAdapter.java | 93 +++++++++++++++++++++ src/net/cbaines/suma/DataManager.java | 43 ++++++++++ src/net/cbaines/suma/StopView.java | 1 + 6 files changed, 198 insertions(+), 38 deletions(-) create mode 100644 src/net/cbaines/suma/BusSpecificTimetableAdapter.java diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index 5d5d3ee..963c682 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -55,10 +55,10 @@ public final class R { } public static final class id { public static final int busActivityBusID=0x7f0a0005; - public static final int busActivityCenterLoadBar=0x7f0a000e; public static final int busActivityContentLayout=0x7f0a000b; public static final int busActivityHeaderLayout=0x7f0a0004; public static final int busActivityLoadBar=0x7f0a000f; + public static final int busActivityLoadBarLayout=0x7f0a000e; public static final int busActivityMessage=0x7f0a000c; public static final int busActivityTimes=0x7f0a000d; public static final int busActivityU1=0x7f0a0006; diff --git a/res/layout/bus_activity.xml b/res/layout/bus_activity.xml index 1468be5..b78f78a 100644 --- a/res/layout/bus_activity.xml +++ b/res/layout/bus_activity.xml @@ -97,7 +97,7 @@ { +public class BusActivity extends OrmLiteBaseActivity implements Preferences { final static String TAG = "BusActivity"; private CheckBox U1RouteRadioButton; @@ -32,6 +35,9 @@ public class BusActivity extends OrmLiteBaseActivity { private CheckBox U6RouteRadioButton; private CheckBox U9RouteRadioButton; + private Handler handler; + private Runnable refreshData; + private TextView busIDTextView; private ProgressBar progBar; @@ -44,6 +50,10 @@ public class BusActivity extends OrmLiteBaseActivity { protected Timetable timetable; private Timetable visibleTimetable; + private ListView timetableView; + + private HashSet timetableStopTasks; + private Context instance; public void onCreate(Bundle savedInstanceState) { @@ -84,7 +94,7 @@ public class BusActivity extends OrmLiteBaseActivity { busIDTextView = (TextView) findViewById(R.id.busActivityBusID); - progBar = (ProgressBar) findViewById(R.id.busActivityCenterLoadBar); + progBar = (ProgressBar) findViewById(R.id.busActivityLoadBar); busContentMessage = (TextView) findViewById(R.id.busActivityMessage); busActivityContentLayout = (LinearLayout) findViewById(R.id.busActivityContentLayout); @@ -141,7 +151,47 @@ public class BusActivity extends OrmLiteBaseActivity { } } - private class GetTimetableTask extends AsyncTask { + public void onResume() { + super.onResume(); + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); + if (sharedPrefs.getBoolean(UNI_LINK_BUS_TIMES, UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT) + || sharedPrefs.getBoolean(NON_UNI_LINK_BUS_TIMES, NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT)) { + Log.i(TAG, "Live Times enabled"); + timetable = (Timetable) getLastNonConfigurationInstance(); + + refreshData = new Runnable() { + @Override + public void run() { + GetTimetableStopTask timetableStopTask = new GetTimetableStopTask(); + timetableStopTask.execute(busStopID); + handler.postDelayed(refreshData, 20000); + } + }; + + handler = new Handler(); + + if (timetable == null) { + Log.i(TAG, "No Previous timetable"); + handler.post(refreshData); + } else { + Log.i(TAG, "Displaying previous timetable"); + displayTimetable(timetable); + if (System.currentTimeMillis() - timetable.fetchTime.getTime() > 20000) { + handler.post(refreshData); + } + } + + } else { + Log.i(TAG, "Live Times Disabled"); + progBar.setVisibility(View.GONE); + busContentMessage.setText("Live bus times disabled"); + busContentMessage.setVisibility(View.VISIBLE); + } + + } + + private class GetTimetableStopTask extends AsyncTask { String errorMessage; protected void onPreExecute() { @@ -198,47 +248,20 @@ public class BusActivity extends OrmLiteBaseActivity { busContentMessage.setVisibility(View.VISIBLE); busActivityContentLayout.setGravity(Gravity.CENTER); } else { - - for (Iterator stopIter = visibleTimetable.iterator(); stopIter.hasNext();) { - Stop stop = stopIter.next(); - Log.i(TAG, "Begin filtering, looking at " + stop + " with route " + stop.bus.route.code); - if (stop.bus.route.code.equals("U1")) { - if (!U1RouteRadioButton.isChecked()) { - stopIter.remove(); - } - } else if (stop.bus.route.code.equals("U1N")) { - if (!U1NRouteRadioButton.isChecked()) { - stopIter.remove(); - } - } else if (stop.bus.route.code.equals("U2")) { - if (!U2RouteRadioButton.isChecked()) { - stopIter.remove(); - } - } else if (stop.bus.route.code.equals("U6")) { - if (!U6RouteRadioButton.isChecked()) { - stopIter.remove(); - } - } else if (stop.bus.route.code.equals("U9")) { - if (!U9RouteRadioButton.isChecked()) { - stopIter.remove(); - } - } - } - if (visibleTimetable.size() == 0) { busActivityContentLayout.setGravity(Gravity.CENTER); busContentMessage.setText("No Busses (With the current enabled routes)"); busContentMessage.setVisibility(View.VISIBLE); - busTimeList.setVisibility(View.GONE); + timetableView.setVisibility(View.GONE); } else { - busTimeList.setVisibility(View.VISIBLE); + timetableView.setVisibility(View.VISIBLE); busContentMessage.setVisibility(View.GONE); - TimetableAdapter adapter; - if ((adapter = (TimetableAdapter) busTimeList.getAdapter()) != null) { + BusSpecificTimetableAdapter adapter; + if ((adapter = (BusSpecificTimetableAdapter) timetableView.getAdapter()) != null) { adapter.updateTimetable(visibleTimetable); } else { - adapter = new TimetableAdapter(this, visibleTimetable); - busTimeList.setAdapter(adapter); + adapter = new BusSpecificTimetableAdapter(this, visibleTimetable); + timetableView.setAdapter(adapter); } busActivityContentLayout.setGravity(Gravity.TOP); } diff --git a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java new file mode 100644 index 0000000..6356e00 --- /dev/null +++ b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java @@ -0,0 +1,93 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package net.cbaines.suma; + +import android.content.Context; +import android.util.Log; +import android.view.View; +import android.view.ViewGroup; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.widget.BaseAdapter; + +public class BusSpecificTimetableAdapter extends BaseAdapter { + + private final Context context; + private Timetable timetable; + private final Animation a; + private boolean[] changed; + + private static final String TAG = "TimetableAdapter"; + + public BusSpecificTimetableAdapter(Context context, Timetable timetable) { + this.context = context; + this.timetable = timetable; + this.a = AnimationUtils.loadAnimation(context, R.anim.updated_stop_view); + } + + public View getView(int position, View convertView, ViewGroup parent) { + Log.i(TAG, "Returning stop " + position + " " + timetable.get(position)); + + BusSpecificStopView stopView; + if (convertView == null) { + stopView = new BusSpecificStopView(context, timetable.get(position)); + } else { + stopView = (BusSpecificStopView) convertView; + stopView.setStop(timetable.get(position)); + } + + if (changed == null || changed[position]) { + a.reset(); + stopView.startAnimation(a); + Log.i(TAG, "Animating it"); + } + + return stopView; + } + + public int getCount() { + return timetable.size(); + } + + public Object getItem(int position) { + return position; + } + + public long getItemId(int position) { + return position; + } + + public void updateTimetable(Timetable newTimetable) { + Log.v(TAG, "Old timetable " + timetable); + Log.v(TAG, "Adaptor loading new timetable"); + changed = new boolean[newTimetable.size()]; + for (int i = 0; i < newTimetable.size(); i++) { + if (!timetable.contains(newTimetable.get(i), true)) { + changed[i] = true; + Log.i(TAG, "Old timetable does not contain: " + newTimetable.get(i)); + } else { + Log.i(TAG, "Old timetable contains: " + newTimetable.get(i)); + changed[i] = false; + } + } + timetable = newTimetable; + this.notifyDataSetChanged(); + } +} diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 634415d..a1530b7 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -704,6 +704,49 @@ public class DataManager { return timetable; } + public static Stop getStop(Context context, Bus bus, BusStop busStop) throws SQLException, ClientProtocolException, IOException, JSONException { + + if (helper == null) + helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + if (busRouteDao == null) + busRouteDao = helper.getBusRouteDao(); + if (busStopDao == null) + busStopDao = helper.getBusStopDao(); + + String file = getFileFromServer(busStopUrl + busStop + ".json"); + + JSONObject data = new JSONObject(file); + JSONArray stopsArray = data.getJSONArray("stops"); + + HashSet busRoutes = new HashSet(); + busRoutes.add(bus.route); + + Stop stop = null; + + Log.i(TAG, "Number of entries " + data.length()); + + Log.i(TAG, "Stops: " + data.getJSONArray("stops")); + + for (int stopNum = 0; stopNum < stopsArray.length(); stopNum++) { + JSONObject stopObj = stopsArray.getJSONObject(stopNum); + + if (stopObj.getString("vehicle").equals(bus.id)) { + + stop = getStop(context, stopObj, busRoutes, busStop); + + if (stop == null) { + Log.w(TAG, "Null stop, skiping"); + continue; + } + + Log.i(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); + + } + } + + return stop; + } + static PathOverlay getRoutePath(InputStream routeResource, int colour, ResourceProxy resProxy) { PathOverlay data = null; diff --git a/src/net/cbaines/suma/StopView.java b/src/net/cbaines/suma/StopView.java index 0fe3aa1..cc60280 100644 --- a/src/net/cbaines/suma/StopView.java +++ b/src/net/cbaines/suma/StopView.java @@ -123,6 +123,7 @@ public class StopView extends LinearLayout implements OnClickListener, OnLongCli if (stop.bus.id != null) { Intent i = new Intent(context, BusActivity.class); i.putExtra("busID", stop.bus.id); + i.putExtra("busStopID", stop.busStop.id); ((Activity) context).startActivityForResult(i, 0); } else { Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT).show(); -- cgit v1.2.3 From dd82262b990a609c715ee43386d149416d1fefbf Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 15 Feb 2012 16:42:56 +0000 Subject: Working stop bus arival prediction. --- src/net/cbaines/suma/BusActivity.java | 117 +++++++++++++++------ src/net/cbaines/suma/BusSpecificStopView.java | 54 +++++++--- .../cbaines/suma/BusSpecificTimetableAdapter.java | 16 +-- src/net/cbaines/suma/DataManager.java | 43 ++++---- .../suma/SouthamptonUniversityMapActivity.java | 22 +++- src/net/cbaines/suma/Stop.java | 13 +++ src/net/cbaines/suma/Timetable.java | 12 ++- 7 files changed, 196 insertions(+), 81 deletions(-) diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index 6a90d7f..392baf2 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -2,12 +2,15 @@ package net.cbaines.suma; import java.io.IOException; import java.sql.SQLException; +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; import org.apache.http.client.ClientProtocolException; +import org.json.JSONArray; import org.json.JSONException; +import org.json.JSONObject; import android.content.Context; import android.content.SharedPreferences; @@ -29,11 +32,11 @@ import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; public class BusActivity extends OrmLiteBaseActivity implements Preferences { final static String TAG = "BusActivity"; - private CheckBox U1RouteRadioButton; - private CheckBox U1NRouteRadioButton; - private CheckBox U2RouteRadioButton; - private CheckBox U6RouteRadioButton; - private CheckBox U9RouteRadioButton; + private TextView U1RouteRadioButton; + private TextView U1NRouteRadioButton; + private TextView U2RouteRadioButton; + private TextView U6RouteRadioButton; + private TextView U9RouteRadioButton; private Handler handler; private Runnable refreshData; @@ -56,6 +59,10 @@ public class BusActivity extends OrmLiteBaseActivity implements private Context instance; + private List busStops; + + int num = 15; + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bus_activity); @@ -86,17 +93,18 @@ public class BusActivity extends OrmLiteBaseActivity implements Log.e(TAG, "Found more than one busStop? " + busStopID); } - U1RouteRadioButton = (CheckBox) findViewById(R.id.radio_u1); - U1NRouteRadioButton = (CheckBox) findViewById(R.id.radio_u1n); - U2RouteRadioButton = (CheckBox) findViewById(R.id.radio_u2); - U6RouteRadioButton = (CheckBox) findViewById(R.id.radio_u6); - U9RouteRadioButton = (CheckBox) findViewById(R.id.radio_u9); + U1RouteRadioButton = (TextView) findViewById(R.id.busActivityU1); + U1NRouteRadioButton = (TextView) findViewById(R.id.busActivityU1N); + U2RouteRadioButton = (TextView) findViewById(R.id.busActivityU2); + U6RouteRadioButton = (TextView) findViewById(R.id.busActivityU6); + U9RouteRadioButton = (TextView) findViewById(R.id.busActivityU9); busIDTextView = (TextView) findViewById(R.id.busActivityBusID); progBar = (ProgressBar) findViewById(R.id.busActivityLoadBar); busContentMessage = (TextView) findViewById(R.id.busActivityMessage); busActivityContentLayout = (LinearLayout) findViewById(R.id.busActivityContentLayout); + timetableView = (ListView) findViewById(R.id.busActivityTimes); if (bus.id != null) { Log.i(TAG, "Bus id is not null (" + bus.id + ") setting busIDTextView"); @@ -149,6 +157,35 @@ public class BusActivity extends OrmLiteBaseActivity implements } catch (SQLException e) { e.printStackTrace(); } + + busStops = new ArrayList(num); + busStops.add(busStop); + + BusRoute route = bus.route; + + for (int i = 0; i < num; i++) { + BusStop nextStop = route.moveInRoute(instance, busStops.get(i), bus.direction, 1); + + if (nextStop != null) { + busStops.add(nextStop); + } else { + Log.e(TAG, "nextStop is null"); + } + } + + refreshData = new Runnable() { + @Override + public void run() { + for (int i = 0; i < num; i++) { + if (timetable.get(i).timeOfFetch == null || (timetable.get(i).timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { + GetTimetableStopTask timetableStopTask = new GetTimetableStopTask(); + BusStop[] str = { busStops.get(i) }; + timetableStopTask.execute(str); + handler.postDelayed(refreshData, 20000); + } + } + } + }; } public void onResume() { @@ -160,27 +197,19 @@ public class BusActivity extends OrmLiteBaseActivity implements Log.i(TAG, "Live Times enabled"); timetable = (Timetable) getLastNonConfigurationInstance(); - refreshData = new Runnable() { - @Override - public void run() { - GetTimetableStopTask timetableStopTask = new GetTimetableStopTask(); - timetableStopTask.execute(busStopID); - handler.postDelayed(refreshData, 20000); - } - }; - handler = new Handler(); if (timetable == null) { Log.i(TAG, "No Previous timetable"); - handler.post(refreshData); + timetable = new Timetable(); + for (int i = 0; i < num; i++) { + timetable.add(new Stop(bus, busStops.get(i), null, null, false)); + } } else { Log.i(TAG, "Displaying previous timetable"); displayTimetable(timetable); - if (System.currentTimeMillis() - timetable.fetchTime.getTime() > 20000) { - handler.post(refreshData); - } } + handler.post(refreshData); } else { Log.i(TAG, "Live Times Disabled"); @@ -191,39 +220,61 @@ public class BusActivity extends OrmLiteBaseActivity implements } - private class GetTimetableStopTask extends AsyncTask { + public void onPause() { + if (handler != null) { // BusTimes are enabled + handler.removeCallbacks(refreshData); + if (timetableStopTasks != null) { // Could happen if the handler has not created the timetableTask yet + for (GetTimetableStopTask task : timetableStopTasks) { + if (task != null) { + task.cancel(true); + } + } + } + Log.i(TAG, "Stoping refreshing timetable data"); + } + + super.onPause(); + } + + private class GetTimetableStopTask extends AsyncTask { String errorMessage; protected void onPreExecute() { progBar.setVisibility(View.VISIBLE); } - protected Timetable doInBackground(String... busStopID) { - Timetable newTimetable = null; + protected Timetable doInBackground(BusStop... busStop) { + Timetable newTimetable = timetable; try { - final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(instance); - - newTimetable = DataManager.getTimetable(instance, bus, busStop, 10); + Log.i(TAG, "Fetching stop for busStop " + busStops.indexOf(busStop[0])); + Stop stop = DataManager.getStop(instance, bus, busStop[0]); + if (stop == null) { + stop = new Stop(bus, busStop[0], null, null, false); + } + Log.i(TAG, "Finished fetching stop for busStop " + busStops.indexOf(busStop[0])); + newTimetable.set(busStops.indexOf(busStop[0]), stop); } catch (SQLException e) { errorMessage = "Error message regarding SQL?"; e.printStackTrace(); + newTimetable = null; } catch (ClientProtocolException e) { errorMessage = "ClientProtocolException!?!"; e.printStackTrace(); + newTimetable = null; } catch (IOException e) { errorMessage = "Error fetching bus times from server, are you connected to the internet?"; e.printStackTrace(); + newTimetable = null; } catch (JSONException e) { errorMessage = "Error parsing bus times"; e.printStackTrace(); - } catch (Exception e) { - Log.e(TAG, e.getMessage(), e.getCause()); + newTimetable = null; } return newTimetable; } protected void onPostExecute(Timetable newTimetable) { - Log.i(TAG, "Got timetable"); + // Log.i(TAG, "Got timetable"); if (newTimetable == null) { Log.i(TAG, "Its null"); @@ -241,7 +292,7 @@ public class BusActivity extends OrmLiteBaseActivity implements private void displayTimetable(Timetable timetable) { visibleTimetable = (Timetable) timetable.clone(); - Log.i(TAG, "It contains " + visibleTimetable.size() + " stops"); + Log.i(TAG, "Displaying timetable, it contains " + visibleTimetable.size() + " stops"); if (timetable.size() == 0) { busContentMessage.setText("No Busses"); diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index 1997e4a..2688113 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -38,8 +38,6 @@ import com.j256.ormlite.dao.Dao; public class BusSpecificStopView extends LinearLayout implements OnClickListener, OnLongClickListener { - // private final ImageView icon; - // private static final String TAG = "StopView"; private final TextView location; @@ -75,8 +73,16 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener this.stop = stop; - location.setText(stop.busStop.description); - time.setText(stop.getTimeToArival()); + if (stop.busStop.description.length() > 20) { + location.setText(stop.busStop.description.substring(0, 20)); // TODO + } else { + location.setText(stop.busStop.description); // TODO + } + if (stop.arivalTime != null) { + time.setText(stop.getShortTimeToArival()); + } else { + time.setText(""); + } DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -85,17 +91,37 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener busDao.refresh(stop.bus); - if (stop.bus.id != null) { - if (stop.live) { - onClickMessage = "Bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + if (stop.arivalTime != null) { + + if (stop.bus.id != null) { + if (stop.live) { + onClickMessage = "Bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } else { + onClickMessage = "Timetabled bus " + stop.bus.toString() + " at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } } else { - onClickMessage = "Timetabled bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + if (stop.live) { + onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } else { + onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } } } else { - if (stop.live) { - onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + if (stop.bus.id != null) { + if (stop.live) { + onClickMessage = "Bus " + stop.bus.toString(); + } else { + onClickMessage = "Timetabled bus " + stop.bus.toString(); + } } else { - onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + if (stop.live) { + onClickMessage = "Unidentified bus (" + stop.bus.getName() + ")"; + } else { + onClickMessage = "Timetabled bus (" + stop.bus.getName() + ")"; + } } } } catch (SQLException e) { @@ -112,7 +138,7 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener } @Override - public boolean onLongClick(View v) { + public boolean onLongClick(View v) { // TODO DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); try { @@ -121,8 +147,8 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener busDao.refresh(stop.bus); if (stop.bus.id != null) { - Intent i = new Intent(context, BusActivity.class); - i.putExtra("busID", stop.bus.id); + Intent i = new Intent(context, SouthamptonUniversityMapActivity.class); + i.putExtra("poiPoint", stop.busStop.point.toDoubleString()); ((Activity) context).startActivityForResult(i, 0); } else { Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT).show(); diff --git a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java index 6356e00..263c6cb 100644 --- a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java +++ b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java @@ -34,7 +34,7 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { private final Animation a; private boolean[] changed; - private static final String TAG = "TimetableAdapter"; + private static final String TAG = "BusSpecificTimetableAdapter"; public BusSpecificTimetableAdapter(Context context, Timetable timetable) { this.context = context; @@ -43,7 +43,7 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { } public View getView(int position, View convertView, ViewGroup parent) { - Log.i(TAG, "Returning stop " + position + " " + timetable.get(position)); + // Log.i(TAG, "Returning stop " + position + " " + timetable.get(position)); BusSpecificStopView stopView; if (convertView == null) { @@ -56,7 +56,7 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { if (changed == null || changed[position]) { a.reset(); stopView.startAnimation(a); - Log.i(TAG, "Animating it"); + // Log.i(TAG, "Animating it"); } return stopView; @@ -75,15 +75,15 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { } public void updateTimetable(Timetable newTimetable) { - Log.v(TAG, "Old timetable " + timetable); - Log.v(TAG, "Adaptor loading new timetable"); + // Log.v(TAG, "Old timetable " + timetable); + // Log.v(TAG, "Adaptor loading new timetable"); changed = new boolean[newTimetable.size()]; for (int i = 0; i < newTimetable.size(); i++) { - if (!timetable.contains(newTimetable.get(i), true)) { + if (newTimetable.get(i).arivalTime != null && !timetable.contains(newTimetable.get(i), true)) { changed[i] = true; - Log.i(TAG, "Old timetable does not contain: " + newTimetable.get(i)); + // Log.i(TAG, "Old timetable does not contain: " + newTimetable.get(i)); } else { - Log.i(TAG, "Old timetable contains: " + newTimetable.get(i)); + // Log.i(TAG, "Old timetable contains: " + newTimetable.get(i)); changed[i] = false; } } diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index a1530b7..2af4b52 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -444,7 +444,7 @@ public class DataManager { boolean live = true; if (!time.equals("Due")) { - Log.v(TAG, "Time: " + time + " current time " + calender.getTime()); + // Log.v(TAG, "Time: " + time + " current time " + calender.getTime()); if (time.contains(":")) { String[] minAndHour = time.split(":"); @@ -456,7 +456,7 @@ public class DataManager { calender.add(Calendar.MINUTE, Integer.parseInt(time.substring(0, time.length() - 1))); } - Log.v(TAG, "Date: " + calender.getTime()); + // Log.v(TAG, "Date: " + calender.getTime()); } String name = stopObj.getString("name"); @@ -472,6 +472,12 @@ public class DataManager { dir = null; } } else { + if (tempRoute == null) { + Log.e(TAG, "tempRoute == null"); + } + if (tempRoute.code == null) { + Log.e(TAG, "tempRoute.code == null"); + } if (tempRoute.code.equals(name.substring(0, 2))) { route = tempRoute; if (route.forwardDirection.equals(name.substring(2))) { @@ -591,7 +597,7 @@ public class DataManager { for (Iterator keyIter = routesObject.keys(); keyIter.hasNext();) { String key = keyIter.next(); - Log.i(TAG, "Route Key: " + key); + Log.v(TAG, "Route Key: " + key); BusRoute route = busRouteDao.queryForId(Integer.parseInt(key.substring(key.length() - 3, key.length()))); @@ -629,7 +635,7 @@ public class DataManager { continue; } - Log.i(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); + Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); timetable.add(stop); } @@ -667,7 +673,7 @@ public class DataManager { for (BusStop busStop : busStops) { - String file = getFileFromServer(busStopUrl + busStop + ".json"); + String file = getFileFromServer(busStopUrl + busStop.id + ".json"); JSONObject data = new JSONObject(file); JSONArray stopsArray = data.getJSONArray("stops"); @@ -675,9 +681,9 @@ public class DataManager { HashSet busRoutes = new HashSet(); busRoutes.add(bus.route); - Log.i(TAG, "Number of entries " + data.length()); + Log.v(TAG, "Number of entries " + data.length()); - Log.i(TAG, "Stops: " + data.getJSONArray("stops")); + Log.v(TAG, "Stops: " + data.getJSONArray("stops")); for (int stopNum = 0; stopNum < stopsArray.length(); stopNum++) { JSONObject stopObj = stopsArray.getJSONObject(stopNum); @@ -691,7 +697,7 @@ public class DataManager { continue; } - Log.i(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); + Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); timetable.add(stop); @@ -713,34 +719,31 @@ public class DataManager { if (busStopDao == null) busStopDao = helper.getBusStopDao(); - String file = getFileFromServer(busStopUrl + busStop + ".json"); + String file = getFileFromServer(busStopUrl + busStop.id + ".json"); JSONObject data = new JSONObject(file); JSONArray stopsArray = data.getJSONArray("stops"); HashSet busRoutes = new HashSet(); + busRouteDao.refresh(bus.route); busRoutes.add(bus.route); Stop stop = null; - Log.i(TAG, "Number of entries " + data.length()); + // Log.v(TAG, "Number of entries " + data.length()); - Log.i(TAG, "Stops: " + data.getJSONArray("stops")); + // Log.v(TAG, "Stops: " + data.getJSONArray("stops")); for (int stopNum = 0; stopNum < stopsArray.length(); stopNum++) { JSONObject stopObj = stopsArray.getJSONObject(stopNum); - if (stopObj.getString("vehicle").equals(bus.id)) { + // Log.v(TAG, "stopObj: " + stopObj); + if (stopObj.has("vehicle") && stopObj.getString("vehicle").equals(bus.id)) { stop = getStop(context, stopObj, busRoutes, busStop); + break; - if (stop == null) { - Log.w(TAG, "Null stop, skiping"); - continue; - } - - Log.i(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); - + // Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); } } @@ -779,7 +782,7 @@ public class DataManager { StringBuilder builder = new StringBuilder(); HttpClient client = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(request); - Log.i("Util.getFileFromServer", "Request used: " + request); + Log.v("Util.getFileFromServer", "Request used: " + request); HttpResponse response = client.execute(httpGet); StatusLine statusLine = response.getStatusLine(); diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index a313d12..26996a0 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -194,12 +194,26 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity { * */ private static final long serialVersionUID = -9021303378059511643L; - + Date fetchTime; public String toString() { @@ -40,6 +40,8 @@ public class Timetable extends ArrayList { } public boolean contains(Stop otherStop, boolean toTheMinute) { + if (otherStop == null) + return false; if (toTheMinute) { for (Stop stop : this) { if (otherStop.bus != null && stop.bus != null && otherStop.bus.equals(stop.bus)) { @@ -47,8 +49,14 @@ public class Timetable extends ArrayList { return true; } } else if (otherStop.busStop.equals(stop.busStop)) { - if (Math.abs(otherStop.arivalTime.getTime() - stop.arivalTime.getTime()) < 60000) { + if (otherStop.arivalTime == null && stop.arivalTime == null) { return true; + } else { + if (otherStop.arivalTime == null || stop.arivalTime == null) { + return false; + } else if (Math.abs(otherStop.arivalTime.getTime() - stop.arivalTime.getTime()) < 60000) { + return true; + } } } } -- cgit v1.2.3 From 34768a91d72d1bb02c96aecf3039d9b9f1a1359b Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 15 Feb 2012 17:11:07 +0000 Subject: Slight changes to the display of the BusActivity. --- src/net/cbaines/suma/BusActivity.java | 90 ++++++++++++++--------------------- src/net/cbaines/suma/Stop.java | 1 - 2 files changed, 37 insertions(+), 54 deletions(-) diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index 392baf2..5f387dd 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -4,13 +4,10 @@ import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import org.apache.http.client.ClientProtocolException; -import org.json.JSONArray; import org.json.JSONException; -import org.json.JSONObject; import android.content.Context; import android.content.SharedPreferences; @@ -21,7 +18,6 @@ import android.preference.PreferenceManager; import android.util.Log; import android.view.Gravity; import android.view.View; -import android.widget.CheckBox; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.ProgressBar; @@ -32,11 +28,11 @@ import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; public class BusActivity extends OrmLiteBaseActivity implements Preferences { final static String TAG = "BusActivity"; - private TextView U1RouteRadioButton; - private TextView U1NRouteRadioButton; - private TextView U2RouteRadioButton; - private TextView U6RouteRadioButton; - private TextView U9RouteRadioButton; + private TextView U1RouteTextView; + private TextView U1NRouteTextView; + private TextView U2RouteTextView; + private TextView U6RouteTextView; + private TextView U9RouteTextView; private Handler handler; private Runnable refreshData; @@ -83,6 +79,8 @@ public class BusActivity extends OrmLiteBaseActivity implements Log.e(TAG, "Found more than one bus? " + busID); } + helper.getBusRouteDao().refresh(bus.route); + List busStops = helper.getBusStopDao().queryForEq(BusStop.ID_FIELD_NAME, busStopID); busStop = null; if (busStops.size() == 0) { @@ -93,11 +91,11 @@ public class BusActivity extends OrmLiteBaseActivity implements Log.e(TAG, "Found more than one busStop? " + busStopID); } - U1RouteRadioButton = (TextView) findViewById(R.id.busActivityU1); - U1NRouteRadioButton = (TextView) findViewById(R.id.busActivityU1N); - U2RouteRadioButton = (TextView) findViewById(R.id.busActivityU2); - U6RouteRadioButton = (TextView) findViewById(R.id.busActivityU6); - U9RouteRadioButton = (TextView) findViewById(R.id.busActivityU9); + U1RouteTextView = (TextView) findViewById(R.id.busActivityU1); + U1NRouteTextView = (TextView) findViewById(R.id.busActivityU1N); + U2RouteTextView = (TextView) findViewById(R.id.busActivityU2); + U6RouteTextView = (TextView) findViewById(R.id.busActivityU6); + U9RouteTextView = (TextView) findViewById(R.id.busActivityU9); busIDTextView = (TextView) findViewById(R.id.busActivityBusID); @@ -108,49 +106,37 @@ public class BusActivity extends OrmLiteBaseActivity implements if (bus.id != null) { Log.i(TAG, "Bus id is not null (" + bus.id + ") setting busIDTextView"); - busIDTextView.setText(bus.id); + busIDTextView.setText(bus.id + " " + bus.getName()); } else { Log.w(TAG, "Bus id is null?"); // Might not ever happen busIDTextView.setText("Unidentified"); } - if (bus.route.uniLink) { - Log.i(TAG, "Bus is uniLink"); - if (bus.route.code.equals("U1")) { - U1RouteRadioButton.setVisibility(View.VISIBLE); - U1NRouteRadioButton.setVisibility(View.GONE); - U2RouteRadioButton.setVisibility(View.GONE); - U6RouteRadioButton.setVisibility(View.GONE); - U9RouteRadioButton.setVisibility(View.GONE); - } else if (bus.route.code.equals("U1N")) { - U1RouteRadioButton.setVisibility(View.GONE); - U1NRouteRadioButton.setVisibility(View.VISIBLE); - U2RouteRadioButton.setVisibility(View.GONE); - U6RouteRadioButton.setVisibility(View.GONE); - U9RouteRadioButton.setVisibility(View.GONE); - } else if (bus.route.code.equals("U2")) { - U1RouteRadioButton.setVisibility(View.GONE); - U1NRouteRadioButton.setVisibility(View.GONE); - U2RouteRadioButton.setVisibility(View.VISIBLE); - U6RouteRadioButton.setVisibility(View.GONE); - U9RouteRadioButton.setVisibility(View.GONE); - } else if (bus.route.code.equals("U6")) { - U1RouteRadioButton.setVisibility(View.GONE); - U1NRouteRadioButton.setVisibility(View.GONE); - U2RouteRadioButton.setVisibility(View.GONE); - U6RouteRadioButton.setVisibility(View.VISIBLE); - U9RouteRadioButton.setVisibility(View.GONE); - } else if (bus.route.code.equals("U9")) { - U1RouteRadioButton.setVisibility(View.GONE); - U1NRouteRadioButton.setVisibility(View.GONE); - U2RouteRadioButton.setVisibility(View.GONE); - U6RouteRadioButton.setVisibility(View.GONE); - U9RouteRadioButton.setVisibility(View.VISIBLE); - } else { - Log.e(TAG, "Route not found " + bus.route.code); - } + U1RouteTextView.setVisibility(View.GONE); + U1NRouteTextView.setVisibility(View.GONE); + U2RouteTextView.setVisibility(View.GONE); + U6RouteTextView.setVisibility(View.GONE); + U9RouteTextView.setVisibility(View.GONE); + + // if (bus.route.uniLink) { + Log.i(TAG, "Bus is uniLink"); + if (bus.route.code.equals("U1")) { + U1RouteTextView.setVisibility(View.VISIBLE); + } else if (bus.route.code.equals("U1N")) { + U1NRouteTextView.setVisibility(View.VISIBLE); + } else if (bus.route.code.equals("U2")) { + U2RouteTextView.setVisibility(View.VISIBLE); + } else if (bus.route.code.equals("U6")) { + U6RouteTextView.setVisibility(View.VISIBLE); + } else if (bus.route.code.equals("U9")) { + U9RouteTextView.setVisibility(View.VISIBLE); + } else { + Log.e(TAG, "Route not found " + bus.route.code); } + // } else { + // Log.i(TAG, "Bus is not uniLink"); + // } } catch (NumberFormatException e) { e.printStackTrace(); @@ -161,10 +147,8 @@ public class BusActivity extends OrmLiteBaseActivity implements busStops = new ArrayList(num); busStops.add(busStop); - BusRoute route = bus.route; - for (int i = 0; i < num; i++) { - BusStop nextStop = route.moveInRoute(instance, busStops.get(i), bus.direction, 1); + BusStop nextStop = bus.route.moveInRoute(instance, busStops.get(i), bus.direction, 1); if (nextStop != null) { busStops.add(nextStop); diff --git a/src/net/cbaines/suma/Stop.java b/src/net/cbaines/suma/Stop.java index a57a452..88af3ef 100644 --- a/src/net/cbaines/suma/Stop.java +++ b/src/net/cbaines/suma/Stop.java @@ -101,7 +101,6 @@ public class Stop { String time = (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS); time = time.replace("in ", ""); time = time.replace(" minutes", "m"); - Log.w("Stop", "time " + time); return time; } } -- cgit v1.2.3 From 152f9525492295cbe93df44d2bd18de94ced0dc6 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 15 Feb 2012 18:05:05 +0000 Subject: Improvements to AsyncTask management. --- src/net/cbaines/suma/BusActivity.java | 61 ++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index 5f387dd..9b8b81f 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -3,6 +3,7 @@ package net.cbaines.suma; import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; +import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -51,13 +52,13 @@ public class BusActivity extends OrmLiteBaseActivity implements private ListView timetableView; - private HashSet timetableStopTasks; + private HashMap timetableStopTasks = new HashMap(); private Context instance; private List busStops; - int num = 15; + int num = 20; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -162,10 +163,14 @@ public class BusActivity extends OrmLiteBaseActivity implements public void run() { for (int i = 0; i < num; i++) { if (timetable.get(i).timeOfFetch == null || (timetable.get(i).timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { - GetTimetableStopTask timetableStopTask = new GetTimetableStopTask(); - BusStop[] str = { busStops.get(i) }; - timetableStopTask.execute(str); - handler.postDelayed(refreshData, 20000); + GetTimetableStopTask previous = timetableStopTasks.get(busStops.get(i)); + if (previous == null) { + GetTimetableStopTask timetableStopTask = new GetTimetableStopTask(); + BusStop[] str = { busStops.get(i) }; + timetableStopTask.execute(str); + timetableStopTasks.put(busStops.get(i), timetableStopTask); + handler.postDelayed(refreshData, 20000); + } } } } @@ -208,7 +213,7 @@ public class BusActivity extends OrmLiteBaseActivity implements if (handler != null) { // BusTimes are enabled handler.removeCallbacks(refreshData); if (timetableStopTasks != null) { // Could happen if the handler has not created the timetableTask yet - for (GetTimetableStopTask task : timetableStopTasks) { + for (GetTimetableStopTask task : timetableStopTasks.values()) { if (task != null) { task.cancel(true); } @@ -220,46 +225,48 @@ public class BusActivity extends OrmLiteBaseActivity implements super.onPause(); } - private class GetTimetableStopTask extends AsyncTask { - String errorMessage; + private class GetTimetableStopTask extends AsyncTask { + private String errorMessage; + + private BusStop busStop; + + private int position; protected void onPreExecute() { progBar.setVisibility(View.VISIBLE); } - protected Timetable doInBackground(BusStop... busStop) { - Timetable newTimetable = timetable; + protected Stop doInBackground(BusStop... busStopArray) { + busStop = busStopArray[0]; + position = busStops.indexOf(busStop); + Stop stop = null; + try { - Log.i(TAG, "Fetching stop for busStop " + busStops.indexOf(busStop[0])); - Stop stop = DataManager.getStop(instance, bus, busStop[0]); + Log.i(TAG, "Fetching stop for busStop " + position); + stop = DataManager.getStop(instance, bus, busStop); if (stop == null) { - stop = new Stop(bus, busStop[0], null, null, false); + stop = new Stop(bus, busStop, null, null, false); } - Log.i(TAG, "Finished fetching stop for busStop " + busStops.indexOf(busStop[0])); - newTimetable.set(busStops.indexOf(busStop[0]), stop); + Log.i(TAG, "Finished fetching stop for busStop " + position); } catch (SQLException e) { errorMessage = "Error message regarding SQL?"; e.printStackTrace(); - newTimetable = null; } catch (ClientProtocolException e) { errorMessage = "ClientProtocolException!?!"; e.printStackTrace(); - newTimetable = null; } catch (IOException e) { errorMessage = "Error fetching bus times from server, are you connected to the internet?"; e.printStackTrace(); - newTimetable = null; } catch (JSONException e) { errorMessage = "Error parsing bus times"; e.printStackTrace(); - newTimetable = null; } - return newTimetable; + return stop; } - protected void onPostExecute(Timetable newTimetable) { + protected void onPostExecute(Stop stop) { // Log.i(TAG, "Got timetable"); - if (newTimetable == null) { + if (stop == null) { Log.i(TAG, "Its null"); progBar.setVisibility(View.GONE); @@ -267,8 +274,10 @@ public class BusActivity extends OrmLiteBaseActivity implements busContentMessage.setVisibility(View.VISIBLE); } else { progBar.setVisibility(View.GONE); - timetable = newTimetable; - displayTimetable(timetable); + synchronized (timetable) { + timetable.set(position, stop); + displayTimetable(timetable); + } } } } @@ -276,7 +285,7 @@ public class BusActivity extends OrmLiteBaseActivity implements private void displayTimetable(Timetable timetable) { visibleTimetable = (Timetable) timetable.clone(); - Log.i(TAG, "Displaying timetable, it contains " + visibleTimetable.size() + " stops"); + // Log.i(TAG, "Displaying timetable, it contains " + visibleTimetable.size() + " stops"); if (timetable.size() == 0) { busContentMessage.setText("No Busses"); -- cgit v1.2.3 From fcac217897640f23d0a528c02f861e1e2d15a212 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 16 Feb 2012 07:58:41 +0000 Subject: Changes to the BusActivity, not working yet... --- src/net/cbaines/suma/BusActivity.java | 84 +-------------------- src/net/cbaines/suma/BusSpecificStopView.java | 87 +++++++++++++++++++++- .../cbaines/suma/BusSpecificTimetableAdapter.java | 8 +- 3 files changed, 94 insertions(+), 85 deletions(-) diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index 9b8b81f..be94bd3 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -35,9 +35,6 @@ public class BusActivity extends OrmLiteBaseActivity implements private TextView U6RouteTextView; private TextView U9RouteTextView; - private Handler handler; - private Runnable refreshData; - private TextView busIDTextView; private ProgressBar progBar; @@ -52,12 +49,12 @@ public class BusActivity extends OrmLiteBaseActivity implements private ListView timetableView; - private HashMap timetableStopTasks = new HashMap(); - private Context instance; private List busStops; + private Handler handler; + int num = 20; public void onCreate(Bundle savedInstanceState) { @@ -158,23 +155,6 @@ public class BusActivity extends OrmLiteBaseActivity implements } } - refreshData = new Runnable() { - @Override - public void run() { - for (int i = 0; i < num; i++) { - if (timetable.get(i).timeOfFetch == null || (timetable.get(i).timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { - GetTimetableStopTask previous = timetableStopTasks.get(busStops.get(i)); - if (previous == null) { - GetTimetableStopTask timetableStopTask = new GetTimetableStopTask(); - BusStop[] str = { busStops.get(i) }; - timetableStopTask.execute(str); - timetableStopTasks.put(busStops.get(i), timetableStopTask); - handler.postDelayed(refreshData, 20000); - } - } - } - } - }; } public void onResume() { @@ -198,7 +178,6 @@ public class BusActivity extends OrmLiteBaseActivity implements Log.i(TAG, "Displaying previous timetable"); displayTimetable(timetable); } - handler.post(refreshData); } else { Log.i(TAG, "Live Times Disabled"); @@ -211,7 +190,7 @@ public class BusActivity extends OrmLiteBaseActivity implements public void onPause() { if (handler != null) { // BusTimes are enabled - handler.removeCallbacks(refreshData); + handler.removeCallbacks(r) if (timetableStopTasks != null) { // Could happen if the handler has not created the timetableTask yet for (GetTimetableStopTask task : timetableStopTasks.values()) { if (task != null) { @@ -225,63 +204,6 @@ public class BusActivity extends OrmLiteBaseActivity implements super.onPause(); } - private class GetTimetableStopTask extends AsyncTask { - private String errorMessage; - - private BusStop busStop; - - private int position; - - protected void onPreExecute() { - progBar.setVisibility(View.VISIBLE); - } - - protected Stop doInBackground(BusStop... busStopArray) { - busStop = busStopArray[0]; - position = busStops.indexOf(busStop); - Stop stop = null; - - try { - Log.i(TAG, "Fetching stop for busStop " + position); - stop = DataManager.getStop(instance, bus, busStop); - if (stop == null) { - stop = new Stop(bus, busStop, null, null, false); - } - Log.i(TAG, "Finished fetching stop for busStop " + position); - } catch (SQLException e) { - errorMessage = "Error message regarding SQL?"; - e.printStackTrace(); - } catch (ClientProtocolException e) { - errorMessage = "ClientProtocolException!?!"; - e.printStackTrace(); - } catch (IOException e) { - errorMessage = "Error fetching bus times from server, are you connected to the internet?"; - e.printStackTrace(); - } catch (JSONException e) { - errorMessage = "Error parsing bus times"; - e.printStackTrace(); - } - return stop; - } - - protected void onPostExecute(Stop stop) { - // Log.i(TAG, "Got timetable"); - if (stop == null) { - Log.i(TAG, "Its null"); - - progBar.setVisibility(View.GONE); - busContentMessage.setText(errorMessage); - busContentMessage.setVisibility(View.VISIBLE); - } else { - progBar.setVisibility(View.GONE); - synchronized (timetable) { - timetable.set(position, stop); - displayTimetable(timetable); - } - } - } - } - private void displayTimetable(Timetable timetable) { visibleTimetable = (Timetable) timetable.clone(); diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index 2688113..b13a6de 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -19,12 +19,19 @@ package net.cbaines.suma; +import java.io.IOException; import java.sql.SQLException; import java.text.DateFormat; +import org.apache.http.client.ClientProtocolException; +import org.json.JSONException; + import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.os.AsyncTask; +import android.os.Handler; +import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; @@ -38,6 +45,12 @@ import com.j256.ormlite.dao.Dao; public class BusSpecificStopView extends LinearLayout implements OnClickListener, OnLongClickListener { + private static final String TAG = "BusSpecificStopView"; + + private Handler handler; + + private Runnable refreshData; + // private static final String TAG = "StopView"; private final TextView location; @@ -45,12 +58,15 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener private String onClickMessage = ""; private final Context context; + private GetTimetableStopTask task; + private Stop stop; - public BusSpecificStopView(Context context, Stop stop) { + public BusSpecificStopView(Context context, Stop newStop, Handler newHandler) { super(context); this.context = context; + this.handler = newHandler; this.setOrientation(HORIZONTAL); @@ -65,6 +81,75 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener addView(location, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); addView(time, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); + + refreshData = new Runnable() { + @Override + public void run() { + if (stop.timeOfFetch == null || (stop.timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { + if (task == null) { + task = new GetTimetableStopTask(); + BusStop[] str = { stop.busStop }; + task.execute(str); + handler.postDelayed(refreshData, 20000); + } + } + + } + }; + + handler.post(refreshData); + } + + private class GetTimetableStopTask extends AsyncTask { + private String errorMessage; + + private BusStop busStop; + + private int position; + + protected void onPreExecute() { + // progBar.setVisibility(View.VISIBLE); + } + + protected Stop doInBackground(BusStop... busStopArray) { + busStop = busStopArray[0]; + Stop stop = null; + + try { + Log.i(TAG, "Fetching stop for busStop " + position); + stop = DataManager.getStop(context, stop.bus, busStop); + if (stop == null) { + stop = new Stop(stop.bus, busStop, null, null, false); + } + Log.i(TAG, "Finished fetching stop for busStop " + position); + } catch (SQLException e) { + errorMessage = "Error message regarding SQL?"; + e.printStackTrace(); + } catch (ClientProtocolException e) { + errorMessage = "ClientProtocolException!?!"; + e.printStackTrace(); + } catch (IOException e) { + errorMessage = "Error fetching bus times from server, are you connected to the internet?"; + e.printStackTrace(); + } catch (JSONException e) { + errorMessage = "Error parsing bus times"; + e.printStackTrace(); + } + return stop; + } + + protected void onPostExecute(Stop stop) { + // Log.i(TAG, "Got timetable"); + if (stop == null) { + + // progBar.setVisibility(View.GONE); + // busContentMessage.setText(errorMessage); + // busContentMessage.setVisibility(View.VISIBLE); + } else { + // progBar.setVisibility(View.GONE); + + } + } } public void setStop(Stop stop) { diff --git a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java index 263c6cb..0467d4a 100644 --- a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java +++ b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java @@ -20,7 +20,7 @@ package net.cbaines.suma; import android.content.Context; -import android.util.Log; +import android.os.Handler; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; @@ -33,12 +33,14 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { private Timetable timetable; private final Animation a; private boolean[] changed; + private Handler handler; private static final String TAG = "BusSpecificTimetableAdapter"; - public BusSpecificTimetableAdapter(Context context, Timetable timetable) { + public BusSpecificTimetableAdapter(Context context, Timetable timetable, Handler handler) { this.context = context; this.timetable = timetable; + this.handler = handler; this.a = AnimationUtils.loadAnimation(context, R.anim.updated_stop_view); } @@ -47,7 +49,7 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { BusSpecificStopView stopView; if (convertView == null) { - stopView = new BusSpecificStopView(context, timetable.get(position)); + stopView = new BusSpecificStopView(context, timetable.get(position), handler); } else { stopView = (BusSpecificStopView) convertView; stopView.setStop(timetable.get(position)); -- cgit v1.2.3 From e20303f3de0782c31a0a794d1be4a06e3b4a0c76 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 16 Feb 2012 10:41:27 +0000 Subject: More changes to the BusActivity. --- src/net/cbaines/suma/BusActivity.java | 96 +++++++++++++++++++++- src/net/cbaines/suma/BusSpecificStopView.java | 67 --------------- .../cbaines/suma/BusSpecificTimetableAdapter.java | 4 +- 3 files changed, 96 insertions(+), 71 deletions(-) diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index be94bd3..eb512f8 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -7,6 +7,8 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; +import net.cbaines.suma.BusSpecificStopView.GetTimetableStopTask; + import org.apache.http.client.ClientProtocolException; import org.json.JSONException; @@ -44,6 +46,8 @@ public class BusActivity extends OrmLiteBaseActivity implements private Bus bus; private BusStop busStop; + private Runnable refreshData; + protected Timetable timetable; private Timetable visibleTimetable; @@ -51,7 +55,11 @@ public class BusActivity extends OrmLiteBaseActivity implements private Context instance; - private List busStops; + // BusStops and if they are being updated by the handler + ArrayList busStops; + ArrayList busStopsActive; + + private HashMap tasks = new HashMap(); private Handler handler; @@ -155,6 +163,34 @@ public class BusActivity extends OrmLiteBaseActivity implements } } + refreshData = new Runnable() { + @Override + public void run() { + for (int num = 0; num < timetable.size(); num++) { + if (busStopsActive.get(num)) { + Stop stop = timetable.get(num); + + GetTimetableStopTask task = tasks.get(busStops.get(num)); + + if (stop.timeOfFetch == null || (stop.timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { + if (task == null) { + task = new GetTimetableStopTask(); + BusStop[] str = { stop.busStop }; + task.execute(str); + handler.postDelayed(refreshData, 20000); + } else { + if (task.getStatus() == AsyncTask.Status.FINISHED) { + BusStop[] str = { stop.busStop }; + task.execute(str); + handler.postDelayed(refreshData, 20000); + } + } + } + } + } + } + }; + } public void onResume() { @@ -190,7 +226,7 @@ public class BusActivity extends OrmLiteBaseActivity implements public void onPause() { if (handler != null) { // BusTimes are enabled - handler.removeCallbacks(r) + handler.removeCallbacks(refreshData); if (timetableStopTasks != null) { // Could happen if the handler has not created the timetableTask yet for (GetTimetableStopTask task : timetableStopTasks.values()) { if (task != null) { @@ -204,6 +240,62 @@ public class BusActivity extends OrmLiteBaseActivity implements super.onPause(); } + private class GetTimetableStopTask extends AsyncTask { + private String errorMessage; + + private BusStop busStop; + + private int position; + + protected void onPreExecute() { + // progBar.setVisibility(View.VISIBLE); + } + + protected Stop doInBackground(BusStop... busStopArray) { + busStop = busStopArray[0]; + Stop stop = null; + + try { + Log.i(TAG, "Fetching stop for busStop " + position); + stop = DataManager.getStop(context, stop.bus, busStop); + if (stop == null) { + stop = new Stop(stop.bus, busStop, null, null, false); + } + Log.i(TAG, "Finished fetching stop for busStop " + position); + } catch (SQLException e) { + errorMessage = "Error message regarding SQL?"; + e.printStackTrace(); + } catch (ClientProtocolException e) { + errorMessage = "ClientProtocolException!?!"; + e.printStackTrace(); + } catch (IOException e) { + errorMessage = "Error fetching bus times from server, are you connected to the internet?"; + e.printStackTrace(); + } catch (JSONException e) { + errorMessage = "Error parsing bus times"; + e.printStackTrace(); + } + return stop; + } + + protected void onPostExecute(Stop stop) { + // Log.i(TAG, "Got timetable"); + if (stop == null) { + + // progBar.setVisibility(View.GONE); + // busContentMessage.setText(errorMessage); + // busContentMessage.setVisibility(View.VISIBLE); + } else { + // progBar.setVisibility(View.GONE); + + } + } + } + + void setStopUpdated(BusStop stop, boolean updated) { + + } + private void displayTimetable(Timetable timetable) { visibleTimetable = (Timetable) timetable.clone(); diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index b13a6de..69b2aee 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -82,76 +82,9 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener addView(location, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); addView(time, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); - refreshData = new Runnable() { - @Override - public void run() { - if (stop.timeOfFetch == null || (stop.timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { - if (task == null) { - task = new GetTimetableStopTask(); - BusStop[] str = { stop.busStop }; - task.execute(str); - handler.postDelayed(refreshData, 20000); - } - } - - } - }; - handler.post(refreshData); } - private class GetTimetableStopTask extends AsyncTask { - private String errorMessage; - - private BusStop busStop; - - private int position; - - protected void onPreExecute() { - // progBar.setVisibility(View.VISIBLE); - } - - protected Stop doInBackground(BusStop... busStopArray) { - busStop = busStopArray[0]; - Stop stop = null; - - try { - Log.i(TAG, "Fetching stop for busStop " + position); - stop = DataManager.getStop(context, stop.bus, busStop); - if (stop == null) { - stop = new Stop(stop.bus, busStop, null, null, false); - } - Log.i(TAG, "Finished fetching stop for busStop " + position); - } catch (SQLException e) { - errorMessage = "Error message regarding SQL?"; - e.printStackTrace(); - } catch (ClientProtocolException e) { - errorMessage = "ClientProtocolException!?!"; - e.printStackTrace(); - } catch (IOException e) { - errorMessage = "Error fetching bus times from server, are you connected to the internet?"; - e.printStackTrace(); - } catch (JSONException e) { - errorMessage = "Error parsing bus times"; - e.printStackTrace(); - } - return stop; - } - - protected void onPostExecute(Stop stop) { - // Log.i(TAG, "Got timetable"); - if (stop == null) { - - // progBar.setVisibility(View.GONE); - // busContentMessage.setText(errorMessage); - // busContentMessage.setVisibility(View.VISIBLE); - } else { - // progBar.setVisibility(View.GONE); - - } - } - } - public void setStop(Stop stop) { // Log.i(TAG, "Time of arival " + stop.arivalTime); diff --git a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java index 0467d4a..c5b81d3 100644 --- a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java +++ b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java @@ -29,7 +29,7 @@ import android.widget.BaseAdapter; public class BusSpecificTimetableAdapter extends BaseAdapter { - private final Context context; + private final BusActivity context; private Timetable timetable; private final Animation a; private boolean[] changed; @@ -37,7 +37,7 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { private static final String TAG = "BusSpecificTimetableAdapter"; - public BusSpecificTimetableAdapter(Context context, Timetable timetable, Handler handler) { + public BusSpecificTimetableAdapter(BusActivity context, Timetable timetable, Handler handler) { this.context = context; this.timetable = timetable; this.handler = handler; -- cgit v1.2.3 From 86629c735d4f7c48e1562825ca63ba3335363cbb Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 16 Feb 2012 13:43:51 +0000 Subject: ARRRRRRRGHH, bus routes dont work, the U6 route loops over the same ground twice by wessex lane, traveling in the same direction, breaking the BusRoute.moveInRoute code :( --- gen/net/cbaines/suma/R.java | 84 +++++++++++----------- res/layout/bus_activity.xml | 15 ---- src/net/cbaines/suma/BusActivity.java | 64 +++++++++-------- src/net/cbaines/suma/BusRoute.java | 36 ++++++---- src/net/cbaines/suma/BusSpecificStopView.java | 13 +--- .../cbaines/suma/BusSpecificTimetableAdapter.java | 10 +-- src/net/cbaines/suma/POI.java | 12 ---- 7 files changed, 100 insertions(+), 134 deletions(-) diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index 963c682..d8cc3af 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -57,8 +57,6 @@ public final class R { public static final int busActivityBusID=0x7f0a0005; public static final int busActivityContentLayout=0x7f0a000b; public static final int busActivityHeaderLayout=0x7f0a0004; - public static final int busActivityLoadBar=0x7f0a000f; - public static final int busActivityLoadBarLayout=0x7f0a000e; public static final int busActivityMessage=0x7f0a000c; public static final int busActivityTimes=0x7f0a000d; public static final int busActivityU1=0x7f0a0006; @@ -66,51 +64,51 @@ public final class R { public static final int busActivityU2=0x7f0a0008; public static final int busActivityU6=0x7f0a0009; public static final int busActivityU9=0x7f0a000a; - public static final int busStopID=0x7f0a001a; - public static final int busStopListItems=0x7f0a0011; - public static final int busStopLoadBar=0x7f0a001f; - public static final int busStopMessage=0x7f0a001c; - public static final int busStopName=0x7f0a0012; - public static final int busStopTimes=0x7f0a001d; - public static final int busTimeContentLayout=0x7f0a001b; - public static final int centerLoadBar=0x7f0a001e; - public static final int check1=0x7f0a002e; - public static final int childname=0x7f0a002d; - public static final int donateBitcoinAddress=0x7f0a0025; + public static final int busStopID=0x7f0a0018; + public static final int busStopListItems=0x7f0a000f; + public static final int busStopLoadBar=0x7f0a001d; + public static final int busStopMessage=0x7f0a001a; + public static final int busStopName=0x7f0a0010; + public static final int busStopTimes=0x7f0a001b; + public static final int busTimeContentLayout=0x7f0a0019; + public static final int centerLoadBar=0x7f0a001c; + public static final int check1=0x7f0a002c; + public static final int childname=0x7f0a002b; + public static final int donateBitcoinAddress=0x7f0a0023; public static final int donateButton=0x7f0a0003; - public static final int donateDialogErrorMessage=0x7f0a0024; - public static final int donateDialogMessage=0x7f0a0021; - public static final int donateDialogMessageLayout=0x7f0a0023; - public static final int donateDialogProgress=0x7f0a0022; - public static final int favouriteCheckBox=0x7f0a0019; - public static final int favouriteDialogMessage=0x7f0a002b; - public static final int favouriteListItems=0x7f0a002c; - public static final int findContentLayout=0x7f0a0027; - public static final int findListItems=0x7f0a0029; - public static final int findLoadBar=0x7f0a0028; + public static final int donateDialogErrorMessage=0x7f0a0022; + public static final int donateDialogMessage=0x7f0a001f; + public static final int donateDialogMessageLayout=0x7f0a0021; + public static final int donateDialogProgress=0x7f0a0020; + public static final int favouriteCheckBox=0x7f0a0017; + public static final int favouriteDialogMessage=0x7f0a0029; + public static final int favouriteListItems=0x7f0a002a; + public static final int findContentLayout=0x7f0a0025; + public static final int findListItems=0x7f0a0027; + public static final int findLoadBar=0x7f0a0026; public static final int helpExpandableListView=0x7f0a0002; - public static final int layout_root=0x7f0a0010; - public static final int linearLayout1=0x7f0a0013; - public static final int linearLayout2=0x7f0a0020; - public static final int mapview=0x7f0a002a; - public static final int menu_about=0x7f0a0034; - public static final int menu_favourites=0x7f0a0035; - public static final int menu_find=0x7f0a0030; - public static final int menu_find_my_location=0x7f0a0032; - public static final int menu_next_stop=0x7f0a0038; - public static final int menu_preferences=0x7f0a0031; - public static final int menu_previous_stop=0x7f0a0036; - public static final int menu_refresh_stop=0x7f0a0037; - public static final int menu_view=0x7f0a0033; - public static final int radio_u1=0x7f0a0014; - public static final int radio_u1n=0x7f0a0015; - public static final int radio_u2=0x7f0a0016; - public static final int radio_u6=0x7f0a0017; - public static final int radio_u9=0x7f0a0018; - public static final int searchBar=0x7f0a0026; + public static final int layout_root=0x7f0a000e; + public static final int linearLayout1=0x7f0a0011; + public static final int linearLayout2=0x7f0a001e; + public static final int mapview=0x7f0a0028; + public static final int menu_about=0x7f0a0032; + public static final int menu_favourites=0x7f0a0033; + public static final int menu_find=0x7f0a002e; + public static final int menu_find_my_location=0x7f0a0030; + public static final int menu_next_stop=0x7f0a0036; + public static final int menu_preferences=0x7f0a002f; + public static final int menu_previous_stop=0x7f0a0034; + public static final int menu_refresh_stop=0x7f0a0035; + public static final int menu_view=0x7f0a0031; + public static final int radio_u1=0x7f0a0012; + public static final int radio_u1n=0x7f0a0013; + public static final int radio_u2=0x7f0a0014; + public static final int radio_u6=0x7f0a0015; + public static final int radio_u9=0x7f0a0016; + public static final int searchBar=0x7f0a0024; public static final int textView1=0x7f0a0000; public static final int textView2=0x7f0a0001; - public static final int view_list=0x7f0a002f; + public static final int view_list=0x7f0a002d; } public static final class layout { public static final int about_dialog=0x7f030000; diff --git a/res/layout/bus_activity.xml b/res/layout/bus_activity.xml index b78f78a..3037916 100644 --- a/res/layout/bus_activity.xml +++ b/res/layout/bus_activity.xml @@ -94,21 +94,6 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" > - - - - - \ No newline at end of file diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index eb512f8..a71cbd3 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -4,11 +4,8 @@ import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import net.cbaines.suma.BusSpecificStopView.GetTimetableStopTask; - import org.apache.http.client.ClientProtocolException; import org.json.JSONException; @@ -39,11 +36,16 @@ public class BusActivity extends OrmLiteBaseActivity implements private TextView busIDTextView; - private ProgressBar progBar; private TextView busContentMessage; private LinearLayout busActivityContentLayout; + /** + * The bus this activity is focused on + */ private Bus bus; + /** + * The bus stop this activity is working from + */ private BusStop busStop; private Runnable refreshData; @@ -63,8 +65,6 @@ public class BusActivity extends OrmLiteBaseActivity implements private Handler handler; - int num = 20; - public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bus_activity); @@ -105,7 +105,6 @@ public class BusActivity extends OrmLiteBaseActivity implements busIDTextView = (TextView) findViewById(R.id.busActivityBusID); - progBar = (ProgressBar) findViewById(R.id.busActivityLoadBar); busContentMessage = (TextView) findViewById(R.id.busActivityMessage); busActivityContentLayout = (LinearLayout) findViewById(R.id.busActivityContentLayout); timetableView = (ListView) findViewById(R.id.busActivityTimes); @@ -150,17 +149,21 @@ public class BusActivity extends OrmLiteBaseActivity implements e.printStackTrace(); } - busStops = new ArrayList(num); + busStops = new ArrayList(); busStops.add(busStop); - for (int i = 0; i < num; i++) { + busStopsActive = new ArrayList(); + busStopsActive.add(false); + + for (int i = 0;; i++) { BusStop nextStop = bus.route.moveInRoute(instance, busStops.get(i), bus.direction, 1); - if (nextStop != null) { - busStops.add(nextStop); - } else { - Log.e(TAG, "nextStop is null"); + if (nextStop.equals(busStop) || (bus.destination != null && bus.destination.equals(nextStop))) { + break; } + + busStops.add(nextStop); + busStopsActive.add(false); } refreshData = new Runnable() { @@ -207,17 +210,18 @@ public class BusActivity extends OrmLiteBaseActivity implements if (timetable == null) { Log.i(TAG, "No Previous timetable"); timetable = new Timetable(); - for (int i = 0; i < num; i++) { + for (int i = 0; i < busStops.size(); i++) { timetable.add(new Stop(bus, busStops.get(i), null, null, false)); } } else { Log.i(TAG, "Displaying previous timetable"); - displayTimetable(timetable); + } + displayTimetable(timetable); + handler.post(refreshData); } else { Log.i(TAG, "Live Times Disabled"); - progBar.setVisibility(View.GONE); busContentMessage.setText("Live bus times disabled"); busContentMessage.setVisibility(View.VISIBLE); } @@ -227,13 +231,12 @@ public class BusActivity extends OrmLiteBaseActivity implements public void onPause() { if (handler != null) { // BusTimes are enabled handler.removeCallbacks(refreshData); - if (timetableStopTasks != null) { // Could happen if the handler has not created the timetableTask yet - for (GetTimetableStopTask task : timetableStopTasks.values()) { - if (task != null) { - task.cancel(true); - } + for (GetTimetableStopTask task : tasks.values()) { + if (task != null) { + task.cancel(true); } } + Log.i(TAG, "Stoping refreshing timetable data"); } @@ -257,9 +260,9 @@ public class BusActivity extends OrmLiteBaseActivity implements try { Log.i(TAG, "Fetching stop for busStop " + position); - stop = DataManager.getStop(context, stop.bus, busStop); + stop = DataManager.getStop(instance, bus, busStop); if (stop == null) { - stop = new Stop(stop.bus, busStop, null, null, false); + stop = new Stop(bus, busStop, null, null, false); } Log.i(TAG, "Finished fetching stop for busStop " + position); } catch (SQLException e) { @@ -281,18 +284,17 @@ public class BusActivity extends OrmLiteBaseActivity implements protected void onPostExecute(Stop stop) { // Log.i(TAG, "Got timetable"); if (stop == null) { + Log.i(TAG, "Its null"); - // progBar.setVisibility(View.GONE); - // busContentMessage.setText(errorMessage); - // busContentMessage.setVisibility(View.VISIBLE); + busContentMessage.setText(errorMessage); + busContentMessage.setVisibility(View.VISIBLE); } else { - // progBar.setVisibility(View.GONE); - + synchronized (timetable) { + timetable.set(position, stop); + displayTimetable(timetable); + } } } - } - - void setStopUpdated(BusStop stop, boolean updated) { } diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index 2dacfd2..0101ae4 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -41,6 +41,8 @@ import com.j256.ormlite.table.DatabaseTable; @DatabaseTable(tableName = "busroutes") public class BusRoute { + private static final String TAG = "BusRoute"; + final static String ID_FIELD_NAME = "id"; final static String CODE_FIELD_NAME = "code"; final static String LABEL_FIELD_NAME = "label"; @@ -147,7 +149,6 @@ public class BusRoute { PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); List routeStopsFound = routeStopsDao.query(routeStopsPreparedQuery); - Log.v("BusRoute", "Found " + routeStopsFound.size() + " stops"); int stopIndex = 0; @@ -158,28 +159,33 @@ public class BusRoute { } if (moveAmount > 0) { - Log.v("BusStop", "stopIndex " + stopIndex); - int stopWanted = (stopIndex + moveAmount) % (routeStopsFound.size()); - Log.v("BusStop", "stopWanted " + stopWanted); - busStopDao.refresh(routeStopsFound.get(stopWanted).stop); + Log.v(TAG, + "Moving forward in direction " + direction + " " + moveAmount + " stops from " + stop + " (" + stopIndex + "/" + routeStopsFound.size() + + ")"); + int stopWanted = stopIndex + moveAmount; + if ((stopWanted + 1) > routeStopsFound.size()) { + Log.v(TAG, "Off the end of the route"); + stopWanted = stopWanted % (routeStopsFound.size() - 1); + } + Log.v(TAG, "Stop wanted " + stopWanted); + BusStop busStopWanted = routeStopsFound.get(stopWanted).stop; - Log.v("BusRoute", - "Moving forward in direction " + direction + " " + moveAmount + " stops from " + stop + " to " + routeStopsFound.get(stopWanted).stop - + " in route " + this); + busStopDao.refresh(busStopWanted); - return routeStopsFound.get(stopWanted).stop; + Log.v(TAG, "Moving to " + busStopWanted + " (" + stopWanted + ") in route " + this); + + return busStopWanted; } else { - Log.v("BusStop", "stopIndex " + stopIndex); + Log.v(TAG, "stopIndex " + stopIndex); int stopWanted = stopIndex + moveAmount; if (stopWanted < 0) { stopWanted = routeStopsFound.size() - (Math.abs(stopWanted) % routeStopsFound.size()); } - Log.v("BusStop", "stopWanted " + stopWanted); + Log.v(TAG, "stopWanted " + stopWanted); busStopDao.refresh(routeStopsFound.get(stopWanted).stop); - Log.v("BusRoute", - "Moving backwards in direction " + direction + " " + moveAmount + " stops from " + stop + " to " + routeStopsFound.get(stopWanted).stop - + " in route " + this); + Log.v(TAG, "Moving backwards in direction " + direction + " " + moveAmount + " stops from " + stop + " to " + + routeStopsFound.get(stopWanted).stop + " in route " + this); return routeStopsFound.get(stopWanted).stop; } @@ -187,7 +193,7 @@ public class BusRoute { } catch (SQLException e) { e.printStackTrace(); } - Log.e("BusRoute", "Error moving in route"); + Log.e(TAG, "Error moving in route"); return null; } diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index 69b2aee..88a403c 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -19,19 +19,13 @@ package net.cbaines.suma; -import java.io.IOException; import java.sql.SQLException; import java.text.DateFormat; -import org.apache.http.client.ClientProtocolException; -import org.json.JSONException; - import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.os.AsyncTask; import android.os.Handler; -import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; @@ -45,7 +39,7 @@ import com.j256.ormlite.dao.Dao; public class BusSpecificStopView extends LinearLayout implements OnClickListener, OnLongClickListener { - private static final String TAG = "BusSpecificStopView"; + // private static final String TAG = "BusSpecificStopView"; private Handler handler; @@ -58,15 +52,12 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener private String onClickMessage = ""; private final Context context; - private GetTimetableStopTask task; - private Stop stop; - public BusSpecificStopView(Context context, Stop newStop, Handler newHandler) { + public BusSpecificStopView(Context context, Stop newStop) { super(context); this.context = context; - this.handler = newHandler; this.setOrientation(HORIZONTAL); diff --git a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java index c5b81d3..4cc894f 100644 --- a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java +++ b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java @@ -19,8 +19,6 @@ package net.cbaines.suma; -import android.content.Context; -import android.os.Handler; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; @@ -33,14 +31,12 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { private Timetable timetable; private final Animation a; private boolean[] changed; - private Handler handler; - private static final String TAG = "BusSpecificTimetableAdapter"; + // private static final String TAG = "BusSpecificTimetableAdapter"; - public BusSpecificTimetableAdapter(BusActivity context, Timetable timetable, Handler handler) { + public BusSpecificTimetableAdapter(BusActivity context, Timetable timetable) { this.context = context; this.timetable = timetable; - this.handler = handler; this.a = AnimationUtils.loadAnimation(context, R.anim.updated_stop_view); } @@ -49,7 +45,7 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { BusSpecificStopView stopView; if (convertView == null) { - stopView = new BusSpecificStopView(context, timetable.get(position), handler); + stopView = new BusSpecificStopView(context, timetable.get(position)); } else { stopView = (BusSpecificStopView) convertView; stopView.setStop(timetable.get(position)); diff --git a/src/net/cbaines/suma/POI.java b/src/net/cbaines/suma/POI.java index dba7924..244198d 100644 --- a/src/net/cbaines/suma/POI.java +++ b/src/net/cbaines/suma/POI.java @@ -60,8 +60,6 @@ public abstract class POI { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); - result = prime * result + ((point == null) ? 0 : point.hashCode()); - result = prime * result + ((type == null) ? 0 : type.hashCode()); return result; } @@ -79,16 +77,6 @@ public abstract class POI { return false; } else if (!id.equals(other.id)) return false; - if (point == null) { - if (other.point != null) - return false; - } else if (!point.equals(other.point)) - return false; - if (type == null) { - if (other.type != null) - return false; - } else if (!type.equals(other.type)) - return false; return true; } } -- cgit v1.2.3 From 3f10264e8dba0cd972647fbe1379f148b1ee6847 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 16 Feb 2012 22:35:53 +0000 Subject: More progress on the route movement stuff, identified the bus stops that need addressing manualy, however I need to redefine the concept of direction. As all of the routes that direction applies are circular, direction is only relevent for dealing with the bus stops that are present in the route more than once. --- src/net/cbaines/suma/BusActivity.java | 12 +-- src/net/cbaines/suma/BusRoute.java | 114 +++++++++++++++++---- src/net/cbaines/suma/BusSpecificStopView.java | 21 ++-- .../cbaines/suma/BusSpecificTimetableAdapter.java | 9 ++ src/net/cbaines/suma/DataManager.java | 76 ++++++++++++-- .../suma/SouthamptonUniversityMapActivity.java | 6 ++ src/net/cbaines/suma/Stop.java | 1 + 7 files changed, 197 insertions(+), 42 deletions(-) diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index a71cbd3..25f373a 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -20,7 +20,6 @@ import android.view.Gravity; import android.view.View; import android.widget.LinearLayout; import android.widget.ListView; -import android.widget.ProgressBar; import android.widget.TextView; import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; @@ -48,7 +47,7 @@ public class BusActivity extends OrmLiteBaseActivity implements */ private BusStop busStop; - private Runnable refreshData; + Runnable refreshData; protected Timetable timetable; private Timetable visibleTimetable; @@ -63,7 +62,7 @@ public class BusActivity extends OrmLiteBaseActivity implements private HashMap tasks = new HashMap(); - private Handler handler; + Handler handler; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -180,17 +179,16 @@ public class BusActivity extends OrmLiteBaseActivity implements task = new GetTimetableStopTask(); BusStop[] str = { stop.busStop }; task.execute(str); - handler.postDelayed(refreshData, 20000); } else { if (task.getStatus() == AsyncTask.Status.FINISHED) { BusStop[] str = { stop.busStop }; task.execute(str); - handler.postDelayed(refreshData, 20000); } } } } } + handler.postDelayed(refreshData, 20000); } }; @@ -213,12 +211,13 @@ public class BusActivity extends OrmLiteBaseActivity implements for (int i = 0; i < busStops.size(); i++) { timetable.add(new Stop(bus, busStops.get(i), null, null, false)); } + Log.v(TAG, "Finished adding placeholder stops"); } else { Log.i(TAG, "Displaying previous timetable"); } displayTimetable(timetable); - handler.post(refreshData); + handler.postDelayed(refreshData, 500); } else { Log.i(TAG, "Live Times Disabled"); @@ -256,6 +255,7 @@ public class BusActivity extends OrmLiteBaseActivity implements protected Stop doInBackground(BusStop... busStopArray) { busStop = busStopArray[0]; + position = busStops.indexOf(busStop); Stop stop = null; try { diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index 0101ae4..94e8e37 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -113,13 +113,18 @@ public class BusRoute { * Untested? * * @param context - * @param stop + * @param busStop * @param moveAmount * @return */ - BusStop moveInRoute(Context context, BusStop stop, String direction, int moveAmount) { + BusStop moveInRoute(final Context context, final BusStop busStop, String direction, int moveAmount) { + + if (!code.startsWith("U") || code.equals("U9")) { + throw new RuntimeException("Route Movement not supported for " + code); + } + if (moveAmount == 0) { - return stop; + return busStop; } DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -128,15 +133,8 @@ public class BusRoute { if (direction != null) { - if (forwardDirection.equals(direction)) { - - } else if (reverseDirection.equals(direction)) { - moveAmount = -moveAmount; - } else { - Log.e("BusRoute", "Direction (" + direction + ") doesnt match either the forward direction (" + forwardDirection - + ") or reverse direction (" + reverseDirection + ")"); - return null; - } + if (direction.equals("E")) + direction = "A"; // Quick hack for U1E } } @@ -150,29 +148,102 @@ public class BusRoute { List routeStopsFound = routeStopsDao.query(routeStopsPreparedQuery); - int stopIndex = 0; + int stopIndex = -1; for (RouteStops routeStop : routeStopsFound) { - if (routeStop.stop.id.equals(stop.id)) { - stopIndex = routeStop.sequence - 1; + if (routeStop.stop.id.equals(busStop.id)) { + if (stopIndex == -1) { + stopIndex = routeStop.sequence - 1; + } else { // ARGH, weird route + if (busStop.id.equals("HAA13651") && id == 327) { // U6 by Wessex Lane + if (direction.equals(forwardDirection)) { + stopIndex = 23; + } else { + stopIndex = 68; + } + } else if (busStop.id.equals("SN120134") && id == 327) { // U6 opposite the Stile + if (direction.equals(forwardDirection)) { + stopIndex = 30; + } else { + stopIndex = 59; + } + } else if (busStop.id.equals("SN120163") && id == 327) { // U6 just up past wessex lane + if (direction.equals(forwardDirection)) { + stopIndex = 22; + } else { + stopIndex = 67; + } + } else if (busStop.id.equals("SNA19482") && id == 327) { // U6 General Hosp West Door + if (moveAmount > 0) { + stopIndex = 44; + } else { + stopIndex = 43; + } + } else if (busStop.id.equals("SN120134") && id == 329) { // U2 opposite the Stile + if (direction.equals(forwardDirection)) { + stopIndex = 13; + } else { + stopIndex = 30; + } + } else if (busStop.id.equals("SN120527") && id == 329) { // U2 Civic Centre Rd os stop AO Civic Ctr E + if (moveAmount > 0) { + stopIndex = 0; + } else { + stopIndex = 42; + } + } else if (busStop.id.equals("SNA09298") && id == 329) { // U2 Bassett Green Rd nr Bassett Green Cl SE + if (moveAmount > 0) { + stopIndex = 22; + } else { + stopIndex = 21; + } + } else if (busStop.id.equals("SN120520") && id == 326) { // U1 By the station + if (direction.equals(forwardDirection)) { + stopIndex = 7; + } else { + stopIndex = 80; + } + } else if (busStop.id.equals("HA030183") && id == 326) { // U1 Up past Wessex Lane + if (direction.equals(forwardDirection)) { + stopIndex = 35; + } else { + stopIndex = 50; + } + } else if (busStop.id.equals("HA030212") && id == 326) { // U1 At Eastleigh + if (moveAmount > 0) { + stopIndex = 43; + } else { + stopIndex = 42; + } + } else if (busStop.id.equals("SN120171") && id == 354) { // U9 + if (moveAmount > 0) { + stopIndex = 0; + } else { + stopIndex = 73; + } + } else { + Log.e(TAG, "Error, unknown bus stop " + busStop.id + " (" + busStop.description + ") that appears mutiple times in " + toString()); + throw new RuntimeException("Error, unknown bus stop " + busStop.id + " that appears mutiple times in " + toString()); + } + } } } if (moveAmount > 0) { Log.v(TAG, - "Moving forward in direction " + direction + " " + moveAmount + " stops from " + stop + " (" + stopIndex + "/" + routeStopsFound.size() - + ")"); + "Moving forward in direction " + direction + " " + moveAmount + " stops from " + busStop + " (" + stopIndex + "/" + + routeStopsFound.size() + ")"); int stopWanted = stopIndex + moveAmount; if ((stopWanted + 1) > routeStopsFound.size()) { Log.v(TAG, "Off the end of the route"); stopWanted = stopWanted % (routeStopsFound.size() - 1); } - Log.v(TAG, "Stop wanted " + stopWanted); + Log.v(TAG, " Stop wanted " + stopWanted); BusStop busStopWanted = routeStopsFound.get(stopWanted).stop; busStopDao.refresh(busStopWanted); - Log.v(TAG, "Moving to " + busStopWanted + " (" + stopWanted + ") in route " + this); + Log.v(TAG, " Moving to " + busStopWanted + " (" + stopWanted + ") in route " + this); return busStopWanted; } else { @@ -184,8 +255,9 @@ public class BusRoute { Log.v(TAG, "stopWanted " + stopWanted); busStopDao.refresh(routeStopsFound.get(stopWanted).stop); - Log.v(TAG, "Moving backwards in direction " + direction + " " + moveAmount + " stops from " + stop + " to " - + routeStopsFound.get(stopWanted).stop + " in route " + this); + Log.v(TAG, + "Moving backwards in direction " + direction + " " + moveAmount + " stops from " + busStop + " to " + + routeStopsFound.get(stopWanted).stop + " in route " + this); return routeStopsFound.get(stopWanted).stop; } diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index 88a403c..cad7524 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -25,7 +25,7 @@ import java.text.DateFormat; import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.os.Handler; +import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; @@ -39,11 +39,7 @@ import com.j256.ormlite.dao.Dao; public class BusSpecificStopView extends LinearLayout implements OnClickListener, OnLongClickListener { - // private static final String TAG = "BusSpecificStopView"; - - private Handler handler; - - private Runnable refreshData; + private static final String TAG = "BusSpecificStopView"; // private static final String TAG = "StopView"; @@ -54,7 +50,7 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener private Stop stop; - public BusSpecificStopView(Context context, Stop newStop) { + public BusSpecificStopView(Context context, Stop stop) { super(context); this.context = context; @@ -73,7 +69,6 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener addView(location, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); addView(time, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); - handler.post(refreshData); } public void setStop(Stop stop) { @@ -82,6 +77,16 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener this.stop = stop; + if (stop == null) { + Log.e(TAG, "stop == null"); + } + if (stop.busStop == null) { + Log.e(TAG, "stop.busStop == null"); + } + if (stop.busStop.description == null) { + Log.e(TAG, "stop.busStop.description == null"); + } + if (stop.busStop.description.length() > 20) { location.setText(stop.busStop.description.substring(0, 20)); // TODO } else { diff --git a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java index 4cc894f..469fa56 100644 --- a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java +++ b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java @@ -32,6 +32,8 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { private final Animation a; private boolean[] changed; + private long timeOfLastForcedUpdate = System.currentTimeMillis(); + // private static final String TAG = "BusSpecificTimetableAdapter"; public BusSpecificTimetableAdapter(BusActivity context, Timetable timetable) { @@ -43,6 +45,13 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { public View getView(int position, View convertView, ViewGroup parent) { // Log.i(TAG, "Returning stop " + position + " " + timetable.get(position)); + context.busStopsActive.set(position, true); + + if (timeOfLastForcedUpdate + 1000 < System.currentTimeMillis()) { + context.handler.post(context.refreshData); + timeOfLastForcedUpdate = System.currentTimeMillis(); + } + BusSpecificStopView stopView; if (convertView == null) { stopView = new BusSpecificStopView(context, timetable.get(position)); diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 2af4b52..f065b07 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -269,13 +269,13 @@ public class DataManager { route = new BusRoute(id, dataBits[1], dataBits[2].replace("\"", ""), uniLink); - if (id == 326) { - route.forwardDirection = "C"; - route.reverseDirection = "A"; - } else if (id == 329) { - route.forwardDirection = "C"; - route.reverseDirection = "B"; - } else if (id == 327) { + if (id == 326) { // U1 + route.forwardDirection = "A"; + route.reverseDirection = "C"; + } else if (id == 329) { // U2 + route.forwardDirection = "B"; + route.reverseDirection = "C"; + } else if (id == 327) { // U6 route.forwardDirection = "H"; route.reverseDirection = "C"; } @@ -801,4 +801,66 @@ public class DataManager { return builder.toString(); } + + public static void routeMovementTest(Context context) throws SQLException { + + Dao routeStopsDao = null; + + if (helper == null) + helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + if (routeStopsDao == null) + routeStopsDao = helper.getRouteStopsDao(); + if (busRouteDao == null) + busRouteDao = helper.getBusRouteDao(); + if (busStopDao == null) + busStopDao = helper.getBusStopDao(); + + for (BusRoute busRoute : busRouteDao) { + if (!busRoute.code.startsWith("U") || busRoute.code.equals("U9")) { + continue; + } + List routeStops = routeStopsDao.queryForEq(RouteStops.ROUTE_ID_FIELD_NAME, busRoute.id); + + ArrayList directions = new ArrayList(); + if (busRoute.forwardDirection != null) { + directions.add(busRoute.forwardDirection); + } + if (busRoute.reverseDirection != null) { + directions.add(busRoute.reverseDirection); + } + if (directions.size() == 0) { + directions.add(null); + } + + BusStop startBusStop = null; + + for (int moveAmount = 1; moveAmount >= -1; moveAmount = moveAmount - 2) { + for (String direction : directions) { + for (int busStop = 0; busStop < routeStops.size() && busStop >= 0; busStop = busStop + moveAmount) { + // if (routeStops.get(busStop).stop.equals(startBusStop)) + // continue; + startBusStop = routeStops.get(busStop).stop; + busStopDao.refresh(startBusStop); + + BusStop predictedNextStop = busRoute.moveInRoute(context, startBusStop, direction, moveAmount); + + BusStop nextStop; + if (busStop == routeStops.size() - 1) { + nextStop = routeStops.get(0).stop; + } else { + nextStop = routeStops.get(busStop + 1).stop; + } + busStopDao.refresh(nextStop); + + if (!nextStop.equals(predictedNextStop) && !startBusStop.equals(nextStop)) { + Log.e(TAG, "predicted: " + predictedNextStop + " next: " + nextStop); + Log.e(TAG, startBusStop.id + " " + nextStop.id); + return; + } + } + } + } + } + + } } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index 26996a0..d4754a4 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -384,6 +384,12 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Fri, 17 Feb 2012 14:15:03 +0000 Subject: Some changes? --- src/net/cbaines/suma/BusRoute.java | 87 +++++++++++++++++++++- .../suma/SouthamptonUniversityMapActivity.java | 6 -- 2 files changed, 86 insertions(+), 7 deletions(-) diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index 94e8e37..ed6deeb 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -20,7 +20,10 @@ package net.cbaines.suma; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import android.content.Context; import android.util.Log; @@ -117,7 +120,87 @@ public class BusRoute { * @param moveAmount * @return */ - BusStop moveInRoute(final Context context, final BusStop busStop, String direction, int moveAmount) { + Set moveInRoute(final Context context, final BusStop busStop, final int moveAmount) { + + if (!code.startsWith("U") || code.equals("U9")) { + throw new RuntimeException("Route Movement not supported for " + code); + } + + Set busStops = new HashSet(); + + if (moveAmount == 0) { + busStops.add(busStop); + return busStops; + } + + DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + + try { + Dao routeStopsDao = helper.getRouteStopsDao(); + Dao busStopDao = helper.getBusStopDao(); + + QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, this.id); + PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); + + List routeStopsFound = routeStopsDao.query(routeStopsPreparedQuery); + + ArrayList stopIndexs = new ArrayList(); + + for (RouteStops routeStop : routeStopsFound) { + if (routeStop.stop.id.equals(busStop.id)) { + stopIndexs.add(routeStop.sequence - 1); + } + } + + for (int stopIndex : stopIndexs) { + + if (moveAmount > 0) { + Log.v(TAG, "Moving forward " + moveAmount + " stops from " + busStop + " (" + stopIndex + "/" + routeStopsFound.size() + ")"); + int stopWanted = stopIndex + moveAmount; + if ((stopWanted + 1) > routeStopsFound.size()) { + Log.v(TAG, "Off the end of the route"); + stopWanted = stopWanted % (routeStopsFound.size() - 1); + } + Log.v(TAG, " Stop wanted " + stopWanted); + BusStop busStopWanted = routeStopsFound.get(stopWanted).stop; + + busStopDao.refresh(busStopWanted); + + Log.v(TAG, " Moving to " + busStopWanted + " (" + stopWanted + ") in route " + this); + + busStops.add(busStopWanted); + } else { + Log.v(TAG, "stopIndex " + stopIndex); + int stopWanted = stopIndex + moveAmount; + if (stopWanted < 0) { + stopWanted = routeStopsFound.size() - (Math.abs(stopWanted) % routeStopsFound.size()); + } + Log.v(TAG, "stopWanted " + stopWanted); + busStopDao.refresh(routeStopsFound.get(stopWanted).stop); + + Log.v(TAG, "Moving backwards " + moveAmount + " stops from " + busStop + " to " + routeStopsFound.get(stopWanted).stop + " in route " + + this); + + busStops.add(routeStopsFound.get(stopWanted).stop); + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + Log.e(TAG, "Error moving in route"); + return null; + } + + /** + * Untested? + * + * @param context + * @param busStop + * @param moveAmount + * @return + */ + BusStop moveInRoute(final Context context, final BusStop busStop, String direction, final int moveAmount) { if (!code.startsWith("U") || code.equals("U9")) { throw new RuntimeException("Route Movement not supported for " + code); @@ -135,6 +218,8 @@ public class BusRoute { if (direction.equals("E")) direction = "A"; // Quick hack for U1E + } else { + throw new NullPointerException("direction is null"); } } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index d4754a4..26996a0 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -384,12 +384,6 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Fri, 17 Feb 2012 15:07:20 +0000 Subject: Somewhat working bus stop movement and bus schedule :) --- src/net/cbaines/suma/BusRoute.java | 10 ++-------- src/net/cbaines/suma/BusStopActivity.java | 13 ++++++++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index ed6deeb..e1bf65b 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -122,10 +122,6 @@ public class BusRoute { */ Set moveInRoute(final Context context, final BusStop busStop, final int moveAmount) { - if (!code.startsWith("U") || code.equals("U9")) { - throw new RuntimeException("Route Movement not supported for " + code); - } - Set busStops = new HashSet(); if (moveAmount == 0) { @@ -185,6 +181,8 @@ public class BusRoute { busStops.add(routeStopsFound.get(stopWanted).stop); } } + + return busStops; } catch (SQLException e) { e.printStackTrace(); } @@ -202,10 +200,6 @@ public class BusRoute { */ BusStop moveInRoute(final Context context, final BusStop busStop, String direction, final int moveAmount) { - if (!code.startsWith("U") || code.equals("U9")) { - throw new RuntimeException("Route Movement not supported for " + code); - } - if (moveAmount == 0) { return busStop; } diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 5928033..9910ad3 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -24,6 +24,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; +import java.util.Set; import org.apache.http.client.ClientProtocolException; import org.json.JSONException; @@ -351,14 +352,16 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme for (BusRoute route : routes) { try { - BusStop tmpStop; + Set tmpStops; if (item.getItemId() == R.id.menu_next_stop) { - tmpStop = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, 1); + tmpStops = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), 1); } else { - tmpStop = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, -1); + tmpStops = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), -1); } - if (!busStops.contains(tmpStop)) { - busStops.add(tmpStop); + for (BusStop busStop : tmpStops) { + if (!busStops.contains(busStop)) { + busStops.add(busStop); + } } } catch (SQLException e) { e.printStackTrace(); -- cgit v1.2.3 From 419cb3529dd8f59790ee9a6aa869b7afe3c21f0c Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 17 Feb 2012 16:29:46 +0000 Subject: Improved toasts, changed the way the map works, one tap gets you a toast with info, two taps gets you the activity, and a long press changes the favourites state. --- src/net/cbaines/suma/BuildingNumOverlay.java | 35 ++++++++++++++---- src/net/cbaines/suma/BusActivity.java | 3 ++ src/net/cbaines/suma/BusSpecificStopView.java | 21 ++++++++--- src/net/cbaines/suma/BusStopActivity.java | 3 ++ src/net/cbaines/suma/BusStopOverlay.java | 42 +++++++++++++++++++--- .../suma/SouthamptonUniversityMapActivity.java | 3 ++ src/net/cbaines/suma/StopView.java | 20 ++++++++--- src/net/cbaines/suma/TimetableAdapter.java | 4 +-- 8 files changed, 110 insertions(+), 21 deletions(-) diff --git a/src/net/cbaines/suma/BuildingNumOverlay.java b/src/net/cbaines/suma/BuildingNumOverlay.java index 4bd5f3a..baa92b5 100644 --- a/src/net/cbaines/suma/BuildingNumOverlay.java +++ b/src/net/cbaines/suma/BuildingNumOverlay.java @@ -25,7 +25,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; - import org.osmdroid.views.MapView; import org.osmdroid.views.MapView.Projection; import org.osmdroid.views.overlay.Overlay; @@ -62,13 +61,13 @@ public class BuildingNumOverlay extends Overlay { private static final String TAG = "BuildingNumOverlay"; - private final Context context; + private final SouthamptonUniversityMapActivity context; private Dao buildingDao; private float userScale = 1f; - public BuildingNumOverlay(Context context, List buildings) throws SQLException { + public BuildingNumOverlay(SouthamptonUniversityMapActivity context, List buildings) throws SQLException { super(context); this.context = context; @@ -192,12 +191,23 @@ public class BuildingNumOverlay extends Overlay { } else { Log.i(TAG, "building Pressed " + building.id); - Toast.makeText(context, building.name + " (" + building.id + ")", Toast.LENGTH_SHORT).show(); + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, building.name + " (" + building.id + ")", Toast.LENGTH_SHORT); + } else { + context.activityToast.setDuration(Toast.LENGTH_SHORT); + context.activityToast.setText(building.name + " (" + building.id + ")"); + } + context.activityToast.show(); + return true; } } + public boolean onDoubleTap(final MotionEvent e, final MapView mapView) { + return false; + } + @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { if (!this.isEnabled()) @@ -214,9 +224,22 @@ public class BuildingNumOverlay extends Overlay { if (building.favourite) { building.favourite = false; - Toast.makeText(context, building.id + " removed from favourites", Toast.LENGTH_SHORT).show(); + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, building.id + " removed from favourites", Toast.LENGTH_SHORT); + } else { + context.activityToast.setDuration(Toast.LENGTH_SHORT); + context.activityToast.setText(building.id + " removed from favourites"); + } + context.activityToast.show(); + } else { - Toast.makeText(context, building.id + " made a favourite", Toast.LENGTH_SHORT).show(); + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, building.id + " made a favourite", Toast.LENGTH_SHORT); + } else { + context.activityToast.setDuration(Toast.LENGTH_SHORT); + context.activityToast.setText(building.id + " made a favourite"); + } + context.activityToast.show(); building.favourite = true; } diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index 25f373a..4b59117 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -21,6 +21,7 @@ import android.view.View; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; +import android.widget.Toast; import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; @@ -38,6 +39,8 @@ public class BusActivity extends OrmLiteBaseActivity implements private TextView busContentMessage; private LinearLayout busActivityContentLayout; + Toast activityToast; + /** * The bus this activity is focused on */ diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index cad7524..fc14fcb 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -46,11 +46,11 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener private final TextView location; private final TextView time; private String onClickMessage = ""; - private final Context context; + private final BusActivity context; private Stop stop; - public BusSpecificStopView(Context context, Stop stop) { + public BusSpecificStopView(BusActivity context, Stop stop) { super(context); this.context = context; @@ -147,8 +147,13 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener } public void onClick(View v) { - Toast.makeText(context, onClickMessage, Toast.LENGTH_SHORT).show(); - + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, onClickMessage, Toast.LENGTH_SHORT); + } else { + context.activityToast.setText(onClickMessage); + context.activityToast.setDuration(Toast.LENGTH_SHORT); + } + context.activityToast.show(); } @Override @@ -165,7 +170,13 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener i.putExtra("poiPoint", stop.busStop.point.toDoubleString()); ((Activity) context).startActivityForResult(i, 0); } else { - Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT).show(); + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT); + } else { + context.activityToast.setText("Arival prediction not avalible for timetabled buses"); + context.activityToast.setDuration(Toast.LENGTH_SHORT); + } + context.activityToast.show(); } } catch (SQLException e) { diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 9910ad3..1c325ec 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -52,6 +52,7 @@ import android.widget.LinearLayout; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; +import android.widget.Toast; import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; import com.j256.ormlite.dao.Dao; @@ -100,6 +101,8 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme private HashSet routes = new HashSet(); + Toast activityToast; + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bustimes); diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java index 59212ef..f912d19 100644 --- a/src/net/cbaines/suma/BusStopOverlay.java +++ b/src/net/cbaines/suma/BusStopOverlay.java @@ -60,7 +60,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { private static final String TAG = "BusStopOverlay"; - private final Context context; + private final SouthamptonUniversityMapActivity context; private Dao busStopDao; @@ -68,7 +68,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { private boolean[] routes = new boolean[5]; - public BusStopOverlay(Context context, List busStops) throws SQLException { + public BusStopOverlay(SouthamptonUniversityMapActivity context, List busStops) throws SQLException { super(context); this.context = context; @@ -196,6 +196,28 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { BusStop busStop = getSelectedItem(event, mapView); + if (busStop == null) { + Log.i(TAG, "No busStop pressed"); + return false; + } else { + Log.i(TAG, "busStop Pressed " + busStop.id); + + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, busStop.description + " (" + busStop.id + ")", Toast.LENGTH_SHORT); + } else { + context.activityToast.setDuration(Toast.LENGTH_SHORT); + context.activityToast.setText(busStop.description + " (" + busStop.id + ")"); + } + context.activityToast.show(); + + return true; + } + } + + public boolean onDoubleTap(final MotionEvent event, final MapView mapView) { + + BusStop busStop = getSelectedItem(event, mapView); + if (busStop == null) { Log.i(TAG, "No busStop pressed"); @@ -226,9 +248,21 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { if (busStop.favourite) { busStop.favourite = false; - Toast.makeText(context, busStop.id + " removed from favourites", Toast.LENGTH_SHORT).show(); + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, busStop.id + " removed from favourites", Toast.LENGTH_SHORT); + } else { + context.activityToast.setDuration(Toast.LENGTH_SHORT); + context.activityToast.setText(busStop.id + " removed from favourites"); + } + context.activityToast.show(); } else { - Toast.makeText(context, busStop.id + " made a favourite", Toast.LENGTH_SHORT).show(); + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, busStop.id + " made a favourite", Toast.LENGTH_SHORT); + } else { + context.activityToast.setDuration(Toast.LENGTH_SHORT); + context.activityToast.setText(busStop.id + " made a favourite"); + } + context.activityToast.show(); busStop.favourite = true; } diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java index 26996a0..1412e3b 100644 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java @@ -69,6 +69,7 @@ import android.widget.CheckBox; import android.widget.ExpandableListView; import android.widget.ExpandableListView.OnChildClickListener; import android.widget.TextView; +import android.widget.Toast; import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; import com.j256.ormlite.dao.Dao; @@ -142,6 +143,8 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity Date: Fri, 17 Feb 2012 19:03:03 +0000 Subject: Renamed SouthamptonUniversityMapActivity to MapActivity, moved the ViewDialog out of it. --- AndroidManifest.xml | 3 +- assets/data.db | Bin 140288 -> 489472 bytes src/net/cbaines/suma/BuildingActivity.java | 1 + src/net/cbaines/suma/BuildingNumOverlay.java | 18 +- src/net/cbaines/suma/Bus.java | 3 - src/net/cbaines/suma/BusRoutesView.java | 19 + src/net/cbaines/suma/BusSpecificStopView.java | 3 +- src/net/cbaines/suma/BusStopActivity.java | 6 +- src/net/cbaines/suma/BusStopOverlay.java | 29 +- src/net/cbaines/suma/MapActivity.java | 1174 ++++++++++++++++ .../suma/SouthamptonUniversityMapActivity.java | 1421 -------------------- src/net/cbaines/suma/ViewDialog.java | 295 ++++ 12 files changed, 1537 insertions(+), 1435 deletions(-) create mode 100644 src/net/cbaines/suma/MapActivity.java delete mode 100644 src/net/cbaines/suma/SouthamptonUniversityMapActivity.java create mode 100644 src/net/cbaines/suma/ViewDialog.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 21e3c2a..cd740a0 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -14,10 +14,11 @@ diff --git a/assets/data.db b/assets/data.db index 353266d..086f5cd 100644 Binary files a/assets/data.db and b/assets/data.db differ diff --git a/src/net/cbaines/suma/BuildingActivity.java b/src/net/cbaines/suma/BuildingActivity.java index 62fbb44..ca605c8 100644 --- a/src/net/cbaines/suma/BuildingActivity.java +++ b/src/net/cbaines/suma/BuildingActivity.java @@ -25,6 +25,7 @@ import java.util.HashSet; import android.content.Context; import android.os.Bundle; + import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; public class BuildingActivity extends OrmLiteBaseActivity { diff --git a/src/net/cbaines/suma/BuildingNumOverlay.java b/src/net/cbaines/suma/BuildingNumOverlay.java index baa92b5..47bee3c 100644 --- a/src/net/cbaines/suma/BuildingNumOverlay.java +++ b/src/net/cbaines/suma/BuildingNumOverlay.java @@ -61,13 +61,13 @@ public class BuildingNumOverlay extends Overlay { private static final String TAG = "BuildingNumOverlay"; - private final SouthamptonUniversityMapActivity context; + private final MapActivity context; private Dao buildingDao; private float userScale = 1f; - public BuildingNumOverlay(SouthamptonUniversityMapActivity context, List buildings) throws SQLException { + public BuildingNumOverlay(MapActivity context, List buildings) throws SQLException { super(context); this.context = context; @@ -180,6 +180,13 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onSingleTapUp(final MotionEvent event, final MapView mapView) { + + Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction()); + if (event.getPointerCount() != 1) { + Log.v(TAG, "Pointer count for onSingleTapUp not 1, ignoring"); + return false; + } + if (!this.isEnabled()) return false; @@ -210,6 +217,13 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { + + Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction()); + if (event.getPointerCount() != 1) { + Log.v(TAG, "Pointer count for onLongPress not 1, ignoring"); + return false; + } + if (!this.isEnabled()) return false; diff --git a/src/net/cbaines/suma/Bus.java b/src/net/cbaines/suma/Bus.java index ac2d223..b36dd89 100644 --- a/src/net/cbaines/suma/Bus.java +++ b/src/net/cbaines/suma/Bus.java @@ -19,9 +19,6 @@ package net.cbaines.suma; -import android.os.Parcel; -import android.os.Parcelable; - import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; diff --git a/src/net/cbaines/suma/BusRoutesView.java b/src/net/cbaines/suma/BusRoutesView.java index b7c1095..32226b0 100644 --- a/src/net/cbaines/suma/BusRoutesView.java +++ b/src/net/cbaines/suma/BusRoutesView.java @@ -1,3 +1,22 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + package net.cbaines.suma; import android.content.Context; diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index fc14fcb..77601ff 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -23,7 +23,6 @@ import java.sql.SQLException; import java.text.DateFormat; import android.app.Activity; -import android.content.Context; import android.content.Intent; import android.util.Log; import android.view.Gravity; @@ -166,7 +165,7 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener busDao.refresh(stop.bus); if (stop.bus.id != null) { - Intent i = new Intent(context, SouthamptonUniversityMapActivity.class); + Intent i = new Intent(context, MapActivity.class); i.putExtra("poiPoint", stop.busStop.point.toDoubleString()); ((Activity) context).startActivityForResult(i, 0); } else { diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java index 1c325ec..03dcbca 100644 --- a/src/net/cbaines/suma/BusStopActivity.java +++ b/src/net/cbaines/suma/BusStopActivity.java @@ -298,9 +298,9 @@ public class BusStopActivity extends OrmLiteBaseActivity impleme try { final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(instance); - newTimetable = DataManager.getTimetable(instance, busStopID, sharedPrefs.getBoolean(SouthamptonUniversityMapActivity.UNI_LINK_BUS_TIMES, - SouthamptonUniversityMapActivity.UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT), sharedPrefs.getBoolean( - SouthamptonUniversityMapActivity.NON_UNI_LINK_BUS_TIMES, SouthamptonUniversityMapActivity.NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT)); + newTimetable = DataManager.getTimetable(instance, busStopID, sharedPrefs.getBoolean(MapActivity.UNI_LINK_BUS_TIMES, + MapActivity.UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT), sharedPrefs.getBoolean( + MapActivity.NON_UNI_LINK_BUS_TIMES, MapActivity.NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT)); } catch (SQLException e) { errorMessage = "Error message regarding SQL?"; e.printStackTrace(); diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java index f912d19..58f5bb0 100644 --- a/src/net/cbaines/suma/BusStopOverlay.java +++ b/src/net/cbaines/suma/BusStopOverlay.java @@ -28,7 +28,6 @@ import org.osmdroid.views.MapView.Projection; import org.osmdroid.views.overlay.Overlay; import android.app.Activity; -import android.content.Context; import android.content.Intent; import android.graphics.Canvas; import android.graphics.Paint; @@ -60,7 +59,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { private static final String TAG = "BusStopOverlay"; - private final SouthamptonUniversityMapActivity context; + private final MapActivity context; private Dao busStopDao; @@ -68,7 +67,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { private boolean[] routes = new boolean[5]; - public BusStopOverlay(SouthamptonUniversityMapActivity context, List busStops) throws SQLException { + public BusStopOverlay(MapActivity context, List busStops) throws SQLException { super(context); this.context = context; @@ -191,9 +190,20 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { } } + public boolean onTouchEvent(final MotionEvent event, final MapView mapView) { + // Log.i(TAG, "Touch Event " + event.getPointerCount() + " " + event.getAction()); + return false; + } + @Override public boolean onSingleTapUp(final MotionEvent event, final MapView mapView) { + Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction()); + if (event.getPointerCount() != 1) { + Log.v(TAG, "Pointer count for onSingleTapUp not 1, ignoring"); + return false; + } + BusStop busStop = getSelectedItem(event, mapView); if (busStop == null) { @@ -216,6 +226,12 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { public boolean onDoubleTap(final MotionEvent event, final MapView mapView) { + Log.v(TAG, "Pointer count for onDoubleTap is " + event.getPointerCount() + " " + event.getAction()); + if (event.getPointerCount() != 1) { + Log.v(TAG, "Pointer count for onDoubleTap not 1, ignoring"); + return false; + } + BusStop busStop = getSelectedItem(event, mapView); if (busStop == null) { @@ -237,6 +253,13 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { + + Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction()); + if (event.getPointerCount() != 1) { + Log.v(TAG, "Pointer count for onLongPress not 1, ignoring"); + return false; + } + BusStop busStop = getSelectedItem(event, mapView); if (busStop == null) { diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java new file mode 100644 index 0000000..5db0a74 --- /dev/null +++ b/src/net/cbaines/suma/MapActivity.java @@ -0,0 +1,1174 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package net.cbaines.suma; + +import java.io.IOException; +import java.io.InputStream; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; + +import org.osmdroid.DefaultResourceProxyImpl; +import org.osmdroid.ResourceProxy; +import org.osmdroid.tileprovider.tilesource.TileSourceFactory; +import org.osmdroid.util.GeoPoint; +import org.osmdroid.views.MapController; +import org.osmdroid.views.MapView; +import org.osmdroid.views.overlay.MyLocationOverlay; +import org.osmdroid.views.overlay.Overlay; +import org.osmdroid.views.overlay.PathOverlay; +import org.osmdroid.views.overlay.ScaleBarOverlay; +import org.osmdroid.views.util.constants.MapViewConstants; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; +import android.content.SharedPreferences.OnSharedPreferenceChangeListener; +import android.graphics.Color; +import android.graphics.DashPathEffect; +import android.graphics.Paint; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.View; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.AdapterView.OnItemLongClickListener; +import android.widget.Toast; + +import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; +import com.j256.ormlite.dao.Dao; + +public class MapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, OnItemClickListener, + OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { + + private boolean useBundledDatabase = true; + + private MapView mapView; + private MapController mapController; + private ResourceProxy mResourceProxy; + + private long startTime; + + static final int VIEW_DIALOG_ID = 0; + static final int FAVOURITE_DIALOG_ID = 1; + + private HashMap overlays = new HashMap(); + private HashMap pastOverlays; + + // Overlays + + // Scale Bar Overlay + private static final String SCALE_BAR_OVERLAY = "scaleBarOverlay"; + private ScaleBarOverlay scaleBarOverlay; + static final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final int SCALE_BAR_OVERLAY_RANK = 1; + + // My Location Overlay + private static final String MY_LOCATION_OVERLAY = "myLocationOverlay"; + private MyLocationOverlay myLocationOverlay; + static final boolean MY_LOCATION_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final int MY_LOCATION_OVERLAY_RANK = 1; + + // Residential Building Overlay + private static final String RESIDENTIAL_BUILDING_OVERLAY = "residentialBuildingOverlay"; + private BuildingNumOverlay residentialBuildingOverlay; + static final boolean RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final int RESIDENTIAL_BUILDING_OVERLAY_RANK = 1; + + // Non-Residential Building Overlay + private static final String NON_RESIDENTIAL_BUILDING_OVERLAY = "nonResidentialBuildingOverlay"; + private BuildingNumOverlay nonResidentialBuildingOverlay; + static final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final int NON_RESIDENTIAL_BUILDING_OVERLAY_RANK = 1; + + // Uni-Link Bus Stop Overlay + private static final String UNI_LINK_BUS_STOP_OVERLAY = "uniLinkBusStopOverlay"; + private BusStopOverlay uniLinkBusStopOverlay; + static final boolean UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final int UNI_LINK_BUS_STOP_OVERLAY_RANK = 1; + + // Uni-Link Bus Stop Overlay + private static final String NON_UNI_LINK_BUS_STOP_OVERLAY = "nonUniLinkBusStopOverlay"; + private BusStopOverlay nonUniLinkBusStopOverlay; + static final boolean NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final int NON_UNI_LINK_BUS_STOP_OVERLAY_RANK = 1; + + // Site Overlays + private static final String SITE_OVERLAYS = "siteOverlays"; + private HashMap siteOverlays = new HashMap(21); + static final boolean SITE_OVERLAYS_ENABLED_BY_DEFAULT = false; + private static final int SITE_OVERLAYS_RANK = 1; + + // Route Overlays + private static final String ROUTE_OVERLAYS = "routeOverlays"; + private HashMap routeOverlays = new HashMap(5); + static final boolean ROUTE_OVERLAYS_ENABLED_BY_DEFAULT = true; + private static final int ROUTE_OVERLAYS_RANK = 1; + + private POIDialog favDialog; + + Toast activityToast; + + private MapActivity instance; + + private static final String TAG = "SUM"; + + @SuppressWarnings("unchecked") + public void onCreate(Bundle savedInstanceState) { + startTime = System.currentTimeMillis(); + + super.onCreate(savedInstanceState); + + instance = this; + + Thread databaseThread = new Thread(this); // Start the database thread + databaseThread.start(); + + setContentView(R.layout.main); + + Log.i(TAG, "Finished setting content view " + (System.currentTimeMillis() - startTime)); + + mapView = (MapView) this.findViewById(R.id.mapview); + mapView.setTileSource(TileSourceFactory.MAPQUESTOSM); + mapView.setBuiltInZoomControls(true); + mapView.setMultiTouchControls(true); + + pastOverlays = (HashMap) getLastNonConfigurationInstance(); + + // SensorManager mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); This code in the following constructor causes problems in + // some emulators, disable sensors to fix. + Log.i(TAG, "Starting creating myLocationOverlay"); + myLocationOverlay = new MyLocationOverlay(instance, mapView); + Log.i(TAG, "Finished creating myLocationOverlay"); + + while (databaseThread.isAlive()) { + Thread.yield(); + } + + new Thread(new Runnable() { + public void run() { + Thread.currentThread().setPriority(Thread.MAX_PRIORITY); + try { + showOverlays(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + }).start(); + + Log.i(TAG, "Started loading thread " + (System.currentTimeMillis() - startTime)); + + mapController = mapView.getController(); + mResourceProxy = new DefaultResourceProxyImpl(getApplicationContext()); + + GeoPoint userLocation = null; + + Bundle extras = getIntent().getExtras(); + if (extras != null && extras.containsKey("poiPoint")) { + String poiPoint = getIntent().getExtras().getString("poiPoint"); + Log.i(TAG, "poiPoint " + poiPoint); + + String[] bits = poiPoint.split(","); + + userLocation = new GeoPoint(Double.valueOf(bits[0]), Double.valueOf(bits[1])); + mapController.setZoom(20); + + } else { + userLocation = myLocationOverlay.getMyLocation(); + if (userLocation == null) { + userLocation = new GeoPoint(50935551, -1393488); // ECS + } + mapController.setZoom(15); + } + + mapController.setCenter(userLocation); + + Log.i(TAG, "Finished onCreate " + (System.currentTimeMillis() - startTime)); + } + + public void onResume() { + super.onResume(); + Log.i(TAG, "OnResume"); + if (myLocationOverlay != null) { + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); + final SharedPreferences activityPrefs = getPreferences(0); + + if (activityPrefs.getBoolean("Other:Compass", false)) { + myLocationOverlay.enableCompass(); + } else { + myLocationOverlay.disableCompass(); + } + + if (activityPrefs.getBoolean("Other:My Location", false) && sharedPrefs.getBoolean(GPS_ENABLED, false)) { + myLocationOverlay.enableMyLocation(); + } else { + myLocationOverlay.disableMyLocation(); + } + + sharedPrefs.registerOnSharedPreferenceChangeListener(this); + activityPrefs.registerOnSharedPreferenceChangeListener(this); + } + } + + public void onPause() { + super.onResume(); + Log.i(TAG, "OnPause"); + if (myLocationOverlay != null) { + myLocationOverlay.disableMyLocation(); + myLocationOverlay.disableCompass(); + } + } + + public void finish() { + super.finish(); + } + + @Override + public Object onRetainNonConfigurationInstance() { + return overlays; + } + + public void run() { + Log.i(TAG, "Begining loading database " + (System.currentTimeMillis() - startTime)); + + DatabaseHelper helper = getHelper(); + Log.i(TAG, "Got the helper at " + (System.currentTimeMillis() - startTime)); + + boolean dbExist = helper.checkDataBase(); + Log.i(TAG, "Finished checking the database at " + (System.currentTimeMillis() - startTime)); + + if (dbExist) { + // do nothing - database already exist + } else { + + if (useBundledDatabase) { + try { + // By calling this method and empty database will be created into the default system path + // of your application so we are gonna be able to overwrite that database with our database. + Log.i(TAG, "GetReadableDatabase"); + helper.getWritableDatabase().close(); + + helper.copyDataBase(); + Log.i(TAG, "Out of copy database"); + } catch (IOException ioe) { + throw new Error("Unable to create database"); + } + } else { + Thread buildingThread = null; + Thread busStopThread = null; + Thread siteThread = null; + + Log.i(TAG, "Begining loading databases " + (System.currentTimeMillis() - startTime)); + try { + Dao buildingDao; + + buildingDao = helper.getBuildingDao(); + + long buildingCount = buildingDao.countOf(); + Log.i(TAG, "Building count " + buildingCount); + if (buildingCount < 260) { + buildingThread = new Thread(new Runnable() { + public void run() { + try { + DataManager.loadBuildings(instance); + Log.i(TAG, "Loaded building database " + (System.currentTimeMillis() - startTime)); + } catch (SQLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + }); + + buildingThread.start(); + } + + Dao busStopDao = helper.getBusStopDao(); + Dao busRouteDao = helper.getBusRouteDao(); + Dao routeStopsDao = helper.getRouteStopsDao(); + + long busStopCount = busStopDao.countOf(); + long busRouteCount = busRouteDao.countOf(); + long routeStopsCount = routeStopsDao.countOf(); + + Log.i(TAG, "BusStop count " + busStopCount); + Log.i(TAG, "BusRoute count " + busRouteCount); + Log.i(TAG, "RouteStops count " + routeStopsCount); + if (busStopCount < 217 || busRouteCount < 5 || routeStopsCount < 327) { + busStopThread = new Thread(new Runnable() { + public void run() { + try { + DataManager.loadBusData(instance, true); + Log.i(TAG, "Loaded bus stop database " + (System.currentTimeMillis() - startTime)); + } catch (SQLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + }); + + busStopThread.start(); + } + + Dao siteDao = helper.getSiteDao(); + + long siteCount = siteDao.countOf(); + Log.i(TAG, "Sites count " + siteCount); + if (siteCount < 21) { + siteThread = new Thread(new Runnable() { + public void run() { + try { + DataManager.loadSiteData(instance); + Log.i(TAG, "Loaded site database " + (System.currentTimeMillis() - startTime)); + } catch (SQLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + }); + + siteThread.start(); + } + + while (true) { + if ((buildingThread == null || !buildingThread.isAlive()) && (busStopThread == null || !busStopThread.isAlive()) + && (siteThread == null || !siteThread.isAlive())) + break; + + Thread.yield(); + } + + Log.i(TAG, "Finished loading databases " + (System.currentTimeMillis() - startTime)); + + } catch (SQLException e1) { + e1.printStackTrace(); + } + } + + } + + Log.i(TAG, "Begining setting up the static values " + (System.currentTimeMillis() - startTime)); + + Log.i(TAG, "Finished the database thread " + (System.currentTimeMillis() - startTime)); + } + + private void showOverlays() throws SQLException { + Log.i(TAG, "Began showing overlays at " + (System.currentTimeMillis() - startTime)); + + if (pastOverlays != null) { + Log.i(TAG, "Able to recover some/all of the overlays from a previous activity"); + } else { + Log.i(TAG, "Unable to recover overlays"); + } + + final SharedPreferences activityPrefs = getPreferences(0); + + showUtilityOverlays(); + + showUniLinkBusStopOverlays(); + + showNonUniLinkBusStopOverlays(); + + if (activityPrefs.getBoolean("Buildings:Residential", true) || activityPrefs.getBoolean("Buildings:Non-Residential", true)) { + // The argument currently dosent matter for this method. + showBuildingOverlay(); + } + + Log.i(TAG, "Begining to show the route overlays at " + (System.currentTimeMillis() - startTime)); + for (BusRoute busRoute : getHelper().getBusRouteDao()) { + if (!busRoute.uniLink) { + continue; + } + Log.v(TAG, "Looking at showing " + busRoute.code + " route overlay"); + if (activityPrefs.getBoolean("Bus Routes:" + busRoute.code, ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)) { + showRouteOverlay(busRoute); + } + } + Log.i(TAG, "Finished loading routes " + (System.currentTimeMillis() - startTime)); + + Log.i(TAG, "Begining to show the site overlays at " + (System.currentTimeMillis() - startTime)); + try { + for (Site site : getHelper().getSiteDao()) { + Log.v(TAG, "Looking at showing " + site.name + " site overlay"); + if (activityPrefs.getBoolean(SITE_OVERLAYS + site.name, SITE_OVERLAYS_ENABLED_BY_DEFAULT)) { + showSiteOverlay(site); + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + Log.i(TAG, "Finished showing the site overlays " + (System.currentTimeMillis() - startTime)); + + Log.i(TAG, "Finished showing all the overlays " + (System.currentTimeMillis() - startTime)); + } + + private void showUtilityOverlays() { + new Thread(new Runnable() { + public void run() { + Log.i(TAG, "Begining showing the utility overlays " + (System.currentTimeMillis() - startTime)); + + final SharedPreferences activityPrefs = getPreferences(0); + final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); + + if (scaleBarOverlay != null) { + Log.v(TAG, "ScaleBarOverlay is already created"); + } else { + if (pastOverlays != null && (scaleBarOverlay = (ScaleBarOverlay) pastOverlays.get(SCALE_BAR_OVERLAY)) != null) { + Log.i(TAG, "Finished restoring utility overlays " + (System.currentTimeMillis() - startTime)); + } else { + scaleBarOverlay = new ScaleBarOverlay(instance); + } + + overlays.put(SCALE_BAR_OVERLAY, scaleBarOverlay); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().add(scaleBarOverlay); + mapView.getOverlays().add(myLocationOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } + + } + + scaleBarOverlay.setEnabled(activityPrefs.getBoolean(SCALE_BAR_OVERLAY, SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT)); + + mapView.postInvalidate(); + + Log.i(TAG, "Finished showing utility overlays " + (System.currentTimeMillis() - startTime)); + } + }).start(); + } + + private void showRouteOverlay(final BusRoute route) { + new Thread(new Runnable() { + public void run() { + Log.i(TAG, "Begining showing route " + route.code + " overlay at " + (System.currentTimeMillis() - startTime)); + + final SharedPreferences activityPrefs = getPreferences(0); + final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); + + PathOverlay routeOverlay; + if ((routeOverlay = routeOverlays.get(route)) != null) { + Log.v(TAG, route.code + " route overlay already existed"); + } else { + if (pastOverlays != null && (routeOverlay = (PathOverlay) pastOverlays.get(ROUTE_OVERLAYS + route.code)) != null) { + Log.v(TAG, "Restored " + route.code + " route overlay"); + if (route.code.equals("U1")) { + PathOverlay routeOverlayU1E = (PathOverlay) pastOverlays.get(ROUTE_OVERLAYS + "U1E"); + overlays.put(ROUTE_OVERLAYS + "U1E", routeOverlayU1E); + } + } else { + InputStream resource = null; + int colour = 0; + if (route.code.equals("U1")) { + resource = getResources().openRawResource(R.raw.u1); + colour = U1; + + // TODO Is this a route like U1N or, something else, this hack works somewhat for now? + PathOverlay routeOverlayU1E = DataManager.getRoutePath(getResources().openRawResource(R.raw.u1e), colour, mResourceProxy); + routeOverlayU1E.getPaint().setAntiAlias(true); + routeOverlayU1E.getPaint().setAlpha(145); + routeOverlayU1E.getPaint().setStrokeWidth(12); + routeOverlayU1E.getPaint().setPathEffect(new DashPathEffect(new float[] { 20, 16 }, 0)); + routeOverlayU1E.setEnabled(activityPrefs.getBoolean("Bus Routes:" + route.code, true)); + + routeOverlays.put(new BusRoute(1000, "U1E", "U1E Route Label", true), routeOverlayU1E); + overlays.put(ROUTE_OVERLAYS + route.code + "E", routeOverlayU1E); + } else if (route.code.equals("U1N")) { + resource = getResources().openRawResource(R.raw.u1n); + colour = U1N; + } else if (route.code.equals("U2")) { + resource = getResources().openRawResource(R.raw.u2); + colour = U2; + } else if (route.code.equals("U6")) { + resource = getResources().openRawResource(R.raw.u6); + colour = U6; + } else if (route.code.equals("U9")) { + resource = getResources().openRawResource(R.raw.u9); + colour = U9; + } else { + Log.w(TAG, "Wierd route " + route); + } + + routeOverlay = DataManager.getRoutePath(resource, colour, mResourceProxy); + + Log.v(TAG, "Path overlay has " + routeOverlay.getNumberOfPoints() + " points"); + + routeOverlay.getPaint().setAntiAlias(true); + routeOverlay.getPaint().setAlpha(145); + routeOverlay.getPaint().setStrokeWidth(12); + } + + routeOverlays.put(route, routeOverlay); + overlays.put(ROUTE_OVERLAYS + route.code, routeOverlay); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().add(routeOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } + + } + + routeOverlay.setEnabled(activityPrefs.getBoolean(ROUTE_OVERLAYS + route.code, ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); + if (route.code.equals("U1")) { + overlays.get(ROUTE_OVERLAYS + "U1E").setEnabled(activityPrefs.getBoolean(ROUTE_OVERLAYS + "U1", ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); + } + + mapView.postInvalidate(); + + Log.i(TAG, "Finished showing route " + route.code + " overlay at " + (System.currentTimeMillis() - startTime)); + } + }).start(); + } + + private void showSiteOverlay(final Site site) { + + new Thread(new Runnable() { + public void run() { + Log.i(TAG, "Begining showing site " + site.name + " overlay at " + (System.currentTimeMillis() - startTime)); + + final SharedPreferences activityPrefs = getPreferences(0); + final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); + + PathOverlay siteOverlay; + if ((siteOverlay = siteOverlays.get(site)) != null) { + + } else { + if (pastOverlays != null && (siteOverlay = (PathOverlay) pastOverlays.get(SITE_OVERLAYS + site.name)) != null) { + Log.i(TAG, "Restored " + site.name + " site overlay"); + } else { + + siteOverlay = new PathOverlay(Color.BLUE, instance); + Paint paint = siteOverlay.getPaint(); + paint.setAntiAlias(true); + paint.setStrokeWidth(1.5f); + for (int i = 0; i < site.outline.points.length; i++) { + siteOverlay.addPoint(site.outline.points[i]); + } + siteOverlay.addPoint(site.outline.points[0]); + + } + + siteOverlays.put(site, siteOverlay); + overlays.put(SITE_OVERLAYS + site.name, siteOverlay); + + Log.v(TAG, "Applyed the site overlay, now sorting them"); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().add(siteOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } + } + + siteOverlay.setEnabled(activityPrefs.getBoolean(SITE_OVERLAYS + site.name, SITE_OVERLAYS_ENABLED_BY_DEFAULT)); + + mapView.postInvalidate(); + + Log.i(TAG, "Finished showing site " + site.name + " overlay at " + (System.currentTimeMillis() - startTime)); + } + }).start(); + } + + private void showBuildingOverlay() { + new Thread(new Runnable() { + public void run() { + Log.i(TAG, "Begining showing building overlays at " + (System.currentTimeMillis() - startTime)); + + final SharedPreferences activityPrefs = getPreferences(0); + final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); + + if (residentialBuildingOverlay != null) { + + } else { + if (pastOverlays != null && (residentialBuildingOverlay = (BuildingNumOverlay) pastOverlays.get(RESIDENTIAL_BUILDING_OVERLAY)) != null) { + nonResidentialBuildingOverlay = (BuildingNumOverlay) pastOverlays.get(NON_RESIDENTIAL_BUILDING_OVERLAY); + + Log.i(TAG, "Restored building overlays"); + } else { + try { + + Log.v(TAG, "Begining the creation of the building overlays"); + + ArrayList residentialBuildings = new ArrayList(); + ArrayList nonResidentialBuildings = new ArrayList(); + + Dao buildingDao; + + buildingDao = getHelper().getBuildingDao(); + + for (Building building : buildingDao) { + if (building.residential == true) { + if (building.favourite) { + residentialBuildings.add(building); + } else { + residentialBuildings.add(0, building); + } + } else { + if (building.favourite) { + nonResidentialBuildings.add(building); + } else { + nonResidentialBuildings.add(0, building); + } + } + } + + residentialBuildingOverlay = new BuildingNumOverlay(instance, residentialBuildings); + nonResidentialBuildingOverlay = new BuildingNumOverlay(instance, nonResidentialBuildings); + + Log.v(TAG, "Applyed the site overlay, now sorting them"); + + } catch (SQLException e) { + e.printStackTrace(); + } + } + + overlays.put(RESIDENTIAL_BUILDING_OVERLAY, residentialBuildingOverlay); + overlays.put(NON_RESIDENTIAL_BUILDING_OVERLAY, nonResidentialBuildingOverlay); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().add(residentialBuildingOverlay); + mapView.getOverlays().add(nonResidentialBuildingOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } + } + + residentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + nonResidentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, + NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + + mapView.postInvalidate(); + + Log.i(TAG, "Finished showing building overlays at " + (System.currentTimeMillis() - startTime)); + } + }).start(); + } + + private void showUniLinkBusStopOverlays() { + new Thread(new Runnable() { + public void run() { + Log.i(TAG, "Begining showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); + + final SharedPreferences activityPrefs = getPreferences(0); + final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); + + if (uniLinkBusStopOverlay != null) { + + } else { + if (pastOverlays != null && (uniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(UNI_LINK_BUS_STOP_OVERLAY)) != null) { + Log.i(TAG, "Restored bus stop overlays"); + } else { + try { + List busStops; + Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); + if (activityPrefs.getBoolean(UNI_LINK_BUS_STOP_OVERLAY, UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { + busStops = getHelper().getBusStopDao().queryForAll(); + } else { + busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); + } + Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); + + uniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + overlays.put(UNI_LINK_BUS_STOP_OVERLAY, uniLinkBusStopOverlay); + + Log.v(TAG, "Applyed the site overlay, now sorting them"); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().add(uniLinkBusStopOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } + } + + uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean("0,0", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean("0,1", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean("0,2", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(3, activityPrefs.getBoolean("0,3", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(4, activityPrefs.getBoolean("0,4", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + + mapView.postInvalidate(); + + Log.i(TAG, "Finished showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); + } + }).start(); + } + + private void showNonUniLinkBusStopOverlays() { + new Thread(new Runnable() { + public void run() { + Log.i(TAG, "Begining showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); + + final SharedPreferences activityPrefs = getPreferences(0); + final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); + + if (nonUniLinkBusStopOverlay == null && activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { + if (pastOverlays != null && (nonUniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(NON_UNI_LINK_BUS_STOPS)) != null) { + Log.i(TAG, "Restored non Uni-Link bus stop overlays"); + } else { + try { + List busStops; + Log.v(TAG, "Begin fetching non Uni-Link BusStops at " + (System.currentTimeMillis() - startTime)); + + busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, false); + + Log.v(TAG, "Finished fetching non Uni-Link BusStops at " + (System.currentTimeMillis() - startTime)); + + nonUniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + overlays.put(NON_UNI_LINK_BUS_STOPS, nonUniLinkBusStopOverlay); + + Log.v(TAG, "Applyed the site overlay, now sorting them"); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().add(nonUniLinkBusStopOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } + } + + mapView.postInvalidate(); + + Log.i(TAG, "Finished showing non Uni-Link bus stop overlays at " + (System.currentTimeMillis() - startTime)); + } + }).start(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.map_menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle item selection + switch (item.getItemId()) { + case R.id.menu_find: + Intent i = new Intent(MapActivity.this, FindActivity.class); + startActivityForResult(i, 0); + return true; + case R.id.menu_preferences: + Intent settingsActivity = new Intent(getBaseContext(), PreferencesActivity.class); + startActivity(settingsActivity); + return true; + case R.id.menu_find_my_location: + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); + if (sharedPrefs.getBoolean("GPSEnabled", false)) { + GeoPoint userLocation = myLocationOverlay.getMyLocation(); + if (userLocation != null) { + Log.i(TAG, "Found user location, scrolling to " + userLocation); + mapController.animateTo(userLocation); + myLocationOverlay.enableFollowLocation(); + } + } else { + DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + switch (which) { + case DialogInterface.BUTTON_POSITIVE: + Editor editor = sharedPrefs.edit(); + editor.putBoolean("GPSEnabled", true); + editor.commit(); + break; + + case DialogInterface.BUTTON_NEGATIVE: + // No button clicked + break; + } + } + }; + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setMessage("GPS is not enabled, do you wish to enable it?").setPositiveButton("Yes", dialogClickListener) + .setNegativeButton("No", dialogClickListener).show(); + } + + return true; + case R.id.menu_view: + Log.i(TAG, "Showing view dialog"); + showDialog(VIEW_DIALOG_ID); + return false; + case R.id.menu_favourites: + Log.i(TAG, "Showing favourite dialog"); + + showDialog(FAVOURITE_DIALOG_ID); + if (favDialog == null) { + Log.e(TAG, "Very wierd, just tried to launch the favourite's dialog, but its null?"); + return false; + } + + refreshFavouriteDialog(); + + return false; + case R.id.menu_about: + Intent aboutIntent = new Intent(MapActivity.this, AboutActivity.class); + startActivityForResult(aboutIntent, 0); + return true; + default: + Log.e(TAG, "No known menu option selected"); + return super.onOptionsItemSelected(item); + } + } + + private void refreshFavouriteDialog() { + ArrayList newFavouriteItems = new ArrayList(); + + try { + Dao buildingDao = getHelper().getBuildingDao(); + Dao busStopDao = getHelper().getBusStopDao(); + + newFavouriteItems.addAll(buildingDao.queryForEq(POI.FAVOURITE_FIELD_NAME, true)); + newFavouriteItems.addAll(busStopDao.queryForEq(POI.FAVOURITE_FIELD_NAME, true)); + } catch (SQLException e) { + e.printStackTrace(); + } + + Log.i(TAG, "There are " + newFavouriteItems.size() + " favourites"); + if (newFavouriteItems.size() == 0) { + Log.i(TAG, "Favourite dialog has no favourites, displaying message"); + favDialog.setMessage(getResources().getString(R.string.favourites_dialog_message)); + favDialog.setItems(null); + } else { + favDialog.setMessage(""); + favDialog.setItems(newFavouriteItems); + } + } + + @Override + public boolean onSearchRequested() { + Intent i = new Intent(MapActivity.this, FindActivity.class); + startActivityForResult(i, 0); + return false; + } + + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + Log.i(TAG, "Got activity result"); + if (resultCode == RESULT_OK) { + + POI poi = null; + Bundle bundle = data.getExtras(); + if (bundle == null) { + Log.i(TAG, "Bundle is null"); + } else { + String poiId = (String) bundle.get("poi"); + if (poiId != null) { + Log.i(TAG, "Got id " + poiId); + try { + poi = getHelper().getBuildingDao().queryForId(poiId); + if (poi == null) { + poi = getHelper().getBusStopDao().queryForId(poiId); + } + } catch (SQLException e) { + e.printStackTrace(); + } + + if (poi == null) { + Log.e(TAG, "Could not find poi " + poiId + " in onActivityResult"); + } else { + if (myLocationOverlay != null) { + // It could be null if it has not been enabled + myLocationOverlay.disableFollowLocation(); + } + mapController.setZoom(20); + mapController.setCenter(poi.point); + + } + } else { + Log.i(TAG, "Got null poi id"); + + // mapController.setZoom(15); + // mapController.setCenter(new GeoPoint(50935551, -1393488)); + } + + // This handles the possible change in favourite state caused by the user within the BusTimeActivity + try { + String busStopID = bundle.getString("busStopChanged"); + if (busStopID != null && busStopID.length() != 0) { + Log.v(TAG, "Got a busStop id back from the BusTimeActivity " + busStopID); + BusStop busStop = getHelper().getBusStopDao().queryForId(busStopID); + + uniLinkBusStopOverlay.refresh(busStop); // This does not invalidate the map, but it seems to make the changes appear + } + } catch (SQLException e) { + e.printStackTrace(); + } + + if (favDialog != null) { + refreshFavouriteDialog(); + } + } + } + + } + + /* + * public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { + * + * mapView.post(new Runnable() { public void run() { // updateEnabledOverlays(); TODO Fix whatever this did? mapView.invalidate(); } }); + * + * return true; } + */ + + protected Dialog onCreateDialog(int id) { + switch (id) { + case VIEW_DIALOG_ID: + ViewDialog viewDialog = new ViewDialog(instance); + return viewDialog; + case FAVOURITE_DIALOG_ID: + favDialog = new POIDialog(instance); + favDialog.setOnItemClickListener(this); + favDialog.setOnItemLongClickListener(this); + favDialog.setTitle(R.string.favourites_dialog_title); + return favDialog; + } + return null; + } + + public void onItemClick(AdapterView parent, View view, int position, long id) { + Log.i(TAG, "OnItemClick pos " + position + " id " + id); + + String poiId = favDialog.adapter.getItemStringId(position); + + Log.i(TAG, "POI " + poiId + " selected"); + + POI poi = null; + + if (poiId != null) { + Log.i(TAG, "Got id " + poiId); + try { + poi = getHelper().getBuildingDao().queryForId(poiId); + if (poi == null) { + poi = getHelper().getBusStopDao().queryForId(poiId); + } + } catch (SQLException e) { + e.printStackTrace(); + } + + if (poi == null) { + Log.e(TAG, "Could not find poi " + poiId + " in onActivityResult"); + } else { + if (myLocationOverlay != null) { + myLocationOverlay.disableFollowLocation(); + } + mapController.setZoom(20); + mapController.setCenter(poi.point); + + favDialog.dismiss(); + + } + } else { + Log.i(TAG, "Got null poi id"); + + // mapController.setZoom(15); + // mapController.setCenter(new GeoPoint(50935551, -1393488)); + } + + } + + /** + * Long click on a item in the favourites menu + */ + public boolean onItemLongClick(AdapterView parent, View view, int position, long id) { + + Log.i(TAG, "OnItemClick pos " + position + " id " + id); + + String poiId = favDialog.adapter.getItemStringId(position); + + Log.i(TAG, "POI " + poiId + " selected"); + + POI poi = null; + + if (poiId != null) { + Log.i(TAG, "Got id " + poiId); + try { + poi = getHelper().getBuildingDao().queryForId(poiId); + if (poi == null) { + poi = getHelper().getBusStopDao().queryForId(poiId); + } + } catch (SQLException e) { + e.printStackTrace(); + } + + if (poi == null) { + Log.e(TAG, "Could not find poi " + poiId + " in onActivityResult"); + } else { + if (poi.type == POI.BUS_STOP) { + BusStop busStop = (BusStop) poi; + + Log.i(TAG, "Pressed " + busStop.id); + + Intent i = new Intent(this, BusStopActivity.class); + i.putExtra("busStopID", busStop.id); + i.putExtra("busStopName", busStop.description); + startActivityForResult(i, 0); + + return true; + + } else { + + myLocationOverlay.disableFollowLocation(); + mapController.setZoom(20); + mapController.setCenter(poi.point); + + favDialog.dismiss(); + favDialog = null; + } + } + } else { + Log.i(TAG, "Got null poi id"); + + // mapController.setZoom(15); + // mapController.setCenter(new GeoPoint(50935551, -1393488)); + } + + return true; + } + + private class OverlayRankComparator implements Comparator { + // private final SharedPreferences prefs; + + OverlayRankComparator(SharedPreferences prefs) { + // this.prefs = prefs; + } + + public int compare(Overlay arg0, Overlay arg1) { + return getRank(arg1) - getRank(arg0); + } + + private final int getRank(Overlay overlay) { // TODO: Dont hardcode the rank values + if (overlay == scaleBarOverlay) { + return SCALE_BAR_OVERLAY_RANK; + } else if (overlay == myLocationOverlay) { + return MY_LOCATION_OVERLAY_RANK; + } else if (overlay == uniLinkBusStopOverlay) { + return UNI_LINK_BUS_STOP_OVERLAY_RANK; + } else if (overlay == nonUniLinkBusStopOverlay) { + return NON_UNI_LINK_BUS_STOP_OVERLAY_RANK; + } else if (overlay == residentialBuildingOverlay) { + return RESIDENTIAL_BUILDING_OVERLAY_RANK; + } else if (overlay == nonResidentialBuildingOverlay) { + return NON_RESIDENTIAL_BUILDING_OVERLAY_RANK; + } else if (siteOverlays != null && siteOverlays.values().contains(overlay)) { + return SITE_OVERLAYS_RANK; + } else if (routeOverlays != null && routeOverlays.values().contains(overlay)) { + return ROUTE_OVERLAYS_RANK; + } else { + Log.e(TAG, "Trying to rank unknown overlay " + overlay); + return -1; + } + } + } + + /** + * Handles all changes in preferences + */ + public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { + Log.v(TAG, "Got shared prefs changed event for key " + key); + + // Shared Preferences + if (key.equals(GPS_ENABLED)) { + final SharedPreferences activityPrefs = getPreferences(0); + + if (activityPrefs.getBoolean("Other:Compass", false) && prefs.getBoolean("GPSEnabled", false)) { + myLocationOverlay.enableMyLocation(); + } else { + myLocationOverlay.disableMyLocation(); + } + } else if (key.equals(NON_UNI_LINK_BUS_TIMES)) { + // Noting to do here atm + } else if (key.equals(UNI_LINK_BUS_TIMES)) { + // Noting to do here atm + } else if (key.equals(UNI_LINK_BUS_STOP_OVERLAY)) { + + } else if (key.equals(NON_UNI_LINK_BUS_STOP_OVERLAY)) { // Activity Preferences + showUniLinkBusStopOverlays(); + } else if (key.equals(NON_UNI_LINK_BUS_STOPS)) { // Activity Preferences + showNonUniLinkBusStopOverlays(); + } else if (key.contains(ROUTE_OVERLAYS)) { + try { + String routeName = key.substring(ROUTE_OVERLAYS.length(), key.length()); + for (BusRoute route : getHelper().getBusRouteDao()) { + Log.v(TAG, route.code + " " + routeName); + if (route.code.equals(routeName)) { + showRouteOverlay(route); + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + } else if (key.equals(RESIDENTIAL_BUILDING_OVERLAY) || key.equals(NON_RESIDENTIAL_BUILDING_OVERLAY)) { + showBuildingOverlay(); + } else if (key.contains(SITE_OVERLAYS)) { + String siteName = key.substring(SITE_OVERLAYS.length(), key.length()); + try { + for (Site site : getHelper().getSiteDao()) { + if (site.name.equals(siteName)) { + showSiteOverlay(site); + } + } + } catch (SQLException e) { + e.printStackTrace(); + } + } else if (key.startsWith("0")) { + uniLinkBusStopOverlay.setRoutes(Integer.parseInt(Character.toString(key.charAt(2))), + prefs.getBoolean(key, UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + mapView.postInvalidate(); + } else if (key.contains("Other")) { + if (key.contains("Scale Bar")) { + showUtilityOverlays(); + } else if (key.contains("Compass")) { + if (prefs.getBoolean("Other:Compass", false)) { + myLocationOverlay.enableCompass(); + } else { + myLocationOverlay.disableCompass(); + } + } else if (key.contains("Other:My Location")) { + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); + + if (prefs.getBoolean("Other:Compass", false) && sharedPrefs.getBoolean("GPSEnabled", false)) { + myLocationOverlay.enableMyLocation(); + } else { + myLocationOverlay.disableMyLocation(); + } + } else { + Log.e(TAG, "Unhandled preference key " + key); + } + } else { + Log.e(TAG, "Unhandled preference key " + key); + } + } +} diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java deleted file mode 100644 index 1412e3b..0000000 --- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java +++ /dev/null @@ -1,1421 +0,0 @@ -/* - * Southampton University Map App - * Copyright (C) 2011 Christopher Baines - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package net.cbaines.suma; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; - -import org.osmdroid.DefaultResourceProxyImpl; -import org.osmdroid.ResourceProxy; -import org.osmdroid.tileprovider.tilesource.TileSourceFactory; -import org.osmdroid.util.GeoPoint; -import org.osmdroid.views.MapController; -import org.osmdroid.views.MapView; -import org.osmdroid.views.overlay.MyLocationOverlay; -import org.osmdroid.views.overlay.Overlay; -import org.osmdroid.views.overlay.PathOverlay; -import org.osmdroid.views.overlay.ScaleBarOverlay; -import org.osmdroid.views.util.constants.MapViewConstants; - -import android.app.AlertDialog; -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.SharedPreferences.Editor; -import android.content.SharedPreferences.OnSharedPreferenceChangeListener; -import android.graphics.Color; -import android.graphics.DashPathEffect; -import android.graphics.Paint; -import android.os.Bundle; -import android.preference.PreferenceManager; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.view.WindowManager; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.AdapterView.OnItemLongClickListener; -import android.widget.BaseExpandableListAdapter; -import android.widget.CheckBox; -import android.widget.ExpandableListView; -import android.widget.ExpandableListView.OnChildClickListener; -import android.widget.TextView; -import android.widget.Toast; - -import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; -import com.j256.ormlite.dao.Dao; - -public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, - OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { - - private boolean useBundledDatabase = false; - - private MapView mapView; - private MapController mapController; - private ResourceProxy mResourceProxy; - - private long startTime; - - static final int VIEW_DIALOG_ID = 0; - static final int FAVOURITE_DIALOG_ID = 1; - - private HashMap overlays = new HashMap(); - private HashMap pastOverlays; - - // Overlays - - // Scale Bar Overlay - private static final String SCALE_BAR_OVERLAY = "scaleBarOverlay"; - private ScaleBarOverlay scaleBarOverlay; - private static final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int SCALE_BAR_OVERLAY_RANK = 1; - - // My Location Overlay - private static final String MY_LOCATION_OVERLAY = "myLocationOverlay"; - private MyLocationOverlay myLocationOverlay; - private static final boolean MY_LOCATION_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int MY_LOCATION_OVERLAY_RANK = 1; - - // Residential Building Overlay - private static final String RESIDENTIAL_BUILDING_OVERLAY = "residentialBuildingOverlay"; - private BuildingNumOverlay residentialBuildingOverlay; - private static final boolean RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int RESIDENTIAL_BUILDING_OVERLAY_RANK = 1; - - // Non-Residential Building Overlay - private static final String NON_RESIDENTIAL_BUILDING_OVERLAY = "nonResidentialBuildingOverlay"; - private BuildingNumOverlay nonResidentialBuildingOverlay; - private static final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int NON_RESIDENTIAL_BUILDING_OVERLAY_RANK = 1; - - // Uni-Link Bus Stop Overlay - private static final String UNI_LINK_BUS_STOP_OVERLAY = "uniLinkBusStopOverlay"; - private BusStopOverlay uniLinkBusStopOverlay; - private static final boolean UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int UNI_LINK_BUS_STOP_OVERLAY_RANK = 1; - - // Uni-Link Bus Stop Overlay - private static final String NON_UNI_LINK_BUS_STOP_OVERLAY = "nonUniLinkBusStopOverlay"; - private BusStopOverlay nonUniLinkBusStopOverlay; - private static final boolean NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int NON_UNI_LINK_BUS_STOP_OVERLAY_RANK = 1; - - // Site Overlays - private static final String SITE_OVERLAYS = "siteOverlays"; - private HashMap siteOverlays = new HashMap(21); - private static final boolean SITE_OVERLAYS_ENABLED_BY_DEFAULT = false; - private static final int SITE_OVERLAYS_RANK = 1; - - // Route Overlays - private static final String ROUTE_OVERLAYS = "routeOverlays"; - private HashMap routeOverlays = new HashMap(5); - private static final boolean ROUTE_OVERLAYS_ENABLED_BY_DEFAULT = true; - private static final int ROUTE_OVERLAYS_RANK = 1; - - private POIDialog favDialog; - - Toast activityToast; - - private SouthamptonUniversityMapActivity instance; - - private static final String TAG = "SUM"; - - @SuppressWarnings("unchecked") - public void onCreate(Bundle savedInstanceState) { - startTime = System.currentTimeMillis(); - - super.onCreate(savedInstanceState); - - instance = this; - - Thread databaseThread = new Thread(this); // Start the database thread - databaseThread.start(); - - setContentView(R.layout.main); - - Log.i(TAG, "Finished setting content view " + (System.currentTimeMillis() - startTime)); - - mapView = (MapView) this.findViewById(R.id.mapview); - mapView.setTileSource(TileSourceFactory.MAPQUESTOSM); - mapView.setBuiltInZoomControls(true); - mapView.setMultiTouchControls(true); - - pastOverlays = (HashMap) getLastNonConfigurationInstance(); - - // SensorManager mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); This code in the following constructor causes problems in - // some emulators, disable sensors to fix. - Log.i(TAG, "Starting creating myLocationOverlay"); - myLocationOverlay = new MyLocationOverlay(instance, mapView); - Log.i(TAG, "Finished creating myLocationOverlay"); - - while (databaseThread.isAlive()) { - Thread.yield(); - } - - new Thread(new Runnable() { - public void run() { - Thread.currentThread().setPriority(Thread.MAX_PRIORITY); - try { - showOverlays(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - }).start(); - - Log.i(TAG, "Started loading thread " + (System.currentTimeMillis() - startTime)); - - mapController = mapView.getController(); - mResourceProxy = new DefaultResourceProxyImpl(getApplicationContext()); - - GeoPoint userLocation = null; - - Bundle extras = getIntent().getExtras(); - if (extras != null && extras.containsKey("poiPoint")) { - String poiPoint = getIntent().getExtras().getString("poiPoint"); - Log.i(TAG, "poiPoint " + poiPoint); - - String[] bits = poiPoint.split(","); - - userLocation = new GeoPoint(Double.valueOf(bits[0]), Double.valueOf(bits[1])); - mapController.setZoom(20); - - } else { - userLocation = myLocationOverlay.getMyLocation(); - if (userLocation == null) { - userLocation = new GeoPoint(50935551, -1393488); // ECS - } - mapController.setZoom(15); - } - - mapController.setCenter(userLocation); - - Log.i(TAG, "Finished onCreate " + (System.currentTimeMillis() - startTime)); - } - - public void onResume() { - super.onResume(); - Log.i(TAG, "OnResume"); - if (myLocationOverlay != null) { - final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); - final SharedPreferences activityPrefs = getPreferences(0); - - if (activityPrefs.getBoolean("Other:Compass", false)) { - myLocationOverlay.enableCompass(); - } else { - myLocationOverlay.disableCompass(); - } - - if (activityPrefs.getBoolean("Other:My Location", false) && sharedPrefs.getBoolean(GPS_ENABLED, false)) { - myLocationOverlay.enableMyLocation(); - } else { - myLocationOverlay.disableMyLocation(); - } - - sharedPrefs.registerOnSharedPreferenceChangeListener(this); - activityPrefs.registerOnSharedPreferenceChangeListener(this); - } - } - - public void onPause() { - super.onResume(); - Log.i(TAG, "OnPause"); - if (myLocationOverlay != null) { - myLocationOverlay.disableMyLocation(); - myLocationOverlay.disableCompass(); - } - } - - public void finish() { - super.finish(); - } - - @Override - public Object onRetainNonConfigurationInstance() { - return overlays; - } - - public void run() { - Log.i(TAG, "Begining loading database " + (System.currentTimeMillis() - startTime)); - - DatabaseHelper helper = getHelper(); - Log.i(TAG, "Got the helper at " + (System.currentTimeMillis() - startTime)); - - boolean dbExist = helper.checkDataBase(); - Log.i(TAG, "Finished checking the database at " + (System.currentTimeMillis() - startTime)); - - if (dbExist) { - // do nothing - database already exist - } else { - - if (useBundledDatabase) { - try { - // By calling this method and empty database will be created into the default system path - // of your application so we are gonna be able to overwrite that database with our database. - Log.i(TAG, "GetReadableDatabase"); - helper.getWritableDatabase().close(); - - helper.copyDataBase(); - Log.i(TAG, "Out of copy database"); - } catch (IOException ioe) { - throw new Error("Unable to create database"); - } - } else { - Thread buildingThread = null; - Thread busStopThread = null; - Thread siteThread = null; - - Log.i(TAG, "Begining loading databases " + (System.currentTimeMillis() - startTime)); - try { - Dao buildingDao; - - buildingDao = helper.getBuildingDao(); - - long buildingCount = buildingDao.countOf(); - Log.i(TAG, "Building count " + buildingCount); - if (buildingCount < 260) { - buildingThread = new Thread(new Runnable() { - public void run() { - try { - DataManager.loadBuildings(instance); - Log.i(TAG, "Loaded building database " + (System.currentTimeMillis() - startTime)); - } catch (SQLException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }); - - buildingThread.start(); - } - - Dao busStopDao = helper.getBusStopDao(); - Dao busRouteDao = helper.getBusRouteDao(); - Dao routeStopsDao = helper.getRouteStopsDao(); - - long busStopCount = busStopDao.countOf(); - long busRouteCount = busRouteDao.countOf(); - long routeStopsCount = routeStopsDao.countOf(); - - Log.i(TAG, "BusStop count " + busStopCount); - Log.i(TAG, "BusRoute count " + busRouteCount); - Log.i(TAG, "RouteStops count " + routeStopsCount); - if (busStopCount < 217 || busRouteCount < 5 || routeStopsCount < 327) { - busStopThread = new Thread(new Runnable() { - public void run() { - try { - DataManager.loadBusData(instance, true); - Log.i(TAG, "Loaded bus stop database " + (System.currentTimeMillis() - startTime)); - } catch (SQLException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }); - - busStopThread.start(); - } - - Dao siteDao = helper.getSiteDao(); - - long siteCount = siteDao.countOf(); - Log.i(TAG, "Sites count " + siteCount); - if (siteCount < 21) { - siteThread = new Thread(new Runnable() { - public void run() { - try { - DataManager.loadSiteData(instance); - Log.i(TAG, "Loaded site database " + (System.currentTimeMillis() - startTime)); - } catch (SQLException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }); - - siteThread.start(); - } - - while (true) { - if ((buildingThread == null || !buildingThread.isAlive()) && (busStopThread == null || !busStopThread.isAlive()) - && (siteThread == null || !siteThread.isAlive())) - break; - - Thread.yield(); - } - - Log.i(TAG, "Finished loading databases " + (System.currentTimeMillis() - startTime)); - - } catch (SQLException e1) { - e1.printStackTrace(); - } - } - - } - - Log.i(TAG, "Begining setting up the static values " + (System.currentTimeMillis() - startTime)); - - Log.i(TAG, "Finished the database thread " + (System.currentTimeMillis() - startTime)); - } - - private void showOverlays() throws SQLException { - Log.i(TAG, "Began showing overlays at " + (System.currentTimeMillis() - startTime)); - - if (pastOverlays != null) { - Log.i(TAG, "Able to recover some/all of the overlays from a previous activity"); - } else { - Log.i(TAG, "Unable to recover overlays"); - } - - final SharedPreferences activityPrefs = getPreferences(0); - - showUtilityOverlays(); - - showUniLinkBusStopOverlays(); - - showNonUniLinkBusStopOverlays(); - - if (activityPrefs.getBoolean("Buildings:Residential", true) || activityPrefs.getBoolean("Buildings:Non-Residential", true)) { - // The argument currently dosent matter for this method. - showBuildingOverlay(); - } - - Log.i(TAG, "Begining to show the route overlays at " + (System.currentTimeMillis() - startTime)); - for (BusRoute busRoute : getHelper().getBusRouteDao()) { - if (!busRoute.uniLink) { - continue; - } - Log.v(TAG, "Looking at showing " + busRoute.code + " route overlay"); - if (activityPrefs.getBoolean("Bus Routes:" + busRoute.code, ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)) { - showRouteOverlay(busRoute); - } - } - Log.i(TAG, "Finished loading routes " + (System.currentTimeMillis() - startTime)); - - Log.i(TAG, "Begining to show the site overlays at " + (System.currentTimeMillis() - startTime)); - try { - for (Site site : getHelper().getSiteDao()) { - Log.v(TAG, "Looking at showing " + site.name + " site overlay"); - if (activityPrefs.getBoolean(SITE_OVERLAYS + site.name, SITE_OVERLAYS_ENABLED_BY_DEFAULT)) { - showSiteOverlay(site); - } - } - } catch (SQLException e) { - e.printStackTrace(); - } - Log.i(TAG, "Finished showing the site overlays " + (System.currentTimeMillis() - startTime)); - - Log.i(TAG, "Finished showing all the overlays " + (System.currentTimeMillis() - startTime)); - } - - private void showUtilityOverlays() { - new Thread(new Runnable() { - public void run() { - Log.i(TAG, "Begining showing the utility overlays " + (System.currentTimeMillis() - startTime)); - - final SharedPreferences activityPrefs = getPreferences(0); - final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); - - if (scaleBarOverlay != null) { - Log.v(TAG, "ScaleBarOverlay is already created"); - } else { - if (pastOverlays != null && (scaleBarOverlay = (ScaleBarOverlay) pastOverlays.get(SCALE_BAR_OVERLAY)) != null) { - Log.i(TAG, "Finished restoring utility overlays " + (System.currentTimeMillis() - startTime)); - } else { - scaleBarOverlay = new ScaleBarOverlay(instance); - } - - overlays.put(SCALE_BAR_OVERLAY, scaleBarOverlay); - - synchronized (mapView.getOverlays()) { - mapView.getOverlays().add(scaleBarOverlay); - mapView.getOverlays().add(myLocationOverlay); - Collections.sort(mapView.getOverlays(), comparator); - } - - } - - scaleBarOverlay.setEnabled(activityPrefs.getBoolean(SCALE_BAR_OVERLAY, SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT)); - - mapView.postInvalidate(); - - Log.i(TAG, "Finished showing utility overlays " + (System.currentTimeMillis() - startTime)); - } - }).start(); - } - - private void showRouteOverlay(final BusRoute route) { - new Thread(new Runnable() { - public void run() { - Log.i(TAG, "Begining showing route " + route.code + " overlay at " + (System.currentTimeMillis() - startTime)); - - final SharedPreferences activityPrefs = getPreferences(0); - final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); - - PathOverlay routeOverlay; - if ((routeOverlay = routeOverlays.get(route)) != null) { - Log.v(TAG, route.code + " route overlay already existed"); - } else { - if (pastOverlays != null && (routeOverlay = (PathOverlay) pastOverlays.get(ROUTE_OVERLAYS + route.code)) != null) { - Log.v(TAG, "Restored " + route.code + " route overlay"); - if (route.code.equals("U1")) { - PathOverlay routeOverlayU1E = (PathOverlay) pastOverlays.get(ROUTE_OVERLAYS + "U1E"); - overlays.put(ROUTE_OVERLAYS + "U1E", routeOverlayU1E); - } - } else { - InputStream resource = null; - int colour = 0; - if (route.code.equals("U1")) { - resource = getResources().openRawResource(R.raw.u1); - colour = U1; - - // TODO Is this a route like U1N or, something else, this hack works somewhat for now? - PathOverlay routeOverlayU1E = DataManager.getRoutePath(getResources().openRawResource(R.raw.u1e), colour, mResourceProxy); - routeOverlayU1E.getPaint().setAntiAlias(true); - routeOverlayU1E.getPaint().setAlpha(145); - routeOverlayU1E.getPaint().setStrokeWidth(12); - routeOverlayU1E.getPaint().setPathEffect(new DashPathEffect(new float[] { 20, 16 }, 0)); - routeOverlayU1E.setEnabled(activityPrefs.getBoolean("Bus Routes:" + route.code, true)); - - routeOverlays.put(new BusRoute(1000, "U1E", "U1E Route Label", true), routeOverlayU1E); - overlays.put(ROUTE_OVERLAYS + route.code + "E", routeOverlayU1E); - } else if (route.code.equals("U1N")) { - resource = getResources().openRawResource(R.raw.u1n); - colour = U1N; - } else if (route.code.equals("U2")) { - resource = getResources().openRawResource(R.raw.u2); - colour = U2; - } else if (route.code.equals("U6")) { - resource = getResources().openRawResource(R.raw.u6); - colour = U6; - } else if (route.code.equals("U9")) { - resource = getResources().openRawResource(R.raw.u9); - colour = U9; - } else { - Log.w(TAG, "Wierd route " + route); - } - - routeOverlay = DataManager.getRoutePath(resource, colour, mResourceProxy); - - Log.v(TAG, "Path overlay has " + routeOverlay.getNumberOfPoints() + " points"); - - routeOverlay.getPaint().setAntiAlias(true); - routeOverlay.getPaint().setAlpha(145); - routeOverlay.getPaint().setStrokeWidth(12); - } - - routeOverlays.put(route, routeOverlay); - overlays.put(ROUTE_OVERLAYS + route.code, routeOverlay); - - synchronized (mapView.getOverlays()) { - mapView.getOverlays().add(routeOverlay); - Collections.sort(mapView.getOverlays(), comparator); - } - - } - - routeOverlay.setEnabled(activityPrefs.getBoolean(ROUTE_OVERLAYS + route.code, ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); - if (route.code.equals("U1")) { - overlays.get(ROUTE_OVERLAYS + "U1E").setEnabled(activityPrefs.getBoolean(ROUTE_OVERLAYS + "U1", ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); - } - - mapView.postInvalidate(); - - Log.i(TAG, "Finished showing route " + route.code + " overlay at " + (System.currentTimeMillis() - startTime)); - } - }).start(); - } - - private void showSiteOverlay(final Site site) { - - new Thread(new Runnable() { - public void run() { - Log.i(TAG, "Begining showing site " + site.name + " overlay at " + (System.currentTimeMillis() - startTime)); - - final SharedPreferences activityPrefs = getPreferences(0); - final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); - - PathOverlay siteOverlay; - if ((siteOverlay = siteOverlays.get(site)) != null) { - - } else { - if (pastOverlays != null && (siteOverlay = (PathOverlay) pastOverlays.get(SITE_OVERLAYS + site.name)) != null) { - Log.i(TAG, "Restored " + site.name + " site overlay"); - } else { - - siteOverlay = new PathOverlay(Color.BLUE, instance); - Paint paint = siteOverlay.getPaint(); - paint.setAntiAlias(true); - paint.setStrokeWidth(1.5f); - for (int i = 0; i < site.outline.points.length; i++) { - siteOverlay.addPoint(site.outline.points[i]); - } - siteOverlay.addPoint(site.outline.points[0]); - - } - - siteOverlays.put(site, siteOverlay); - overlays.put(SITE_OVERLAYS + site.name, siteOverlay); - - Log.v(TAG, "Applyed the site overlay, now sorting them"); - - synchronized (mapView.getOverlays()) { - mapView.getOverlays().add(siteOverlay); - Collections.sort(mapView.getOverlays(), comparator); - } - } - - siteOverlay.setEnabled(activityPrefs.getBoolean(SITE_OVERLAYS + site.name, SITE_OVERLAYS_ENABLED_BY_DEFAULT)); - - mapView.postInvalidate(); - - Log.i(TAG, "Finished showing site " + site.name + " overlay at " + (System.currentTimeMillis() - startTime)); - } - }).start(); - } - - private void showBuildingOverlay() { - new Thread(new Runnable() { - public void run() { - Log.i(TAG, "Begining showing building overlays at " + (System.currentTimeMillis() - startTime)); - - final SharedPreferences activityPrefs = getPreferences(0); - final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); - - if (residentialBuildingOverlay != null) { - - } else { - if (pastOverlays != null && (residentialBuildingOverlay = (BuildingNumOverlay) pastOverlays.get(RESIDENTIAL_BUILDING_OVERLAY)) != null) { - nonResidentialBuildingOverlay = (BuildingNumOverlay) pastOverlays.get(NON_RESIDENTIAL_BUILDING_OVERLAY); - - Log.i(TAG, "Restored building overlays"); - } else { - try { - - Log.v(TAG, "Begining the creation of the building overlays"); - - ArrayList residentialBuildings = new ArrayList(); - ArrayList nonResidentialBuildings = new ArrayList(); - - Dao buildingDao; - - buildingDao = getHelper().getBuildingDao(); - - for (Building building : buildingDao) { - if (building.residential == true) { - if (building.favourite) { - residentialBuildings.add(building); - } else { - residentialBuildings.add(0, building); - } - } else { - if (building.favourite) { - nonResidentialBuildings.add(building); - } else { - nonResidentialBuildings.add(0, building); - } - } - } - - residentialBuildingOverlay = new BuildingNumOverlay(instance, residentialBuildings); - nonResidentialBuildingOverlay = new BuildingNumOverlay(instance, nonResidentialBuildings); - - Log.v(TAG, "Applyed the site overlay, now sorting them"); - - } catch (SQLException e) { - e.printStackTrace(); - } - } - - overlays.put(RESIDENTIAL_BUILDING_OVERLAY, residentialBuildingOverlay); - overlays.put(NON_RESIDENTIAL_BUILDING_OVERLAY, nonResidentialBuildingOverlay); - - synchronized (mapView.getOverlays()) { - mapView.getOverlays().add(residentialBuildingOverlay); - mapView.getOverlays().add(nonResidentialBuildingOverlay); - Collections.sort(mapView.getOverlays(), comparator); - } - } - - residentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); - nonResidentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, - NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); - - mapView.postInvalidate(); - - Log.i(TAG, "Finished showing building overlays at " + (System.currentTimeMillis() - startTime)); - } - }).start(); - } - - private void showUniLinkBusStopOverlays() { - new Thread(new Runnable() { - public void run() { - Log.i(TAG, "Begining showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); - - final SharedPreferences activityPrefs = getPreferences(0); - final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); - - if (uniLinkBusStopOverlay != null) { - - } else { - if (pastOverlays != null && (uniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(UNI_LINK_BUS_STOP_OVERLAY)) != null) { - Log.i(TAG, "Restored bus stop overlays"); - } else { - try { - List busStops; - Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); - if (activityPrefs.getBoolean(UNI_LINK_BUS_STOP_OVERLAY, UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { - busStops = getHelper().getBusStopDao().queryForAll(); - } else { - busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); - } - Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); - - uniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); - } catch (SQLException e) { - e.printStackTrace(); - } - } - - overlays.put(UNI_LINK_BUS_STOP_OVERLAY, uniLinkBusStopOverlay); - - Log.v(TAG, "Applyed the site overlay, now sorting them"); - - synchronized (mapView.getOverlays()) { - mapView.getOverlays().add(uniLinkBusStopOverlay); - Collections.sort(mapView.getOverlays(), comparator); - } - } - - uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean("0,0", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean("0,1", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean("0,2", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(3, activityPrefs.getBoolean("0,3", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(4, activityPrefs.getBoolean("0,4", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - - mapView.postInvalidate(); - - Log.i(TAG, "Finished showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); - } - }).start(); - } - - private void showNonUniLinkBusStopOverlays() { - new Thread(new Runnable() { - public void run() { - Log.i(TAG, "Begining showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); - - final SharedPreferences activityPrefs = getPreferences(0); - final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); - - if (nonUniLinkBusStopOverlay == null && activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { - if (pastOverlays != null && (nonUniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(NON_UNI_LINK_BUS_STOPS)) != null) { - Log.i(TAG, "Restored non Uni-Link bus stop overlays"); - } else { - try { - List busStops; - Log.v(TAG, "Begin fetching non Uni-Link BusStops at " + (System.currentTimeMillis() - startTime)); - - busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, false); - - Log.v(TAG, "Finished fetching non Uni-Link BusStops at " + (System.currentTimeMillis() - startTime)); - - nonUniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); - } catch (SQLException e) { - e.printStackTrace(); - } - } - - overlays.put(NON_UNI_LINK_BUS_STOPS, nonUniLinkBusStopOverlay); - - Log.v(TAG, "Applyed the site overlay, now sorting them"); - - synchronized (mapView.getOverlays()) { - mapView.getOverlays().add(nonUniLinkBusStopOverlay); - Collections.sort(mapView.getOverlays(), comparator); - } - } - - mapView.postInvalidate(); - - Log.i(TAG, "Finished showing non Uni-Link bus stop overlays at " + (System.currentTimeMillis() - startTime)); - } - }).start(); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.map_menu, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Handle item selection - switch (item.getItemId()) { - case R.id.menu_find: - Intent i = new Intent(SouthamptonUniversityMapActivity.this, FindActivity.class); - startActivityForResult(i, 0); - return true; - case R.id.menu_preferences: - Intent settingsActivity = new Intent(getBaseContext(), PreferencesActivity.class); - startActivity(settingsActivity); - return true; - case R.id.menu_find_my_location: - final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); - if (sharedPrefs.getBoolean("GPSEnabled", false)) { - GeoPoint userLocation = myLocationOverlay.getMyLocation(); - if (userLocation != null) { - Log.i(TAG, "Found user location, scrolling to " + userLocation); - mapController.animateTo(userLocation); - myLocationOverlay.enableFollowLocation(); - } - } else { - DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - switch (which) { - case DialogInterface.BUTTON_POSITIVE: - Editor editor = sharedPrefs.edit(); - editor.putBoolean("GPSEnabled", true); - editor.commit(); - break; - - case DialogInterface.BUTTON_NEGATIVE: - // No button clicked - break; - } - } - }; - - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setMessage("GPS is not enabled, do you wish to enable it?").setPositiveButton("Yes", dialogClickListener) - .setNegativeButton("No", dialogClickListener).show(); - } - - return true; - case R.id.menu_view: - Log.i(TAG, "Showing view dialog"); - showDialog(VIEW_DIALOG_ID); - return false; - case R.id.menu_favourites: - Log.i(TAG, "Showing favourite dialog"); - - showDialog(FAVOURITE_DIALOG_ID); - if (favDialog == null) { - Log.e(TAG, "Very wierd, just tried to launch the favourite's dialog, but its null?"); - return false; - } - - refreshFavouriteDialog(); - - return false; - case R.id.menu_about: - Intent aboutIntent = new Intent(SouthamptonUniversityMapActivity.this, AboutActivity.class); - startActivityForResult(aboutIntent, 0); - return true; - default: - Log.e(TAG, "No known menu option selected"); - return super.onOptionsItemSelected(item); - } - } - - private void refreshFavouriteDialog() { - ArrayList newFavouriteItems = new ArrayList(); - - try { - Dao buildingDao = getHelper().getBuildingDao(); - Dao busStopDao = getHelper().getBusStopDao(); - - newFavouriteItems.addAll(buildingDao.queryForEq(POI.FAVOURITE_FIELD_NAME, true)); - newFavouriteItems.addAll(busStopDao.queryForEq(POI.FAVOURITE_FIELD_NAME, true)); - } catch (SQLException e) { - e.printStackTrace(); - } - - Log.i(TAG, "There are " + newFavouriteItems.size() + " favourites"); - if (newFavouriteItems.size() == 0) { - Log.i(TAG, "Favourite dialog has no favourites, displaying message"); - favDialog.setMessage(getResources().getString(R.string.favourites_dialog_message)); - favDialog.setItems(null); - } else { - favDialog.setMessage(""); - favDialog.setItems(newFavouriteItems); - } - } - - @Override - public boolean onSearchRequested() { - Intent i = new Intent(SouthamptonUniversityMapActivity.this, FindActivity.class); - startActivityForResult(i, 0); - return false; - } - - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - Log.i(TAG, "Got activity result"); - if (resultCode == RESULT_OK) { - - POI poi = null; - Bundle bundle = data.getExtras(); - if (bundle == null) { - Log.i(TAG, "Bundle is null"); - } else { - String poiId = (String) bundle.get("poi"); - if (poiId != null) { - Log.i(TAG, "Got id " + poiId); - try { - poi = getHelper().getBuildingDao().queryForId(poiId); - if (poi == null) { - poi = getHelper().getBusStopDao().queryForId(poiId); - } - } catch (SQLException e) { - e.printStackTrace(); - } - - if (poi == null) { - Log.e(TAG, "Could not find poi " + poiId + " in onActivityResult"); - } else { - if (myLocationOverlay != null) { - // It could be null if it has not been enabled - myLocationOverlay.disableFollowLocation(); - } - mapController.setZoom(20); - mapController.setCenter(poi.point); - - } - } else { - Log.i(TAG, "Got null poi id"); - - // mapController.setZoom(15); - // mapController.setCenter(new GeoPoint(50935551, -1393488)); - } - - // This handles the possible change in favourite state caused by the user within the BusTimeActivity - try { - String busStopID = bundle.getString("busStopChanged"); - if (busStopID != null && busStopID.length() != 0) { - Log.v(TAG, "Got a busStop id back from the BusTimeActivity " + busStopID); - BusStop busStop = getHelper().getBusStopDao().queryForId(busStopID); - - uniLinkBusStopOverlay.refresh(busStop); // This does not invalidate the map, but it seems to make the changes appear - } - } catch (SQLException e) { - e.printStackTrace(); - } - - if (favDialog != null) { - refreshFavouriteDialog(); - } - } - } - - } - - /* - * public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { - * - * mapView.post(new Runnable() { public void run() { // updateEnabledOverlays(); TODO Fix whatever this did? mapView.invalidate(); } }); - * - * return true; } - */ - - protected Dialog onCreateDialog(int id) { - switch (id) { - case VIEW_DIALOG_ID: - ViewDialog viewDialog = new ViewDialog(instance); - return viewDialog; - case FAVOURITE_DIALOG_ID: - favDialog = new POIDialog(instance); - favDialog.setOnItemClickListener(this); - favDialog.setOnItemLongClickListener(this); - favDialog.setTitle(R.string.favourites_dialog_title); - return favDialog; - } - return null; - } - - public void onItemClick(AdapterView parent, View view, int position, long id) { - Log.i(TAG, "OnItemClick pos " + position + " id " + id); - - String poiId = favDialog.adapter.getItemStringId(position); - - Log.i(TAG, "POI " + poiId + " selected"); - - POI poi = null; - - if (poiId != null) { - Log.i(TAG, "Got id " + poiId); - try { - poi = getHelper().getBuildingDao().queryForId(poiId); - if (poi == null) { - poi = getHelper().getBusStopDao().queryForId(poiId); - } - } catch (SQLException e) { - e.printStackTrace(); - } - - if (poi == null) { - Log.e(TAG, "Could not find poi " + poiId + " in onActivityResult"); - } else { - if (myLocationOverlay != null) { - myLocationOverlay.disableFollowLocation(); - } - mapController.setZoom(20); - mapController.setCenter(poi.point); - - favDialog.dismiss(); - - } - } else { - Log.i(TAG, "Got null poi id"); - - // mapController.setZoom(15); - // mapController.setCenter(new GeoPoint(50935551, -1393488)); - } - - } - - /** - * Long click on a item in the favourites menu - */ - public boolean onItemLongClick(AdapterView parent, View view, int position, long id) { - - Log.i(TAG, "OnItemClick pos " + position + " id " + id); - - String poiId = favDialog.adapter.getItemStringId(position); - - Log.i(TAG, "POI " + poiId + " selected"); - - POI poi = null; - - if (poiId != null) { - Log.i(TAG, "Got id " + poiId); - try { - poi = getHelper().getBuildingDao().queryForId(poiId); - if (poi == null) { - poi = getHelper().getBusStopDao().queryForId(poiId); - } - } catch (SQLException e) { - e.printStackTrace(); - } - - if (poi == null) { - Log.e(TAG, "Could not find poi " + poiId + " in onActivityResult"); - } else { - if (poi.type == POI.BUS_STOP) { - BusStop busStop = (BusStop) poi; - - Log.i(TAG, "Pressed " + busStop.id); - - Intent i = new Intent(this, BusStopActivity.class); - i.putExtra("busStopID", busStop.id); - i.putExtra("busStopName", busStop.description); - startActivityForResult(i, 0); - - return true; - - } else { - - myLocationOverlay.disableFollowLocation(); - mapController.setZoom(20); - mapController.setCenter(poi.point); - - favDialog.dismiss(); - favDialog = null; - } - } - } else { - Log.i(TAG, "Got null poi id"); - - // mapController.setZoom(15); - // mapController.setCenter(new GeoPoint(50935551, -1393488)); - } - - return true; - } - - private class OverlayRankComparator implements Comparator { - // private final SharedPreferences prefs; - - OverlayRankComparator(SharedPreferences prefs) { - // this.prefs = prefs; - } - - public int compare(Overlay arg0, Overlay arg1) { - return getRank(arg1) - getRank(arg0); - } - - private final int getRank(Overlay overlay) { // TODO: Dont hardcode the rank values - if (overlay == scaleBarOverlay) { - return SCALE_BAR_OVERLAY_RANK; - } else if (overlay == myLocationOverlay) { - return MY_LOCATION_OVERLAY_RANK; - } else if (overlay == uniLinkBusStopOverlay) { - return UNI_LINK_BUS_STOP_OVERLAY_RANK; - } else if (overlay == nonUniLinkBusStopOverlay) { - return NON_UNI_LINK_BUS_STOP_OVERLAY_RANK; - } else if (overlay == residentialBuildingOverlay) { - return RESIDENTIAL_BUILDING_OVERLAY_RANK; - } else if (overlay == nonResidentialBuildingOverlay) { - return NON_RESIDENTIAL_BUILDING_OVERLAY_RANK; - } else if (siteOverlays != null && siteOverlays.values().contains(overlay)) { - return SITE_OVERLAYS_RANK; - } else if (routeOverlays != null && routeOverlays.values().contains(overlay)) { - return ROUTE_OVERLAYS_RANK; - } else { - Log.e(TAG, "Trying to rank unknown overlay " + overlay); - return -1; - } - } - } - - /** - * Handles all changes in preferences - */ - public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { - Log.v(TAG, "Got shared prefs changed event for key " + key); - - // Shared Preferences - if (key.equals(GPS_ENABLED)) { - final SharedPreferences activityPrefs = getPreferences(0); - - if (activityPrefs.getBoolean("Other:Compass", false) && prefs.getBoolean("GPSEnabled", false)) { - myLocationOverlay.enableMyLocation(); - } else { - myLocationOverlay.disableMyLocation(); - } - } else if (key.equals(NON_UNI_LINK_BUS_TIMES)) { - // Noting to do here atm - } else if (key.equals(UNI_LINK_BUS_TIMES)) { - // Noting to do here atm - } else if (key.equals(UNI_LINK_BUS_STOP_OVERLAY)) { - - } else if (key.equals(UNI_LINK_BUS_STOP_OVERLAY)) { // Activity Preferences - showUniLinkBusStopOverlays(); - } else if (key.equals(NON_UNI_LINK_BUS_STOP_OVERLAY)) { // Activity Preferences - showNonUniLinkBusStopOverlays(); - } else if (key.contains(ROUTE_OVERLAYS)) { - try { - String routeName = key.substring(ROUTE_OVERLAYS.length(), key.length()); - for (BusRoute route : getHelper().getBusRouteDao()) { - Log.v(TAG, route.code + " " + routeName); - if (route.code.equals(routeName)) { - showRouteOverlay(route); - } - } - } catch (SQLException e) { - e.printStackTrace(); - } - } else if (key.equals(RESIDENTIAL_BUILDING_OVERLAY) || key.equals(NON_RESIDENTIAL_BUILDING_OVERLAY)) { - showBuildingOverlay(); - } else if (key.contains(SITE_OVERLAYS)) { - String siteName = key.substring(SITE_OVERLAYS.length(), key.length()); - try { - for (Site site : getHelper().getSiteDao()) { - if (site.name.equals(siteName)) { - showSiteOverlay(site); - } - } - } catch (SQLException e) { - e.printStackTrace(); - } - } else if (key.contains("Other")) { - if (key.contains("Scale Bar")) { - showUtilityOverlays(); - } else if (key.contains("Compass")) { - if (prefs.getBoolean("Other:Compass", false)) { - myLocationOverlay.enableCompass(); - } else { - myLocationOverlay.disableCompass(); - } - } else if (key.contains("Other:My Location")) { - final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); - - if (prefs.getBoolean("Other:Compass", false) && sharedPrefs.getBoolean("GPSEnabled", false)) { - myLocationOverlay.enableMyLocation(); - } else { - myLocationOverlay.disableMyLocation(); - } - } else { - Log.e(TAG, "Unhandled preference key " + key); - } - } else { - Log.e(TAG, "Unhandled preference key " + key); - } - } - - class ViewDialog extends Dialog implements OnChildClickListener { - - private final ExpandableListView epView; - - private static final String TAG = "ViewDialog"; - - private final MyExpandableListAdapter mAdapter; - - private OnChildClickListener listener; - - private String[] busRoutes; - private String[] buildingTypes; - private String[] other; - private String[] groupHeadings; - private String[] siteNames; - - public ViewDialog(Context context) { - super(context); - - setContentView(R.layout.view_dialog); - setTitle("Select the map elements to display"); - - WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); - lp.copyFrom(this.getWindow().getAttributes()); - lp.width = WindowManager.LayoutParams.FILL_PARENT; - lp.height = WindowManager.LayoutParams.FILL_PARENT; - - this.getWindow().setAttributes(lp); - - epView = (ExpandableListView) findViewById(R.id.view_list); - mAdapter = new MyExpandableListAdapter(context); - epView.setAdapter(mAdapter); - epView.setOnChildClickListener(this); - - int size; - try { - size = (int) getHelper().getSiteDao().countOf(); - - ArrayList sites = new ArrayList(size); - - try { - sites.addAll(getHelper().getSiteDao().queryForAll()); - } catch (SQLException e) { - e.printStackTrace(); - } - siteNames = new String[size]; - for (int i = 0; i < size; i++) { - siteNames[i] = sites.get(i).name; - } - } catch (SQLException e1) { - e1.printStackTrace(); - } - - busRoutes = getResources().getStringArray(R.array.uniLinkBusRoutes); - buildingTypes = getResources().getStringArray(R.array.buildingTypes); - other = getResources().getStringArray(R.array.utilityOverlays); - groupHeadings = getResources().getStringArray(R.array.preferencesHeadings); - - } - - public void setOnItemClickListener(OnChildClickListener onChildClickListener) { - Log.i(TAG, "Listener set for dialog"); - listener = onChildClickListener; - } - - class MyExpandableListAdapter extends BaseExpandableListAdapter { - - private LayoutInflater inflater; - - private static final String TAG = "MyExpandableListAdapter"; - - // Bus Stops (0) - // |_ U1 (0:0) - // |_ U1N (0:1) - // |_ U2 (0:2) - // |_ U6 (0:3) - // |_ U9 (0:4) - // Bus Routes (1) - // |_ U1 (1:0) - // |_ U1N (1:1) - // |_ U2 (1:2) - // |_ U6 (1:3) - // |_ U9 (1:4) - // Buildings (2) - // |_ Residential (2:0) - // |_ Non-Residential (2:1) - // Site Outlines (3) - // |_ Highfield Campus (3:0) - // |_ Boldrewood Campus (3:1) - // |_ Avenue Campus (3:2) - // |_ Winchester School of Art (3:3) - // |_ The University of Southampton Science Park (3:4) - // |_ National Oceanography Centre Campus (3:5) - // |_ Boat House (3:6) - // |_ Southampton General Hospital (3:0) - // |_ Royal South Hants Hospital (3:0) - // |_ Belgrave Industrial Site (3:0) - // |_ Highfield Hall (3:0) - // |_ Glen Eyre Hall (3:0) - // |_ South Hill Hall (3:0) - // |_ Chamberlain Hall (3:0) - // |_ Hartley Grove1 (3:0) - // |_ Bencraft Hall (3:0) - // |_ Connaught Hall (3:0) - // |_ Montefiore Hall (3:0) - // |_ Stoneham Hall (3:0) - // |_ Erasmus Park (3:0) - // Other (4) - // |_ Scale Bar (4:0) - // |_ Compass (4:1) - // |_ My Location (4:2) - - MyExpandableListAdapter(Context context) { - inflater = LayoutInflater.from(context); - } - - public Object getChild(int groupPosition, int childPosition) { - if (groupPosition == 0 || groupPosition == 1) { - return busRoutes[childPosition]; - } else if (groupPosition == 2) { - return buildingTypes[childPosition]; - } else if (groupPosition == 3) { - return siteNames[childPosition]; - } else if (groupPosition == 4) { - return other[childPosition]; - } else { - Log.e(TAG, "Unrecognised groupPosition " + groupPosition); - return null; - } - } - - public long getChildId(int groupPosition, int childPosition) { - return groupPosition * 50 + childPosition; - } - - public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { - View v = null; - if (convertView != null) - v = convertView; - else - v = inflater.inflate(R.layout.view_child_row, parent, false); - String c = (String) getChild(groupPosition, childPosition); - TextView childName = (TextView) v.findViewById(R.id.childname); - if (childName != null) - childName.setText(c); - CheckBox cb = (CheckBox) v.findViewById(R.id.check1); - cb.setClickable(false); - cb.setFocusable(false); - SharedPreferences activityPrefs = getPreferences(0); - - String str = groupPosition + ":" + childPosition; - - if (groupPosition == 0) { - cb.setChecked(activityPrefs.getBoolean(str, UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - } else if (groupPosition == 1) { - cb.setChecked(activityPrefs.getBoolean(str, ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); - } else if (groupPosition == 2) { - if (childPosition == 0) { - cb.setChecked(activityPrefs.getBoolean(str, RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); - } else { - cb.setChecked(activityPrefs.getBoolean(str, NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); - } - } else if (groupPosition == 3) { - cb.setChecked(activityPrefs.getBoolean(str, SITE_OVERLAYS_ENABLED_BY_DEFAULT)); - } else if (groupPosition == 4) { - cb.setChecked(activityPrefs.getBoolean(str, SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT)); - } - return v; - } - - public int getChildrenCount(int groupPosition) { - if (groupPosition == 0 || groupPosition == 1) { - return busRoutes.length; - } else if (groupPosition == 2) { - return buildingTypes.length; - } else if (groupPosition == 3) { - return siteNames.length; - } else if (groupPosition == 4) { - return other.length; - } - return 0; - } - - public Object getGroup(int groupPosition) { - return groupHeadings[groupPosition]; - } - - public int getGroupCount() { - return groupHeadings.length; - } - - public long getGroupId(int groupPosition) { - return groupPosition * 5; - } - - public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { - View v = null; - if (convertView != null) - v = convertView; - else - v = inflater.inflate(R.layout.view_group_row, parent, false); - String gt = (String) getGroup(groupPosition); - TextView colorGroup = (TextView) v.findViewById(R.id.childname); - if (gt != null) - colorGroup.setText(gt); - return v; - } - - public boolean hasStableIds() { - return true; - } - - public boolean isChildSelectable(int groupPosition, int childPosition) { - return true; - } - - } - - public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { - Log.i(TAG, "Got view dialog click at " + groupPosition + ":" + childPosition); - - SharedPreferences activityPrefs = getPreferences(0); - - Editor editor = activityPrefs.edit(); - - CheckBox cb = (CheckBox) v.findViewById(R.id.check1); - - String str = groupPosition + ":" + childPosition; - - editor.putBoolean(str, !cb.isChecked()); - - editor.commit(); - - mAdapter.notifyDataSetInvalidated(); - - listener.onChildClick(parent, v, groupPosition, childPosition, id); - - return true; - } - - } -} diff --git a/src/net/cbaines/suma/ViewDialog.java b/src/net/cbaines/suma/ViewDialog.java new file mode 100644 index 0000000..a8e36ed --- /dev/null +++ b/src/net/cbaines/suma/ViewDialog.java @@ -0,0 +1,295 @@ +/* + * Southampton University Map App + * Copyright (C) 2011 Christopher Baines + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package net.cbaines.suma; + +import java.sql.SQLException; +import java.util.ArrayList; + +import android.app.Dialog; +import android.content.Context; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.BaseExpandableListAdapter; +import android.widget.CheckBox; +import android.widget.ExpandableListView; +import android.widget.ExpandableListView.OnChildClickListener; +import android.widget.TextView; + +import com.j256.ormlite.android.apptools.OpenHelperManager; + +class ViewDialog extends Dialog implements OnChildClickListener { + + private final ExpandableListView epView; + + private static final String TAG = "ViewDialog"; + + private final MyExpandableListAdapter mAdapter; + + private OnChildClickListener listener; + + private DatabaseHelper helper; + + private String[] busRoutes; + private String[] buildingTypes; + private String[] other; + private String[] groupHeadings; + private String[] siteNames; + + protected MapActivity context; + + public ViewDialog(MapActivity context) { + super(context); + + this.context = context; + + helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + + int size; + try { + size = (int) helper.getSiteDao().countOf(); + + ArrayList sites = new ArrayList(size); + + try { + sites.addAll(helper.getSiteDao().queryForAll()); + } catch (SQLException e) { + e.printStackTrace(); + } + siteNames = new String[size]; + for (int i = 0; i < size; i++) { + siteNames[i] = sites.get(i).name; + } + } catch (SQLException e1) { + e1.printStackTrace(); + } + + busRoutes = context.getResources().getStringArray(R.array.uniLinkBusRoutes); + buildingTypes = context.getResources().getStringArray(R.array.buildingTypes); + other = context.getResources().getStringArray(R.array.utilityOverlays); + groupHeadings = context.getResources().getStringArray(R.array.preferencesHeadings); + + setContentView(R.layout.view_dialog); + setTitle("Select the map elements to display"); + + WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); + lp.copyFrom(this.getWindow().getAttributes()); + lp.width = WindowManager.LayoutParams.FILL_PARENT; + lp.height = WindowManager.LayoutParams.FILL_PARENT; + + this.getWindow().setAttributes(lp); + + epView = (ExpandableListView) findViewById(R.id.view_list); + mAdapter = new MyExpandableListAdapter(context); + epView.setAdapter(mAdapter); + epView.setOnChildClickListener(this); + + } + + public void setOnItemClickListener(OnChildClickListener onChildClickListener) { + Log.i(TAG, "Listener set for dialog"); + listener = onChildClickListener; + } + + class MyExpandableListAdapter extends BaseExpandableListAdapter implements Preferences { + + private LayoutInflater inflater; + + private static final String TAG = "MyExpandableListAdapter"; + + // Bus Stops (0) + // |_ U1 (0:0) + // |_ U1N (0:1) + // |_ U2 (0:2) + // |_ U6 (0:3) + // |_ U9 (0:4) + // Bus Routes (1) + // |_ U1 (1:0) + // |_ U1N (1:1) + // |_ U2 (1:2) + // |_ U6 (1:3) + // |_ U9 (1:4) + // Buildings (2) + // |_ Residential (2:0) + // |_ Non-Residential (2:1) + // Site Outlines (3) + // |_ Highfield Campus (3:0) + // |_ Boldrewood Campus (3:1) + // |_ Avenue Campus (3:2) + // |_ Winchester School of Art (3:3) + // |_ The University of Southampton Science Park (3:4) + // |_ National Oceanography Centre Campus (3:5) + // |_ Boat House (3:6) + // |_ Southampton General Hospital (3:0) + // |_ Royal South Hants Hospital (3:0) + // |_ Belgrave Industrial Site (3:0) + // |_ Highfield Hall (3:0) + // |_ Glen Eyre Hall (3:0) + // |_ South Hill Hall (3:0) + // |_ Chamberlain Hall (3:0) + // |_ Hartley Grove1 (3:0) + // |_ Bencraft Hall (3:0) + // |_ Connaught Hall (3:0) + // |_ Montefiore Hall (3:0) + // |_ Stoneham Hall (3:0) + // |_ Erasmus Park (3:0) + // Other (4) + // |_ Scale Bar (4:0) + // |_ Compass (4:1) + // |_ My Location (4:2) + + MyExpandableListAdapter(Context context) { + inflater = LayoutInflater.from(context); + } + + public Object getChild(int groupPosition, int childPosition) { + if (groupPosition == 0 || groupPosition == 1) { + return busRoutes[childPosition]; + } else if (groupPosition == 2) { + return buildingTypes[childPosition]; + } else if (groupPosition == 3) { + return siteNames[childPosition]; + } else if (groupPosition == 4) { + return other[childPosition]; + } else { + Log.e(TAG, "Unrecognised groupPosition " + groupPosition); + return null; + } + } + + public long getChildId(int groupPosition, int childPosition) { + return groupPosition * 50 + childPosition; + } + + public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { + View v = null; + if (convertView != null) + v = convertView; + else + v = inflater.inflate(R.layout.view_child_row, parent, false); + String c = (String) getChild(groupPosition, childPosition); + TextView childName = (TextView) v.findViewById(R.id.childname); + if (childName != null) + childName.setText(c); + CheckBox cb = (CheckBox) v.findViewById(R.id.check1); + cb.setClickable(false); + cb.setFocusable(false); + if (context == null) { + Log.e(TAG, "context == null"); + } + SharedPreferences activityPrefs = context.getPreferences(0); + + String str = groupPosition + ":" + childPosition; + + if (groupPosition == 0) { + cb.setChecked(activityPrefs.getBoolean(str, MapActivity.UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + } else if (groupPosition == 1) { + cb.setChecked(activityPrefs.getBoolean(str, MapActivity.ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); + } else if (groupPosition == 2) { + if (childPosition == 0) { + cb.setChecked(activityPrefs.getBoolean(str, MapActivity.RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + } else { + cb.setChecked(activityPrefs.getBoolean(str, MapActivity.NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + } + } else if (groupPosition == 3) { + cb.setChecked(activityPrefs.getBoolean(str, MapActivity.SITE_OVERLAYS_ENABLED_BY_DEFAULT)); + } else if (groupPosition == 4) { + cb.setChecked(activityPrefs.getBoolean(str, MapActivity.SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT)); + } + return v; + } + + public int getChildrenCount(int groupPosition) { + if (groupPosition == 0 || groupPosition == 1) { + return busRoutes.length; + } else if (groupPosition == 2) { + return buildingTypes.length; + } else if (groupPosition == 3) { + return siteNames.length; + } else if (groupPosition == 4) { + return other.length; + } + return 0; + } + + public Object getGroup(int groupPosition) { + return groupHeadings[groupPosition]; + } + + public int getGroupCount() { + return groupHeadings.length; + } + + public long getGroupId(int groupPosition) { + return groupPosition * 5; + } + + public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { + View v = null; + if (convertView != null) + v = convertView; + else + v = inflater.inflate(R.layout.view_group_row, parent, false); + String gt = (String) getGroup(groupPosition); + TextView colorGroup = (TextView) v.findViewById(R.id.childname); + if (gt != null) + colorGroup.setText(gt); + return v; + } + + public boolean hasStableIds() { + return true; + } + + public boolean isChildSelectable(int groupPosition, int childPosition) { + return true; + } + + } + + public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { + Log.i(TAG, "Got view dialog click at " + groupPosition + ":" + childPosition); + + SharedPreferences activityPrefs = context.getPreferences(0); + + Editor editor = activityPrefs.edit(); + + CheckBox cb = (CheckBox) v.findViewById(R.id.check1); + + String str = groupPosition + ":" + childPosition; + + editor.putBoolean(str, !cb.isChecked()); + + editor.commit(); + + mAdapter.notifyDataSetInvalidated(); + + if (listener != null) { + listener.onChildClick(parent, v, groupPosition, childPosition, id); + } + + return true; + } + +} \ No newline at end of file -- cgit v1.2.3 From 190cb3c6a16d6c65764f18afd5f5f19f1a912aac Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 17 Feb 2012 20:50:17 +0000 Subject: Fixed a bug with dest stop detection, and added a safeguard on the bus activity. --- src/net/cbaines/suma/BuildingNumOverlay.java | 4 ++-- src/net/cbaines/suma/BusActivity.java | 11 +++++++++++ src/net/cbaines/suma/BusRoute.java | 25 +++++++++++++++++++------ src/net/cbaines/suma/BusStopOverlay.java | 4 ++-- src/net/cbaines/suma/DataManager.java | 14 +++++++++++--- 5 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/net/cbaines/suma/BuildingNumOverlay.java b/src/net/cbaines/suma/BuildingNumOverlay.java index 47bee3c..9825616 100644 --- a/src/net/cbaines/suma/BuildingNumOverlay.java +++ b/src/net/cbaines/suma/BuildingNumOverlay.java @@ -181,7 +181,7 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onSingleTapUp(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction()); + Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); if (event.getPointerCount() != 1) { Log.v(TAG, "Pointer count for onSingleTapUp not 1, ignoring"); return false; @@ -218,7 +218,7 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction()); + Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); if (event.getPointerCount() != 1) { Log.v(TAG, "Pointer count for onLongPress not 1, ignoring"); return false; diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index 4b59117..f68c051 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -157,6 +157,12 @@ public class BusActivity extends OrmLiteBaseActivity implements busStopsActive = new ArrayList(); busStopsActive.add(false); + if (bus.destination != null) { + Log.i(TAG, "Bus destination is " + bus.destination); + } else { + Log.i(TAG, "Bus destination is null"); + } + for (int i = 0;; i++) { BusStop nextStop = bus.route.moveInRoute(instance, busStops.get(i), bus.direction, 1); @@ -166,6 +172,11 @@ public class BusActivity extends OrmLiteBaseActivity implements busStops.add(nextStop); busStopsActive.add(false); + + if (busStops.size() > 50) { + Log.e(TAG, "Got more than 50 bus stops"); + break; + } } refreshData = new Runnable() { diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index e1bf65b..cdb0e4d 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -62,9 +62,25 @@ public class BusRoute { @DatabaseField(canBeNull = false) String label; + /** + * The direction the bus is travelling if it is moving through the route and sequence is increasing. + *
    + *
  • U1 = A
  • + *
  • U2 = B
  • + *
  • U6 = H
  • + *
+ */ @DatabaseField(canBeNull = true) String forwardDirection; + /** + * The direction the bus is travelling if it is moving through the route and sequence is decreasing. + *
    + *
  • U1 = C
  • + *
  • U2 = C
  • + *
  • U6 = C
  • + *
+ */ @DatabaseField(canBeNull = true) String reverseDirection; @@ -304,14 +320,13 @@ public class BusRoute { Log.e(TAG, "Error, unknown bus stop " + busStop.id + " (" + busStop.description + ") that appears mutiple times in " + toString()); throw new RuntimeException("Error, unknown bus stop " + busStop.id + " that appears mutiple times in " + toString()); } + Log.v(TAG, "Selecting " + stopIndex + " for " + busStop.id + " as direction == " + direction); } } } if (moveAmount > 0) { - Log.v(TAG, - "Moving forward in direction " + direction + " " + moveAmount + " stops from " + busStop + " (" + stopIndex + "/" - + routeStopsFound.size() + ")"); + Log.v(TAG, "Moving forward " + moveAmount + " stops from " + busStop + " (" + stopIndex + "/" + routeStopsFound.size() + ")"); int stopWanted = stopIndex + moveAmount; if ((stopWanted + 1) > routeStopsFound.size()) { Log.v(TAG, "Off the end of the route"); @@ -334,9 +349,7 @@ public class BusRoute { Log.v(TAG, "stopWanted " + stopWanted); busStopDao.refresh(routeStopsFound.get(stopWanted).stop); - Log.v(TAG, - "Moving backwards in direction " + direction + " " + moveAmount + " stops from " + busStop + " to " - + routeStopsFound.get(stopWanted).stop + " in route " + this); + Log.v(TAG, "Moving backwards " + moveAmount + " stops from " + busStop + " to " + routeStopsFound.get(stopWanted).stop + " in route " + this); return routeStopsFound.get(stopWanted).stop; } diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java index 58f5bb0..6ef956b 100644 --- a/src/net/cbaines/suma/BusStopOverlay.java +++ b/src/net/cbaines/suma/BusStopOverlay.java @@ -226,7 +226,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { public boolean onDoubleTap(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onDoubleTap is " + event.getPointerCount() + " " + event.getAction()); + Log.v(TAG, "Pointer count for onDoubleTap is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); if (event.getPointerCount() != 1) { Log.v(TAG, "Pointer count for onDoubleTap not 1, ignoring"); return false; @@ -254,7 +254,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction()); + Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); if (event.getPointerCount() != 1) { Log.v(TAG, "Pointer count for onLongPress not 1, ignoring"); return false; diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index f065b07..4959865 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -433,6 +433,9 @@ public class DataManager { helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); if (busRouteDao == null) busRouteDao = helper.getBusRouteDao(); + Dao routeStopsDao = null; + if (routeStopsDao == null) + routeStopsDao = helper.getRouteStopsDao(); if (busDao == null) busDao = helper.getBusDao(); if (busStopDao == null) @@ -513,13 +516,11 @@ public class DataManager { BusStop destStop = null; if (destString.equals("Central Station")) { - destStop = busStopDao.queryForId("SNA19709"); + destStop = busStopDao.queryForId("SN120520"); } else if (destString.equals("Civic Centre")) { destStop = busStopDao.queryForId("SN120527"); } else if (destString.equals("City DG4")) { destStop = busStopDao.queryForId("HAA13579"); - } else if (destString.equals("Central Station")) { - destStop = busStopDao.queryForId("SN120520"); } else if (destString.equals("Airport")) { destStop = busStopDao.queryForId("HA030184"); } else if (destString.equals("City, Town Quay")) { @@ -540,6 +541,13 @@ public class DataManager { Log.e(TAG, "Unknown end dest " + destString + " for route " + route.code); } + QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, route.id).and().eq(RouteStops.STOP_ID_FIELD_NAME, destStop.id); + PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); + + List routeStops = routeStopsDao.query(routeStopsPreparedQuery); + Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code); + Date now = new Date(System.currentTimeMillis()); String busID = null; -- cgit v1.2.3 From 6a1277d9a0d69dc34b1c0c1cfb6c502346035434 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 18 Feb 2012 12:50:54 +0000 Subject: Improved bus activity, now you can move back through a route as well as forward. --- src/net/cbaines/suma/BusActivity.java | 71 +++++++++++---------- src/net/cbaines/suma/BusRoute.java | 116 +++++++++++++++++++++++++++++++--- src/net/cbaines/suma/DataManager.java | 13 ++-- src/net/cbaines/suma/RouteStops.java | 8 +-- 4 files changed, 156 insertions(+), 52 deletions(-) diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index f68c051..d632298 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -60,7 +60,7 @@ public class BusActivity extends OrmLiteBaseActivity implements private Context instance; // BusStops and if they are being updated by the handler - ArrayList busStops; + List busStops; ArrayList busStopsActive; private HashMap tasks = new HashMap(); @@ -89,14 +89,16 @@ public class BusActivity extends OrmLiteBaseActivity implements helper.getBusRouteDao().refresh(bus.route); - List busStops = helper.getBusStopDao().queryForEq(BusStop.ID_FIELD_NAME, busStopID); busStop = null; - if (busStops.size() == 0) { - Log.e(TAG, "BusStop " + busStopID + " not found!"); - } else if (busStops.size() == 1) { - busStop = busStops.get(0); - } else if (busStops.size() > 1) { - Log.e(TAG, "Found more than one busStop? " + busStopID); + if (busStopID != null) { + List busStops = helper.getBusStopDao().queryForEq(BusStop.ID_FIELD_NAME, busStopID); + if (busStops.size() == 0) { + Log.e(TAG, "BusStop " + busStopID + " not found!"); + } else if (busStops.size() == 1) { + busStop = busStops.get(0); + } else if (busStops.size() > 1) { + Log.e(TAG, "Found more than one busStop? " + busStopID); + } } U1RouteTextView = (TextView) findViewById(R.id.busActivityU1); @@ -151,11 +153,12 @@ public class BusActivity extends OrmLiteBaseActivity implements e.printStackTrace(); } - busStops = new ArrayList(); - busStops.add(busStop); - - busStopsActive = new ArrayList(); - busStopsActive.add(false); + busStops = bus.route.getRouteSection(instance, bus.direction); + Log.i(TAG, "Got " + busStops.size() + " bus stops for this bus"); + busStopsActive = new ArrayList(busStops.size()); + for (int i = 0; i < busStops.size(); i++) { + busStopsActive.add(false); + } if (bus.destination != null) { Log.i(TAG, "Bus destination is " + bus.destination); @@ -163,21 +166,15 @@ public class BusActivity extends OrmLiteBaseActivity implements Log.i(TAG, "Bus destination is null"); } - for (int i = 0;; i++) { - BusStop nextStop = bus.route.moveInRoute(instance, busStops.get(i), bus.direction, 1); - - if (nextStop.equals(busStop) || (bus.destination != null && bus.destination.equals(nextStop))) { - break; - } - - busStops.add(nextStop); - busStopsActive.add(false); - - if (busStops.size() > 50) { - Log.e(TAG, "Got more than 50 bus stops"); - break; - } - } + /* + * for (int i = 0;; i++) { BusStop nextStop = bus.route.moveInRoute(instance, busStops.get(i), bus.direction, 1); + * + * if (nextStop.equals(busStop) || (bus.destination != null && bus.destination.equals(nextStop))) { break; } + * + * busStops.add(nextStop); busStopsActive.add(false); + * + * if (busStops.size() > 50) { Log.e(TAG, "Got more than 50 bus stops"); break; } } + */ refreshData = new Runnable() { @Override @@ -189,20 +186,22 @@ public class BusActivity extends OrmLiteBaseActivity implements GetTimetableStopTask task = tasks.get(busStops.get(num)); if (stop.timeOfFetch == null || (stop.timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { + if (task != null) { + if (task.getStatus() == AsyncTask.Status.FINISHED) { + task = null; + } + } + if (task == null) { task = new GetTimetableStopTask(); BusStop[] str = { stop.busStop }; task.execute(str); - } else { - if (task.getStatus() == AsyncTask.Status.FINISHED) { - BusStop[] str = { stop.busStop }; - task.execute(str); - } + tasks.put(stop.busStop, task); } } } } - handler.postDelayed(refreshData, 20000); + handler.postDelayed(refreshData, 50000); } }; @@ -336,6 +335,10 @@ public class BusActivity extends OrmLiteBaseActivity implements } else { adapter = new BusSpecificTimetableAdapter(this, visibleTimetable); timetableView.setAdapter(adapter); + if (busStop != null) { + Log.i(TAG, "Moving to position of " + busStop.description + " which is " + busStops.indexOf(busStop)); + timetableView.setSelection(busStops.indexOf(busStop)); + } } busActivityContentLayout.setGravity(Gravity.TOP); } diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index cdb0e4d..244f56e 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -160,7 +160,7 @@ public class BusRoute { ArrayList stopIndexs = new ArrayList(); for (RouteStops routeStop : routeStopsFound) { - if (routeStop.stop.id.equals(busStop.id)) { + if (routeStop.busStop.id.equals(busStop.id)) { stopIndexs.add(routeStop.sequence - 1); } } @@ -175,7 +175,7 @@ public class BusRoute { stopWanted = stopWanted % (routeStopsFound.size() - 1); } Log.v(TAG, " Stop wanted " + stopWanted); - BusStop busStopWanted = routeStopsFound.get(stopWanted).stop; + BusStop busStopWanted = routeStopsFound.get(stopWanted).busStop; busStopDao.refresh(busStopWanted); @@ -189,12 +189,12 @@ public class BusRoute { stopWanted = routeStopsFound.size() - (Math.abs(stopWanted) % routeStopsFound.size()); } Log.v(TAG, "stopWanted " + stopWanted); - busStopDao.refresh(routeStopsFound.get(stopWanted).stop); + busStopDao.refresh(routeStopsFound.get(stopWanted).busStop); - Log.v(TAG, "Moving backwards " + moveAmount + " stops from " + busStop + " to " + routeStopsFound.get(stopWanted).stop + " in route " + Log.v(TAG, "Moving backwards " + moveAmount + " stops from " + busStop + " to " + routeStopsFound.get(stopWanted).busStop + " in route " + this); - busStops.add(routeStopsFound.get(stopWanted).stop); + busStops.add(routeStopsFound.get(stopWanted).busStop); } } @@ -246,7 +246,7 @@ public class BusRoute { int stopIndex = -1; for (RouteStops routeStop : routeStopsFound) { - if (routeStop.stop.id.equals(busStop.id)) { + if (routeStop.busStop.id.equals(busStop.id)) { if (stopIndex == -1) { stopIndex = routeStop.sequence - 1; } else { // ARGH, weird route @@ -333,7 +333,7 @@ public class BusRoute { stopWanted = stopWanted % (routeStopsFound.size() - 1); } Log.v(TAG, " Stop wanted " + stopWanted); - BusStop busStopWanted = routeStopsFound.get(stopWanted).stop; + BusStop busStopWanted = routeStopsFound.get(stopWanted).busStop; busStopDao.refresh(busStopWanted); @@ -347,11 +347,11 @@ public class BusRoute { stopWanted = routeStopsFound.size() - (Math.abs(stopWanted) % routeStopsFound.size()); } Log.v(TAG, "stopWanted " + stopWanted); - busStopDao.refresh(routeStopsFound.get(stopWanted).stop); + busStopDao.refresh(routeStopsFound.get(stopWanted).busStop); - Log.v(TAG, "Moving backwards " + moveAmount + " stops from " + busStop + " to " + routeStopsFound.get(stopWanted).stop + " in route " + this); + Log.v(TAG, "Moving backwards " + moveAmount + " stops from " + busStop + " to " + routeStopsFound.get(stopWanted).busStop + " in route " + this); - return routeStopsFound.get(stopWanted).stop; + return routeStopsFound.get(stopWanted).busStop; } } catch (SQLException e) { @@ -361,6 +361,102 @@ public class BusRoute { return null; } + /** + * Untested? + * + * @param context + * @param busStop + * @param moveAmount + * @return + */ + List getRouteSection(final Context context, String direction) { + + DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); + + if (forwardDirection != null) { + + if (direction != null) { + + if (direction.equals("E")) + direction = "A"; // Quick hack for U1E + } else { + throw new NullPointerException("direction is null"); + } + } + + List busStops = new ArrayList(); + + try { + + Dao routeStopsDao = helper.getRouteStopsDao(); + Dao busStopDao = helper.getBusStopDao(); + + QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, this.id); + PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); + + List routeStopsFound = routeStopsDao.query(routeStopsPreparedQuery); + + int startStopSeq = -1; + int endStopSeq = -1; + + if (id == 326) { // U1 + if (direction.equals(forwardDirection)) { + startStopSeq = 1; + endStopSeq = 43; + } else if (direction.equals(reverseDirection)) { + startStopSeq = 44; + endStopSeq = 88; + } else { + Log.e(TAG, "Error, unrecognised direction " + direction); + } + } else if (id == 468) { // U1N + startStopSeq = 1; + endStopSeq = 29; + } else if (id == 329) { // U2 + if (direction.equals(forwardDirection)) { + startStopSeq = 1; + endStopSeq = 22; + } else if (direction.equals(reverseDirection)) { + startStopSeq = 23; + endStopSeq = 43; + } else { + Log.e(TAG, "Error, unrecognised direction " + direction); + } + } else if (id == 327) { // U6 + if (direction.equals(forwardDirection)) { + startStopSeq = 1; + endStopSeq = 44; + } else if (direction.equals(reverseDirection)) { + startStopSeq = 45; + endStopSeq = 93; + } else { + Log.e(TAG, "Error, unrecognised direction " + direction); + } + } else if (id == 354) { // U9 + startStopSeq = 1; + endStopSeq = 74; + } else { + Log.e(TAG, "Error, unrecognised route " + id); + } + + for (RouteStops routeStop : routeStopsFound) { + if (routeStop.sequence >= startStopSeq && routeStop.sequence <= endStopSeq) { + busStopDao.refresh(routeStop.busStop); + busStops.add(routeStop.busStop); + } + } + + return busStops; + + } catch (SQLException e) { + e.printStackTrace(); + } + Log.e(TAG, "Error moving in route"); + return null; + + } + @Override public int hashCode() { final int prime = 31; diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 4959865..9ccc8f0 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -546,7 +546,12 @@ public class DataManager { PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); List routeStops = routeStopsDao.query(routeStopsPreparedQuery); - Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code); + if (routeStops.size() > 0) { + Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code); + } else { + Log.e(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code); + return null; + } Date now = new Date(System.currentTimeMillis()); @@ -847,16 +852,16 @@ public class DataManager { for (int busStop = 0; busStop < routeStops.size() && busStop >= 0; busStop = busStop + moveAmount) { // if (routeStops.get(busStop).stop.equals(startBusStop)) // continue; - startBusStop = routeStops.get(busStop).stop; + startBusStop = routeStops.get(busStop).busStop; busStopDao.refresh(startBusStop); BusStop predictedNextStop = busRoute.moveInRoute(context, startBusStop, direction, moveAmount); BusStop nextStop; if (busStop == routeStops.size() - 1) { - nextStop = routeStops.get(0).stop; + nextStop = routeStops.get(0).busStop; } else { - nextStop = routeStops.get(busStop + 1).stop; + nextStop = routeStops.get(busStop + 1).busStop; } busStopDao.refresh(nextStop); diff --git a/src/net/cbaines/suma/RouteStops.java b/src/net/cbaines/suma/RouteStops.java index 1206153..29fb18c 100644 --- a/src/net/cbaines/suma/RouteStops.java +++ b/src/net/cbaines/suma/RouteStops.java @@ -40,18 +40,18 @@ public class RouteStops { // This is a foreign object which just stores the id from the User object in this table. @DatabaseField(foreign = true, columnName = STOP_ID_FIELD_NAME, indexName = "routestops_routestop_idx") - BusStop stop; + BusStop busStop; // This is a foreign object which just stores the id from the Post object in this table. @DatabaseField(foreign = true, columnName = ROUTE_ID_FIELD_NAME, indexName = "routestops_routestop_idx") - BusRoute route; + BusRoute busRoute; RouteStops() { } public RouteStops(BusStop stop, BusRoute route, int sequence) { - this.stop = stop; - this.route = route; + this.busStop = stop; + this.busRoute = route; this.sequence = sequence; } } -- cgit v1.2.3 From b374a50fb6f3bd0866bc1f75f7592abb0a6b8cc1 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 18 Feb 2012 20:38:19 +0000 Subject: Fixed a bug in the constructor of BusRoute, and rebuild the database acordingly. Also made improvements to the preferences system. --- assets/data.db | Bin 489472 -> 492544 bytes res/values/strings.xml | 1 - src/net/cbaines/suma/BusRoute.java | 31 ++-- src/net/cbaines/suma/DataManager.java | 100 +++++++----- src/net/cbaines/suma/MapActivity.java | 280 ++++++++++++++++++++++------------ src/net/cbaines/suma/ViewDialog.java | 127 +++++++-------- 6 files changed, 318 insertions(+), 221 deletions(-) diff --git a/assets/data.db b/assets/data.db index 086f5cd..a9a0745 100644 Binary files a/assets/data.db and b/assets/data.db differ diff --git a/res/values/strings.xml b/res/values/strings.xml index 40efa7a..7c77eb2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -18,7 +18,6 @@ About Favourites Favourites - You can drag the map to move it, you can use pinch motions to zoom in and out, this can also be done with the buttons at the bottom of the screen. Taping the building markers will show you there full name, and tapping the bus stop markers will show the live times at that stop. Presing and holding a marker, will add the item to the favourites list. diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index 244f56e..97309c4 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -90,12 +90,14 @@ public class BusRoute { BusRoute() { } - public BusRoute(Integer id, String code, String label, String forwardDirection, String reverseDirection, boolean uniLink) { + public BusRoute(Integer id, String code, String label, String forwardDirection, String reverseDirection, + boolean uniLink) { this.id = id.intValue(); this.code = code; this.label = label; this.forwardDirection = forwardDirection; this.reverseDirection = reverseDirection; + this.uniLink = uniLink; } public BusRoute(Integer id, String code, String label, boolean uniLink) { @@ -168,7 +170,8 @@ public class BusRoute { for (int stopIndex : stopIndexs) { if (moveAmount > 0) { - Log.v(TAG, "Moving forward " + moveAmount + " stops from " + busStop + " (" + stopIndex + "/" + routeStopsFound.size() + ")"); + Log.v(TAG, "Moving forward " + moveAmount + " stops from " + busStop + " (" + stopIndex + "/" + + routeStopsFound.size() + ")"); int stopWanted = stopIndex + moveAmount; if ((stopWanted + 1) > routeStopsFound.size()) { Log.v(TAG, "Off the end of the route"); @@ -191,8 +194,9 @@ public class BusRoute { Log.v(TAG, "stopWanted " + stopWanted); busStopDao.refresh(routeStopsFound.get(stopWanted).busStop); - Log.v(TAG, "Moving backwards " + moveAmount + " stops from " + busStop + " to " + routeStopsFound.get(stopWanted).busStop + " in route " - + this); + Log.v(TAG, + "Moving backwards " + moveAmount + " stops from " + busStop + " to " + + routeStopsFound.get(stopWanted).busStop + " in route " + this); busStops.add(routeStopsFound.get(stopWanted).busStop); } @@ -280,13 +284,15 @@ public class BusRoute { } else { stopIndex = 30; } - } else if (busStop.id.equals("SN120527") && id == 329) { // U2 Civic Centre Rd os stop AO Civic Ctr E + } else if (busStop.id.equals("SN120527") && id == 329) { // U2 Civic Centre Rd os stop AO Civic + // Ctr E if (moveAmount > 0) { stopIndex = 0; } else { stopIndex = 42; } - } else if (busStop.id.equals("SNA09298") && id == 329) { // U2 Bassett Green Rd nr Bassett Green Cl SE + } else if (busStop.id.equals("SNA09298") && id == 329) { // U2 Bassett Green Rd nr Bassett Green + // Cl SE if (moveAmount > 0) { stopIndex = 22; } else { @@ -317,8 +323,10 @@ public class BusRoute { stopIndex = 73; } } else { - Log.e(TAG, "Error, unknown bus stop " + busStop.id + " (" + busStop.description + ") that appears mutiple times in " + toString()); - throw new RuntimeException("Error, unknown bus stop " + busStop.id + " that appears mutiple times in " + toString()); + Log.e(TAG, "Error, unknown bus stop " + busStop.id + " (" + busStop.description + + ") that appears mutiple times in " + toString()); + throw new RuntimeException("Error, unknown bus stop " + busStop.id + + " that appears mutiple times in " + toString()); } Log.v(TAG, "Selecting " + stopIndex + " for " + busStop.id + " as direction == " + direction); } @@ -326,7 +334,8 @@ public class BusRoute { } if (moveAmount > 0) { - Log.v(TAG, "Moving forward " + moveAmount + " stops from " + busStop + " (" + stopIndex + "/" + routeStopsFound.size() + ")"); + Log.v(TAG, "Moving forward " + moveAmount + " stops from " + busStop + " (" + stopIndex + "/" + + routeStopsFound.size() + ")"); int stopWanted = stopIndex + moveAmount; if ((stopWanted + 1) > routeStopsFound.size()) { Log.v(TAG, "Off the end of the route"); @@ -349,7 +358,9 @@ public class BusRoute { Log.v(TAG, "stopWanted " + stopWanted); busStopDao.refresh(routeStopsFound.get(stopWanted).busStop); - Log.v(TAG, "Moving backwards " + moveAmount + " stops from " + busStop + " to " + routeStopsFound.get(stopWanted).busStop + " in route " + this); + Log.v(TAG, + "Moving backwards " + moveAmount + " stops from " + busStop + " to " + + routeStopsFound.get(stopWanted).busStop + " in route " + this); return routeStopsFound.get(stopWanted).busStop; } diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 9ccc8f0..196a7e2 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -96,7 +96,8 @@ public class DataManager { // Log.i(TAG, "Data: " + strLine); String[] dataBits = strLine.split(","); GeoPoint point = Util.csLatLongToGeoPoint(dataBits[2], dataBits[1]); - // Log.i(TAG, "Creating building with id " + dataBits[0] + " and " + point.getLatitudeE6() + " " + point.getLongitudeE6()); + // Log.i(TAG, "Creating building with id " + dataBits[0] + " and " + point.getLatitudeE6() + " " + + // point.getLongitudeE6()); buildingPoints.put(dataBits[0], point); } @@ -109,14 +110,14 @@ public class DataManager { Log.i(TAG, "Number of building points " + buildingPoints.size()); /* - * inputStream = context.getResources().openRawResource(R.raw.buildings_shapes); bufferedReader = new BufferedReader(new - * InputStreamReader(inputStream)); + * inputStream = context.getResources().openRawResource(R.raw.buildings_shapes); bufferedReader = new + * BufferedReader(new InputStreamReader(inputStream)); * * try { String def = bufferedReader.readLine(); // Log.i(TAG, "Reading the definition " + def); * - * while ((strLine = bufferedReader.readLine()) != null) { // Log.i(TAG, "Data: " + strLine); String[] dataBits = strLine.split(","); Polygon poly = - * Util.csPolygonToPolygon(strLine.split("\"")[1]); // Log.i(TAG, "Creating building with id " + dataBits[0] + " and " + poly); - * buildingPolys.put(dataBits[0], poly); } + * while ((strLine = bufferedReader.readLine()) != null) { // Log.i(TAG, "Data: " + strLine); String[] dataBits + * = strLine.split(","); Polygon poly = Util.csPolygonToPolygon(strLine.split("\"")[1]); // Log.i(TAG, + * "Creating building with id " + dataBits[0] + " and " + poly); buildingPolys.put(dataBits[0], poly); } * * bufferedReader.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } * @@ -143,16 +144,19 @@ public class DataManager { continue; } - Building bdg = new Building(dataBits[1], buildingPoints.get(dataBits[1]), dataBits[3].equals("R"), quoteBits[0]); + Building bdg = new Building(dataBits[1], buildingPoints.get(dataBits[1]), dataBits[3].equals("R"), + quoteBits[0]); /* * Polygon poly = buildingPolys.get(dataBits[1]); * - * if (poly != null) { bdg.outline = poly; // Log.i(TAG, "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + - * bdg.point.getLongitudeE6() + " " + poly); } else { // Log.i(TAG, "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + + * if (poly != null) { bdg.outline = poly; // Log.i(TAG, "Adding building " + key + " " + + * bdg.point.getLatitudeE6() + " " + bdg.point.getLongitudeE6() + " " + poly); } else { // + * Log.i(TAG, "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + * bdg.point.getLongitudeE6()); } */ - // Log.i(TAG, "Creating building " + bdg.id + " " + bdg.name + " " + bdg.point + " " + bdg.residential + " " + bdg.outline); + // Log.i(TAG, "Creating building " + bdg.id + " " + bdg.name + " " + bdg.point + " " + + // bdg.residential + " " + bdg.outline); buildingDao.create(bdg); @@ -165,16 +169,19 @@ public class DataManager { continue; } - Building bdg = new Building(dataBits[1], buildingPoints.get(dataBits[1]), dataBits[3].equals("R"), dataBits[0]); + Building bdg = new Building(dataBits[1], buildingPoints.get(dataBits[1]), dataBits[3].equals("R"), + dataBits[0]); /* * Polygon poly = buildingPolys.get(dataBits[1]); * - * if (poly != null) { bdg.outline = poly; // Log.i(TAG, "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + - * bdg.point.getLongitudeE6() + " " + poly); } else { // Log.i(TAG, "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + + * if (poly != null) { bdg.outline = poly; // Log.i(TAG, "Adding building " + key + " " + + * bdg.point.getLatitudeE6() + " " + bdg.point.getLongitudeE6() + " " + poly); } else { // + * Log.i(TAG, "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + * bdg.point.getLongitudeE6()); } */ - // Log.i(TAG, "Creating building " + bdg.id + " " + bdg.name + " " + bdg.point + " " + bdg.residential + " " + bdg.outline); + // Log.i(TAG, "Creating building " + bdg.id + " " + bdg.name + " " + bdg.point + " " + + // bdg.residential + " " + bdg.outline); buildingDao.create(bdg); @@ -192,8 +199,9 @@ public class DataManager { * * Building bdg = new Building(key, buildingPoints.get(key), false); Polygon poly = buildingPolys.get(key); * - * if (poly != null) { bdg.outline = poly; // Log.i(TAG, "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + bdg.point.getLongitudeE6() + - * " " + poly); } else { // Log.i(TAG, "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + bdg.point.getLongitudeE6()); } + * if (poly != null) { bdg.outline = poly; // Log.i(TAG, "Adding building " + key + " " + + * bdg.point.getLatitudeE6() + " " + bdg.point.getLongitudeE6() + " " + poly); } else { // Log.i(TAG, + * "Adding building " + key + " " + bdg.point.getLatitudeE6() + " " + bdg.point.getLongitudeE6()); } * * buildingDao.create(bdg); } */ @@ -229,13 +237,18 @@ public class DataManager { String[] quBitsLng = dataBits[4].substring(1, dataBits[4].length() - 1).split(" "); // Log.i(TAG, "Whole " + dataBits[3] + " First bit " + quBitsLat[0] + " last bit " + quBitsLat[1]); - double lat = Double.valueOf(quBitsLat[0]) + Double.valueOf(quBitsLat[1].substring(0, quBitsLat[1].length() - 1)) / 60d; // TODO Much hackage + double lat = Double.valueOf(quBitsLat[0]) + + Double.valueOf(quBitsLat[1].substring(0, quBitsLat[1].length() - 1)) / 60d; // TODO Much + // hackage // Log.i(TAG, "Whole " + dataBits[4] + " First bit " + quBitsLng[0] + " last bit " + quBitsLng[1]); - double lng = Double.valueOf(quBitsLng[0]) + Double.valueOf(quBitsLng[1].substring(0, quBitsLng[1].length() - 1)) / 60d; // TODO Much hackage + double lng = Double.valueOf(quBitsLng[0]) + + Double.valueOf(quBitsLng[1].substring(0, quBitsLng[1].length() - 1)) / 60d; // TODO Much + // hackage GeoPoint point = new GeoPoint((int) (lat * 1e6), (int) (lng * -1e6)); // Log.i(TAG, "Lat " + point.getLatitudeE6() + " lng " + point.getLongitudeE6()); - busStopDao.create(new BusStop(dataBits[0].replace("\"", ""), dataBits[1].replace("\"", ""), dataBits[2].replace("\"", ""), point)); + busStopDao.create(new BusStop(dataBits[0].replace("\"", ""), dataBits[1].replace("\"", ""), dataBits[2] + .replace("\"", ""), point)); } @@ -261,10 +274,14 @@ public class DataManager { BusRoute route; - boolean uniLink = false; + boolean uniLink; int id = Integer.parseInt(dataBits[0]); if (id == 326 || id == 468 || id == 327 || id == 329 || id == 354) { + Log.e(TAG, "Route " + id + " " + dataBits[1] + " is uni link"); uniLink = true; + } else { + Log.e(TAG, "Route " + id + " " + dataBits[1] + " is not uni link"); + uniLink = false; } route = new BusRoute(id, dataBits[1], dataBits[2].replace("\"", ""), uniLink); @@ -357,10 +374,12 @@ public class DataManager { // Log.i(TAG, "Looking at stop " + stop.id); /* - * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); routeStopsQueryBuilder.where().eq(columnName, value) + * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + * routeStopsQueryBuilder.where().eq(columnName, value) * - * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where password is null - * deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) accountDao.delete(deleteBuilder.prepare()); + * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where + * password is null deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) + * accountDao.delete(deleteBuilder.prepare()); */ QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); @@ -427,7 +446,8 @@ public class DataManager { Log.i(TAG, "Loaded sites from csv"); } - private static Stop getStop(Context context, JSONObject stopObj, Set routes, BusStop busStop) throws SQLException, JSONException { + private static Stop getStop(Context context, JSONObject stopObj, Set routes, BusStop busStop) + throws SQLException, JSONException { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -542,14 +562,17 @@ public class DataManager { } QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); - routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, route.id).and().eq(RouteStops.STOP_ID_FIELD_NAME, destStop.id); + routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, route.id).and() + .eq(RouteStops.STOP_ID_FIELD_NAME, destStop.id); PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); List routeStops = routeStopsDao.query(routeStopsPreparedQuery); if (routeStops.size() > 0) { - Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code); + Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + + route.code); } else { - Log.e(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + route.code); + Log.e(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + + route.code); return null; } @@ -588,8 +611,8 @@ public class DataManager { return stop; } - public static Timetable getTimetable(Context context, String busStop, boolean keepUniLink, boolean keepNonUniLink) throws SQLException, - ClientProtocolException, IOException, JSONException { + public static Timetable getTimetable(Context context, String busStop, boolean keepUniLink, boolean keepNonUniLink) + throws SQLException, ClientProtocolException, IOException, JSONException { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -617,7 +640,8 @@ public class DataManager { if (route != null) { busRoutes.add(route); } else { - throw new RuntimeException("Route not found " + key.substring(key.length() - 3, key.length()) + " " + key); + throw new RuntimeException("Route not found " + key.substring(key.length() - 3, key.length()) + " " + + key); } } @@ -648,7 +672,8 @@ public class DataManager { continue; } - Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); + Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + + stop.arivalTime); timetable.add(stop); } @@ -657,8 +682,8 @@ public class DataManager { return timetable; } - public static Timetable getTimetable(Context context, Bus bus, BusStop startStop, int num) throws SQLException, ClientProtocolException, IOException, - JSONException { + public static Timetable getTimetable(Context context, Bus bus, BusStop startStop, int num) throws SQLException, + ClientProtocolException, IOException, JSONException { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -710,7 +735,8 @@ public class DataManager { continue; } - Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); + Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + + " at " + stop.arivalTime); timetable.add(stop); @@ -723,7 +749,8 @@ public class DataManager { return timetable; } - public static Stop getStop(Context context, Bus bus, BusStop busStop) throws SQLException, ClientProtocolException, IOException, JSONException { + public static Stop getStop(Context context, Bus bus, BusStop busStop) throws SQLException, ClientProtocolException, + IOException, JSONException { if (helper == null) helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); @@ -756,7 +783,8 @@ public class DataManager { stop = getStop(context, stopObj, busRoutes, busStop); break; - // Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + stop.arivalTime); + // Log.v(TAG, "Found stop for a unidentified " + stop.bus.toString() + " at " + stop.busStop.id + " at " + // + stop.arivalTime); } } diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java index 5db0a74..4d9eddc 100644 --- a/src/net/cbaines/suma/MapActivity.java +++ b/src/net/cbaines/suma/MapActivity.java @@ -65,10 +65,20 @@ import android.widget.Toast; import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; import com.j256.ormlite.dao.Dao; -public class MapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, RouteColorConstants, OnItemClickListener, - OnItemLongClickListener, OnSharedPreferenceChangeListener, Preferences { +/** + * + * @author Christopher Baines + * + */ +public class MapActivity extends OrmLiteBaseActivity implements MapViewConstants, Runnable, + RouteColorConstants, OnItemClickListener, OnItemLongClickListener, OnSharedPreferenceChangeListener, + Preferences { - private boolean useBundledDatabase = true; + /** + * Enable to use the database in the assets folder, if its not enabled, the database is built from the csv files in + * the assets folder + */ + private boolean useBundledDatabase = false; private MapView mapView; private MapController mapController; @@ -78,62 +88,98 @@ public class MapActivity extends OrmLiteBaseActivity implements static final int VIEW_DIALOG_ID = 0; static final int FAVOURITE_DIALOG_ID = 1; + private POIDialog favDialog; private HashMap overlays = new HashMap(); private HashMap pastOverlays; // Overlays - // Scale Bar Overlay - private static final String SCALE_BAR_OVERLAY = "scaleBarOverlay"; - private ScaleBarOverlay scaleBarOverlay; - static final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int SCALE_BAR_OVERLAY_RANK = 1; - - // My Location Overlay - private static final String MY_LOCATION_OVERLAY = "myLocationOverlay"; - private MyLocationOverlay myLocationOverlay; - static final boolean MY_LOCATION_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int MY_LOCATION_OVERLAY_RANK = 1; + // -- Building Overlays + static final String BUILDING_OVERLAYS = "buildingOverlays:"; - // Residential Building Overlay + // ---- Residential Building Overlay private static final String RESIDENTIAL_BUILDING_OVERLAY = "residentialBuildingOverlay"; private BuildingNumOverlay residentialBuildingOverlay; static final boolean RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int RESIDENTIAL_BUILDING_OVERLAY_RANK = 1; + private static final int RESIDENTIAL_BUILDING_OVERLAY_RANK = 6; - // Non-Residential Building Overlay + // ---- Non-Residential Building Overlay private static final String NON_RESIDENTIAL_BUILDING_OVERLAY = "nonResidentialBuildingOverlay"; private BuildingNumOverlay nonResidentialBuildingOverlay; static final boolean NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int NON_RESIDENTIAL_BUILDING_OVERLAY_RANK = 1; + private static final int NON_RESIDENTIAL_BUILDING_OVERLAY_RANK = 5; - // Uni-Link Bus Stop Overlay + static final String[] BUILDING_TYPES = { RESIDENTIAL_BUILDING_OVERLAY, NON_RESIDENTIAL_BUILDING_OVERLAY }; + + // -- Bus Stop Overlays + static final String BUS_STOP_OVERLAYS = "busStopOverlays:"; + + // ---- Uni-Link Bus Stop Overlay private static final String UNI_LINK_BUS_STOP_OVERLAY = "uniLinkBusStopOverlay"; private BusStopOverlay uniLinkBusStopOverlay; static final boolean UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int UNI_LINK_BUS_STOP_OVERLAY_RANK = 1; + private static final int UNI_LINK_BUS_STOP_OVERLAY_RANK = 3; - // Uni-Link Bus Stop Overlay + // ---- Non Uni-Link Bus Stop Overlay private static final String NON_UNI_LINK_BUS_STOP_OVERLAY = "nonUniLinkBusStopOverlay"; private BusStopOverlay nonUniLinkBusStopOverlay; static final boolean NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; - private static final int NON_UNI_LINK_BUS_STOP_OVERLAY_RANK = 1; + private static final int NON_UNI_LINK_BUS_STOP_OVERLAY_RANK = 4; - // Site Overlays - private static final String SITE_OVERLAYS = "siteOverlays"; + // -- Site Overlays + static final String[] SITE_NAMES = { "Highfield Campus", "Boldrewood Campus", "Avenue Campus", + "Winchester School of Art", "The University of Southampton Science Park", + "National Oceanography Centre Campus", "Boat House", "Southampton General Hospital", + "Royal South Hants Hospital", "Belgrave Industrial Site", "Highfield Hall", "Glen Eyre Hall", + "South Hill Hall", "Chamberlain Hall", "Hartley Grove", "Bencraft Hall", "Connaught Hall", + "Montefiore Hall", "Stoneham Hall", "Erasmus Park" }; + + private static final String SITE_OVERLAYS = "siteOverlays:"; private HashMap siteOverlays = new HashMap(21); static final boolean SITE_OVERLAYS_ENABLED_BY_DEFAULT = false; - private static final int SITE_OVERLAYS_RANK = 1; + private static final int SITE_OVERLAYS_RANK = 8; - // Route Overlays - private static final String ROUTE_OVERLAYS = "routeOverlays"; - private HashMap routeOverlays = new HashMap(5); - static final boolean ROUTE_OVERLAYS_ENABLED_BY_DEFAULT = true; - private static final int ROUTE_OVERLAYS_RANK = 1; + // -- Route Overlays + private static final String BUS_ROUTE_OVERLAYS = "routeOverlays:"; + private HashMap busRouteOverlays = new HashMap(5); + static final boolean BUS_ROUTE_OVERLAYS_ENABLED_BY_DEFAULT = true; + private static final int BUS_ROUTE_OVERLAYS_RANK = 7; - private POIDialog favDialog; + // -- Other + static final String OTHER_OVERLAYS = "otherOverlay:"; + // ---- Scale Bar Overlay + private static final String SCALE_BAR_OVERLAY = "scaleBarOverlay"; + private ScaleBarOverlay scaleBarOverlay; + static final boolean SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT = true; + private static final int SCALE_BAR_OVERLAY_RANK = 1; + + // ---- My Location Overlay + private static final String MY_LOCATION_OVERLAY = "myLocationOverlay"; + private static final String MY_LOCATION_OVERLAY_COMPASS = "myLocationOverlayCompass"; + private MyLocationOverlay myLocationOverlay; + static final boolean MY_LOCATION_OVERLAY_ENABLED_BY_DEFAULT = true; + static final boolean MY_LOCATION_OVERLAY_COMPASS_ENABLED_BY_DEFAULT = true; + private static final int MY_LOCATION_OVERLAY_RANK = 2; + + static final String[] OTHER_OVERLAY_NAMES = { SCALE_BAR_OVERLAY, MY_LOCATION_OVERLAY, MY_LOCATION_OVERLAY_COMPASS }; + + // Other bits + + // Uni-Link routes + static final String[] UNI_LINK_ROUTES = { "U1", "U1N", "U2", "U6", "U9" }; + + static final String[] PREFERENCES_GROUPS = { BUS_STOP_OVERLAYS, BUS_ROUTE_OVERLAYS, BUILDING_OVERLAYS, + SITE_OVERLAYS, OTHER_OVERLAYS }; + + static final String[][] PREFERENCES_CHILDREN = { UNI_LINK_ROUTES, UNI_LINK_ROUTES, BUILDING_TYPES, SITE_NAMES, + OTHER_OVERLAY_NAMES }; + + /** + * The toast for this activity, storing the toast centrally allows it to be changed quickly, instead of a queue + * building up + */ Toast activityToast; private MapActivity instance; @@ -162,8 +208,10 @@ public class MapActivity extends OrmLiteBaseActivity implements pastOverlays = (HashMap) getLastNonConfigurationInstance(); - // SensorManager mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); This code in the following constructor causes problems in - // some emulators, disable sensors to fix. + /* + * SensorManager mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); This code in the + * following constructor causes problems in some emulators, disable sensors to fix. + */ Log.i(TAG, "Starting creating myLocationOverlay"); myLocationOverlay = new MyLocationOverlay(instance, mapView); Log.i(TAG, "Finished creating myLocationOverlay"); @@ -220,13 +268,14 @@ public class MapActivity extends OrmLiteBaseActivity implements final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); final SharedPreferences activityPrefs = getPreferences(0); - if (activityPrefs.getBoolean("Other:Compass", false)) { + if (activityPrefs.getBoolean(OTHER_OVERLAYS + MY_LOCATION_OVERLAY_COMPASS, false)) { myLocationOverlay.enableCompass(); } else { myLocationOverlay.disableCompass(); } - if (activityPrefs.getBoolean("Other:My Location", false) && sharedPrefs.getBoolean(GPS_ENABLED, false)) { + if (activityPrefs.getBoolean(OTHER_OVERLAYS + MY_LOCATION_OVERLAY, false) + && sharedPrefs.getBoolean(GPS_ENABLED, false)) { myLocationOverlay.enableMyLocation(); } else { myLocationOverlay.disableMyLocation(); @@ -360,7 +409,8 @@ public class MapActivity extends OrmLiteBaseActivity implements } while (true) { - if ((buildingThread == null || !buildingThread.isAlive()) && (busStopThread == null || !busStopThread.isAlive()) + if ((buildingThread == null || !buildingThread.isAlive()) + && (busStopThread == null || !busStopThread.isAlive()) && (siteThread == null || !siteThread.isAlive())) break; @@ -398,18 +448,21 @@ public class MapActivity extends OrmLiteBaseActivity implements showNonUniLinkBusStopOverlays(); - if (activityPrefs.getBoolean("Buildings:Residential", true) || activityPrefs.getBoolean("Buildings:Non-Residential", true)) { - // The argument currently dosent matter for this method. + if (activityPrefs.getBoolean(BUILDING_OVERLAYS + RESIDENTIAL_BUILDING_OVERLAY, + RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT) + || activityPrefs.getBoolean(BUILDING_OVERLAYS + NON_RESIDENTIAL_BUILDING_OVERLAY, + NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)) { showBuildingOverlay(); } Log.i(TAG, "Begining to show the route overlays at " + (System.currentTimeMillis() - startTime)); for (BusRoute busRoute : getHelper().getBusRouteDao()) { if (!busRoute.uniLink) { + Log.v(TAG, "Bus route " + busRoute.code + "(" + busRoute.id + ") is not unilink"); continue; } Log.v(TAG, "Looking at showing " + busRoute.code + " route overlay"); - if (activityPrefs.getBoolean("Bus Routes:" + busRoute.code, ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)) { + if (activityPrefs.getBoolean(BUS_ROUTE_OVERLAYS + busRoute.code, BUS_ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)) { showRouteOverlay(busRoute); } } @@ -442,7 +495,8 @@ public class MapActivity extends OrmLiteBaseActivity implements if (scaleBarOverlay != null) { Log.v(TAG, "ScaleBarOverlay is already created"); } else { - if (pastOverlays != null && (scaleBarOverlay = (ScaleBarOverlay) pastOverlays.get(SCALE_BAR_OVERLAY)) != null) { + if (pastOverlays != null + && (scaleBarOverlay = (ScaleBarOverlay) pastOverlays.get(SCALE_BAR_OVERLAY)) != null) { Log.i(TAG, "Finished restoring utility overlays " + (System.currentTimeMillis() - startTime)); } else { scaleBarOverlay = new ScaleBarOverlay(instance); @@ -458,7 +512,8 @@ public class MapActivity extends OrmLiteBaseActivity implements } - scaleBarOverlay.setEnabled(activityPrefs.getBoolean(SCALE_BAR_OVERLAY, SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT)); + scaleBarOverlay.setEnabled(activityPrefs.getBoolean(OTHER_OVERLAYS + SCALE_BAR_OVERLAY, + SCALE_BAR_OVERLAY_ENABLED_BY_DEFAULT)); mapView.postInvalidate(); @@ -470,20 +525,22 @@ public class MapActivity extends OrmLiteBaseActivity implements private void showRouteOverlay(final BusRoute route) { new Thread(new Runnable() { public void run() { - Log.i(TAG, "Begining showing route " + route.code + " overlay at " + (System.currentTimeMillis() - startTime)); + Log.i(TAG, "Begining showing route " + route.code + " overlay at " + + (System.currentTimeMillis() - startTime)); final SharedPreferences activityPrefs = getPreferences(0); final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); PathOverlay routeOverlay; - if ((routeOverlay = routeOverlays.get(route)) != null) { + if ((routeOverlay = busRouteOverlays.get(route)) != null) { Log.v(TAG, route.code + " route overlay already existed"); } else { - if (pastOverlays != null && (routeOverlay = (PathOverlay) pastOverlays.get(ROUTE_OVERLAYS + route.code)) != null) { + if (pastOverlays != null + && (routeOverlay = (PathOverlay) pastOverlays.get(BUS_ROUTE_OVERLAYS + route.code)) != null) { Log.v(TAG, "Restored " + route.code + " route overlay"); if (route.code.equals("U1")) { - PathOverlay routeOverlayU1E = (PathOverlay) pastOverlays.get(ROUTE_OVERLAYS + "U1E"); - overlays.put(ROUTE_OVERLAYS + "U1E", routeOverlayU1E); + PathOverlay routeOverlayU1E = (PathOverlay) pastOverlays.get(BUS_ROUTE_OVERLAYS + "U1E"); + overlays.put(BUS_ROUTE_OVERLAYS + "U1E", routeOverlayU1E); } } else { InputStream resource = null; @@ -493,15 +550,16 @@ public class MapActivity extends OrmLiteBaseActivity implements colour = U1; // TODO Is this a route like U1N or, something else, this hack works somewhat for now? - PathOverlay routeOverlayU1E = DataManager.getRoutePath(getResources().openRawResource(R.raw.u1e), colour, mResourceProxy); + PathOverlay routeOverlayU1E = DataManager.getRoutePath( + getResources().openRawResource(R.raw.u1e), colour, mResourceProxy); routeOverlayU1E.getPaint().setAntiAlias(true); routeOverlayU1E.getPaint().setAlpha(145); routeOverlayU1E.getPaint().setStrokeWidth(12); routeOverlayU1E.getPaint().setPathEffect(new DashPathEffect(new float[] { 20, 16 }, 0)); routeOverlayU1E.setEnabled(activityPrefs.getBoolean("Bus Routes:" + route.code, true)); - routeOverlays.put(new BusRoute(1000, "U1E", "U1E Route Label", true), routeOverlayU1E); - overlays.put(ROUTE_OVERLAYS + route.code + "E", routeOverlayU1E); + busRouteOverlays.put(new BusRoute(1000, "U1E", "U1E Route Label", true), routeOverlayU1E); + overlays.put(BUS_ROUTE_OVERLAYS + route.code + "E", routeOverlayU1E); } else if (route.code.equals("U1N")) { resource = getResources().openRawResource(R.raw.u1n); colour = U1N; @@ -527,8 +585,8 @@ public class MapActivity extends OrmLiteBaseActivity implements routeOverlay.getPaint().setStrokeWidth(12); } - routeOverlays.put(route, routeOverlay); - overlays.put(ROUTE_OVERLAYS + route.code, routeOverlay); + busRouteOverlays.put(route, routeOverlay); + overlays.put(BUS_ROUTE_OVERLAYS + route.code, routeOverlay); synchronized (mapView.getOverlays()) { mapView.getOverlays().add(routeOverlay); @@ -537,14 +595,17 @@ public class MapActivity extends OrmLiteBaseActivity implements } - routeOverlay.setEnabled(activityPrefs.getBoolean(ROUTE_OVERLAYS + route.code, ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); + routeOverlay.setEnabled(activityPrefs.getBoolean(BUS_ROUTE_OVERLAYS + route.code, + BUS_ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); if (route.code.equals("U1")) { - overlays.get(ROUTE_OVERLAYS + "U1E").setEnabled(activityPrefs.getBoolean(ROUTE_OVERLAYS + "U1", ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); + overlays.get(BUS_ROUTE_OVERLAYS + "U1E").setEnabled( + activityPrefs.getBoolean(BUS_ROUTE_OVERLAYS + "U1", BUS_ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); } mapView.postInvalidate(); - Log.i(TAG, "Finished showing route " + route.code + " overlay at " + (System.currentTimeMillis() - startTime)); + Log.i(TAG, "Finished showing route " + route.code + " overlay at " + + (System.currentTimeMillis() - startTime)); } }).start(); } @@ -553,7 +614,8 @@ public class MapActivity extends OrmLiteBaseActivity implements new Thread(new Runnable() { public void run() { - Log.i(TAG, "Begining showing site " + site.name + " overlay at " + (System.currentTimeMillis() - startTime)); + Log.i(TAG, "Begining showing site " + site.name + " overlay at " + + (System.currentTimeMillis() - startTime)); final SharedPreferences activityPrefs = getPreferences(0); final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); @@ -562,7 +624,8 @@ public class MapActivity extends OrmLiteBaseActivity implements if ((siteOverlay = siteOverlays.get(site)) != null) { } else { - if (pastOverlays != null && (siteOverlay = (PathOverlay) pastOverlays.get(SITE_OVERLAYS + site.name)) != null) { + if (pastOverlays != null + && (siteOverlay = (PathOverlay) pastOverlays.get(SITE_OVERLAYS + site.name)) != null) { Log.i(TAG, "Restored " + site.name + " site overlay"); } else { @@ -588,11 +651,13 @@ public class MapActivity extends OrmLiteBaseActivity implements } } - siteOverlay.setEnabled(activityPrefs.getBoolean(SITE_OVERLAYS + site.name, SITE_OVERLAYS_ENABLED_BY_DEFAULT)); + siteOverlay.setEnabled(activityPrefs.getBoolean(SITE_OVERLAYS + site.name, + SITE_OVERLAYS_ENABLED_BY_DEFAULT)); mapView.postInvalidate(); - Log.i(TAG, "Finished showing site " + site.name + " overlay at " + (System.currentTimeMillis() - startTime)); + Log.i(TAG, "Finished showing site " + site.name + " overlay at " + + (System.currentTimeMillis() - startTime)); } }).start(); } @@ -608,8 +673,11 @@ public class MapActivity extends OrmLiteBaseActivity implements if (residentialBuildingOverlay != null) { } else { - if (pastOverlays != null && (residentialBuildingOverlay = (BuildingNumOverlay) pastOverlays.get(RESIDENTIAL_BUILDING_OVERLAY)) != null) { - nonResidentialBuildingOverlay = (BuildingNumOverlay) pastOverlays.get(NON_RESIDENTIAL_BUILDING_OVERLAY); + if (pastOverlays != null + && (residentialBuildingOverlay = (BuildingNumOverlay) pastOverlays + .get(RESIDENTIAL_BUILDING_OVERLAY)) != null) { + nonResidentialBuildingOverlay = (BuildingNumOverlay) pastOverlays + .get(NON_RESIDENTIAL_BUILDING_OVERLAY); Log.i(TAG, "Restored building overlays"); } else { @@ -660,7 +728,8 @@ public class MapActivity extends OrmLiteBaseActivity implements } } - residentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + residentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, + RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); nonResidentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); @@ -682,13 +751,15 @@ public class MapActivity extends OrmLiteBaseActivity implements if (uniLinkBusStopOverlay != null) { } else { - if (pastOverlays != null && (uniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(UNI_LINK_BUS_STOP_OVERLAY)) != null) { + if (pastOverlays != null + && (uniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(UNI_LINK_BUS_STOP_OVERLAY)) != null) { Log.i(TAG, "Restored bus stop overlays"); } else { try { List busStops; Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); - if (activityPrefs.getBoolean(UNI_LINK_BUS_STOP_OVERLAY, UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { + if (activityPrefs.getBoolean(UNI_LINK_BUS_STOP_OVERLAY, + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { busStops = getHelper().getBusStopDao().queryForAll(); } else { busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); @@ -711,11 +782,16 @@ public class MapActivity extends OrmLiteBaseActivity implements } } - uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean("0,0", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean("0,1", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean("0,2", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(3, activityPrefs.getBoolean("0,3", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(4, activityPrefs.getBoolean("0,4", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1N", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U2", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(3, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U6", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(4, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U9", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); mapView.postInvalidate(); @@ -732,17 +808,22 @@ public class MapActivity extends OrmLiteBaseActivity implements final SharedPreferences activityPrefs = getPreferences(0); final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); - if (nonUniLinkBusStopOverlay == null && activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { - if (pastOverlays != null && (nonUniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(NON_UNI_LINK_BUS_STOPS)) != null) { + if (nonUniLinkBusStopOverlay == null + && activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, + NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { + if (pastOverlays != null + && (nonUniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(NON_UNI_LINK_BUS_STOPS)) != null) { Log.i(TAG, "Restored non Uni-Link bus stop overlays"); } else { try { List busStops; - Log.v(TAG, "Begin fetching non Uni-Link BusStops at " + (System.currentTimeMillis() - startTime)); + Log.v(TAG, "Begin fetching non Uni-Link BusStops at " + + (System.currentTimeMillis() - startTime)); busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, false); - Log.v(TAG, "Finished fetching non Uni-Link BusStops at " + (System.currentTimeMillis() - startTime)); + Log.v(TAG, "Finished fetching non Uni-Link BusStops at " + + (System.currentTimeMillis() - startTime)); nonUniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); } catch (SQLException e) { @@ -750,7 +831,7 @@ public class MapActivity extends OrmLiteBaseActivity implements } } - overlays.put(NON_UNI_LINK_BUS_STOPS, nonUniLinkBusStopOverlay); + overlays.put(NON_UNI_LINK_BUS_STOP_OVERLAY, nonUniLinkBusStopOverlay); Log.v(TAG, "Applyed the site overlay, now sorting them"); @@ -762,7 +843,8 @@ public class MapActivity extends OrmLiteBaseActivity implements mapView.postInvalidate(); - Log.i(TAG, "Finished showing non Uni-Link bus stop overlays at " + (System.currentTimeMillis() - startTime)); + Log.i(TAG, "Finished showing non Uni-Link bus stop overlays at " + + (System.currentTimeMillis() - startTime)); } }).start(); } @@ -813,8 +895,9 @@ public class MapActivity extends OrmLiteBaseActivity implements }; AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setMessage("GPS is not enabled, do you wish to enable it?").setPositiveButton("Yes", dialogClickListener) - .setNegativeButton("No", dialogClickListener).show(); + builder.setMessage("GPS is not enabled, do you wish to enable it?") + .setPositiveButton("Yes", dialogClickListener).setNegativeButton("No", dialogClickListener) + .show(); } return true; @@ -921,7 +1004,8 @@ public class MapActivity extends OrmLiteBaseActivity implements Log.v(TAG, "Got a busStop id back from the BusTimeActivity " + busStopID); BusStop busStop = getHelper().getBusStopDao().queryForId(busStopID); - uniLinkBusStopOverlay.refresh(busStop); // This does not invalidate the map, but it seems to make the changes appear + uniLinkBusStopOverlay.refresh(busStop); // This does not invalidate the map, but it seems to + // make the changes appear } } catch (SQLException e) { e.printStackTrace(); @@ -938,7 +1022,8 @@ public class MapActivity extends OrmLiteBaseActivity implements /* * public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { * - * mapView.post(new Runnable() { public void run() { // updateEnabledOverlays(); TODO Fix whatever this did? mapView.invalidate(); } }); + * mapView.post(new Runnable() { public void run() { // updateEnabledOverlays(); TODO Fix whatever this did? + * mapView.invalidate(); } }); * * return true; } */ @@ -1078,14 +1163,14 @@ public class MapActivity extends OrmLiteBaseActivity implements return UNI_LINK_BUS_STOP_OVERLAY_RANK; } else if (overlay == nonUniLinkBusStopOverlay) { return NON_UNI_LINK_BUS_STOP_OVERLAY_RANK; - } else if (overlay == residentialBuildingOverlay) { + } else if (overlay.equals(residentialBuildingOverlay)) { return RESIDENTIAL_BUILDING_OVERLAY_RANK; - } else if (overlay == nonResidentialBuildingOverlay) { + } else if (overlay.equals(nonResidentialBuildingOverlay)) { return NON_RESIDENTIAL_BUILDING_OVERLAY_RANK; } else if (siteOverlays != null && siteOverlays.values().contains(overlay)) { return SITE_OVERLAYS_RANK; - } else if (routeOverlays != null && routeOverlays.values().contains(overlay)) { - return ROUTE_OVERLAYS_RANK; + } else if (busRouteOverlays != null && busRouteOverlays.values().contains(overlay)) { + return BUS_ROUTE_OVERLAYS_RANK; } else { Log.e(TAG, "Trying to rank unknown overlay " + overlay); return -1; @@ -1112,15 +1197,13 @@ public class MapActivity extends OrmLiteBaseActivity implements // Noting to do here atm } else if (key.equals(UNI_LINK_BUS_TIMES)) { // Noting to do here atm - } else if (key.equals(UNI_LINK_BUS_STOP_OVERLAY)) { - - } else if (key.equals(NON_UNI_LINK_BUS_STOP_OVERLAY)) { // Activity Preferences + } else if (key.startsWith(BUS_STOP_OVERLAYS)) { showUniLinkBusStopOverlays(); - } else if (key.equals(NON_UNI_LINK_BUS_STOPS)) { // Activity Preferences + } else if (key.startsWith(NON_UNI_LINK_BUS_STOPS)) { showNonUniLinkBusStopOverlays(); - } else if (key.contains(ROUTE_OVERLAYS)) { + } else if (key.startsWith(BUS_ROUTE_OVERLAYS)) { try { - String routeName = key.substring(ROUTE_OVERLAYS.length(), key.length()); + String routeName = key.substring(BUS_ROUTE_OVERLAYS.length(), key.length()); for (BusRoute route : getHelper().getBusRouteDao()) { Log.v(TAG, route.code + " " + routeName); if (route.code.equals(routeName)) { @@ -1130,9 +1213,9 @@ public class MapActivity extends OrmLiteBaseActivity implements } catch (SQLException e) { e.printStackTrace(); } - } else if (key.equals(RESIDENTIAL_BUILDING_OVERLAY) || key.equals(NON_RESIDENTIAL_BUILDING_OVERLAY)) { + } else if (key.startsWith(BUILDING_OVERLAYS)) { showBuildingOverlay(); - } else if (key.contains(SITE_OVERLAYS)) { + } else if (key.startsWith(SITE_OVERLAYS)) { String siteName = key.substring(SITE_OVERLAYS.length(), key.length()); try { for (Site site : getHelper().getSiteDao()) { @@ -1143,23 +1226,20 @@ public class MapActivity extends OrmLiteBaseActivity implements } catch (SQLException e) { e.printStackTrace(); } - } else if (key.startsWith("0")) { - uniLinkBusStopOverlay.setRoutes(Integer.parseInt(Character.toString(key.charAt(2))), - prefs.getBoolean(key, UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - mapView.postInvalidate(); - } else if (key.contains("Other")) { - if (key.contains("Scale Bar")) { + } else if (key.startsWith(OTHER_OVERLAYS)) { + if (key.substring(OTHER_OVERLAYS.length(), key.length()).equals(SCALE_BAR_OVERLAY)) { showUtilityOverlays(); - } else if (key.contains("Compass")) { - if (prefs.getBoolean("Other:Compass", false)) { + } else if (key.substring(OTHER_OVERLAYS.length(), key.length()).equals(MY_LOCATION_OVERLAY_COMPASS)) { + if (prefs.getBoolean(key, MY_LOCATION_OVERLAY_COMPASS_ENABLED_BY_DEFAULT)) { myLocationOverlay.enableCompass(); } else { myLocationOverlay.disableCompass(); } - } else if (key.contains("Other:My Location")) { + } else if (key.substring(OTHER_OVERLAYS.length(), key.length()).equals(MY_LOCATION_OVERLAY)) { final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); - if (prefs.getBoolean("Other:Compass", false) && sharedPrefs.getBoolean("GPSEnabled", false)) { + if (prefs.getBoolean(key, MY_LOCATION_OVERLAY_ENABLED_BY_DEFAULT) + && sharedPrefs.getBoolean(GPS_ENABLED, GPS_ENABLED_BY_DEFAULT)) { myLocationOverlay.enableMyLocation(); } else { myLocationOverlay.disableMyLocation(); diff --git a/src/net/cbaines/suma/ViewDialog.java b/src/net/cbaines/suma/ViewDialog.java index a8e36ed..432fec1 100644 --- a/src/net/cbaines/suma/ViewDialog.java +++ b/src/net/cbaines/suma/ViewDialog.java @@ -19,9 +19,6 @@ package net.cbaines.suma; -import java.sql.SQLException; -import java.util.ArrayList; - import android.app.Dialog; import android.content.Context; import android.content.SharedPreferences; @@ -37,8 +34,6 @@ import android.widget.ExpandableListView; import android.widget.ExpandableListView.OnChildClickListener; import android.widget.TextView; -import com.j256.ormlite.android.apptools.OpenHelperManager; - class ViewDialog extends Dialog implements OnChildClickListener { private final ExpandableListView epView; @@ -49,8 +44,6 @@ class ViewDialog extends Dialog implements OnChildClickListener { private OnChildClickListener listener; - private DatabaseHelper helper; - private String[] busRoutes; private String[] buildingTypes; private String[] other; @@ -64,31 +57,12 @@ class ViewDialog extends Dialog implements OnChildClickListener { this.context = context; - helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); - - int size; - try { - size = (int) helper.getSiteDao().countOf(); - - ArrayList sites = new ArrayList(size); - - try { - sites.addAll(helper.getSiteDao().queryForAll()); - } catch (SQLException e) { - e.printStackTrace(); - } - siteNames = new String[size]; - for (int i = 0; i < size; i++) { - siteNames[i] = sites.get(i).name; - } - } catch (SQLException e1) { - e1.printStackTrace(); - } - busRoutes = context.getResources().getStringArray(R.array.uniLinkBusRoutes); buildingTypes = context.getResources().getStringArray(R.array.buildingTypes); other = context.getResources().getStringArray(R.array.utilityOverlays); groupHeadings = context.getResources().getStringArray(R.array.preferencesHeadings); + siteNames = MapActivity.SITE_NAMES; // TODO: Temp hack, should be included in the strings res for translation + // purposes? setContentView(R.layout.view_dialog); setTitle("Select the map elements to display"); @@ -118,46 +92,46 @@ class ViewDialog extends Dialog implements OnChildClickListener { private static final String TAG = "MyExpandableListAdapter"; - // Bus Stops (0) - // |_ U1 (0:0) - // |_ U1N (0:1) - // |_ U2 (0:2) - // |_ U6 (0:3) - // |_ U9 (0:4) - // Bus Routes (1) - // |_ U1 (1:0) - // |_ U1N (1:1) - // |_ U2 (1:2) - // |_ U6 (1:3) - // |_ U9 (1:4) - // Buildings (2) - // |_ Residential (2:0) - // |_ Non-Residential (2:1) - // Site Outlines (3) - // |_ Highfield Campus (3:0) - // |_ Boldrewood Campus (3:1) - // |_ Avenue Campus (3:2) - // |_ Winchester School of Art (3:3) - // |_ The University of Southampton Science Park (3:4) - // |_ National Oceanography Centre Campus (3:5) - // |_ Boat House (3:6) - // |_ Southampton General Hospital (3:0) - // |_ Royal South Hants Hospital (3:0) - // |_ Belgrave Industrial Site (3:0) - // |_ Highfield Hall (3:0) - // |_ Glen Eyre Hall (3:0) - // |_ South Hill Hall (3:0) - // |_ Chamberlain Hall (3:0) - // |_ Hartley Grove1 (3:0) - // |_ Bencraft Hall (3:0) - // |_ Connaught Hall (3:0) - // |_ Montefiore Hall (3:0) - // |_ Stoneham Hall (3:0) - // |_ Erasmus Park (3:0) - // Other (4) - // |_ Scale Bar (4:0) - // |_ Compass (4:1) - // |_ My Location (4:2) + // Bus Stops + // |_ U1 + // |_ U1N + // |_ U2 + // |_ U6 + // |_ U9 + // Bus Routes + // |_ U1 + // |_ U1N + // |_ U2 + // |_ U6 + // |_ U9 + // Buildings + // |_ Residential + // |_ Non-Residential + // Site Outlines + // |_ Highfield Campus + // |_ Boldrewood Campus + // |_ Avenue Campus + // |_ Winchester School of Art + // |_ The University of Southampton Science Park + // |_ National Oceanography Centre Campus + // |_ Boat House + // |_ Southampton General Hospital + // |_ Royal South Hants Hospital + // |_ Belgrave Industrial Site + // |_ Highfield Hall + // |_ Glen Eyre Hall + // |_ South Hill Hall + // |_ Chamberlain Hall + // |_ Hartley Grove + // |_ Bencraft Hall + // |_ Connaught Hall + // |_ Montefiore Hall + // |_ Stoneham Hall + // |_ Erasmus Park + // Other + // |_ Scale Bar + // |_ Compass + // |_ My Location MyExpandableListAdapter(Context context) { inflater = LayoutInflater.from(context); @@ -182,7 +156,8 @@ class ViewDialog extends Dialog implements OnChildClickListener { return groupPosition * 50 + childPosition; } - public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { + public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, + ViewGroup parent) { View v = null; if (convertView != null) v = convertView; @@ -200,17 +175,20 @@ class ViewDialog extends Dialog implements OnChildClickListener { } SharedPreferences activityPrefs = context.getPreferences(0); - String str = groupPosition + ":" + childPosition; + String str = MapActivity.PREFERENCES_GROUPS[groupPosition] + + MapActivity.PREFERENCES_CHILDREN[groupPosition][childPosition]; if (groupPosition == 0) { cb.setChecked(activityPrefs.getBoolean(str, MapActivity.UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); } else if (groupPosition == 1) { - cb.setChecked(activityPrefs.getBoolean(str, MapActivity.ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); + cb.setChecked(activityPrefs.getBoolean(str, MapActivity.BUS_ROUTE_OVERLAYS_ENABLED_BY_DEFAULT)); } else if (groupPosition == 2) { if (childPosition == 0) { - cb.setChecked(activityPrefs.getBoolean(str, MapActivity.RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + cb.setChecked(activityPrefs.getBoolean(str, + MapActivity.RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); } else { - cb.setChecked(activityPrefs.getBoolean(str, MapActivity.NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + cb.setChecked(activityPrefs.getBoolean(str, + MapActivity.NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); } } else if (groupPosition == 3) { cb.setChecked(activityPrefs.getBoolean(str, MapActivity.SITE_OVERLAYS_ENABLED_BY_DEFAULT)); @@ -277,7 +255,8 @@ class ViewDialog extends Dialog implements OnChildClickListener { CheckBox cb = (CheckBox) v.findViewById(R.id.check1); - String str = groupPosition + ":" + childPosition; + String str = MapActivity.PREFERENCES_GROUPS[groupPosition] + + MapActivity.PREFERENCES_CHILDREN[groupPosition][childPosition]; editor.putBoolean(str, !cb.isChecked()); -- cgit v1.2.3 From 4ee5e20a86f34961ffaf2081f2602e1486de6f92 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 18 Feb 2012 21:14:17 +0000 Subject: More bug fixes, working non uni link bus times, just need to get the non uni link bus stops working :) --- res/xml/preferences.xml | 2 +- src/net/cbaines/suma/BuildingActivity.java | 84 ---------------------------- src/net/cbaines/suma/BuildingNumOverlay.java | 34 ++++++----- src/net/cbaines/suma/DataManager.java | 30 +++++----- src/net/cbaines/suma/MapActivity.java | 33 +++++------ src/net/cbaines/suma/Stop.java | 7 ++- src/net/cbaines/suma/StopView.java | 16 ++++-- src/net/cbaines/suma/TimetableAdapter.java | 1 - 8 files changed, 70 insertions(+), 137 deletions(-) delete mode 100644 src/net/cbaines/suma/BuildingActivity.java diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index f4cdd9f..4a12e1c 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -28,7 +28,7 @@ android:orderingFromXml="true" android:title="@string/preferences_catagory_data" > diff --git a/src/net/cbaines/suma/BuildingActivity.java b/src/net/cbaines/suma/BuildingActivity.java deleted file mode 100644 index ca605c8..0000000 --- a/src/net/cbaines/suma/BuildingActivity.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - - * Southampton University Map App - * Copyright (C) 2011 Christopher Baines - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package net.cbaines.suma; - -import java.io.InputStream; -import java.util.HashSet; - -import android.content.Context; -import android.os.Bundle; - -import com.j256.ormlite.android.apptools.OrmLiteBaseActivity; - -public class BuildingActivity extends OrmLiteBaseActivity { - - final static String TAG = "BusTimeActivity"; - - private boolean dataChanged; - - private Context instance; - - private HashSet routes = new HashSet(); - - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.bustimes); - - final DatabaseHelper helper = getHelper(); - - // create an empty model - // Model model = ModelFactory.createDefaultModel(); - - // use the FileManager to find the input file - InputStream in = getResources().openRawResource(R.raw.u9); - if (in == null) { - throw new IllegalArgumentException("File not found"); - } - - // read the RDF/XML file - // model.read(in, null); - - instance = this; - - } - - public void onResume() { - super.onResume(); - - } - - public void onPause() { - - super.onPause(); - } - - public void finish() { - setResult(RESULT_OK, getIntent()); - - super.finish(); - } - - @Override - public Object onRetainNonConfigurationInstance() { - return null; - } - -} diff --git a/src/net/cbaines/suma/BuildingNumOverlay.java b/src/net/cbaines/suma/BuildingNumOverlay.java index 9825616..33b5efc 100644 --- a/src/net/cbaines/suma/BuildingNumOverlay.java +++ b/src/net/cbaines/suma/BuildingNumOverlay.java @@ -29,7 +29,6 @@ import org.osmdroid.views.MapView; import org.osmdroid.views.MapView.Projection; import org.osmdroid.views.overlay.Overlay; -import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; @@ -92,25 +91,29 @@ public class BuildingNumOverlay extends Overlay { /** * Draw a marker on each of our items. populate() must have been called first.
*
- * The marker will be drawn twice for each Item in the Overlay--once in the shadow phase, skewed and darkened, then again in the non-shadow phase. The - * bottom-center of the marker will be aligned with the geographical coordinates of the Item.
+ * The marker will be drawn twice for each Item in the Overlay--once in the shadow phase, skewed and darkened, then + * again in the non-shadow phase. The bottom-center of the marker will be aligned with the geographical coordinates + * of the Item.
*
- * The order of drawing may be changed by overriding the getIndexToDraw(int) method. An item may provide an alternate marker via its - * OverlayItem.getMarker(int) method. If that method returns null, the default marker is used.
+ * The order of drawing may be changed by overriding the getIndexToDraw(int) method. An item may provide an + * alternate marker via its OverlayItem.getMarker(int) method. If that method returns null, the default marker is + * used.
*
* The focused item is always drawn last, which puts it visually on top of the other items.
* * @param canvas - * the Canvas upon which to draw. Note that this may already have a transformation applied, so be sure to leave it the way you found it + * the Canvas upon which to draw. Note that this may already have a transformation applied, so be sure to + * leave it the way you found it * @param mapView - * the MapView that requested the draw. Use MapView.getProjection() to convert between on-screen pixels and latitude/longitude pairs + * the MapView that requested the draw. Use MapView.getProjection() to convert between on-screen pixels + * and latitude/longitude pairs * @param shadow * if true, draw the shadow layer. If false, draw the overlay contents. */ @Override public void draw(final Canvas canvas, final MapView mapView, final boolean shadow) { - if (shadow) { + if (shadow || !isEnabled()) { return; } @@ -181,7 +184,8 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onSingleTapUp(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); + Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction() + " " + + event.describeContents()); if (event.getPointerCount() != 1) { Log.v(TAG, "Pointer count for onSingleTapUp not 1, ignoring"); return false; @@ -199,7 +203,8 @@ public class BuildingNumOverlay extends Overlay { Log.i(TAG, "building Pressed " + building.id); if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, building.name + " (" + building.id + ")", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, building.name + " (" + building.id + ")", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(building.name + " (" + building.id + ")"); @@ -218,7 +223,8 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); + Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction() + " " + + event.describeContents()); if (event.getPointerCount() != 1) { Log.v(TAG, "Pointer count for onLongPress not 1, ignoring"); return false; @@ -239,7 +245,8 @@ public class BuildingNumOverlay extends Overlay { building.favourite = false; if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, building.id + " removed from favourites", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, building.id + " removed from favourites", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(building.id + " removed from favourites"); @@ -248,7 +255,8 @@ public class BuildingNumOverlay extends Overlay { } else { if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, building.id + " made a favourite", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, building.id + " made a favourite", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(building.id + " made a favourite"); diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 196a7e2..140ddfa 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -561,19 +561,21 @@ public class DataManager { Log.e(TAG, "Unknown end dest " + destString + " for route " + route.code); } - QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); - routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, route.id).and() - .eq(RouteStops.STOP_ID_FIELD_NAME, destStop.id); - PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); - - List routeStops = routeStopsDao.query(routeStopsPreparedQuery); - if (routeStops.size() > 0) { - Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " - + route.code); - } else { - Log.e(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " - + route.code); - return null; + if (destStop != null) { + + QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + routeStopsQueryBuilder.where().eq(RouteStops.ROUTE_ID_FIELD_NAME, route.id).and() + .eq(RouteStops.STOP_ID_FIELD_NAME, destStop.id); + PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); + + List routeStops = routeStopsDao.query(routeStopsPreparedQuery); + if (routeStops.size() > 0) { + Log.i(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + + route.code); + } else { + Log.w(TAG, "Found " + routeStops.size() + " stops matching the destStop " + destStop + " on route " + + route.code); + } } Date now = new Date(System.currentTimeMillis()); @@ -653,10 +655,12 @@ public class DataManager { JSONObject stopObj = stopsArray.getJSONObject(stopNum); if (!keepNonUniLink && !stopObj.getString("name").startsWith("U")) { + Log.v(TAG, "Skipping non uni-link stop " + stopObj.getString("name")); continue; } if (!keepUniLink && stopObj.getString("name").startsWith("U")) { + Log.v(TAG, "Skipping uni-link stop " + stopObj.getString("name")); continue; } diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java index 4d9eddc..c0a2aba 100644 --- a/src/net/cbaines/suma/MapActivity.java +++ b/src/net/cbaines/suma/MapActivity.java @@ -78,7 +78,7 @@ public class MapActivity extends OrmLiteBaseActivity implements * Enable to use the database in the assets folder, if its not enabled, the database is built from the csv files in * the assets folder */ - private boolean useBundledDatabase = false; + private boolean useBundledDatabase = true; private MapView mapView; private MapController mapController; @@ -444,15 +444,15 @@ public class MapActivity extends OrmLiteBaseActivity implements showUtilityOverlays(); - showUniLinkBusStopOverlays(); + showUniLinkBusStopOverlay(); - showNonUniLinkBusStopOverlays(); + showNonUniLinkBusStopOverlay(); if (activityPrefs.getBoolean(BUILDING_OVERLAYS + RESIDENTIAL_BUILDING_OVERLAY, RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT) || activityPrefs.getBoolean(BUILDING_OVERLAYS + NON_RESIDENTIAL_BUILDING_OVERLAY, NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)) { - showBuildingOverlay(); + showBuildingOverlays(); } Log.i(TAG, "Begining to show the route overlays at " + (System.currentTimeMillis() - startTime)); @@ -662,7 +662,7 @@ public class MapActivity extends OrmLiteBaseActivity implements }).start(); } - private void showBuildingOverlay() { + private void showBuildingOverlays() { new Thread(new Runnable() { public void run() { Log.i(TAG, "Begining showing building overlays at " + (System.currentTimeMillis() - startTime)); @@ -728,10 +728,10 @@ public class MapActivity extends OrmLiteBaseActivity implements } } - residentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, - RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); - nonResidentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(RESIDENTIAL_BUILDING_OVERLAY, - NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + residentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(BUILDING_OVERLAYS + + RESIDENTIAL_BUILDING_OVERLAY, RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); + nonResidentialBuildingOverlay.setEnabled(activityPrefs.getBoolean(BUILDING_OVERLAYS + + NON_RESIDENTIAL_BUILDING_OVERLAY, NON_RESIDENTIAL_BUILDING_OVERLAY_ENABLED_BY_DEFAULT)); mapView.postInvalidate(); @@ -740,7 +740,7 @@ public class MapActivity extends OrmLiteBaseActivity implements }).start(); } - private void showUniLinkBusStopOverlays() { + private void showUniLinkBusStopOverlay() { new Thread(new Runnable() { public void run() { Log.i(TAG, "Begining showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); @@ -800,10 +800,11 @@ public class MapActivity extends OrmLiteBaseActivity implements }).start(); } - private void showNonUniLinkBusStopOverlays() { + private void showNonUniLinkBusStopOverlay() { new Thread(new Runnable() { public void run() { - Log.i(TAG, "Begining showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); + Log.i(TAG, "Begining showing non uni link bus stop overlays at " + + (System.currentTimeMillis() - startTime)); final SharedPreferences activityPrefs = getPreferences(0); final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); @@ -1198,9 +1199,9 @@ public class MapActivity extends OrmLiteBaseActivity implements } else if (key.equals(UNI_LINK_BUS_TIMES)) { // Noting to do here atm } else if (key.startsWith(BUS_STOP_OVERLAYS)) { - showUniLinkBusStopOverlays(); - } else if (key.startsWith(NON_UNI_LINK_BUS_STOPS)) { - showNonUniLinkBusStopOverlays(); + showUniLinkBusStopOverlay(); + } else if (key.equals(NON_UNI_LINK_BUS_STOPS)) { + showNonUniLinkBusStopOverlay(); } else if (key.startsWith(BUS_ROUTE_OVERLAYS)) { try { String routeName = key.substring(BUS_ROUTE_OVERLAYS.length(), key.length()); @@ -1214,7 +1215,7 @@ public class MapActivity extends OrmLiteBaseActivity implements e.printStackTrace(); } } else if (key.startsWith(BUILDING_OVERLAYS)) { - showBuildingOverlay(); + showBuildingOverlays(); } else if (key.startsWith(SITE_OVERLAYS)) { String siteName = key.substring(SITE_OVERLAYS.length(), key.length()); try { diff --git a/src/net/cbaines/suma/Stop.java b/src/net/cbaines/suma/Stop.java index c6bedf0..94fc908 100644 --- a/src/net/cbaines/suma/Stop.java +++ b/src/net/cbaines/suma/Stop.java @@ -22,7 +22,6 @@ package net.cbaines.suma; import java.util.Date; import android.text.format.DateUtils; -import android.util.Log; /** * Stop represents a Bus stopping at a time at a BusStop. @@ -90,7 +89,8 @@ public class Stop { if (arivalTime.getTime() - System.currentTimeMillis() <= 60000) { return "Due"; } else { - return (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS); + return (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), System.currentTimeMillis(), + DateUtils.MINUTE_IN_MILLIS); } } @@ -98,7 +98,8 @@ public class Stop { if (arivalTime.getTime() - System.currentTimeMillis() <= 60000) { return "Due"; } else { - String time = (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS); + String time = (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), + System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS); time = time.replace("in ", ""); time = time.replace(" minutes", "m"); time = time.replace(" minute", "m"); diff --git a/src/net/cbaines/suma/StopView.java b/src/net/cbaines/suma/StopView.java index 011964d..08e5843 100644 --- a/src/net/cbaines/suma/StopView.java +++ b/src/net/cbaines/suma/StopView.java @@ -23,7 +23,6 @@ import java.sql.SQLException; import java.text.DateFormat; import android.app.Activity; -import android.content.Context; import android.content.Intent; import android.view.Gravity; import android.view.View; @@ -87,15 +86,19 @@ public class StopView extends LinearLayout implements OnClickListener, OnLongCli if (stop.bus.id != null) { if (stop.live) { - onClickMessage = "Bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Bus " + stop.bus.toString() + " at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } else { - onClickMessage = "Timetabled bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Timetabled bus " + stop.bus.toString() + " at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } } else { if (stop.live) { - onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Unidentified bus (" + stop.bus.getName() + ") at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } else { - onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } } } catch (SQLException e) { @@ -133,7 +136,8 @@ public class StopView extends LinearLayout implements OnClickListener, OnLongCli ((Activity) context).startActivityForResult(i, 0); } else { if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, + "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT); } else { context.activityToast.setText("Arival prediction not avalible for timetabled buses"); context.activityToast.setDuration(Toast.LENGTH_SHORT); diff --git a/src/net/cbaines/suma/TimetableAdapter.java b/src/net/cbaines/suma/TimetableAdapter.java index ae4407f..9ec7a72 100644 --- a/src/net/cbaines/suma/TimetableAdapter.java +++ b/src/net/cbaines/suma/TimetableAdapter.java @@ -19,7 +19,6 @@ package net.cbaines.suma; -import android.content.Context; import android.util.Log; import android.view.View; import android.view.ViewGroup; -- cgit v1.2.3 From 8fcfee6f01df391476a884c73a8c6c9259e4165b Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 18 Feb 2012 23:02:43 +0000 Subject: Ok, there are now non uni-link bus stops, but they cant be switched off.... --- assets/data.db | Bin 492544 -> 492544 bytes src/net/cbaines/suma/DataManager.java | 131 ++++++++++++++-------------------- src/net/cbaines/suma/MapActivity.java | 7 +- 3 files changed, 58 insertions(+), 80 deletions(-) diff --git a/assets/data.db b/assets/data.db index a9a0745..a128ffd 100644 Binary files a/assets/data.db and b/assets/data.db differ diff --git a/src/net/cbaines/suma/DataManager.java b/src/net/cbaines/suma/DataManager.java index 140ddfa..c6a3a36 100644 --- a/src/net/cbaines/suma/DataManager.java +++ b/src/net/cbaines/suma/DataManager.java @@ -81,7 +81,7 @@ public class DataManager { TableUtils.clearTable(helper.getConnectionSource(), Building.class); - Log.i(TAG, "Loading buildings from csv"); + Log.i(TAG, "Begining loading buildings from csv"); HashMap buildingPoints = new HashMap(); @@ -103,26 +103,10 @@ public class DataManager { bufferedReader.close(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); } - Log.i(TAG, "Number of building points " + buildingPoints.size()); - - /* - * inputStream = context.getResources().openRawResource(R.raw.buildings_shapes); bufferedReader = new - * BufferedReader(new InputStreamReader(inputStream)); - * - * try { String def = bufferedReader.readLine(); // Log.i(TAG, "Reading the definition " + def); - * - * while ((strLine = bufferedReader.readLine()) != null) { // Log.i(TAG, "Data: " + strLine); String[] dataBits - * = strLine.split(","); Polygon poly = Util.csPolygonToPolygon(strLine.split("\"")[1]); // Log.i(TAG, - * "Creating building with id " + dataBits[0] + " and " + poly); buildingPolys.put(dataBits[0], poly); } - * - * bufferedReader.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } - * - * Log.i(TAG, "Number of polys points " + buildingPolys.size()); - */ + // Log.i(TAG, "Number of building points " + buildingPoints.size()); inputStream = context.getAssets().open("building_estates.csv"); bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); @@ -238,12 +222,10 @@ public class DataManager { // Log.i(TAG, "Whole " + dataBits[3] + " First bit " + quBitsLat[0] + " last bit " + quBitsLat[1]); double lat = Double.valueOf(quBitsLat[0]) - + Double.valueOf(quBitsLat[1].substring(0, quBitsLat[1].length() - 1)) / 60d; // TODO Much - // hackage + + Double.valueOf(quBitsLat[1].substring(0, quBitsLat[1].length() - 1)) / 60d; // Log.i(TAG, "Whole " + dataBits[4] + " First bit " + quBitsLng[0] + " last bit " + quBitsLng[1]); double lng = Double.valueOf(quBitsLng[0]) - + Double.valueOf(quBitsLng[1].substring(0, quBitsLng[1].length() - 1)) / 60d; // TODO Much - // hackage + + Double.valueOf(quBitsLng[1].substring(0, quBitsLng[1].length() - 1)) / 60d; GeoPoint point = new GeoPoint((int) (lat * 1e6), (int) (lng * -1e6)); // Log.i(TAG, "Lat " + point.getLatitudeE6() + " lng " + point.getLongitudeE6()); @@ -254,7 +236,6 @@ public class DataManager { bufferedReader.close(); } catch (IOException e) { - // TODO Auto-generated catch block Log.e(TAG, "Line: " + strLine); e.printStackTrace(); } @@ -277,10 +258,8 @@ public class DataManager { boolean uniLink; int id = Integer.parseInt(dataBits[0]); if (id == 326 || id == 468 || id == 327 || id == 329 || id == 354) { - Log.e(TAG, "Route " + id + " " + dataBits[1] + " is uni link"); uniLink = true; } else { - Log.e(TAG, "Route " + id + " " + dataBits[1] + " is not uni link"); uniLink = false; } @@ -304,7 +283,6 @@ public class DataManager { bufferedReader.close(); } catch (IOException e) { - // TODO Auto-generated catch block Log.e(TAG, "Line: " + strLine); e.printStackTrace(); } @@ -322,16 +300,16 @@ public class DataManager { // Log.i(TAG, "Data: " + strLine); String[] dataBits = strLine.split(","); - BusStop stop = busStopDao.queryForId(dataBits[2]); - if (stop != null) { + BusStop busStop = busStopDao.queryForId(dataBits[2]); + if (busStop != null) { // Log.i(TAG, "Found stop " + stop.id); } else { Log.w(TAG, "No stop found for " + dataBits[2]); continue; } - BusRoute route = busRouteDao.queryForId(Integer.parseInt(dataBits[0])); - if (route != null) { + BusRoute busRoute = busRouteDao.queryForId(Integer.parseInt(dataBits[0])); + if (busRoute != null) { // Log.i(TAG, "Found route " + route.id); } else { Log.w(TAG, "No route found for " + dataBits[0]); @@ -339,65 +317,64 @@ public class DataManager { } int sequence = Integer.parseInt(dataBits[1]); - Log.i(TAG, "Creating RouteStop " + stop.id + " " + route.code + " " + sequence); - - routeStopsDao.create(new RouteStops(stop, route, sequence)); - - if (route.id == 326) { // U1 - stop.routes = (byte) (stop.routes | 1); - } else if (route.id == 468) { // U1N - stop.routes = (byte) (stop.routes | (1 << 1)); - } else if (route.id == 329) { // U2 - stop.routes = (byte) (stop.routes | (1 << 2)); - } else if (route.id == 327) { // U6 - stop.routes = (byte) (stop.routes | (1 << 3)); - } else if (route.id == 354) { // U9 - stop.routes = (byte) (stop.routes | (1 << 4)); + Log.i(TAG, "Creating RouteStop " + busStop.id + " " + busRoute.code + " " + sequence); + + routeStopsDao.create(new RouteStops(busStop, busRoute, sequence)); + + if (busRoute.id == 326) { // U1 + busStop.routes = (byte) (busStop.routes | 1); + busStop.uniLink = true; + } else if (busRoute.id == 468) { // U1N + busStop.routes = (byte) (busStop.routes | (1 << 1)); + busStop.uniLink = true; + } else if (busRoute.id == 329) { // U2 + busStop.routes = (byte) (busStop.routes | (1 << 2)); + busStop.uniLink = true; + } else if (busRoute.id == 327) { // U6 + busStop.routes = (byte) (busStop.routes | (1 << 3)); + busStop.uniLink = true; + } else if (busRoute.id == 354) { // U9 + busStop.routes = (byte) (busStop.routes | (1 << 4)); + busStop.uniLink = true; } else { - stop.routes = 0; + busStop.routes = 0; } - Log.v(TAG, "Stop routes " + stop.routes); - busStopDao.update(stop); + // Log.v(TAG, "Stop routes " + busStop.routes); + busStopDao.update(busStop); } bufferedReader.close(); } catch (IOException e) { - // TODO Auto-generated catch block Log.e(TAG, "Line: " + strLine); e.printStackTrace(); } - for (Iterator busStopIter = busStopDao.iterator(); busStopIter.hasNext();) { - BusStop stop = busStopIter.next(); - // Log.i(TAG, "Looking at stop " + stop.id); - - /* - * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); - * routeStopsQueryBuilder.where().eq(columnName, value) - * - * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where - * password is null deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) - * accountDao.delete(deleteBuilder.prepare()); - */ - - QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); - routeStopsQueryBuilder.setCountOf(true); - routeStopsQueryBuilder.where().eq(RouteStops.STOP_ID_FIELD_NAME, stop); - - PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); - long num = routeStopsDao.countOf(routeStopsPreparedQuery); - // long num = routeStopsDao.query(routeStopsPreparedQuery).size(); - // Log.i(TAG, "Number is " + num); - if (num == 0) { - // Log.i(TAG, "Removing " + stop.id); - stop.uniLink = false; - } else { - stop.uniLink = true; - } - busStopDao.update(stop); - } + /* + * for (Iterator busStopIter = busStopDao.iterator(); busStopIter.hasNext();) { BusStop stop = + * busStopIter.next(); // Log.i(TAG, "Looking at stop " + stop.id); + * + * + * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + * routeStopsQueryBuilder.where().eq(columnName, value) + * + * DeleteBuilder deleteBuilder = busStopDao.deleteBuilder(); // only delete the rows where + * password is null deleteBuilder.where().in(RouteStops.STOP_ID_FIELD_NAME, objects) + * accountDao.delete(deleteBuilder.prepare()); + * + * + * QueryBuilder routeStopsQueryBuilder = routeStopsDao.queryBuilder(); + * routeStopsQueryBuilder.setCountOf(true); routeStopsQueryBuilder.where().eq(RouteStops.STOP_ID_FIELD_NAME, + * stop); + * + * PreparedQuery routeStopsPreparedQuery = routeStopsQueryBuilder.prepare(); List + * routeStops = routeStopsDao.query(routeStopsPreparedQuery); // long num = + * routeStopsDao.query(routeStopsPreparedQuery).size(); // Log.i(TAG, "Number is " + num); + * + * stop.uniLink = false; for (RouteStops routeStop : routeStops) { if (routeStop.busRoute.uniLink) { + * stop.uniLink = true; } } busStopDao.update(stop); } + */ Log.i(TAG, "Finished loading bus data"); } diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java index c0a2aba..aa621da 100644 --- a/src/net/cbaines/suma/MapActivity.java +++ b/src/net/cbaines/suma/MapActivity.java @@ -78,7 +78,7 @@ public class MapActivity extends OrmLiteBaseActivity implements * Enable to use the database in the assets folder, if its not enabled, the database is built from the csv files in * the assets folder */ - private boolean useBundledDatabase = true; + private boolean useBundledDatabase = false; private MapView mapView; private MapController mapController; @@ -823,8 +823,9 @@ public class MapActivity extends OrmLiteBaseActivity implements busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, false); - Log.v(TAG, "Finished fetching non Uni-Link BusStops at " - + (System.currentTimeMillis() - startTime)); + Log.v(TAG, + "Finished fetching " + busStops.size() + " non Uni-Link BusStops at " + + (System.currentTimeMillis() - startTime)); nonUniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); } catch (SQLException e) { -- cgit v1.2.3 From c3ccc3b44f3cb272afc4c30023c922558ec928ec Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 18 Feb 2012 23:37:52 +0000 Subject: Working non uni link bus stop overlay :) --- src/net/cbaines/suma/MapActivity.java | 130 +++++++++++++++++--------- src/net/cbaines/suma/Preferences.java | 4 +- src/net/cbaines/suma/PreferencesActivity.java | 4 +- 3 files changed, 91 insertions(+), 47 deletions(-) diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java index aa621da..21bcf15 100644 --- a/src/net/cbaines/suma/MapActivity.java +++ b/src/net/cbaines/suma/MapActivity.java @@ -78,7 +78,7 @@ public class MapActivity extends OrmLiteBaseActivity implements * Enable to use the database in the assets folder, if its not enabled, the database is built from the csv files in * the assets folder */ - private boolean useBundledDatabase = false; + private boolean useBundledDatabase = true; private MapView mapView; private MapController mapController; @@ -122,9 +122,7 @@ public class MapActivity extends OrmLiteBaseActivity implements private static final int UNI_LINK_BUS_STOP_OVERLAY_RANK = 3; // ---- Non Uni-Link Bus Stop Overlay - private static final String NON_UNI_LINK_BUS_STOP_OVERLAY = "nonUniLinkBusStopOverlay"; private BusStopOverlay nonUniLinkBusStopOverlay; - static final boolean NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = true; private static final int NON_UNI_LINK_BUS_STOP_OVERLAY_RANK = 4; // -- Site Overlays @@ -749,50 +747,83 @@ public class MapActivity extends OrmLiteBaseActivity implements final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); if (uniLinkBusStopOverlay != null) { - - } else { - if (pastOverlays != null - && (uniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(UNI_LINK_BUS_STOP_OVERLAY)) != null) { - Log.i(TAG, "Restored bus stop overlays"); + if (!activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT) + && !activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1N", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT) + && !activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U2", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT) + && !activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U6", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT) + && !activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U9", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { + Log.i(TAG, "Uni-Link bus stop overlay not needed"); + uniLinkBusStopOverlay = null; } else { - try { - List busStops; - Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); - if (activityPrefs.getBoolean(UNI_LINK_BUS_STOP_OVERLAY, + uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1N", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U2", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(3, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U6", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(4, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U9", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + } + } else { + if (activityPrefs + .getBoolean(BUS_STOP_OVERLAYS + "U1", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT) + || activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1N", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT) + || activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U2", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT) + || activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U6", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT) + || activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U9", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { - busStops = getHelper().getBusStopDao().queryForAll(); - } else { + if (pastOverlays != null + && (uniLinkBusStopOverlay = (BusStopOverlay) pastOverlays + .get(UNI_LINK_BUS_STOP_OVERLAY)) != null) { + Log.i(TAG, "Restored Uni-Link bus stop overlay"); + } else { + + try { + List busStops; + Log.v(TAG, "Begin fetching BusStops at " + (System.currentTimeMillis() - startTime)); + busStops = getHelper().getBusStopDao().queryForEq(BusStop.UNI_LINK_FIELD_NAME, true); - } - Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); - uniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); - } catch (SQLException e) { - e.printStackTrace(); + Log.v(TAG, "Finished fetching BusStops at " + (System.currentTimeMillis() - startTime)); + + uniLinkBusStopOverlay = new BusStopOverlay(instance, busStops); + } catch (SQLException e) { + e.printStackTrace(); + } } - } - overlays.put(UNI_LINK_BUS_STOP_OVERLAY, uniLinkBusStopOverlay); + uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1N", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U2", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(3, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U6", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + uniLinkBusStopOverlay.setRoutes(4, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U9", + UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - Log.v(TAG, "Applyed the site overlay, now sorting them"); + overlays.put(UNI_LINK_BUS_STOP_OVERLAY, uniLinkBusStopOverlay); - synchronized (mapView.getOverlays()) { - mapView.getOverlays().add(uniLinkBusStopOverlay); - Collections.sort(mapView.getOverlays(), comparator); + Log.v(TAG, "Applyed the site overlay, now sorting them"); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().add(uniLinkBusStopOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } } } - uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1", - UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(1, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1N", - UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(2, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U2", - UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(3, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U6", - UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - uniLinkBusStopOverlay.setRoutes(4, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U9", - UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); - mapView.postInvalidate(); Log.i(TAG, "Finished showing bus stop overlays at " + (System.currentTimeMillis() - startTime)); @@ -806,14 +837,23 @@ public class MapActivity extends OrmLiteBaseActivity implements Log.i(TAG, "Begining showing non uni link bus stop overlays at " + (System.currentTimeMillis() - startTime)); - final SharedPreferences activityPrefs = getPreferences(0); + // final SharedPreferences activityPrefs = getPreferences(0); + final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(instance); final OverlayRankComparator comparator = new OverlayRankComparator(getPreferences(0)); - if (nonUniLinkBusStopOverlay == null - && activityPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS, - NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { + if (nonUniLinkBusStopOverlay != null) { + nonUniLinkBusStopOverlay.setEnabled(sharedPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS_OVERLAY, + NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + + Log.i(TAG, + "nonUniLinkBusStopOverlay enabled ? " + + sharedPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS_OVERLAY, + NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)); + } else if (sharedPrefs.getBoolean(NON_UNI_LINK_BUS_STOPS_OVERLAY, + NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { if (pastOverlays != null - && (nonUniLinkBusStopOverlay = (BusStopOverlay) pastOverlays.get(NON_UNI_LINK_BUS_STOPS)) != null) { + && (nonUniLinkBusStopOverlay = (BusStopOverlay) pastOverlays + .get(NON_UNI_LINK_BUS_STOPS_OVERLAY)) != null) { Log.i(TAG, "Restored non Uni-Link bus stop overlays"); } else { try { @@ -833,7 +873,7 @@ public class MapActivity extends OrmLiteBaseActivity implements } } - overlays.put(NON_UNI_LINK_BUS_STOP_OVERLAY, nonUniLinkBusStopOverlay); + overlays.put(NON_UNI_LINK_BUS_STOPS_OVERLAY, nonUniLinkBusStopOverlay); Log.v(TAG, "Applyed the site overlay, now sorting them"); @@ -843,6 +883,10 @@ public class MapActivity extends OrmLiteBaseActivity implements } } + if (nonUniLinkBusStopOverlay != null) { + + } + mapView.postInvalidate(); Log.i(TAG, "Finished showing non Uni-Link bus stop overlays at " @@ -1201,7 +1245,7 @@ public class MapActivity extends OrmLiteBaseActivity implements // Noting to do here atm } else if (key.startsWith(BUS_STOP_OVERLAYS)) { showUniLinkBusStopOverlay(); - } else if (key.equals(NON_UNI_LINK_BUS_STOPS)) { + } else if (key.equals(NON_UNI_LINK_BUS_STOPS_OVERLAY)) { showNonUniLinkBusStopOverlay(); } else if (key.startsWith(BUS_ROUTE_OVERLAYS)) { try { diff --git a/src/net/cbaines/suma/Preferences.java b/src/net/cbaines/suma/Preferences.java index d73d0ce..a978dd9 100644 --- a/src/net/cbaines/suma/Preferences.java +++ b/src/net/cbaines/suma/Preferences.java @@ -8,6 +8,6 @@ public interface Preferences { static final boolean UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = true; static final String NON_UNI_LINK_BUS_TIMES = "nonUniLinkLiveBusTimesEnabled"; static final boolean NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT = false; - static final String NON_UNI_LINK_BUS_STOPS = "nonUniLinkBusStops"; - static final boolean NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT = false; + static final String NON_UNI_LINK_BUS_STOPS_OVERLAY = "nonUniLinkBusStops"; + static final boolean NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT = false; } diff --git a/src/net/cbaines/suma/PreferencesActivity.java b/src/net/cbaines/suma/PreferencesActivity.java index 0d61c6d..d72d266 100644 --- a/src/net/cbaines/suma/PreferencesActivity.java +++ b/src/net/cbaines/suma/PreferencesActivity.java @@ -42,8 +42,8 @@ public class PreferencesActivity extends PreferenceActivity implements Preferenc if (!sharedPrefs.contains(NON_UNI_LINK_BUS_TIMES)) { editor.putBoolean(NON_UNI_LINK_BUS_TIMES, NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT); } - if (!sharedPrefs.contains(NON_UNI_LINK_BUS_STOPS)) { - editor.putBoolean(NON_UNI_LINK_BUS_STOPS, NON_UNI_LINK_BUS_STOPS_ENABLED_BY_DEFAULT); + if (!sharedPrefs.contains(NON_UNI_LINK_BUS_STOPS_OVERLAY)) { + editor.putBoolean(NON_UNI_LINK_BUS_STOPS_OVERLAY, NON_UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT); } editor.commit(); -- cgit v1.2.3 From 7bb198687abe16bc457c96b77dc07283b0340832 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 18 Feb 2012 23:46:12 +0000 Subject: Bumped the version in preperation for the 0.3 release. --- AndroidManifest.xml | 4 ++-- res/values/strings.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index cd740a0..3a93397 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="6" + android:versionName="0.3 (alpha)" > diff --git a/res/values/strings.xml b/res/values/strings.xml index 7c77eb2..c602a26 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -102,7 +102,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< About Version - 0.2.2 (alpha) + 0.3 (alpha) Copyright © 2012, Christopher Baines License -- cgit v1.2.3 From bff738801d5a231806c42bcb06b1e187d120b5a9 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 19 Feb 2012 09:41:44 +0000 Subject: Fixed a bug with the MapActivity overlay toasts, and improved the BusStopActivity. --- src/net/cbaines/suma/BuildingNumOverlay.java | 25 ++------- src/net/cbaines/suma/BusActivity.java | 42 +++++++-------- src/net/cbaines/suma/BusRoute.java | 11 +++- .../cbaines/suma/BusSpecificTimetableAdapter.java | 2 - src/net/cbaines/suma/BusStopOverlay.java | 63 ++++++++-------------- src/net/cbaines/suma/MapActivity.java | 10 +++- src/net/cbaines/suma/StopView.java | 30 +++++++---- 7 files changed, 84 insertions(+), 99 deletions(-) diff --git a/src/net/cbaines/suma/BuildingNumOverlay.java b/src/net/cbaines/suma/BuildingNumOverlay.java index 33b5efc..32616a7 100644 --- a/src/net/cbaines/suma/BuildingNumOverlay.java +++ b/src/net/cbaines/suma/BuildingNumOverlay.java @@ -182,14 +182,7 @@ public class BuildingNumOverlay extends Overlay { } @Override - public boolean onSingleTapUp(final MotionEvent event, final MapView mapView) { - - Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction() + " " - + event.describeContents()); - if (event.getPointerCount() != 1) { - Log.v(TAG, "Pointer count for onSingleTapUp not 1, ignoring"); - return false; - } + public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) { if (!this.isEnabled()) return false; @@ -197,10 +190,10 @@ public class BuildingNumOverlay extends Overlay { final Building building = getSelectedItem(event, mapView); if (building == null) { - Log.i(TAG, "No building pressed"); + // Log.v(TAG, "No building pressed"); return false; } else { - Log.i(TAG, "building Pressed " + building.id); + Log.v(TAG, "building Pressed " + building.id); if (context.activityToast == null) { context.activityToast = Toast.makeText(context, building.name + " (" + building.id + ")", @@ -223,23 +216,16 @@ public class BuildingNumOverlay extends Overlay { @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction() + " " - + event.describeContents()); - if (event.getPointerCount() != 1) { - Log.v(TAG, "Pointer count for onLongPress not 1, ignoring"); - return false; - } - if (!this.isEnabled()) return false; final Building building = getSelectedItem(event, mapView); if (building == null) { - Log.i(TAG, "No building pressed"); + // Log.v(TAG, "No building pressed"); return false; } else { - Log.i(TAG, "building Pressed " + building.id); + Log.v(TAG, "building Pressed " + building.id); if (building.favourite) { building.favourite = false; @@ -269,7 +255,6 @@ public class BuildingNumOverlay extends Overlay { try { buildingDao.update(building); } catch (SQLException e) { - // TODO Auto-generated catch block e.printStackTrace(); } diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java index d632298..b802cfb 100644 --- a/src/net/cbaines/suma/BusActivity.java +++ b/src/net/cbaines/suma/BusActivity.java @@ -2,7 +2,6 @@ package net.cbaines.suma; import java.io.IOException; import java.sql.SQLException; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -61,7 +60,6 @@ public class BusActivity extends OrmLiteBaseActivity implements // BusStops and if they are being updated by the handler List busStops; - ArrayList busStopsActive; private HashMap tasks = new HashMap(); @@ -155,10 +153,6 @@ public class BusActivity extends OrmLiteBaseActivity implements busStops = bus.route.getRouteSection(instance, bus.direction); Log.i(TAG, "Got " + busStops.size() + " bus stops for this bus"); - busStopsActive = new ArrayList(busStops.size()); - for (int i = 0; i < busStops.size(); i++) { - busStopsActive.add(false); - } if (bus.destination != null) { Log.i(TAG, "Bus destination is " + bus.destination); @@ -167,7 +161,8 @@ public class BusActivity extends OrmLiteBaseActivity implements } /* - * for (int i = 0;; i++) { BusStop nextStop = bus.route.moveInRoute(instance, busStops.get(i), bus.direction, 1); + * for (int i = 0;; i++) { BusStop nextStop = bus.route.moveInRoute(instance, busStops.get(i), bus.direction, + * 1); * * if (nextStop.equals(busStop) || (bus.destination != null && bus.destination.equals(nextStop))) { break; } * @@ -179,27 +174,26 @@ public class BusActivity extends OrmLiteBaseActivity implements refreshData = new Runnable() { @Override public void run() { - for (int num = 0; num < timetable.size(); num++) { - if (busStopsActive.get(num)) { - Stop stop = timetable.get(num); + for (int num = timetableView.getFirstVisiblePosition(); num < timetableView.getLastVisiblePosition(); num++) { + Stop stop = timetable.get(num); - GetTimetableStopTask task = tasks.get(busStops.get(num)); + GetTimetableStopTask task = tasks.get(busStops.get(num)); - if (stop.timeOfFetch == null || (stop.timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { - if (task != null) { - if (task.getStatus() == AsyncTask.Status.FINISHED) { - task = null; - } + if (stop.timeOfFetch == null || (stop.timeOfFetch.getTime() - System.currentTimeMillis()) > 20000) { + if (task != null) { + if (task.getStatus() == AsyncTask.Status.FINISHED) { + task = null; } + } - if (task == null) { - task = new GetTimetableStopTask(); - BusStop[] str = { stop.busStop }; - task.execute(str); - tasks.put(stop.busStop, task); - } + if (task == null) { + task = new GetTimetableStopTask(); + BusStop[] str = { stop.busStop }; + task.execute(str); + tasks.put(stop.busStop, task); } } + } handler.postDelayed(refreshData, 50000); } @@ -336,7 +330,9 @@ public class BusActivity extends OrmLiteBaseActivity implements adapter = new BusSpecificTimetableAdapter(this, visibleTimetable); timetableView.setAdapter(adapter); if (busStop != null) { - Log.i(TAG, "Moving to position of " + busStop.description + " which is " + busStops.indexOf(busStop)); + Log.i(TAG, + "Moving to position of " + busStop.description + " which is " + + busStops.indexOf(busStop)); timetableView.setSelection(busStops.indexOf(busStop)); } } diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index 97309c4..4152605 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -21,6 +21,7 @@ package net.cbaines.suma; import java.sql.SQLException; import java.util.ArrayList; +import java.util.Calendar; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -445,8 +446,14 @@ public class BusRoute { Log.e(TAG, "Error, unrecognised direction " + direction); } } else if (id == 354) { // U9 - startStopSeq = 1; - endStopSeq = 74; + Calendar rightNow = Calendar.getInstance(); + if (rightNow.get(Calendar.HOUR_OF_DAY) < 12) { + startStopSeq = 1; + endStopSeq = 40; // TODO: Guess, and untested + } else { + startStopSeq = 41; // TODO: Guess, and untested + endStopSeq = 74; + } } else { Log.e(TAG, "Error, unrecognised route " + id); } diff --git a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java index 469fa56..c115fea 100644 --- a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java +++ b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java @@ -45,8 +45,6 @@ public class BusSpecificTimetableAdapter extends BaseAdapter { public View getView(int position, View convertView, ViewGroup parent) { // Log.i(TAG, "Returning stop " + position + " " + timetable.get(position)); - context.busStopsActive.set(position, true); - if (timeOfLastForcedUpdate + 1000 < System.currentTimeMillis()) { context.handler.post(context.refreshData); timeOfLastForcedUpdate = System.currentTimeMillis(); diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java index 6ef956b..06a1729 100644 --- a/src/net/cbaines/suma/BusStopOverlay.java +++ b/src/net/cbaines/suma/BusStopOverlay.java @@ -180,7 +180,8 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { Log.e(TAG, "Unknown route code"); } - canvas.drawRect(rectLeft, mCurScreenCoords.y + ((yOfsetPerMarker * makersPlaced) - (45 * scale)), rectRight, mCurScreenCoords.y + canvas.drawRect(rectLeft, mCurScreenCoords.y + + ((yOfsetPerMarker * makersPlaced) - (45 * scale)), rectRight, mCurScreenCoords.y + (yOfsetPerMarker * makersPlaced) - ((45 * scale) - markerYSize), paint); makersPlaced++; @@ -190,30 +191,20 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { } } - public boolean onTouchEvent(final MotionEvent event, final MapView mapView) { - // Log.i(TAG, "Touch Event " + event.getPointerCount() + " " + event.getAction()); - return false; - } - @Override - public boolean onSingleTapUp(final MotionEvent event, final MapView mapView) { - - Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction()); - if (event.getPointerCount() != 1) { - Log.v(TAG, "Pointer count for onSingleTapUp not 1, ignoring"); - return false; - } + public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) { BusStop busStop = getSelectedItem(event, mapView); if (busStop == null) { - Log.i(TAG, "No busStop pressed"); + // Log.v(TAG, "No busStop pressed"); return false; } else { Log.i(TAG, "busStop Pressed " + busStop.id); if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, busStop.description + " (" + busStop.id + ")", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, busStop.description + " (" + busStop.id + ")", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(busStop.description + " (" + busStop.id + ")"); @@ -226,17 +217,10 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { public boolean onDoubleTap(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onDoubleTap is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); - if (event.getPointerCount() != 1) { - Log.v(TAG, "Pointer count for onDoubleTap not 1, ignoring"); - return false; - } - BusStop busStop = getSelectedItem(event, mapView); if (busStop == null) { - Log.i(TAG, "No busStop pressed"); - + // Log.v(TAG, "No busStop pressed"); return false; } else { Log.i(TAG, "Pressed " + busStop.id); @@ -254,16 +238,10 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { @Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { - Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction() + " " + event.describeContents()); - if (event.getPointerCount() != 1) { - Log.v(TAG, "Pointer count for onLongPress not 1, ignoring"); - return false; - } - BusStop busStop = getSelectedItem(event, mapView); if (busStop == null) { - Log.i(TAG, "No busStop pressed"); + // Log.v(TAG, "No busStop pressed"); return false; } else { Log.i(TAG, "Pressed " + busStop.id); @@ -272,7 +250,8 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { busStop.favourite = false; if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, busStop.id + " removed from favourites", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, busStop.id + " removed from favourites", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(busStop.id + " removed from favourites"); @@ -280,7 +259,8 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { context.activityToast.show(); } else { if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, busStop.id + " made a favourite", Toast.LENGTH_SHORT); + context.activityToast = Toast.makeText(context, busStop.id + " made a favourite", + Toast.LENGTH_SHORT); } else { context.activityToast.setDuration(Toast.LENGTH_SHORT); context.activityToast.setText(busStop.id + " made a favourite"); @@ -302,7 +282,6 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { return true; } - } public void refresh() { @@ -349,17 +328,19 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { pj.toPixels(busStop.point, mItemPoint); if (marker.getBounds().contains(mTouchScreenPoint.x - mItemPoint.x, mTouchScreenPoint.y - mItemPoint.y)) { - boolean drawing = false; - for (int route = 0; route < 5; route++) { - if ((busStop.routes & (1 << route)) != 0) { - if (routes[route]) { - drawing = true; - break; + if (busStop.uniLink) { + boolean drawing = false; + for (int route = 0; route < 5; route++) { + if ((busStop.routes & (1 << route)) != 0) { + if (routes[route]) { + drawing = true; + break; + } } } + if (!drawing) + continue; } - if (!drawing) - continue; return busStop; } diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java index 21bcf15..d12057c 100644 --- a/src/net/cbaines/suma/MapActivity.java +++ b/src/net/cbaines/suma/MapActivity.java @@ -1050,8 +1050,14 @@ public class MapActivity extends OrmLiteBaseActivity implements Log.v(TAG, "Got a busStop id back from the BusTimeActivity " + busStopID); BusStop busStop = getHelper().getBusStopDao().queryForId(busStopID); - uniLinkBusStopOverlay.refresh(busStop); // This does not invalidate the map, but it seems to - // make the changes appear + if (busStop.uniLink) { + uniLinkBusStopOverlay.refresh(busStop); // This does not invalidate the map, but it seems to + // make the changes appear + } else { + nonUniLinkBusStopOverlay.refresh(busStop); // This does not invalidate the map, but it seems + // to + // make the changes appear + } } } catch (SQLException e) { e.printStackTrace(); diff --git a/src/net/cbaines/suma/StopView.java b/src/net/cbaines/suma/StopView.java index 08e5843..32cd3e1 100644 --- a/src/net/cbaines/suma/StopView.java +++ b/src/net/cbaines/suma/StopView.java @@ -126,29 +126,41 @@ public class StopView extends LinearLayout implements OnClickListener, OnLongCli try { Dao busDao = helper.getBusDao(); + Dao busRouteDao = helper.getBusRouteDao(); busDao.refresh(stop.bus); + busRouteDao.refresh(stop.bus.route); - if (stop.bus.id != null) { + if (stop.bus.id != null && stop.bus.route.uniLink) { Intent i = new Intent(context, BusActivity.class); i.putExtra("busID", stop.bus.id); i.putExtra("busStopID", stop.busStop.id); ((Activity) context).startActivityForResult(i, 0); } else { - if (context.activityToast == null) { - context.activityToast = Toast.makeText(context, - "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT); + if (stop.bus.route.uniLink) { + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, + "Bus schedules only avalible for Uni-Link buses", Toast.LENGTH_SHORT); + } else { + context.activityToast.setText("Bus schedules only avalible for Uni-Link buses"); + context.activityToast.setDuration(Toast.LENGTH_SHORT); + } + context.activityToast.show(); } else { - context.activityToast.setText("Arival prediction not avalible for timetabled buses"); - context.activityToast.setDuration(Toast.LENGTH_SHORT); + if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, + "Bus schedules not avalible for unidentified buses", Toast.LENGTH_SHORT); + } else { + context.activityToast.setText("Bus schedules not avalible for unidentified buses"); + context.activityToast.setDuration(Toast.LENGTH_SHORT); + } + context.activityToast.show(); } - context.activityToast.show(); } } catch (SQLException e) { e.printStackTrace(); } - return false; + return true; } - } -- cgit v1.2.3 From a02e8ae9eed3b2e3c105db19e84c27a0774172dd Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 19 Feb 2012 10:16:16 +0000 Subject: More bug fixes and stuff. --- res/raw/ormlite_config.txt | 2 +- src/net/cbaines/suma/DataHandler.java | 12 ++++++------ src/net/cbaines/suma/MapActivity.java | 7 +++++++ src/net/cbaines/suma/POIView.java | 2 -- src/net/cbaines/suma/StopView.java | 6 +++++- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/res/raw/ormlite_config.txt b/res/raw/ormlite_config.txt index 60f9ade..2268ae9 100644 --- a/res/raw/ormlite_config.txt +++ b/res/raw/ormlite_config.txt @@ -1,3 +1,3 @@ # -# generated on 2012/02/01 07:59:58 +# generated on 2012/02/19 09:50:39 # diff --git a/src/net/cbaines/suma/DataHandler.java b/src/net/cbaines/suma/DataHandler.java index f564d19..25f66ff 100644 --- a/src/net/cbaines/suma/DataHandler.java +++ b/src/net/cbaines/suma/DataHandler.java @@ -25,8 +25,6 @@ import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -import android.util.Log; - public class DataHandler extends DefaultHandler { // this holds the data @@ -70,7 +68,8 @@ public class DataHandler extends DefaultHandler { } /** - * This gets called at the start of an element. Here we're also setting the booleans to true if it's at that specific tag. (so we know where we are) + * This gets called at the start of an element. Here we're also setting the booleans to true if it's at that + * specific tag. (so we know where we are) * * @param namespaceURI * @param localName @@ -81,7 +80,8 @@ public class DataHandler extends DefaultHandler { @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { if (localName.equals("trkpt")) { - // Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " + atts.getValue("lon")); + // Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " + + // atts.getValue("lon")); _data.addPoint(Util.csLatLongToGeoPoint(atts.getValue("lat"), atts.getValue("lon"))); } } @@ -100,8 +100,8 @@ public class DataHandler extends DefaultHandler { } /** - * Calling when we're within an element. Here we're checking to see if there is any content in the tags that we're interested in and populating it in the - * Config object. + * Calling when we're within an element. Here we're checking to see if there is any content in the tags that we're + * interested in and populating it in the Config object. * * @param ch * @param start diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java index d12057c..cad7567 100644 --- a/src/net/cbaines/suma/MapActivity.java +++ b/src/net/cbaines/suma/MapActivity.java @@ -758,6 +758,13 @@ public class MapActivity extends OrmLiteBaseActivity implements && !activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U9", UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) { Log.i(TAG, "Uni-Link bus stop overlay not needed"); + overlays.remove(UNI_LINK_BUS_STOP_OVERLAY); + + synchronized (mapView.getOverlays()) { + mapView.getOverlays().remove(uniLinkBusStopOverlay); + Collections.sort(mapView.getOverlays(), comparator); + } + uniLinkBusStopOverlay = null; } else { uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1", diff --git a/src/net/cbaines/suma/POIView.java b/src/net/cbaines/suma/POIView.java index d312f37..fb8a6c6 100644 --- a/src/net/cbaines/suma/POIView.java +++ b/src/net/cbaines/suma/POIView.java @@ -23,11 +23,9 @@ import android.content.Context; import android.util.Log; import android.view.Display; import android.view.Gravity; -import android.view.View; import android.view.WindowManager; import android.widget.LinearLayout; import android.widget.TextView; -import android.widget.TableLayout.LayoutParams; public class POIView extends LinearLayout { diff --git a/src/net/cbaines/suma/StopView.java b/src/net/cbaines/suma/StopView.java index 32cd3e1..764072e 100644 --- a/src/net/cbaines/suma/StopView.java +++ b/src/net/cbaines/suma/StopView.java @@ -24,6 +24,7 @@ import java.text.DateFormat; import android.app.Activity; import android.content.Intent; +import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; @@ -131,13 +132,16 @@ public class StopView extends LinearLayout implements OnClickListener, OnLongCli busDao.refresh(stop.bus); busRouteDao.refresh(stop.bus.route); + Log.i("StopView", "Bus route " + stop.bus.route + " Uni-Link " + stop.bus.route.uniLink + " Bus ID " + + stop.bus.id); + if (stop.bus.id != null && stop.bus.route.uniLink) { Intent i = new Intent(context, BusActivity.class); i.putExtra("busID", stop.bus.id); i.putExtra("busStopID", stop.busStop.id); ((Activity) context).startActivityForResult(i, 0); } else { - if (stop.bus.route.uniLink) { + if (!stop.bus.route.uniLink) { if (context.activityToast == null) { context.activityToast = Toast.makeText(context, "Bus schedules only avalible for Uni-Link buses", Toast.LENGTH_SHORT); -- cgit v1.2.3