| Line |
Branch |
Exec |
Source |
| 1 |
|
|
/***************************************************************************** |
| 2 |
|
|
* |
| 3 |
|
|
* This file is part of the ecapp library (EtherCAT application devices). |
| 4 |
|
|
* |
| 5 |
|
|
* Copyright (C) 2026 Florian Pose <fp@igh.de> |
| 6 |
|
|
* |
| 7 |
|
|
* The ecapp library is free software: you can redistribute it and/or |
| 8 |
|
|
* modify it under the terms of the GNU Lesser General Public License |
| 9 |
|
|
* as published by the Free Software Foundation, version 3 of the |
| 10 |
|
|
* License. |
| 11 |
|
|
* |
| 12 |
|
|
* The ecapp library is distributed in the hope that it will be useful, |
| 13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
|
|
* Lesser General Public License for more details. |
| 16 |
|
|
* |
| 17 |
|
|
* You should have received a copy of the GNU Lesser General Public |
| 18 |
|
|
* License along with the ecapp library. If not, see |
| 19 |
|
|
* <https://www.gnu.org/licenses/>. |
| 20 |
|
|
* |
| 21 |
|
|
****************************************************************************/ |
| 22 |
|
|
|
| 23 |
|
|
#ifndef ECAPP_CONFIGURABLESCALE_H |
| 24 |
|
|
#define ECAPP_CONFIGURABLESCALE_H |
| 25 |
|
|
|
| 26 |
|
|
/****************************************************************************/ |
| 27 |
|
|
|
| 28 |
|
|
#include "ecapp/Capability.h" |
| 29 |
|
|
#include "ecapp_export.h" |
| 30 |
|
|
|
| 31 |
|
|
/****************************************************************************/ |
| 32 |
|
|
|
| 33 |
|
|
namespace EcApp { |
| 34 |
|
|
|
| 35 |
|
|
/** Optional capability for an analog device whose engineering-unit |
| 36 |
|
|
* conversion (scale and/or offset applied to the raw hardware value) |
| 37 |
|
|
* is an application/calibration concern, not a hardware fact -- e.g. |
| 38 |
|
|
* the full-scale range a particular sensor was wired for. A device |
| 39 |
|
|
* with no offset concept (only a scale) accepts setOffset() as a |
| 40 |
|
|
* legitimate no-op; offset then stays 0. */ |
| 41 |
|
3 |
class ECAPP_EXPORT ConfigurableScale |
| 42 |
|
|
{ |
| 43 |
|
|
public: |
| 44 |
|
3 |
virtual ~ConfigurableScale() = default; |
| 45 |
|
|
|
| 46 |
|
|
virtual void setScale(unsigned int channel, double scale) = 0; |
| 47 |
|
|
virtual void setOffset(unsigned int channel, double offset) = 0; |
| 48 |
|
|
}; |
| 49 |
|
|
|
| 50 |
|
|
} // namespace EcApp |
| 51 |
|
|
|
| 52 |
|
|
#endif // ECAPP_CONFIGURABLESCALE_H |
| 53 |
|
|
|
| 54 |
|
|
/****************************************************************************/ |
| 55 |
|
|
|