Big Mouth Billy Bass automation library

Dependents:   BillyBass_with_SD

Committer:
bikeNomad
Date:
Mon Jun 17 22:17:59 2013 +0000
Revision:
0:84aaade0de8f
Child:
2:eaba75af0f0d
Mostly working; hangs when reading actions

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bikeNomad 0:84aaade0de8f 1 #ifndef __included_action_hpp
bikeNomad 0:84aaade0de8f 2 #define __included_action_hpp
bikeNomad 0:84aaade0de8f 3
bikeNomad 0:84aaade0de8f 4 #include "billybass.hpp"
bikeNomad 0:84aaade0de8f 5
bikeNomad 0:84aaade0de8f 6 // 0.000000\t5.646050\thead
bikeNomad 0:84aaade0de8f 7 // 0.064498\t1.069177\ttail
bikeNomad 0:84aaade0de8f 8 // 0.357219\t0.580481\tmouth
bikeNomad 0:84aaade0de8f 9
bikeNomad 0:84aaade0de8f 10 #define MAX_ACTION_LINE_LENGTH 30
bikeNomad 0:84aaade0de8f 11
bikeNomad 0:84aaade0de8f 12 struct Action
bikeNomad 0:84aaade0de8f 13 {
bikeNomad 0:84aaade0de8f 14 Action(float _time = -1.0,
bikeNomad 0:84aaade0de8f 15 bool _state = false,
bikeNomad 0:84aaade0de8f 16 DigitalOut *_out = 0,
bikeNomad 0:84aaade0de8f 17 char const *_outName = 0)
bikeNomad 0:84aaade0de8f 18 : actionTime(_time), desiredState(_state)
bikeNomad 0:84aaade0de8f 19 , output(_out), outputName(_outName)
bikeNomad 0:84aaade0de8f 20 {
bikeNomad 0:84aaade0de8f 21 }
bikeNomad 0:84aaade0de8f 22
bikeNomad 0:84aaade0de8f 23 bool operator < (Action const &other) const { return actionTime < other.actionTime; }
bikeNomad 0:84aaade0de8f 24
bikeNomad 0:84aaade0de8f 25 bool isValid() const { return actionTime >= 0.0 && output != 0; }
bikeNomad 0:84aaade0de8f 26
bikeNomad 0:84aaade0de8f 27 float actionTime;
bikeNomad 0:84aaade0de8f 28 bool desiredState;
bikeNomad 0:84aaade0de8f 29 DigitalOut *output;
bikeNomad 0:84aaade0de8f 30 char const *outputName;
bikeNomad 0:84aaade0de8f 31 };
bikeNomad 0:84aaade0de8f 32
bikeNomad 0:84aaade0de8f 33 #endif