OMCompiler/SimulationRuntime/cpp/Core/SimController/Configuration.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file belongs to the OpenModelica Run-Time System | ||
| 3 | * | ||
| 4 | * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC), c/o Linköpings | ||
| 5 | * universitet, Department of Computer and Information Science, SE-58183 Linköping, Sweden. All rights | ||
| 6 | * reserved. | ||
| 7 | * | ||
| 8 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE | ||
| 9 | * AGPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8. ANY | ||
| 10 | * USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S | ||
| 11 | * ACCEPTANCE OF THE BSD NEW LICENSE OR THE OSMC PUBLIC LICENSE OR THE AGPL | ||
| 12 | * VERSION 3, ACCORDING TO RECIPIENTS CHOICE. | ||
| 13 | * | ||
| 14 | * The OpenModelica software and the OSMC (Open Source Modelica Consortium) Public License | ||
| 15 | * (OSMC-PL) are obtained from OSMC, either from the above address, from the URLs: | ||
| 16 | * http://www.openmodelica.org or https://github.com/OpenModelica/ or | ||
| 17 | * http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica distribution. GNU | ||
| 18 | * AGPL version 3 is obtained from: https://www.gnu.org/licenses/licenses.html#GPL. The BSD NEW | ||
| 19 | * License is obtained from: http://www.opensource.org/licenses/BSD-3-Clause. | ||
| 20 | * | ||
| 21 | * This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY | ||
| 23 | * SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF | ||
| 24 | * OSMC-PL. | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | |||
| 28 | /** @addtogroup coreSimcontroller | ||
| 29 | * | ||
| 30 | * @{ | ||
| 31 | */ | ||
| 32 | |||
| 33 | #include <Core/ModelicaDefine.h> | ||
| 34 | #include <Core/Modelica.h> | ||
| 35 | #include <Core/SimController/Configuration.h> | ||
| 36 | #if defined(OMC_BUILD) || defined(SIMSTER_BUILD) | ||
| 37 | #include "LibrariesConfig.h" | ||
| 38 | #endif | ||
| 39 | |||
| 40 | 40 | Configuration::Configuration(PATH libraries_path, PATH config_path, PATH modelicasystem_path) | |
| 41 |
4/10✓ Branch 2 taken 40 times.
✓ Branch 4 taken 40 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 40 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 40 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
|
200 | : ConfigurationPolicy(libraries_path, modelicasystem_path, config_path) |
| 42 | { | ||
| 43 |
2/2✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
|
80 | _settings_factory = createSettingsFactory(); |
| 44 |
1/1✓ Branch 1 taken 40 times.
|
40 | _global_settings = _settings_factory->createSolverGlobalSettings(); |
| 45 | 40 | } | |
| 46 | |||
| 47 |
1/2✓ Branch 0 taken 40 times.
✗ Branch 1 not taken.
|
80 | Configuration::~Configuration(void) |
| 48 | { | ||
| 49 | 80 | } | |
| 50 | |||
| 51 | 2125 | shared_ptr<IGlobalSettings> Configuration::getGlobalSettings() | |
| 52 | { | ||
| 53 | 2125 | return _global_settings; | |
| 54 | } | ||
| 55 | |||
| 56 | 72 | ISolverSettings* Configuration::getSolverSettings() | |
| 57 | { | ||
| 58 | 72 | return _solver_settings.get(); | |
| 59 | } | ||
| 60 | |||
| 61 | 40 | shared_ptr<ISolver> Configuration::createSelectedSolver(IMixedSystem* system) | |
| 62 | { | ||
| 63 | 40 | string solver_name = _global_settings->getSelectedSolver(); | |
| 64 |
1/1✓ Branch 1 taken 40 times.
|
40 | _solver_settings =_settings_factory->createSelectedSolverSettings(); |
| 65 |
3/9✓ Branch 2 taken 40 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 40 times.
✓ Branch 6 taken 40 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
|
160 | _solver = createSolver(system, solver_name, _solver_settings); |
| 66 | 40 | return _solver; | |
| 67 | } | ||
| 68 | /** @} */ // end of coreSimcontroller | ||
| 69 |