Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented "stop file" command. Added StopAction. Driver now stops w…
…hen stopDeviceIO is called (either explicitly or implicitly when the experiment ends).
- Loading branch information
Showing
9 changed files
with
161 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
BlackrockLEDDriver/Actions/BlackrockLEDDriverStopAction.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// BlackrockLEDDriverStopAction.cpp | ||
// BlackrockLEDDriver | ||
// | ||
// Created by Christopher Stawarz on 2/4/20. | ||
// Copyright © 2020 The MWorks Project. All rights reserved. | ||
// | ||
|
||
#include "BlackrockLEDDriverStopAction.hpp" | ||
|
||
|
||
BEGIN_NAMESPACE_MW_BLACKROCK_LEDDRIVER | ||
|
||
|
||
void StopAction::describeComponent(ComponentInfo &info) { | ||
Action::describeComponent(info); | ||
info.setSignature("action/blackrock_led_driver_stop"); | ||
} | ||
|
||
|
||
bool StopAction::execute() { | ||
if (auto sharedDevice = weakDevice.lock()) { | ||
sharedDevice->stop(); | ||
} | ||
return true; | ||
} | ||
|
||
|
||
END_NAMESPACE_MW_BLACKROCK_LEDDRIVER |
33 changes: 33 additions & 0 deletions
33
BlackrockLEDDriver/Actions/BlackrockLEDDriverStopAction.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// BlackrockLEDDriverStopAction.hpp | ||
// BlackrockLEDDriver | ||
// | ||
// Created by Christopher Stawarz on 2/4/20. | ||
// Copyright © 2020 The MWorks Project. All rights reserved. | ||
// | ||
|
||
#ifndef BlackrockLEDDriverStopAction_hpp | ||
#define BlackrockLEDDriverStopAction_hpp | ||
|
||
#include "BlackrockLEDDriverAction.h" | ||
|
||
|
||
BEGIN_NAMESPACE_MW_BLACKROCK_LEDDRIVER | ||
|
||
|
||
class StopAction : public Action { | ||
|
||
public: | ||
static void describeComponent(ComponentInfo &info); | ||
|
||
using Action::Action; | ||
|
||
bool execute() override; | ||
|
||
}; | ||
|
||
|
||
END_NAMESPACE_MW_BLACKROCK_LEDDRIVER | ||
|
||
|
||
#endif /* BlackrockLEDDriverStopAction_hpp */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.