24 #include "MGrblTrigger.hpp"
26 #include <ccut/async.hpp>
28 #include "MGrblPlatform.hpp"
30 using namespace logger;
32 using namespace smc::internal;
33 using namespace smc::units;
35 MGrblTrigger::MGrblTrigger(
const std::string &uid,
36 const std::shared_ptr<MGrblPlatform> &mgrbl,
37 const std::shared_ptr<GrblPlatform> &grbl) :
42 std::future<void> MGrblTrigger::arm()
const
46 std::shared_ptr<MGrblPlatform> mgrbl(m_mgrbl.lock());
48 throw Exception(ErrorCode::Canceled,
"platform stopped (deleted)");
50 mgrbl->updateInstance(
const_cast<MGrblTrigger &
>(*
this));
55 return ccut::make_future_error(ex);
63 std::shared_ptr<MGrblPlatform> mgrbl(m_mgrbl.lock());
65 throw Exception(ErrorCode::Canceled,
"platform stopped (deleted)");
67 mgrbl->updateInstance(
const_cast<MGrblTrigger &
>(*
this));
72 return ccut::make_future_error(ex);
80 std::shared_ptr<MGrblPlatform> mgrbl(m_mgrbl.lock());
82 throw Exception(ErrorCode::Canceled,
"platform stopped (deleted)");
84 mgrbl->updateInstance(
const_cast<MGrblTrigger &
>(*
this));
89 return ccut::make_future_error<bool>(ex);
97 std::shared_ptr<MGrblPlatform> mgrbl(m_mgrbl.lock());
99 throw Exception(ErrorCode::Canceled,
"platform stopped (deleted)");
101 mgrbl->updateInstance(
const_cast<MGrblTrigger &
>(*
this));
106 return ccut::make_future_error(ex);
Exception thrown by MotionController in case of issues with command.
std::future< bool > isArmed() const override
check if trigger is armed
std::future< void > trig() const override
soft-trigger the trigger
std::future< void > arm() const override
arm the trigger
std::future< void > disarm() const override
disarm the trigger
std::future< void > trig() const override
soft-trigger the trigger
std::future< void > disarm() const override
disarm the trigger
std::future< bool > isArmed() const override
check if trigger is armed
main motion-lib namespace