-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·42 lines (33 loc) · 1.41 KB
/
main.cpp
File metadata and controls
executable file
·42 lines (33 loc) · 1.41 KB
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
/****************************************************************
* File: main.cpp
* Description: Main loop for our simulations
* Author: Fabio Andreozzi Godoy
* Date: 2020-06-06 - Modified: 2020-06-27
*/
#ifndef MAIN_SOURCE
#define MAIN_SOURCE
#include <iostream>
#include "Util/general.h"
#include "Laboratory/freeFallingBall.h"
int main(int argc,char* argv[]) {
// Example:
// $ ./scicpp -simulation=millikan
std::string simulation = GeneralPurpose::getCmdOption(argc, argv, "-simulation=");
// We don't have a simulation with the given name. Let's finish the program and inform the user.
if (simulation.empty()) {
std::cout << "Simulation name is mandatory" << std::endl;
return 1;
}
// We found the simulation that user asked. Let's start it.
std::cout << "Starting system with simulation: " << simulation << std::endl;
// In the future I'll change it with some kindo of IoC or Factory
if (!simulation.compare("millikan")) std::cout << "To be done..." << std::endl;
if (!simulation.compare("michelsonInterferometer")) std::cout << "To be done..." << std::endl;
if (!simulation.compare("thermionicEmission")) std::cout << "To be done..." << std::endl;
if (!simulation.compare("freeFallingBall")) {
FreeFallingBall* f = new FreeFallingBall(true);
f->execute();
}
return 0;
}
#endif // MAIN_SOURCE