Skip to content

Commit

Permalink
Config
Browse files Browse the repository at this point in the history
  • Loading branch information
bcsanches committed Oct 17, 2024
1 parent 4d3cc9f commit 20c5ac2
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 25 deletions.
4 changes: 2 additions & 2 deletions data/EFMR/PanelStagingExtC.decoders.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"deactivateDelayMs":100,
"comment":"Botao PAS 01"
},
{
{
"name":"ST_PNL_EXTC_BTN_PAS_02",
"class":"Sensor",
"pin":33,
Expand All @@ -21,7 +21,7 @@
"deactivateDelayMs":100,
"comment":"Botao PAS 02"
},
{
{
"name":"ST_PNL_EXTC_BTN_PAS_03",
"class":"Sensor",
"pin":30,
Expand Down
17 changes: 15 additions & 2 deletions data/EFMR/TC_02.decoders.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,20 @@
"invertedFrog": true,
"invertedPower": true,
"operationTime": 300
},
},
{
"name": "TC_T14",
"class": "ServoTurnout",
"address": "1414",
"pin": 47,
"inverted": true,
"powerPin": 10,
"frogPin": 54,
"range":35,
"invertedFrog": true,
"invertedPower": false,
"operationTime": 3000
},
{
"name": "TC_T15",
"class": "ServoTurnout",
Expand All @@ -201,7 +214,7 @@
"inverted": false,
"powerPin": 67,
"frogPin": 66,
"range":25,
"range":35,
"invertedFrog": false,
"invertedPower": true,
"operationTime": 3000
Expand Down
42 changes: 21 additions & 21 deletions src/BrokerLib/dispatcher/DispatcherService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,39 +111,39 @@ namespace dcclite::broker

class DispatcherServiceImpl: public DispatcherService, public ScriptSystem::IScriptSupport, public IResettableService
{
public:
typedef DccLiteService Requirement_t;
public:
typedef DccLiteService Requirement_t;

DispatcherServiceImpl(RName name, Broker &broker, const rapidjson::Value &params, const Project &project, DccLiteService &dep);
~DispatcherServiceImpl() override;
DispatcherServiceImpl(RName name, Broker &broker, const rapidjson::Value &params, const Project &project, DccLiteService &dep);
~DispatcherServiceImpl() override;

void Serialize(JsonOutputStream_t &stream) const override;
void Serialize(JsonOutputStream_t &stream) const override;

void IResettableService_ResetItem(RName name) override;
void IResettableService_ResetItem(RName name) override;

private:
void RegisterSection(std::string_view name, sol::table obj);
void RegisterTSection(std::string_view name, sol::table obj);
private:
void RegisterSection(std::string_view name, sol::table obj);
void RegisterTSection(std::string_view name, sol::table obj);

void OnSectionStateChange(sol::table obj, int newState);
void OnSectionStateChange(sol::table obj, int newState);

void IScriptSupport_RegisterProxy(sol::table &table) override;
void IScriptSupport_RegisterProxy(sol::table &table) override;

void IScriptSupport_OnVMInit(sol::state &state) override;
void IScriptSupport_OnVMFinalize(sol::state &state) override;
void IScriptSupport_OnVMInit(sol::state &state) override;
void IScriptSupport_OnVMFinalize(sol::state &state) override;

void Panic(sol::table src, const char *reason);
void Panic(sol::table src, const char *reason);

VirtualSensorDecoder &CreateSectionSensor(sol::table obj);
VirtualSensorDecoder &CreateSectionSensor(sol::table obj);

private:
sigslot::scoped_connection m_slotScriptVMInit;
sigslot::scoped_connection m_slotScriptVMFinalize;
private:
sigslot::scoped_connection m_slotScriptVMInit;
sigslot::scoped_connection m_slotScriptVMFinalize;

DccLiteService &m_rclDccLite;
DccLiteService &m_rclDccLite;

FolderObject *m_pSections;
Device *m_pclDevice = nullptr;
FolderObject *m_pSections;
Device *m_pclDevice = nullptr;
};

DispatcherServiceImpl::DispatcherServiceImpl(RName name, Broker &broker, const rapidjson::Value &params, const Project &project, DccLiteService &dep):
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions todo.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
DCCLite
-------

- Change DccDevice decoder structure: expose a DecoderProxy, that is never destroyed.
- This will make all code around simple, no need for handling create / destroy events
- The proxy keeps a reference to the real decoder
- use a std::variant inside the proxy?
- decoders may have no device
- keep decoders type inside the device, do not leak specific decoders code to outside

- Lua script failing to reload, seems to be a problem with sections
- Why lua scripts are not notified when devices gets online and state changes during sync? Check routes
- Implement coroutine support on lua scripts?
Expand Down

0 comments on commit 20c5ac2

Please sign in to comment.