-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (50 loc) · 1.55 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Function main() : Defines the entry point for the console application.
//
// A program to bring in binary data from a file and assign that data to an
// array for the purpose of program development.
//
// Usage: unlimited 'file'.bin
//
// Developed for the Programming for Engineers 3 course (ANSI C)
// June 2001
//
// Adapted for the Programming for Engineers 4 course
// January 2005
//
// Further adapted for the Programming for Software Systems course in C++
// February 2007 / 2008
//
// Further adaption in C++ February 2009
// Additional adaptation for Virtual Week exercise February 2012
// Further adaption for Programming for Engineers (ELEE1147) January 2019
// Modified for Programming for Engineers (ELEE1147) November 2020
//
// Dr D I Armour-Chelu / School of Engineering
#include "unlimited.hpp"
#include "binfileread.hpp"
#include "decimate.hpp"
#include "binfilewrite.hpp"
#include "getContentFromSignal.hpp"
int main(int argc, char* argv[])
{
if(argc == 1)
{
cout << "Usage: " << argv[0] << "<data file>" << endl;
exit(0);
}
if(argc > 2)
{
cout << "Too many input parameters" << endl;
cout << "Usage: " << argv[0] << " <data file>" << endl;
exit(0);
}
// Read the data file
struct dataContent datareturn;
datareturn = readBinaryFile(argv[1]);
// Process the data file
struct dataContent dataprocessed;
dataprocessed = decimate(datareturn);
// Write the processed data to file
writeBinaryFile(dataprocessed);
return 0;
} // End of main()