Skip to content

Commit 269df9a

Browse files
committed
Copmpleted prog doc
1 parent 1928716 commit 269df9a

File tree

4 files changed

+85
-7
lines changed

4 files changed

+85
-7
lines changed

POPSensor.ph

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public:
4545
void Broadcast(int x_publicationType, double x_data);
4646
void Broadcast(int x_publicationType, const std::string& x_data);
4747

48+
// TODO: Reduce
49+
4850

4951
/// Clear data gathered
5052
void Clear();
@@ -65,7 +67,7 @@ public:
6567
bool IsConnected();
6668

6769
// Size of collected data
68-
sync conc int GetSize();
70+
sync conc int GetSize(); // TODO rename to GetDataSize
6971

7072

7173
private:

PROGRAMMING.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
Programming manual
2+
==================
13

24
Examples of programmation
35
-------------------------
46

57
TODO: Write a manual
68

9+
POPSensor.ph
10+
POPSensorData.h
11+
712
### main_example.cpp
813
This file contains the a simple example on how to uses the different classes of the POPWin project. The main code of this examples is:
914

@@ -43,3 +48,46 @@ To compile and run this example use:
4348
make
4449
popcrun objects.map ./main resources.json
4550

51+
Main parallel classes
52+
---------------------
53+
This chapter describes in more details the main classes used in this project.
54+
55+
### POPSensor parallel class
56+
POPSensor is the primary class to use in a POPWin application. It allows the user to access the remote sensors. Its main methods are:
57+
58+
- **Constructor**: specifies the name of the JSON file that describes resources and start acquiring data from the remote sensors.
59+
- **Gather** : returns the data that was gathered in the form of a POPSensorData object.
60+
- **Broadcast** : broadcast one message to all sensors
61+
62+
[Full definition](POPSensor.ph).
63+
64+
### SensorProxy parallel class
65+
One POPSensor object can connect to one or many POPSensor class. This second class handles the communication with the gateway sensor. The POPSensor object will create one POPSensor for each gateway sensor connected on USB. This is transparent to the programmer so this class should not be used directly.
66+
67+
[Full definition](SensorProxy.ph).
68+
69+
### POPSensorData class
70+
A POPSensorData object is returned by the Gather() method. It contains all the data collected by the sensors including:
71+
72+
- Sensor id
73+
- Time stamp
74+
- Measurement type
75+
- Measurement unit
76+
77+
Additionally this class provides the mothods:
78+
79+
- **Print** : Prints the data to the standard output
80+
- **PrintToFile** : Outputs the data to a file in .csv format
81+
- **Clear** : Clears the data
82+
- **GetSize** : Returns the number of records
83+
- **Insert**: Insert new data into the structure
84+
- **Reduce**: Compute and returns statistics on the data (size, min, max, aver, sum, stdev)
85+
86+
[Full definition](POPSensorData.h).
87+
88+
89+
Limitations
90+
-----------
91+
Broadcast of messages TODO
92+
Different firmwares for sensors
93+

README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ POPWin
55

66
This document contains a general description of the POPWin project, specifications and examples of programmation.
77

8-
1. For a more technical documentation (installation, troubleshooting, ...) the developer documentation can be found here [here](INSTALL.md).
9-
2. The full programming guide for POPWin can be found [here](PROGRAMMING.md).
10-
3. Specifications of resource description and messaging can be found [here](SPECIFICATIONS.md).
11-
128
Contacts
139
--------
1410
- EIFR
@@ -45,8 +41,40 @@ As explained in the documentation of the POPWin project the communication uses d
4541
- **High level**: the POP model is used
4642
- **Low level**: the publish/subscribe model is used
4743

48-
A more complete scheme of the network can be found [here](POPWINarchi.pdf) !
44+
A more complete scheme of the network:
45+
46+
![POPWin architecture](POPWINarchi.pdf "POPWin architecture") !
47+
48+
Resource description and messaging system
49+
-----------------------------------------
50+
To configure easily where sensors (described as resources) can be found the application uses a resource file in JSON format. This file indicates how to connect to sensors and to which data the user wants to subscribe.
51+
52+
To set up communication between the different sensors of the low-level part and the nodes of the high-level parts of the system a messaging interface was developed. This interface allows to easily transcribe message from the publish-subscribe used in the low-level system to the POP model used on the higher level.
53+
54+
Specifications of resource description and messaging can be found [here](SPECIFICATIONS.md).
55+
56+
57+
Programming
58+
-----------
59+
One goal of the POPWin project is to provide an easy programming interface to the developer. This interface allows to acquire data from different sensor types in a transparent way.
60+
61+
The full programming guide for POPWin can be found [here](PROGRAMMING.md).
62+
63+
### Example
64+
65+
66+
67+
Quick start
68+
-----------
69+
To start the main example of POPWin:
4970

71+
1. Install POP-C++ on your computer
72+
2. Connect the gateway sensor to your computer via USB (Zolertia z1 in recommended)
73+
3. Compile and launch POPWin main application
5074

75+
cd pop-win
76+
make
77+
popcrun objects.map ./main resources.json
5178

79+
For details on installation and troubleshooting please look at the [development documentation](INSTALL.md).
5280

main_example.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int main(int argc, char** argv)
6868
sleep(3);
6969

7070
cout<<"\nPrint the gathered data to screen"<<popcendl;
71-
POPSensorData data(popSensor.Gather());
71+
POPSensorData data = popSensor.Gather();
7272
data.Print();
7373

7474
cout<<"\nTemperature average is "<<data.Reduce<double>(MSR_TEMPERATURE, POPSensorData::POPReduceF::aver)<< popcendl;

0 commit comments

Comments
 (0)