Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Updated README with information about the type of data which should b…
Browse files Browse the repository at this point in the history
…e sent to the compass widget
  • Loading branch information
nigelmilham committed Dec 15, 2020
1 parent 9b1c93b commit 6190e96
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cumulocity IoT Compass widget[<img width="35" src="https://user-images.githubusercontent.com/67993842/97668428-f360cc80-1aa7-11eb-8801-da578bda4334.png"/>](https://github.com/SoftwareAG/cumulocity-compass-widget/releases/download/1.0.0/compass-widget.zip)
# Cumulocity IoT Compass widget[<img width="35" src="https://user-images.githubusercontent.com/67993842/97668428-f360cc80-1aa7-11eb-8801-da578bda4334.png"/>](https://github.com/SoftwareAG/cumulocity-compass-widget/releases/download/1.0.1/compass-widget_v1.0.1.zip)

![Compasswidget](compass-widget.png)

Expand All @@ -10,7 +10,7 @@

### Runtime Widget Deployment?

* This widget supports runtime deployment. Download the [Runtime Binary](https://github.com/SoftwareAG/cumulocity-compass-widget/releases/download/1.0.0/compass-widget.zip) and follow runtime deployment instructions from [here](https://github.com/SoftwareAG/cumulocity-runtime-widget-loader).
* This widget supports runtime deployment. Download the [Runtime Binary](https://github.com/SoftwareAG/cumulocity-compass-widget/releases/download/1.0.1/compass-widget_v1.0.1.zip) and follow runtime deployment instructions from [here](https://github.com/SoftwareAG/cumulocity-runtime-widget-loader).


## Quickstart
Expand All @@ -30,8 +30,40 @@ NOTE: This guide assumes that you have followed the [installation](https://githu
2. Select the device measurement and fragment in the `Measurement` dropdown
3. Click `Save`

The compass widget will refresh each time a new measurement value is sent for the device.

The compass widget will refresh each time a new measurement value is sent from the device.

### Sending data to the Compass widget
The compass widget will listen for the measurement and fragment which you have specified in the configuration options above

The compass arrow will move to the numeric measurement value which must be between 0 and 360 to represent the arrow rotation in degrees.

In the 'body' of your Cumulocity measurement, you will need to include the following:

{
measurementseries: The measurement series which has been selected in the compass widget e.g. "weather_station"
{
measureementfragment: The measurement fragment which has been selected in the compass widget e.g. "wind_direction"
{
value: numeric value from 0 to 360 to represent the rotation of the compass arrow e.g. 270
unit: the unit label e.g. "degrees"
}
.
.
}

e.g.

{
weather_station: {
wind_direction: {
value: 270,
unit: "degrees"
}
}
.
.
}
### Development - to enhance and test this widget in your local environment
1. Clone the repository on your local machine using `git clone https://github.com/SoftwareAG/cumulocity-compass-widget.git`.
2. Run `npm install` to download the module dependencies.
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const bundle = series(
return src('./dist/widget/**/*')
// Filter out the webpackRuntime chunk, we only need the widget code chunks
.pipe(filter(file => !/^[a-f0-9]{20}\.js(\.map)?$/.test(file.relative)))
.pipe(zip('compass-widget.zip'))
.pipe(zip('compass-widget_v1.0.1.zip'))
.pipe(dest('dist/'))
}
)
Expand All @@ -49,7 +49,7 @@ exports.build = compile;
exports.bundle = bundle;
exports.default = series(clean, compile, bundle, async function success() {
console.log("Build Finished Successfully!");
console.log("Runtime Widget Output (Install in the browser): dist/compass-widget.zip");
console.log("Runtime Widget Output (Install in the browser): dist/compass-widget_v1.0.1.zip");
const pkgJson = require('./dist/widget-library/package.json');
console.log(`Widget Angular Library (Install with: "npm i <filename.tgz>"): dist/${pkgJson.name}-${pkgJson.version}.tgz`);
});
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dist\\bundle-src\\custom-widget.js": "compass-widget-CustomWidget",
"dist/bundle-src/custom-widget.js": "compass-widget-CustomWidget"
},
"version": "1.0.0",
"version": "1.0.1",
"description": "Displays an animated compass direction based on the measurement data provided (written by Software AG Global Presales)",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 6190e96

Please sign in to comment.