#pragma once
class AcsProgram
{
public:
    AcsProgram(HANDLE hComm, int iBufferId, bool bTraceData);
    ~AcsProgram(void);
    bool        ClearBuffer();
    bool        LoadBuffer();
    bool        RunBuffer();
    bool        StopBuffer();
    HANDLE      GetProgramFinishedHandle();
    AcsProgram& Append(const char *fmt, ...);
    AcsProgram& Append(CString &cMsg);
private:
    CString m_buffer;
    HANDLE  m_hProgramFinished;
    const char *GetErrorString();
    const char *GetErrorString(int errorNumber);
    bool        TestAcsResult(int line_nr, int result, char *code);
    HANDLE        m_hComm;
    char          m_errorString[256];
    int           m_lastError;
    CMotionLogger m_logger;
    bool          m_bTraceData;
    int           m_iBufferId;
};
