/* $Id: SETUP.H 2.4 1995/07/20 11:24:33 leon Exp $
 *
 *      GISEL - G-CODE ISEL CNC driver
 *
 *      Copyright (c) 1994 LECAD
 *      All Rights Reserved.
 *
 */

//

// SETUP.H - setup dialog box for communication settings.

//


#ifndef SETUP_H_INCLUDED

#define SETUP_H_INCLUDED


#include "serial.h"


#define Uses_TDialog

#include <tvision/tv.h>


#define B4800   0x00

#define B9600   0x01

#define B19200  0x02


#define P_EVEN  0x00

#define P_ODD   0x01

#define P_NONE  0x02


/**
 ** Communication data setup dialog box
 **/
class comData // : public TStreamable

{
private:

    unsigned baudRate, comPort, parity;
    unsigned char stopBits[2], dataBits[2];

public:

    comData(unsigned baud = B9600,
            unsigned port = COM2,
            unsigned parit = P_NONE,
            unsigned char stop = 1,
            unsigned char data = 8)
    {
        baudRate = baud;
        comPort = port - 1;
        parity = parit;
        stopBits[0] = stop + '0';
        dataBits[0] = data + '0';
        stopBits[1] = dataBits[1] = '\0';
    }

    int getBaud();
    int getComPort() { return(comPort+1); }
    int getParity();
    int getParityNum() {return parity;}
    char getStopBits() { return(stopBits[0] - '0'); }
    char getDataBits() { return(dataBits[0] - '0'); }
    void setBaud(unsigned baud);
    void setPort(unsigned port) {comPort = port - 1;}
    void setStopBits(unsigned stop) {stopBits[0] = stop + '0'; }
    void setDataBits(unsigned data) {dataBits[0] = data + '0'; }
    void setParity(unsigned parit) {parity = parit; }
#if 0

    virtual void *read(ipstream &is);
    virtual void write(opstream &os);

    virtual const char *streamableName() const;
#endif


};

/**
 ** Comm setup dialog
 **/
class TSetupDialog : public TDialog
{

public:

    TSetupDialog();

};

#endif /* SETUP_H_INCLUDED */




syntax highlighted by Code2HTML, v. 0.9.1