ChimeraTK-ApplicationCore 04.06.00
Loading...
Searching...
No Matches
SetpointRamp.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4/*
5 * This example is explained as part of the \ref conceptualOverview. Please refere there for step-by-step explanations.
6 * Reading the full example might not be a good starting point for learning ApplicationCore as it can be overwelming
7 * and lacks important background information.
8 *
9 * Please ignore all comments of the format "//! [some name]", those are used for Doxygen to include code snippets in
10 * the documentation pages.
11 */
12
13#include "SetpointRamp.h"
14
15/**********************************************************************************************************************/
16
17void SetpointRamp::mainLoop() {
18 const float maxStep = 0.1F;
19 while(true) {
20 readAll(); // waits until trigger received, then read operatorSetpoint
21 ctrl.actualSetpoint += std::max(std::min(operatorSetpoint - ctrl.actualSetpoint, maxStep), -maxStep);
22 writeAll();
23 }
24}
25
26/**********************************************************************************************************************/
void readAll(bool includeReturnChannels=false)
Read all readable variables in the group.
Definition Module.cc:72
void writeAll(bool includeReturnChannels=false)
Just call write() on all writable variables in the group.
Definition Module.cc:157