Motion Master
Loading...
Searching...
No Matches
watchdog_machine.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <future>
5#include <map>
6
7#include "ethercat_slave.h"
9#include "machine.h"
10
11class WatchdogMachine : public Machine {
12 public:
13 WatchdogMachine(VirtualDeviceManager &vdm, ctpl::thread_pool &thread_pool,
14 Notifier &notifier,
15 moodycamel::ReaderWriterQueue<OutgoingMachineMessage>
16 &outgoing_machine_message_queue);
17
18 void execute(uint64_t pending_signals) override;
19 void start();
20 void stop();
21 void abort_client_requests(const std::string &connection_id) override;
22 bool done() override;
23
24 private:
25 uint64_t elapsed_milliseconds_ = 0;
26 uint64_t counter_ = 0;
27 std::future<void> future_;
28 bool running_ = true;
29
30 std::map<uint16_t, EthercatSlave::State> ecat_slave_states_;
31
32 void check_drives();
33 void send_connection_warning(uint16_t device_id);
34};
Definition: machine.h:20
Definition: notifier.h:10
Definition: virtual_device_manager.h:16
Definition: watchdog_machine.h:11
bool done() override
Check if all of the machine started processes are done (including the Command Workers)
Definition: watchdog_machine.cc:151
void abort_client_requests(const std::string &connection_id) override
Abort all of the requests a certain client has issues.
Definition: watchdog_machine.cc:145
void execute(uint64_t pending_signals) override
Execute the machine.
Definition: watchdog_machine.cc:26
void start()
Definition: watchdog_machine.cc:131
void stop()
Definition: watchdog_machine.cc:139