Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update carbon calculations for GIS server (richer modes) #576

Merged
merged 28 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0ed9378
added connection config file with 0.0.0.0 instead of localhost, for d…
tms-martins May 13, 2019
f929f1b
updated trip modes and carbon data, refactored main carbon calculations
tms-martins May 27, 2019
3f79598
restored optimal and worst carbon footprint calculations
tms-martins Jun 3, 2019
315703b
a few corrections after first round of PR review, carbon calc for mod…
tms-martins Jun 11, 2019
68d66af
restored IN_VEHICLE to standardMETs
tms-martins Jun 11, 2019
d8e0a27
Add i18n for most of the app
DO3B Jun 17, 2019
a552c10
Fix issues and add consent files management
DO3B Jun 17, 2019
ff15d04
Fix #4
DO3B Jun 17, 2019
83d4a56
updatecheck i18n and minor fixes
DO3B Jun 18, 2019
29bfaf7
Add forgotten key
DO3B Jun 18, 2019
91d8d8b
Add i18n for modes and purposes
DO3B Jun 18, 2019
5b94703
Change loadAndPopulateOptions to use lang
DO3B Jun 19, 2019
f8db039
Change static formats by locale aware formats
DO3B Jun 19, 2019
07982ac
Change comment to match reality
shankari Jun 19, 2019
f03c1ff
Merge pull request #584 from fabmob/i18n-emission
shankari Jun 19, 2019
01c8f6c
added connection config file with 0.0.0.0 instead of localhost, for d…
tms-martins May 13, 2019
f0df6a0
updated trip modes and carbon data, refactored main carbon calculations
tms-martins May 27, 2019
546f083
restored optimal and worst carbon footprint calculations
tms-martins Jun 3, 2019
d9cd5e3
a few corrections after first round of PR review, carbon calc for mod…
tms-martins Jun 11, 2019
7b5aad0
restored IN_VEHICLE to standardMETs
tms-martins Jun 11, 2019
e3746e1
Always use WALKING instead of ON_FOOT; other small celan-ups
tms-martins Jun 24, 2019
dc929da
updated base (rebased on master after PR 584), added ON_FOOT to WALKI…
tms-martins Jun 24, 2019
3cc0597
Merge branch 'update_carbon_calc_for_GIS' of https://github.com/tms-m…
tms-martins Jun 24, 2019
a4737e2
Tidied up for PR/merge.
tms-martins Jul 1, 2019
30e661d
Restore the e-mission server to the CSP
shankari Jul 1, 2019
8220ddb
Fixed property names (missing quotes)
tms-martins Jul 1, 2019
fe2c575
Merge branch 'update_carbon_calc_for_GIS' of https://github.com/tms-m…
tms-martins Jul 1, 2019
c34dd15
Corrected/restored commented code
tms-martins Jul 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"nz-tour": "^1.2.1",
"jquery": "^3.1.0",
"leaflet-plugins": "^3.0.0",
"angularjs-slider": "^6.2.2"
"angularjs-slider": "^6.2.2",
"angular-translate": "^2.18.1",
"angular-translate-loader-static-files": "^2.18.1",
"angular-translate-interpolation-messageformat": "^2.18.1"
}
}
247 changes: 247 additions & 0 deletions www/i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
{
"loading" : "Loading...",
"map-refresh": "Refresh",
"map-fixmap": "Fix Map",

"weekdays-all": "All",
"weekdays-select": "Select day of the week",

"post-trip-prompt":{
"notification-option-mute": "Mute",
"notification-option-snooze": "Snooze",
"notification-option-choose": "Choose",
"notification-title": "How and why did you come here?",
"choose-mode": "Choose Mode",
"skip": "Skip",
"snoozed-reminder": "Snoozed reminder",
"snoozed-reapper-message": "Will reappear in 30 mins",
"platform-specific-message-ios": "Swipe left or tap to add information about this trip.",
"platform-specific-message-android": "See options or tap to add information about this trip.",
"platform-specific-message-other": "Tap to add information about this trip.",
"notifications-muted": "Notifications for TRIP_END incident report muted",
"notifications-reenabled": "Can be re-enabled from the Profile -> Developer Zone screen. Select to re-enable now, clear to ignore",
"muted": "Muted",
"unmute": "Unmute",
"keep-muted": "Keep muted"
},

"post-trip-map-display-tour-incident": "Zoom in as much as possible to the location where the incident occurred and click on the blue line of the trip to mark a <font size='+3'>&#x263B;</font> or <font size='+3'>&#x2639;</font> incident",

"tour-next": "Next",
"tour-previous": "Previous",
"tour-finish": "Finish",

"trip-confirm": {
"recenttrip": "Recent trip from: {{startTime}} &rarr; to: {{endTime}}",
"continue": "Continue",
"done": "Done",
"services-please-fill-in": "Please fill in the {{text}} not listed.",
"services-cancel": "Cancel",
"services-save": "Save"
},

"place-common-place": "Common place",
"place-successor-trips": "Successor trips",
"place-trips-to": "{{trips}} trips to",
"place-usually-starts": "Usually starts at: {{hour}}:00",
"place-usually-takes": "Usually takes: {{duration}}",

"trip-start-hours": "Start hours",
"trip-start-duration": "Duration",

"control":{
"profile": "Profile",
"tracking": "Tracking",
"medium-accuracy": "Medium accuracy",
"dark-theme": "Dark theme",
"force-sync": "Force sync",
"share": "Share",
"check-ui-updates": "Check for UI updates",
"download-json-dump": "Download json dump",
"email-log": "Email log",
"user-data": "User data",
"erase-data": "Erase data",
"dev-zone": "Developer zone",
"refresh": "Refresh",
"end-trip-sync": "End trip + sync",
"check-consent": "Check consent",
"invalidate-cached-docs": "Invalidate cached docs",
"nuke-all": "Nuke all buffers and cache",
"set-ui-channel": "Set UI channel",
"check-log": "Check log",
"check-sensed-data": "Check sensed data",
"check-map": "Check map",
"collection": "Collection",
"sync": "Sync",
"transition-notify": "Transition Notify"
},

"general-settings":{
"choose-date" : "Choose date to download data",
"nuke-ui-state-only" : "UI state only",
"nuke-native-cache-only" : "Native cache only",
"nuke-everything" : "Everything",
"clear-data": "Clear data",
"cancel": "Cancel",
"user-data-erased": "User data erased.",
"consent-not-found": "Consent for data collection not found, consent now?",
"no-consent-message": "OK! Note that you won't get any personalized stats until you do!",
"consent-found": "Consent found!",
"consented-to": "Consented to protocol {{protocol_id}}, {{approval_date}}",
"consented-ok": "OK",
"share-message": "Join me in making transportation greener and healthier \nDownload the emission app:",
"share-subject": "Emission - UC Berkeley Research Project",
"share-url": "https://bic2cal.eecs.berkeley.edu/#download"
},

"metrics":{
"cancel": "Cancel",
"confirm": "Confirm",
"get": "Get",
"range": "Range",
"filter": "Filter",
"from": "From:",
"to": "To:",
"last-week": "Last week",
"frequency": "Frequency:",
"pandafreqoptions-daily": "DAILY",
"pandafreqoptions-weekly": "WEEKLY",
"pandafreqoptions-biweekly": "BIWEEKLY",
"pandafreqoptions-monthly": "MONTHLY",
"pandafreqoptions-yearly": "YEARLY",
"freqoptions-daily": "DAILY",
"freqoptions-monthly": "MONTHLY",
"freqoptions-yearly": "YEARLY",
"select-pandafrequency": "Select summary freqency",
"select-frequency": "Select summary freqency",
"chart-xaxis-date": "Date",
"chart-no-data": "No Data Available",
"trips-yaxis-number": "Number",
"calorie-data-change": " change",
"carbon-data-change": " change",
"carbon-data-calculating": "Calculating...",
"carbon-data-unknown": "Unknown",
"calorie-data-unknown": "Unknown...",
"calorie-data-change-increase": " increase over a week",
"calorie-data-change-decrease": " decrease over a week",
"carbon-data-change-increase": " increase over a week",
"carbon-data-change-decrease": " decrease over a week",
"pick-a-date": "Pick a date"
},

"diary": {
"current-trip": "Current Trip",
"current-yesterday": "Yesterday",
"current-weekago": "Week ago",
"history": "History",
"began": "Began {{startTime}}",
"report-incident": "Report Incident",
"draft": "DRAFT",
"distance-in-time": "{{distance}} km in {{time}}",
"distance": "Distance",
"time": "Time",
"mode": "Mode",
"purpose": "Purpose",
"choose-mode": "Choose Mode",
"choose-purpose": "Choose Purpose",
"how-did-you-get-here": "How did you get here?",
"why-did-you-come-here": "Why did you come here?",
"list-pick-a-date": "Pick a date"
},

"user-gender": "Gender",
"gender-male": "Male",
"gender-female": "Female",
"user-height": "Height",
"user-weight": "Weight",
"user-age": "Age",

"main-metrics":{
"dashboard": "Dashboard",
"summary": "Summary",
"chart": "Chart",
"change-data": "Change data:",
"distance": "Distance",
"trips": "Trips",
"duration": "Duration",
"speed": "Speed",
"footprint": "Footprint",
"optimal": "Optimal:",
"average": "Average:",
"worst": "Worst:",
"lastweek": "Last Week:",
"calories": "Calories",
"calibrate": "Calibrate",
"no-summary-data": "No summary data",
"median-speed": "Median Speed",
"equals-cookies": "Equals {cookies, plural, =0{0 homemade chocolate chip cookies} one {1 homemade chocolate chip cookie} other {# homemade chocolate chip cookies}}",
"equals-icecream": "Equals {icecream, plural, =0{0 half cups vanilla ice cream} one {1 half cup vanilla ice cream} other {# half cups vanilla ice cream}}",
"equals-bananas": "Equals {bananas, plural, =0{0 bananas} one {1 banana} other {# bananas}}"
},

"main-diary" : "Diary",

"main-heatmap":{
"title": "Heatmap",
"counts" : "Counts",
"stress" : "Stress",
"from" : "From:",
"to" : "To:",
"get" : "Get!",
"all": "ALL",
"none": "NONE",
"bicycling": "BICYCLING",
"walking": "WALKING",
"in-vehicle": "IN_VEHICLE",
"select-travel-mode" : "Select travel mode",
"cancel": "Cancel",
"tour-datepicker": "This heatmap shows the aggregate data for all E-mission users. Select the dates you want to see, and filter by hours of the day (24h format) and days of the week. For example, if you enter 16 and 19 in the last field, and select Monday and Friday, you'll see the Heatmap filtered to show the traffic on weekdays between 4pm and 7pm.",
"tour-mode": "Click here to filter your results by mode of transportation. The default is to show all modes.",
"tour-get": "Click here to generate the heatmap."
},

"details":{
"speed": "Speed",
"time": "Temps",
"tour-detail-content": "To report an incident, zoom in as much as possible to the location where the incident occurred and click on the trip to mark a &#x263B; or &#x2639; incident",
"tour-sectionList-content": "Trip sections, along with times and modes",
"tour-sectionPct-content": "% of time spent in each mode for this trip"
},

"list-explainDraft-alert": "This trip has not yet been analysed. If it stays in this state, please ask your sysadmin to check what is wrong.",
"list-datepicker-today": "Today",
"list-datepicker-close": "Close",
"list-datepicker-set": "Set",
"list-tour-datepicker-button" : "Use this to select the day you want to see.",
"list-tour-diary-entry" : "Click on the map to see more details about each trip.",
"list-tour-map-fix-button" : "Use this to fix the map tiles if they have not loaded properly.",

"service":{
"reading-server": "Reading from server...",
"reading-cache": "Reading from cache...",
"reading-unprocessed-data": "Reading unprocessed data..."
},


"post-trip-manual-incident-time" : "Choose incident time",

"recent":{
"email-account-not-configured": "Email account is not configured, cannot send email",
"email-account-mail-app": "You must have the mail app on your phone configured with an email address. Otherwise, this won't work",
"going-to-email": "Going to email database from {{parentDir}}/userCacheDB"
},

"consent":{
"button-accept": "I accept",
"button-decline": "I refuse"
},

"updatecheck":{
"downloading-update": "Downloading UI-only update",
"extracting-update": "Extracting UI-only update",
"done": "Update done, reloading...",
"download-new-ui": "Download new UI-only update?.",
"download-not-now": "Not now",
"download-apply": "Apply"
}
}
8 changes: 7 additions & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com http://nominatim.openstreetmap.org https://e-mission.eecs.berkeley.edu https://api.ionic.io/push/tokens emission: 'unsafe-eval'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: http://*.tile.openstreetmap.org http://tile.stamen.com https://*.tile.stamen.com http://*.tile.stamen.com 'unsafe-inline'">
shankari marked this conversation as resolved.
Show resolved Hide resolved
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com http://nominatim.openstreetmap.org emission: 'unsafe-eval'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: http://*.tile.openstreetmap.org http://tile.stamen.com https://*.tile.stamen.com http://*.tile.stamen.com 'unsafe-inline'">
<title></title>

<link href="lib/ionic/css/ionic.css" rel="stylesheet">
Expand All @@ -30,7 +30,13 @@
<script src="lib/jquery/dist/jquery.min.js"></script>
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic-toast/dist/ionic-toast.bundle.min.js"></script>
<script src="lib/angular-translate/angular-translate.min.js"></script>
<script src="lib/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js"></script>
<script src="lib/messageformat/messageformat.min.js"></script>
<script src="lib/angular-translate-interpolation-messageformat/angular-translate-interpolation-messageformat.min.js"></script>
<script src="lib/moment/min/moment.min.js"></script>
<script src="lib/moment/min/locales.min.js"></script>
<script src="lib/moment/min/moment-with-locales.min.js"></script>
<script src="lib/moment-timezone/builds/moment-timezone-with-data.min.js"></script>
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="lib/angular-animate/angular-animate.js"></script>
Expand Down
23 changes: 21 additions & 2 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ angular.module('emission', ['ionic',
'emission.controllers','emission.services', 'emission.plugin.logger',
'emission.splash.customURLScheme', 'emission.splash.referral',
'emission.splash.updatecheck',
'emission.intro', 'emission.main'])
'emission.intro', 'emission.main',
'pascalprecht.translate'])

.run(function($ionicPlatform, $rootScope, $http, Logger,
CustomURLScheme, ReferralHandler, UpdateCheck) {
Expand Down Expand Up @@ -70,7 +71,7 @@ angular.module('emission', ['ionic',
console.log("Ending run");
})

.config(function($stateProvider, $urlRouterProvider) {
.config(function($stateProvider, $urlRouterProvider, $translateProvider) {
console.log("Starting config");
// alert("config");

Expand Down Expand Up @@ -102,5 +103,23 @@ angular.module('emission', ['ionic',
// alert("about to fall back to otherwise");
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/splash');

// Allow the use of MessageForm interpolation for Gender and Plural.
$translateProvider.addInterpolation('$translateMessageFormatInterpolation');

// Define where we can find the .json and the fallback language
$translateProvider
.fallbackLanguage('en')
.registerAvailableLanguageKeys(['en', 'fr'], {
'en_*': 'en',
'fr_*': 'fr',
'*': 'en'
})
.determinePreferredLanguage()
.useStaticFilesLoader({
prefix: 'i18n/',
suffix: '.json'
});

console.log("Ending config");
});
Loading