Initial Commit
[HECS.git] / Hecs.cpp
blob6f664be166628d2ccf8ceaba96284c735542686c
1 /***************************************************************************
2 * *
3 * Main.cpp Copyright (C) 2008 by Jon Rumble *
4 * j.w.rumble@reading.ac.uk *
5 * *
6 * This file is part of HECS, *
7 * *
8 * HECS is free software: you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation, either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * HECS is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
20 ***************************************************************************/
22 #include "Hecs.h"
24 int main(int argc, char *argv[])
26 QApplication app(argc, argv);
29 if (argc != 2 )
31 printUsage();
32 return 1;
36 QString filename (app.argv()[1]);
37 //Sanity Check for file....
38 if (checkFiles() != 0)
39 return 1;
41 hecsModel= new RdSap(filename);
42 hecsModel->buildBoilerList();
44 //hecsGui = new HecsUI (hecsModel);
45 //hecsGui->guiLoop();
47 // return app.exec();
48 delete hecsModel;
49 delete hecsGui;
50 return 0;
51 //hecsGui.setModel(hecsModel);
55 std::cout << "Bye !!" << std::endl;
59 bool checkFiles()
62 /*QDir fp("data");
64 QFile file (fp.filePath("table13"));
65 if (!fp.exists())
67 qWarning("Can't Find Table13 file !!");
68 return 1;
69 }*/
71 /* filePath = "data/table12";
72 if (!filePath.exists())
74 qWarning("Can't Find Table12 file !!");
75 qApp->exit(1);
78 filePath = "data/table10";
79 if (!filePath.exists())
81 qWarning("Can't Find Table10 file !!");
82 qApp->exit(1);
85 filePath = "data/table6e";
86 if (!filePath.exists())
88 qWarning("Can't Find Table6e file !!");
89 qApp->exit(1);
90 }*/
91 return 0;
94 void printUsage()
96 std::cout << "\nUsage: HECS <filename>\n\n" << std::endl;