Corretta formattazione

git-svn-id: svn://10.65.10.50/trunk@1235 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1995-04-11 15:23:11 +00:00
parent 5375f9867b
commit 0f008e78ad

View File

@ -1,103 +1,103 @@
#ifndef __BA1300_H #ifndef __BA1300_H
#define __BA1300_H #define __BA1300_H
#include "ba1100.h" #include "ba1100.h"
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN
#define Separator '\\' #define Separator '\\'
#else #else
#define Separator '/' #define Separator '/'
#endif #endif
//////////////////////////////////////// ////////////////////////////////////////
// Here defining classes // // Here defining classes //
//////////////////////////////////////// ////////////////////////////////////////
class TTestSheet : public TDir_sheet class TTestSheet : public TDir_sheet
{ {
TBit_array _oldstatus; // Previous status of selected files TBit_array _oldstatus; // Previous status of selected files
protected: protected:
void page_build(long first, byte rows); void page_build(long first, byte rows);
public: public:
TTestSheet(const char* titolo, const char* colonne="@1|N.@5|Nome@20|EOD@7|EOX@7|Lung. |Descrizione@43|Flags@7", byte bottoni=0x0); TTestSheet(const char* titolo, const char* colonne="@1|N.@5|Nome@20|EOD@7|EOX@7|Lung. |Descrizione@43|Flags@7", byte bottoni=0x0);
~TTestSheet() ; ~TTestSheet() ;
void sr_status(bool save=TRUE); void sr_status(bool save=TRUE);
}; };
class TTestFile : public TBaseisamfile class TTestFile : public TBaseisamfile
{ {
public: public:
TTestFile(int ln,bool lt=TRUE) : TBaseisamfile(ln,lt) {} TTestFile(int ln,bool lt=TRUE) : TBaseisamfile(ln,lt) {}
virtual ~TTestFile() {} virtual ~TTestFile() {}
int close() {return _close();} int close() {return _close();}
int open(unsigned int mode = _manulock) {return _open(mode);} int open(unsigned int mode = _manulock) {return _open(mode);}
const char * file_name() const {return filename();} const char * file_name() const {return filename();}
}; };
class TTestWin : public TIndwin class TTestWin : public TIndwin
{ {
protected: protected:
virtual void update() {update_text();} virtual void update() {update_text();}
virtual void handler(WINDOW w, EVENT *e); virtual void handler(WINDOW w, EVENT *e);
void update_text() {set_mode(M_COPY); check_stop();} void update_text() {set_mode(M_COPY); check_stop();}
public: public:
void WriteW(short x, short y, const char* line) {stringat(x,y,line);update_text();do_events();} void WriteW(short x, short y, const char* line) {stringat(x,y,line);update_text();do_events();}
TTestWin(); TTestWin();
~TTestWin() {}; ~TTestWin() {};
}; };
class TTestProc class TTestProc
{ {
TTestSheet * _sheet; // Sheet with files selected TTestSheet * _sheet; // Sheet with files selected
TTestFile * _workf; // working file TTestFile * _workf; // working file
TTestWin * _win; // Output window TTestWin * _win; // Output window
long * _randseq; // Random sequence long * _randseq; // Random sequence
long _ntest; // number of test in progress long _ntest; // number of test in progress
int _nfile; // number of file being tested int _nfile; // number of file being tested
long _kriminal; // number of record incriminated (Debug) long _kriminal; // number of record incriminated (Debug)
int _nkeys; // # of keys defined for current file int _nkeys; // # of keys defined for current file
bool _block; // is test blocked ? bool _block; // is test blocked ?
bool _rmc; // Remove copies at the end of test ? bool _rmc; // Remove copies at the end of test ?
protected: protected:
void do_random(long eod); void do_random(long eod);
void filecopy(bool save=TRUE); void filecopy(bool save=TRUE);
void DumpReport(int err, long i, long x, int key); void DumpReport(int err, long i, long x, int key);
long sumop(const long n) {return ((n+1)*(n/2)+(n%2)*((n+1)/2));} long sumop(const long n) {return ((n+1)*(n/2)+(n%2)*((n+1)/2));}
int ctrl_keys(); int ctrl_keys();
bool show_mess(int, int, long, long, int); bool show_mess(int, int, long, long, int);
const char * fmttime(const long); const char * fmttime(const long);
public: public:
TTestProc(); TTestProc();
~TTestProc(); ~TTestProc();
const char* get_base(); const char* get_base();
void do_test_1(); void do_test_1();
void do_test_2(); void do_test_2();
void do_debug(); void do_debug();
void remove_copy(int n); void remove_copy(int n);
void load_random(const TString& st); void load_random(const TString& st);
bool stopped() {return _block;} bool stopped() {return _block;}
bool rm_copy() {return _rmc;} bool rm_copy() {return _rmc;}
void set_rmc(bool a=FALSE) {_rmc = a;} void set_rmc(bool a=FALSE) {_rmc = a;}
long num_test() {return _ntest;} long num_test() {return _ntest;}
void set_numt(const long num) { _ntest = num;} void set_numt(const long num) { _ntest = num;}
int num_file() {return _nfile;} int num_file() {return _nfile;}
void set_file(int n) {_nfile=n;} void set_file(int n) {_nfile=n;}
long number(const long n) {return _randseq[n];} long number(const long n) {return _randseq[n];}
void set_sheet (TTestSheet * sh) {_sheet=sh;} void set_sheet (TTestSheet * sh) {_sheet=sh;}
TTestSheet * get_isheet() {return _sheet;} TTestSheet * get_isheet() {return _sheet;}
TTestWin * get_win() {return _win;} TTestWin * get_win() {return _win;}
}; };
class TTestReport : public TScroll_window class TTestReport : public TScroll_window
{ {
TArray _report; TArray _report;
protected: protected:
virtual void update(); virtual void update();
virtual bool on_key(KEY); virtual bool on_key(KEY);
public: public:
TTestReport(const char* title); TTestReport(const char* title);
~TTestReport() {}; ~TTestReport() {};
void load_report(); void load_report();
TString& get_row(int n) {return (TString&)_report[n];} TString& get_row(int n) {return (TString&)_report[n];}
}; };
#endif #endif