Skip to content

Commit

Permalink
Merge pull request #374 from nightscout/release/0.6.1
Browse files Browse the repository at this point in the history
Dreamsicle (Release 0.6.1)
  • Loading branch information
jasoncalabrese committed Jan 28, 2015
2 parents 649ecba + a8098b1 commit 3ff1755
Show file tree
Hide file tree
Showing 12 changed files with 281 additions and 131 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ static/bower_components/
.DS_Store

.vagrant
/iisnode
/iisnode

# istanbul output
coverage/
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ language: node_js
node_js:
- "0.10"
- "0.11"
matrix:
allow_failures:
- node_js: "0.11"
services:
- mongodb
before_script:
- sleep 10
- echo mongo mongo_travis
script:
- make test
- make travis
80 changes: 80 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

# Contributing to cgm-remote-monitor

[![Build Status][build-img]][build-url]
[![Dependency Status][dependency-img]][dependency-url]
[![Coverage Status][coverage-img]][coverage-url]
[![Gitter chat][gitter-img]][gitter-url]
[![Stories in Ready][ready-img]][waffle]
[![Stories in Progress][progress-img]][waffle]

[build-img]: https://img.shields.io/travis/nightscout/cgm-remote-monitor.svg
[build-url]: https://travis-ci.org/nightscout/cgm-remote-monitor
[dependency-img]: https://img.shields.io/david/nightscout/cgm-remote-monitor.svg
[dependency-url]: https://david-dm.org/nightscout/cgm-remote-monitor
[coverage-img]: https://img.shields.io/coveralls/nightscout/cgm-remote-monitor/coverage.svg
[coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=dev
[gitter-img]: https://img.shields.io/badge/Gitter-Join%20Chat%20%E2%86%92-1dce73.svg
[gitter-url]: https://gitter.im/nightscout/public
[ready-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=ready&title=Ready
[waffle]: https://waffle.io/nightscout/cgm-remote-monitor
[progress-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=in+progress&title=In+Progress


## Design

Participate in the design process by creating an issue to discuss your
design.

## Develop on `dev`

We develop on the `dev` branch.
You can get the dev branch checked out using `git checkout dev`.

## Create a prototype

Fork cgm-remote-monitor and create a branch.
You can create a branch using `git checkout -b wip/add-my-widget`.
This creates a new branch called `wip/add-my-widget`. The `wip`
stands for work in progress and is a common prefix so that when know
what to expect when reviewing many branches.

## Submit a pull request

When you are done working with your prototype, it can be tempting to
post on popular channels such as Facebook. We encourage contributors
to submit their code for review, debate, and release before announcing
features on social media.

This can be done by checking your code `git commit -avm 'my
improvements are here'`, the branch you created back to your own
fork. This will probably look something like
`git push -u origin wip/add-my-widget`.

Now that the commits are available on github, you can click on the
compare buttons on your fork to create a pull request. Make sure to
select [Nightscout's `dev` branch](https://github.com/nightscout/cgm-remote-monitor/tree/dev).

## Comments and issues

We encourage liberal use of the comments, including images where
appropriate.

## Co-ordination

There is a google groups nightscout-core developers list where lots of
people discuss Nightscout. Most cgm-remote-monitor hackers use
github's ticketing system, along with Facebook cgm-in-the-cloud, and
gitter system.

We use git-flow, with `master` as our production, stable branch, and
`dev` is used to queue up for upcoming releases. Everything else is
done on branches, hopefully with names that indicate what to expect.

Once `dev` has been reviewed and people feel it's time to release, we
follow the git-flow release process, which creates a new tag and bumps
the version correctly. See sem-ver for versioning strategy.

Every commit is tested by travis. We encourage adding tests to
validate your design. We encourage discussing your use cases to help
everyone get a better understanding of your design.
27 changes: 9 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,23 @@ TESTS=tests/*.js
MONGO_CONNECTION?=mongodb://localhost/test_db
CUSTOMCONNSTR_mongo_settings_collection?=test_settings
CUSTOMCONNSTR_mongo_collection?=test_sgvs

BLANKET=--require blanket
MONGO_SETTINGS=MONGO_CONNECTION=${MONGO_CONNECTION} \
CUSTOMCONNSTR_mongo_collection=${CUSTOMCONNSTR_mongo_collection} \
CUSTOMCONNSTR_mongo_settings_collection=${CUSTOMCONNSTR_mongo_settings_collection}

all: test

travis-cov:
NODE_ENV=test node_modules/.bin/mocha ${BLANKET} -R 'travis-cov' ${TESTS}

coveralls:
NODE_ENV=test \
./node_modules/.bin/mocha ${BLANKET} -R mocha-lcov-reporter \
${TESTS} | ./coverall.sh

coverhtml:
./node_modules/.bin/mocha ${BLANKET} -R html-cov ${TESTS} > tests/coverage.html
${MONGO_SETTINGS} \
istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -vvv -R tap ${TESTS} && \
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && \
rm -rf ./coverage

test:
MONGO_CONNECTION=${MONGO_CONNECTION} \
CUSTOMCONNSTR_mongo_collection=${CUSTOMCONNSTR_mongo_collection} \
CUSTOMCONNSTR_mongo_settings_collection=${CUSTOMCONNSTR_mongo_settings_collection} \
${MONGO_SETTINGS} \
mocha --verbose -vvv -R tap ${TESTS}

precover:
./node_modules/.bin/mocha ${BLANKET} ${SHOULD} -R html-cov ${TESTS} | w3m -T text/html


travis: test travis-cov coveralls coverhtml
travis: test travis-cov

.PHONY: test
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
cgm-remote-monitor (a.k.a. Nightscout)
======================================

[![Build Status](https://travis-ci.org/nightscout/cgm-remote-monitor.png)](https://travis-ci.org/nightscout/cgm-remote-monitor)
[![Dependency Status](https://david-dm.org/nightscout/cgm-remote-monitor.png)](https://david-dm.org/nightscout/cgm-remote-monitor)
[![Gitter chat](https://badges.gitter.im/nightscout.png)](https://gitter.im/nightscout/public)
[![Stories in Ready](https://badge.waffle.io/nightscout/cgm-remote-monitor.png?label=ready&title=Ready)](https://waffle.io/nightscout/cgm-remote-monitor)
[![Stories in Progress](https://badge.waffle.io/nightscout/cgm-remote-monitor.png?label=in+progress&title=In+Progress)](https://waffle.io/nightscout/cgm-remote-monitor)
[![Build Status][build-img]][build-url]
[![Dependency Status][dependency-img]][dependency-url]
[![Coverage Status][coverage-img]][coverage-url]
[![Gitter chat][gitter-img]][gitter-url]
[![Stories in Ready][ready-img]][waffle]
[![Stories in Progress][progress-img]][waffle]

[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
[![Deploy to Heroku][heroku-img]][heroku-url]

This acts as a web-based CGM (Continuous Glucose Monitor) to allow
multiple caregivers to remotely view a patient's glucose data in
Expand All @@ -19,7 +20,22 @@ autoregressive second order model. Alarms are generated for high and
low values, which can be cleared by any watcher of the data.

Community maintained fork of the
[original cgm-remote-monitor](https://github.com/rnpenguin/cgm-remote-monitor).
[original cgm-remote-monitor][original].

[build-img]: https://img.shields.io/travis/nightscout/cgm-remote-monitor.svg
[build-url]: https://travis-ci.org/nightscout/cgm-remote-monitor
[dependency-img]: https://img.shields.io/david/nightscout/cgm-remote-monitor.svg
[dependency-url]: https://david-dm.org/nightscout/cgm-remote-monitor
[coverage-img]: https://img.shields.io/coveralls/nightscout/cgm-remote-monitor/coverage.svg
[coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=coverage
[gitter-img]: https://img.shields.io/badge/Gitter-Join%20Chat%20%E2%86%92-1dce73.svg
[gitter-url]: https://gitter.im/nightscout/public
[ready-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=ready&title=Ready
[waffle]: https://waffle.io/nightscout/cgm-remote-monitor
[progress-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=in+progress&title=In+Progress
[heroku-img]: https://www.herokucdn.com/deploy/button.png
[heroku-url]: https://heroku.com/deploy
[original]: https://github.com/rnpenguin/cgm-remote-monitor

Install
---------------
Expand Down
35 changes: 30 additions & 5 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,52 @@
"repository": "https://github.com/nightscout/cgm-remote-monitor",
"env": {
"MONGO_COLLECTION": {
"description": "The mongo collection for CGM data. Most users should leave this as default.",
"description": "REQUIRED: The mongo collection used for CGM data. Default value is 'entries'. Most users should use the default.",
"value": "entries",
"required": true
},
"API_SECRET": {
"description": "User generated password required for REST API and other features (12 character minimum).",
"description": "REQUIRED: User generated password used for REST API and optional features (12 character minimum).",
"value": "",
"required": true
},
"ENABLE": {
"description": "Space delimited list of optional features to enable. Leave blank for a default site.",
"description": "Space delimited list of optional features to enable, such as 'careportal'.",
"value": "",
"required": false
},
"ALARM_TYPES": {
"description": "Nightscout alarm behavior control. Default null value implies 'predict'. For adjustable alarm thresholds (set below), set to 'simple'.",
"value": "",
"required": false
},
"BG_HIGH": {
"description": "Urgent high BG alarm. Default null value implies 260. Must be set in mg/dL. Only used with simple alarms.",
"value": "",
"required": false
},
"BG_TARGET_TOP": {
"description": "Non-urgent high BG alarm, the top of your target range. Default null value implies 180. Must be set in mg/dL. Only used with simple alarms.",
"value": "",
"required": false
},
"BG_TARGET_BOTTOM": {
"description": "Non urgent low BG alarm, the bottom of your target range. Default null value implies 80. Must be set in mg/dL. Only used with simple alarms.",
"value": "",
"required": false
},
"BG_LOW": {
"description": "Urgent Low BG alarm. Default null value implies 55. Must be set in mg/dL. Only used with simple alarms.",
"value": "",
"required": false
},
"PUSHOVER_API_TOKEN": {
"description": "Pushover API token, required for Pushover notifications. Leave blank for a default site.",
"description": "Pushover API token, required for Pushover notifications. Leave blank if not using Pushover.",
"value": "",
"required": false
},
"PUSHOVER_USER_KEY": {
"description": "Pushover user key, required for Pushover notifications. Leave blank for a default site.",
"description": "Pushover user key, required for Pushover notifications. Leave blank if not using Pushover.",
"value": "",
"required": false
}
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nightscout",
"version": "0.6.0",
"version": "0.6.1",
"dependencies": {
"angularjs": "1.3.0-beta.19",
"bootstrap": "~3.2.0",
Expand Down
4 changes: 2 additions & 2 deletions lib/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ var dir2Char = {
function emitData ( ) {
console.log('running emitData', now, patientData && patientData.length);
if (patientData.length > 0) {
io.sockets.emit("now", now);
io.sockets.emit("sgv", patientData);
}
}
Expand All @@ -62,7 +61,6 @@ var dir2Char = {

function listeners ( ) {
io.sockets.on('connection', function (socket) {
io.sockets.emit("now", now);
io.sockets.emit("sgv", patientData);
io.sockets.emit("clients", ++watchers);
socket.on('ack', function(alarmType, silenceTime) {
Expand Down Expand Up @@ -312,6 +310,7 @@ function loadData() {
}
}
}

function is_different (actual, predicted, mbg, treatment, errorCode) {
if (patientData && patientData.length < 3) {
return true;
Expand All @@ -333,6 +332,7 @@ function loadData() {

// textual diff of objects
if (JSON.stringify(old) == JSON.stringify(last)) {
console.info("data isn't different, will not send to clients");
return false;
}
return true;
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Nightscout",
"version": "0.6.0",
"version": "0.6.1",
"description": "Nightscout acts as a web-based CGM (Continuous Glucose Montinor) to allow multiple caregivers to remotely view a patients glucose data in realtime.",
"license": "AGPL3",
"author": "Nightscout Team",
Expand Down Expand Up @@ -29,7 +29,7 @@
"postinstall": "node node_modules/bower/bin/bower install"
},
"engines": {
"node": ">=0.10 <0.12"
"node": "~0.10.0"
},
"dependencies": {
"body-parser": "^1.4.3",
Expand All @@ -46,8 +46,10 @@
"git-rev": "git://github.com/bewest/git-rev.git"
},
"devDependencies": {
"supertest": "~0.13.0",
"coveralls": "~2.11.2",
"istanbul": "~0.3.5",
"mocha": "~1.20.1",
"should": "~4.0.4",
"mocha": "~1.20.1"
"supertest": "~0.13.0"
}
}
11 changes: 6 additions & 5 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<link rel="apple-touch-icon" href="/images/logomobile.png">
<title>Nightscout</title>
<link href="/images/round1.png" rel="icon" id="favicon" type="image/png" />
<link rel="stylesheet" type="text/css" href="/css/main.css?v=0.6.0" />
<link rel="stylesheet" type="text/css" href="/css/main.css?v=0.6.1" />
<link rel="stylesheet" type="text/css" href="/css/dropdown.css" />
<link rel="stylesheet" type="text/css" href="/css/drawer.css?v=0.6.0" />
<link rel="stylesheet" type="text/css" href="/css/drawer.css?v=0.6.1" />
<link rel="stylesheet" type="text/css" href="/bower_components/tipsy-jmalonzo/src/stylesheets/tipsy.css" />
</head>
<body>
Expand Down Expand Up @@ -75,7 +75,7 @@ <h1 class="customTitle">Nightscout</h1>
<dd><input type="radio" name="timeformat-browser" id="24-browser" value="24" /><label for="24-browser">24 hours</label></dd>
</dl>
<dl class="toggle">
<dt>Enable Alarms <a class="tip" original-title="When enabled the an alarm will sound."><i class="icon-help-circled"></i></a></dt>
<dt>Enable Alarms <a class="tip" original-title="When enabled the an alarm may sound."><i class="icon-help-circled"></i></a></dt>
<dd><input type="checkbox" id="alarm-urgenthigh-browser" /><label for="alarm-urgenthigh-browser">Urgent High Alarm</label></dd>
<dd><input type="checkbox" id="alarm-high-browser" /><label for="alarm-high-browser">High Alarm</label></dd>
<dd><input type="checkbox" id="alarm-low-browser" /><label for="alarm-low-browser">Low Alarm</label></dd>
Expand Down Expand Up @@ -213,14 +213,15 @@ <h1 class="customTitle">Nightscout</h1>
<audio src="/audio/alarm.mp3" preload="auto" loop="true" class="alarm mp3" type="audio/mp3"></audio>
<audio src="/audio/alarm2.mp3" preload="auto" loop="true" class="urgent alarm2 mp3" type="audio/mp3"></audio>
</div>

<script src="/socket.io/socket.io.js"></script>
<script src="/api/v1/status.js"></script>
<script src="/bower_components/d3/d3.min.js"></script>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/jQuery-Storage-API/jquery.storageapi.min.js"></script>
<script src="/bower_components/tipsy-jmalonzo/src/javascripts/jquery.tipsy.js"></script>
<script src="/js/ui-utils.js?v=0.6.0"></script>
<script src="/js/client.js?v=0.6.0"></script>
<script src="/js/ui-utils.js?v=0.6.1"></script>
<script src="/js/client.js?v=0.6.1"></script>
<script src="/js/experiments.js"></script>
</body>
</html>
Loading

0 comments on commit 3ff1755

Please sign in to comment.