/* $Id: COMM.H 2.4 1995/07/20 11:24:33 leon Exp $
 */
#ifndef COMM_H_INCLUDED

#define COMM_H_INCLUDED


#include <iostream.h>

#include <fstream.h>

#include <tvision/tv.h>


class TLogWindow;
class TView;

/**
 ** Communication over serial line
 **/
class Comm {
  int reply;
public:
  Comm(TLogWindow **log);
  void update();
  open(int port, int speed, int parity, int bits, int stopBit);
  open();
  Boolean isOpen();
  void close();
  void sendCommand(const char *s);
  void sendCommand(const char *s, int count);
  void sendCommand(const char *s, TView *owner);
  Boolean clearToSend();
  Boolean isEnqueued() {return enqueued;}
  Boolean isPaused() {return paused;}
  int enqueue(istream& inStream, const char *jobName = "Job");
  int enqueue(const char *fileName);
  void dequeue();
  int getReply();
  long getLineNumber();
  short pauseQueue();
  short continueQueue();
  void setRelativeSpeed(short axis, double factor);
private:
  TLogWindow **logWindow;
  TView *receiver;
  Boolean commIsOpen;
  istream_withassign is;
  ifstream ifs;
  void sendNextLine();
  Boolean enqueued;
  Boolean dequeued;
  Boolean paused;
  Boolean depaused;
  long lineNumber;
  const char *jobName;
  double relativeSpeed[3];
  

};

#endif








syntax highlighted by Code2HTML, v. 0.9.1