SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
hydrothermalconfiguration.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <openswmm/engine/openswmm_heat.h>
13#include <openswmm/engine/openswmm_process_components.h>
14#include <QUuid>
15
16namespace OpenSWMM::Ui
17{
18
19// A configured heat component needs a persistent owner. Generate a stable,
20// collision-resistant relative asset name; the native writer publishes it at
21// save time. Existing component paths always retain their authored spelling.
29{
30 unsigned flags = 0;
31 const int status = swmm_heat_get_authoring_flags(engine, &flags);
32 if (status != SWMM_OK || !(flags & 1u))
33 return status;
34 constexpr auto id = "org.hydrocouple.openswmm.heat";
35 if (swmm_process_component_find(engine, id) >= 0)
36 return SWMM_OK;
37 const auto name = "heat-" + QUuid::createUuid().toString(QUuid::WithoutBraces) + ".cfg";
38 return swmm_process_component_register(engine, id, name.toUtf8().constData());
39}
40
41} // namespace OpenSWMM::Ui
Definition hydrothermalconfiguration.h:17
int ensureHeatConfigurationFile(SWMM_Engine engine)
Ensure configured heat authoring has a registered persistent component asset name.
Definition hydrothermalconfiguration.h:28
void * SWMM_Engine
Definition objectdefaultsapplier.h:23