| Line | |
|---|
| 1 | #include "MCosy.h"
|
|---|
| 2 |
|
|---|
| 3 | #include <iomanip.h>
|
|---|
| 4 | #include <fstream.h>
|
|---|
| 5 | #include <iostream.h>
|
|---|
| 6 |
|
|---|
| 7 | #include <TROOT.h>
|
|---|
| 8 | #include <TSystem.h>
|
|---|
| 9 | #include <TApplication.h>
|
|---|
| 10 |
|
|---|
| 11 | int main(int argc, char **argv)
|
|---|
| 12 | {
|
|---|
| 13 | cout << endl;
|
|---|
| 14 | cout << "Starting..." << endl;
|
|---|
| 15 | cout << endl;
|
|---|
| 16 |
|
|---|
| 17 | //
|
|---|
| 18 | // this must move to MGCosy !!!! (or MApplication)
|
|---|
| 19 | //
|
|---|
| 20 | ofstream lout("cosy.log");
|
|---|
| 21 | lout << "Starting Cosy" << endl;
|
|---|
| 22 |
|
|---|
| 23 | //
|
|---|
| 24 | // start the main window
|
|---|
| 25 | //
|
|---|
| 26 | lout << "- Initialising Root environment." << endl;
|
|---|
| 27 | TROOT root("Cosy", "Magic Control System");
|
|---|
| 28 | TApplication app("App", &argc, argv);
|
|---|
| 29 |
|
|---|
| 30 | //
|
|---|
| 31 | // Create the Network. Device: /dev/dpm_00, Rate: 500kbps
|
|---|
| 32 | //
|
|---|
| 33 | MCosy *cosy = new MCosy("/dev/dpm_00", 500, lout);
|
|---|
| 34 | cosy->Start();
|
|---|
| 35 |
|
|---|
| 36 | lout << "- Starting mainloop." << endl;
|
|---|
| 37 | app.Run(kTRUE);
|
|---|
| 38 |
|
|---|
| 39 | lout << "- Stopping cosy." << endl;
|
|---|
| 40 | cosy->Stop();
|
|---|
| 41 | lout << "- cosy stopped." << endl;
|
|---|
| 42 |
|
|---|
| 43 | delete cosy;
|
|---|
| 44 |
|
|---|
| 45 | lout << "- Terminating Program." << endl;
|
|---|
| 46 | cout << "The End." << endl;
|
|---|
| 47 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.