Skip to content

Commit b30c2c7

Browse files
committed
Segment is not a ResourceSetDisableAND but a simple ResourceSet with its own comput_disabled_state since it may contain non-resource applications
1 parent e1859b1 commit b30c2c7

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

schema/confmodel/dunedaq.schema.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
<oks-schema>
8282

83-
<info name="" type="" num-of-items="49" oks-format="schema" oks-version="862f2957270" created-by="jcfree" created-on="mu2edaq13.fnal.gov" creation-time="20230123T223700" last-modified-by="gjc" last-modified-on="latitude" last-modification-time="20250625T130407"/>
83+
<info name="" type="" num-of-items="49" oks-format="schema" oks-version="862f2957270" created-by="jcfree" created-on="mu2edaq13.fnal.gov" creation-time="20230123T223700" last-modified-by="gjc" last-modified-on="latitude" last-modification-time="20250730T085923"/>
8484

8585
<class name="ActionPlan" description="A set of parallel steps for an application to carry out a command">
8686
<attribute name="execution_policy" description="How the application should execute steps of the action plan" type="enum" range="modules-in-parallel,modules-in-series" init-value="modules-in-parallel"/>
@@ -371,13 +371,16 @@
371371
</class>
372372

373373
<class name="Segment" description="Logical sub division of the configuration that can be enabled/disabled as a group">
374-
<superclass name="ResourceSetDisableAND"/>
374+
<superclass name="ResourceSet"/>
375375
<relationship name="segments" description="Nested list of Segments that form part of this Segment" class-type="Segment" low-cc="zero" high-cc="many" is-composite="yes" is-exclusive="no" is-dependent="yes"/>
376376
<relationship name="applications" description="List of Applications that run in this Segment" class-type="Application" low-cc="zero" high-cc="many" is-composite="yes" is-exclusive="yes" is-dependent="yes"/>
377377
<relationship name="controller" description="This Segment&apos;s run controller." class-type="RCApplication" low-cc="one" high-cc="one" is-composite="yes" is-exclusive="yes" is-dependent="yes"/>
378378
<method name="contained_resources" description="">
379379
<method-implementation language="c++" prototype="virtual std::vector&lt;const Resource*&gt; contained_resources() const" body=""/>
380380
</method>
381+
<method name="compute_disabled_state" description="">
382+
<method-implementation language="c++" prototype="bool compute_disabled_state(const std::set&lt;std::string&gt;&amp; disabled) const final" body=""/>
383+
</method>
381384
</class>
382385

383386
<class name="Service">

src/dalMethods.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,5 +452,23 @@ Segment::contained_resources() const {
452452
return resources;
453453
}
454454

455+
bool
456+
Segment::compute_disabled_state(const std::set<std::string>& disabled) const {
457+
if (disabled.contains(UID())) {
458+
return true;
459+
}
460+
for (auto app: get_applications()) {
461+
auto res=app->cast<const Resource>();
462+
if (res == nullptr) {
463+
return false;
464+
}
465+
}
466+
for (auto res: contained_resources()) {
467+
if (!res->compute_disabled_state(disabled)) {
468+
return false;
469+
}
470+
}
471+
return true;
472+
}
455473

456474
} // namespace dunedaq::confmodel

0 commit comments

Comments
 (0)