#ifndef CommandSet_h
#define CommandSet_h

#include "UK1104.h"
#include <QString>
#include <QStringList>
#include <sys/time.h>

class Scheduler;

// An instance of this class represents a group of UK1104 commands to
// be run in sequence together.
//
class CommandSet {

   friend class Scheduler;

public:

   CommandSet(int init_unique_id, const QStringList & init_commands);

   ~CommandSet();

      // Return the unique ID code passed in when the CommandSet was
      // created.
      //
   int
   GetUniqueId();

      // Return the result of running the command (UK1104_PENDING if
      // commands not yet run).
      //
   UK1104::UK1104Errors
   GetStatus();

      // Return the string with the output from the UK1104 collected
      // while running this command set.
      //
   QString
   GetResults();

private:

   int unique_id;

   QStringList commands;

   UK1104::UK1104Errors status;

   QString results;

   struct timeval sched_time;
   int            timeout_ms;
   CommandSet *   next;
};

#endif // CommandSet_h
