Rev 497 | Rev 515 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 497 | Rev 514 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | #include "model.h"
|
11 | #include "model.h"
|
12 | #include "helper.h"
|
12 | #include "helper.h"
|
13 | #include "expression.h"
|
13 | #include "expression.h"
|
14 | #include "expressionwrapper.h"
|
14 | #include "expressionwrapper.h"
|
15 | #include "../output/outputmanager.h"
|
15 | #include "../output/outputmanager.h"
|
- | 16 | ||
- | 17 | #include "species.h"
|
|
- | 18 | #include "speciesset.h"
|
|
16 | 19 | ||
17 | #include "mainwindow.h" // for the debug message buffering
|
20 | #include "mainwindow.h" // for the debug message buffering
|
18 | 21 | ||
19 | ModelController::ModelController() |
22 | ModelController::ModelController() |
20 | {
|
23 | {
|
Line 27... | Line 30... | ||
27 | ModelController::~ModelController() |
30 | ModelController::~ModelController() |
28 | {
|
31 | {
|
29 | destroy(); |
32 | destroy(); |
30 | }
|
33 | }
|
31 | 34 | ||
- | 35 | /// prepare a list of all (active) species
|
|
- | 36 | QHash<QString, QString> ModelController::availableSpecies() |
|
- | 37 | {
|
|
- | 38 | QHash<QString, QString> list; |
|
- | 39 | if (mModel) { |
|
- | 40 | SpeciesSet *set = mModel->speciesSet(); |
|
- | 41 | if (!set) |
|
- | 42 | throw IException("there are 0 or more than one species sets."); |
|
- | 43 | foreach (const Species *s, set->activeSpecies()) { |
|
- | 44 | list[s->id()] = s->name(); |
|
- | 45 | }
|
|
- | 46 | }
|
|
- | 47 | return list; |
|
- | 48 | }
|
|
32 | 49 | ||
33 | bool ModelController::canCreate() |
50 | bool ModelController::canCreate() |
34 | {
|
51 | {
|
35 | if (mModel) |
52 | if (mModel) |
36 | return false; |
53 | return false; |