root/cli.hpp @ 29

Revision 29, 1.4 KB (checked in by h.w.p.vandentoorn@…, 2 years ago)

things are looking good, both versions are now working. For label free analysis the results are identical between the original and our version, except that ms2 mass differences are not written in our version. The program gives an error state ("exited unexpectedly") and sometimes an exception "out of range" is thrown somewhere but Qt doesnt make it easy to findout where.

Line 
1#include "anyoption.h"
2#include "analyzer.hpp"
3#include "statusoutputcli.hpp"
4#include "progressoutputcli.hpp"
5#include <QObject>
6#include <QString>
7
8#ifndef CLI_HPP
9#define CLI_HPP
10/*
11 * CLI class, for starting pView in CLI modus
12
13 */
14class CLI : public QObject
15{
16Q_OBJECT
17public:
18    // Constructor, set up AnyOption.
19    CLI(int argc, char *argv[]) : ms1profile(false), ms2profile(false){
20
21        opt.addUsage("Usage");
22        opt.addUsage("");
23        opt.addUsage(" -h --help          prints this help");
24        opt.addUsage("");
25        opt.addUsage("All of these have to be provided:");
26        opt.addUsage(" -d --directory     the location of the folder structure");
27        opt.addUsage(" -o --output        output file");
28        opt.addUsage(" -1 --ms1profile    ms1 profile mode (true/false)");
29        opt.addUsage(" -2 --ms2profile    ms2 profile mode (true/false)");
30
31        opt.autoUsagePrint(true);
32
33        opt.setFlag("help", 'h');
34        opt.setOption("output",'o');
35        opt.setOption("directory",'d');
36        opt.setOption("ms1profile", '1');
37        opt.setOption("ms2profile", '2');
38
39        opt.processCommandArgs(argc, argv);
40
41        if (strcmp(opt.getValue('1'),"true")) ms1profile = true;
42        if (strcmp(opt.getValue('2'),"true")) ms2profile = true;
43
44    }
45
46private:
47    AnyOption opt;
48    bool ms1profile, ms2profile;
49
50    int display_help_if_wanted();
51    bool check_parameters_ok();
52
53public slots:
54    int run();
55};
56
57#endif // CLI_HPP
Note: See TracBrowser for help on using the browser.