Revert "Revert "Formatting changes after already merging""

This reverts commit c2f1ce8369.
This commit is contained in:
Patrick McDonagh
2016-05-03 11:18:34 -05:00
parent c2f1ce8369
commit 606bebbccc
2 changed files with 37 additions and 2 deletions

View File

@@ -11,34 +11,41 @@ Written by Patrick McDonagh, Henry Pump
## Installation ## Installation
1. Clone this repository using either HTTPS: 1. Clone this repository using either HTTPS:
``` ```
git clone http://<USERNAME>@bitbucket.poconsole.net/scm/pocloud/tag-server.git git clone http://<USERNAME>@bitbucket.poconsole.net/scm/pocloud/tag-server.git
``` ```
2. Change directory to the "www" folder 2. Change directory to the "www" folder
``` ```
cd tag-server/www cd tag-server/www
``` ```
3. Install necessary npm packages 3. Install necessary npm packages
``` ```
npm install npm install
``` ```
4. Install necessary bower packages 4. Install necessary bower packages
``` ```
bower install bower install
``` ```
5. Create init.d scripts 5. Create init.d scripts
``` ```
INFO HERE COMING SOON INFO HERE COMING SOON
``` ```
6. Test Web Server functionality 6. Test Web Server functionality
``` ```
sails lift sails lift
``` ```
@@ -48,21 +55,25 @@ Written by Patrick McDonagh, Henry Pump
9. Test the Python datalogger functiality. 9. Test the Python datalogger functiality.
``` ```
python python/tagserver.py python python/tagserver.py
``` ```
The program should return messages saying it has stored values. If errors occur, check the PLC ip address. If errors persist, contact Henry Pump. The program should return messages saying it has stored values. If errors occur, check the PLC ip address. If errors persist, contact Henry Pump.
10. Start the init.d scripts so the programs run in the background. 10. Start the init.d scripts so the programs run in the background.
``` ```
/etc/int.d/tagserver start /etc/int.d/tagserver start
``` ```
and and
``` ```
/etc/init.d/website start /etc/init.d/website start
OR OR
forever www/app.js forever www/app.js
``` ```
# Database Documentation # Database Documentation
## MySQL Tables ## MySQL Tables
@@ -82,7 +93,9 @@ Written by Patrick McDonagh, Henry Pump
``` ```
## config Table ## config Table
Holds parameter/val pairs for configuration parameters Holds parameter/val pairs for configuration parameters
``` ```
+-----------+------------------+------+-----+---------+----------------+ +-----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
@@ -96,7 +109,9 @@ Holds parameter/val pairs for configuration parameters
``` ```
## data_types Table ## data_types Table
Holds all possible data types Holds all possible data types
``` ```
+-----------+------------------+------+-----+---------+----------------+ +-----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
@@ -109,7 +124,9 @@ Holds all possible data types
``` ```
## device_types Table ## device_types Table
Holds all possible device types Holds all possible device types
``` ```
+-----------+------------------+------+-----+---------+----------------+ +-----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
@@ -122,9 +139,11 @@ Holds all possible device types
``` ```
## devices Table ## devices Table
Holds device configuration. Holds device configuration.
*devices.device_type = device_types.dType* *devices.device_type = device_types.dType*
``` ```
+-------------+------------------+------+-----+---------+----------------+ +-------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
@@ -138,7 +157,9 @@ Holds device configuration.
``` ```
## tag_classes Table ## tag_classes Table
Holds all possible tag classes. All Data Logger tags are "Custom" (id=5) Holds all possible tag classes. All Data Logger tags are "Custom" (id=5)
``` ```
+-------------+------------------+------+-----+---------+----------------+ +-------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
@@ -152,9 +173,11 @@ Holds all possible tag classes. All Data Logger tags are "Custom" (id=5)
``` ```
## tag_vals Table ## tag_vals Table
Holds stored measurements of values of tags. Holds stored measurements of values of tags.
*tag_vals.tagID = tags.id* *tag_vals.tagID = tags.id*
``` ```
+-----------+------------------+------+-----+---------+----------------+ +-----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
@@ -168,6 +191,7 @@ Holds stored measurements of values of tags.
``` ```
## tags Table ## tags Table
Holds the scan-list of tags to be evaluated. Holds the scan-list of tags to be evaluated.
*tag.tag_class = tag_classes.id* *tag.tag_class = tag_classes.id*
@@ -206,9 +230,11 @@ The web API provides a REST-ful API to access the tags and values stored in the
## Devices ## Devices
### GET /device ### GET /device
Returns all the devices stored in the database Returns all the devices stored in the database
**Returns:** **Returns:**
``` ```
[ [
{ {
@@ -242,6 +268,7 @@ Returns all the devices stored in the database
Returns only the information about the specific device Returns only the information about the specific device
**Returns:** **Returns:**
``` ```
[ [
{ {
@@ -262,7 +289,8 @@ Returns only the information about the specific device
### POST /device ### POST /device
Adds a new device to the database Adds a new device to the database
**Parameters:*** **Parameters:**
``` ```
{ {
address: < URL of the device >, address: < URL of the device >,
@@ -273,7 +301,8 @@ Adds a new device to the database
### UPDATE /device/<id> ### UPDATE /device/<id>
Updates a device in the database Updates a device in the database
**Parameters:*** **Parameters:**
``` ```
{ {
address: < URL of the device >, address: < URL of the device >,
@@ -292,6 +321,7 @@ Deletes a device from the database
Returns all the tags stored in the database Returns all the tags stored in the database
**Returns:** **Returns:**
``` ```
[ [
{ {
@@ -369,6 +399,7 @@ Returns all the tags stored in the database
Returns only the information about the specified tag Returns only the information about the specified tag
**Returns:** **Returns:**
``` ```
[ [
{ {
@@ -412,6 +443,7 @@ Returns only the information about the specified tag
Adds a new tag to the scan list Adds a new tag to the scan list
**Parameters** **Parameters**
``` ```
{ {
tag: < Tag name in PLC >, tag: < Tag name in PLC >,
@@ -432,6 +464,7 @@ Adds a new tag to the scan list
Updates a tag in the scan list Updates a tag in the scan list
**Parameters** **Parameters**
``` ```
{ {
tag: < Tag name in PLC >, tag: < Tag name in PLC >,
@@ -457,6 +490,7 @@ Deletes a tag in the scan list
Gets all values in the database Gets all values in the database
**Returns:** **Returns:**
``` ```
[ [
{ {
@@ -558,6 +592,7 @@ Gets all values in the database
Returns the latest stored value for all tags Returns the latest stored value for all tags
**Returns:** **Returns:**
``` ```
[ [
{ {

BIN
readme.pdf Normal file

Binary file not shown.