• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

traintastic / traintastic / 22823086659

08 Mar 2026 02:30PM UTC coverage: 26.831% (+0.06%) from 26.774%
22823086659

push

github

reinder
[cbus] renamed CBUSAccessory(Short) to Long/Short event and added node setting for Long events.

0 of 15 new or added lines in 2 files covered. (0.0%)

1909 existing lines in 38 files now uncovered.

8230 of 30674 relevant lines covered (26.83%)

186.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/server/src/hardware/output/ecosstateoutput.cpp
1
/**
2
 * This file is part of Traintastic,
3
 * see <https://github.com/traintastic/traintastic>.
4
 *
5
 * Copyright (C) 2024-2026 Reinder Feenstra
6
 *
7
 * This program is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU General Public License
9
 * as published by the Free Software Foundation; either version 2
10
 * of the License, or (at your option) any later version.
11
 *
12
 * This program 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
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
 */
21

22
#include "ecosstateoutput.hpp"
23
#include "outputcontroller.hpp"
24
#include "../../core/attributes.hpp"
25
#include "../../core/method.tpp"
26
#include "../../core/objectproperty.tpp"
27
#include "../../utils/inrange.hpp"
28

29
ECoSStateOutput::ECoSStateOutput(std::shared_ptr<OutputController> outputController, OutputChannel channel_, uint16_t ecosObjectId_)
1✔
30
  : Output(std::move(outputController), channel_, OutputType::ECoSState)
1✔
31
  , ecosObjectId{this, "ecos_object_id", ecosObjectId_, PropertyFlags::Constant | PropertyFlags::NoStore | PropertyFlags::ScriptReadOnly}
1✔
32
  , value{this, "value", 0, PropertyFlags::ReadOnly | PropertyFlags::StoreState | PropertyFlags::ScriptReadOnly}
1✔
33
  , setValue{*this, "set_value", MethodFlags::ScriptCallable,
2✔
34
      [this](uint8_t newValue)
1✔
35
      {
UNCOV
36
        assert(interface);
×
37
        return interface->setOutputValue(channel, OutputECoSObject(ecosObjectId), newValue);
×
38
      }}
39
  , onValueChanged{*this, "on_value_changed", EventFlags::Scriptable}
2✔
40
{
41
  Attributes::addObjectEditor(value, false);
1✔
42
  Attributes::addMinMax<uint8_t>(value, std::numeric_limits<uint8_t>::min(), std::numeric_limits<uint8_t>::max());
1✔
43
  m_interfaceItems.add(value);
1✔
44

45
  Attributes::addObjectEditor(setValue, false);
1✔
46
  m_interfaceItems.add(setValue);
1✔
47

48
  m_interfaceItems.add(onValueChanged);
1✔
49
}
1✔
50

UNCOV
51
void ECoSStateOutput::updateValue(uint8_t newValue)
×
52
{
UNCOV
53
  value.setValueInternal(newValue);
×
54
  fireEvent(onValueChanged, newValue, shared_ptr<ECoSStateOutput>());
×
55
  fireEvent(onValueChangedGeneric, shared_ptr<Output>());
×
56
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc