diff --git a/README.md b/README.md index 39c06e0..c7cf55c 100644 --- a/README.md +++ b/README.md @@ -11,34 +11,41 @@ Written by Patrick McDonagh, Henry Pump ## Installation + 1. Clone this repository using either HTTPS: + ``` git clone http://@bitbucket.poconsole.net/scm/pocloud/tag-server.git ``` 2. Change directory to the "www" folder + ``` cd tag-server/www ``` 3. Install necessary npm packages + ``` npm install ``` 4. Install necessary bower packages + ``` bower install ``` 5. Create init.d scripts + ``` INFO HERE COMING SOON ``` 6. Test Web Server functionality + ``` sails lift ``` @@ -48,21 +55,25 @@ Written by Patrick McDonagh, Henry Pump 9. Test the Python datalogger functiality. + ``` 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. 10. Start the init.d scripts so the programs run in the background. + ``` /etc/int.d/tagserver start ``` and + ``` /etc/init.d/website start OR forever www/app.js ``` + # Database Documentation ## MySQL Tables @@ -82,7 +93,9 @@ Written by Patrick McDonagh, Henry Pump ``` ## config Table + Holds parameter/val pairs for configuration parameters + ``` +-----------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | @@ -96,7 +109,9 @@ Holds parameter/val pairs for configuration parameters ``` ## data_types Table + Holds all possible data types + ``` +-----------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | @@ -109,7 +124,9 @@ Holds all possible data types ``` ## device_types Table + Holds all possible device types + ``` +-----------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | @@ -122,9 +139,11 @@ Holds all possible device types ``` ## devices Table + Holds device configuration. *devices.device_type = device_types.dType* + ``` +-------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | @@ -138,7 +157,9 @@ Holds device configuration. ``` ## tag_classes Table + Holds all possible tag classes. All Data Logger tags are "Custom" (id=5) + ``` +-------------+------------------+------+-----+---------+----------------+ | 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 + Holds stored measurements of values of tags. *tag_vals.tagID = tags.id* + ``` +-----------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | @@ -168,6 +191,7 @@ Holds stored measurements of values of tags. ``` ## tags Table + Holds the scan-list of tags to be evaluated. *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 ### GET /device + Returns all the devices stored in the database **Returns:** + ``` [ { @@ -242,6 +268,7 @@ Returns all the devices stored in the database Returns only the information about the specific device **Returns:** + ``` [ { @@ -262,7 +289,8 @@ Returns only the information about the specific device ### POST /device Adds a new device to the database -**Parameters:*** +**Parameters:** + ``` { address: < URL of the device >, @@ -273,7 +301,8 @@ Adds a new device to the database ### UPDATE /device/ Updates a device in the database -**Parameters:*** +**Parameters:** + ``` { address: < URL of the device >, @@ -292,6 +321,7 @@ Deletes a device from the database Returns all the tags stored in the database **Returns:** + ``` [ { @@ -369,6 +399,7 @@ Returns all the tags stored in the database Returns only the information about the specified tag **Returns:** + ``` [ { @@ -412,6 +443,7 @@ Returns only the information about the specified tag Adds a new tag to the scan list **Parameters** + ``` { tag: < Tag name in PLC >, @@ -432,6 +464,7 @@ Adds a new tag to the scan list Updates a tag in the scan list **Parameters** + ``` { tag: < Tag name in PLC >, @@ -457,6 +490,7 @@ Deletes a tag in the scan list Gets all values in the database **Returns:** + ``` [ { @@ -558,6 +592,7 @@ Gets all values in the database Returns the latest stored value for all tags **Returns:** + ``` [ { diff --git a/readme.pdf b/readme.pdf new file mode 100644 index 0000000..7d78cc6 Binary files /dev/null and b/readme.pdf differ