Big Mouth Billy Bass automation library
Diff: action.hpp
- Revision:
- 0:84aaade0de8f
- Child:
- 2:eaba75af0f0d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/action.hpp Mon Jun 17 22:17:59 2013 +0000
@@ -0,0 +1,33 @@
+#ifndef __included_action_hpp
+#define __included_action_hpp
+
+#include "billybass.hpp"
+
+// 0.000000\t5.646050\thead
+// 0.064498\t1.069177\ttail
+// 0.357219\t0.580481\tmouth
+
+#define MAX_ACTION_LINE_LENGTH 30
+
+struct Action
+{
+ Action(float _time = -1.0,
+ bool _state = false,
+ DigitalOut *_out = 0,
+ char const *_outName = 0)
+ : actionTime(_time), desiredState(_state)
+ , output(_out), outputName(_outName)
+ {
+ }
+
+ bool operator < (Action const &other) const { return actionTime < other.actionTime; }
+
+ bool isValid() const { return actionTime >= 0.0 && output != 0; }
+
+ float actionTime;
+ bool desiredState;
+ DigitalOut *output;
+ char const *outputName;
+};
+
+#endif
Ned Konz