| 1 |
/* |
| 2 |
* Scenario.cpp - TaskJuggler |
| 3 |
* |
| 4 |
* SPDX-FileCopyrightText: 2001, 2002, 2003, 2004 Chris Schlaeger <[email protected]> |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of version 2 of the GNU General Public License as |
| 8 |
* published by the Free Software Foundation. |
| 9 |
* |
| 10 |
* $Id$ |
| 11 |
*/ |
| 12 |
|
| 13 |
// clazy:excludeall=qstring-arg |
| 14 |
#include "Scenario.h" |
| 15 |
#include "Project.h" |
| 16 |
|
| 17 |
namespace TJ |
| 18 |
{ |
| 19 |
|
| 20 |
Scenario::Scenario(Project* p, const QString& i, const QString& n, |
| 21 |
Scenario* pr) : |
| 22 |
CoreAttributes(p, i, n, pr), |
| 23 |
enabled(true), |
| 24 |
projectionMode(false), |
| 25 |
strictBookings(false), |
| 26 |
optimize(false), |
| 27 |
minSlackRate(0.05), |
| 28 |
maxPaths(10000000) |
| 29 |
{ |
| 30 |
p->addScenario(this); |
| 31 |
if (pr) |
| 32 |
{ |
| 33 |
// Inherit settings from parent scenario. |
| 34 |
enabled = pr->enabled; |
| 35 |
projectionMode = pr->projectionMode; |
| 36 |
optimize = pr->optimize; |
| 37 |
strictBookings = pr->strictBookings; |
| 38 |
minSlackRate = pr->minSlackRate; |
| 39 |
maxPaths = pr->maxPaths; |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
Scenario::~Scenario() |
| 44 |
{ |
| 45 |
project->deleteScenario(this); |
| 46 |
} |
| 47 |
|
| 48 |
ScenarioListIterator |
| 49 |
Scenario::getSubListIterator() const |
| 50 |
{ |
| 51 |
return ScenarioListIterator(*sub); |
| 52 |
} |
| 53 |
|
| 54 |
} // namespace TJ |