Report
Report
Abstract— It shall complete three tasks for this Task 3: Facilitating the transmission of valid
project. Making a CSV file with the data will be dust data obtained from Task 2.2 using a
the first task. based on the location and the data specified communication protocol. This
generated in job 1. Task 2 will accept a CSV file protocol defines the structure and format of data
as input.Task 2 will generate four CSV files by packets that are to be sent and received,
processing and calculating data. In task 3, the ensuring reliable and standardized
data will come from the Dat file into the CSV communication between systems. The
file, or task 2.1's CSV file as will be used, implementation will involve reading dust data
converted to hex code, and saved in the Dat file. from a file, converting each data entry into a
structured data packet, and writing these packets
I. INTRODUCTION to an output file.
This project is making in Window operating II. DETAIL DESIGN OF THE PROGRAME
system, coding on Vscode and compile by using
gcc or g++ in MinGW-w64 has a goal of Beginning of this part all the C/C++ library that
designing a program to simulate PM2.5 dust included in this project will be summarize as
sensors which measure the concentration of dust below:
particles with the size < 2.5 microns in ambient For Task 1, 2 and 3:
air. The programe is written in C/C++ and #include <iostream>: Using to provide input
and output operations.
𝜇𝑔/𝑚3 with resolution is 0.1), store it in CSV
generate random dust value (range 1 ÷ 800
#include <vector> : Using to provide abilities to
file called “dust_sensor.csv” with multipe use function and class using the data structure
sensors with a specific time interval as a “vector”.
requirement in Task 1. The analysis part of the #include <string>: Using to provide functions
belong to Task 2 and 3 of the project to for manipulating strings.
processes data file, based on the csv file was
generated in Task 1 to filter out outliers dust #include <fstream>: Using to provide ability to
value, summarizing valid data and calculate work with file such as “ ifstream, ofstream”.
maximum minimum and average dust value of #include <sstream>: Using to provide string
the valid data. All the data will be store stream classes as: “stringstream” for easier work
respectively in different CSV files such as: with string.
“dust_outlier.csv, dust_valid.csv, dust_aqi.csv #include <bits/stdc++.h>: Includes almost all
and dust_summary.csv”, in the other hand, task standard libraries for convenience (mainly for
2.4 require to calculate total number of hours for competitive programming).
each pollution level at each sensor and generate
it in “dust_statistics.csv”.
1
HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY
For task 1:
In conclude of this part, the all the project file will
be stored in a folder as bellow: Input:
o Command line
Output:
o A CSV file name
“dust_sensor.csv”
Pre – conditions:
o The program should be work
with correct command line
arguments.
Figure 1: Folder design o The file must have the proper
name and writable
Post – condition:
2
HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY
B. Task 2
Output:File“dust_outlier.csv”,
“dust_valid.csv”, “dust_dust_summary.csv”,
“dust_statistics.csv”
Pre – conditions:
o The input file “dust_sensor.csv”
must exist and readable.
o The output file “dust_valid.csv”,
“dust_outlier.csv”, Figure 3: Overall Flowchart of task 2
“dust_summary.csv”, “dust_aqi.csv"
and “dust_statistics.csv” must be For task 2.1: it’s will generate 2 files as
created and writable. “dust_valid.csv” and “dust_outlier.csv”. For valid
part, all the dust value data, which was generate
randomly in the file “dust_sensor.csv” from task 1,
3
HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY
4
HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY
III. RESULT
5
HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY
ACKNOWLEDGMENT
Giving specially thanks to Mr. Nguyen Tri Cuong for
teaching, supporting and taking the time to listen our
questions.
REFERENCES
[1] Nguyen Tri Cuong, “mini_project_20241_en_v1.pdf”,
HUST