ba4*.* Aggiustato ordine di creazione/distruzione di maschere e files
baformed.cpp Aggiusata indentazione ba883.cpp Modificato test di velocita' isam git-svn-id: svn://10.65.10.50/trunk@6461 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ca9bf04c98
commit
5c71880761
26
ba/ba4.cpp
26
ba/ba4.cpp
@ -1,36 +1,26 @@
|
|||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#include <strings.h>
|
|
||||||
#include <checks.h>
|
|
||||||
|
|
||||||
#include "ba4.h"
|
#include "ba4.h"
|
||||||
|
|
||||||
#define usage "Error - usage : %s -{0|1|2|3|4|5}"
|
|
||||||
|
|
||||||
int main(int argc,char** argv)
|
int main(int argc,char** argv)
|
||||||
|
|
||||||
{
|
{
|
||||||
int rt = -1 ;
|
const int r = (argc > 1) ? argv[1][1]-'0' : 0;
|
||||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
|
||||||
|
|
||||||
switch (r)
|
switch (r)
|
||||||
{
|
{
|
||||||
case 0:
|
|
||||||
rt = ba4100(argc,argv) ; break;
|
|
||||||
case 1:
|
case 1:
|
||||||
rt = ba4200(argc,argv) ; break;
|
ba4200(argc,argv) ; break;
|
||||||
case 2:
|
case 2:
|
||||||
rt = ba4300(argc,argv) ; break;
|
ba4300(argc,argv) ; break;
|
||||||
case 3:
|
case 3:
|
||||||
rt = ba4400(argc,argv) ; break;
|
ba4400(argc,argv) ; break;
|
||||||
case 4:
|
case 4:
|
||||||
rt = ba4500(argc,argv) ; break;
|
ba4500(argc,argv) ; break;
|
||||||
case 5:
|
case 5:
|
||||||
rt = ba4600(argc,argv) ; break;
|
ba4600(argc,argv) ; break;
|
||||||
default:
|
default:
|
||||||
error_box(usage, argv[0]) ;
|
ba4100(argc,argv) ; break;
|
||||||
exit(1);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return rt;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
ba/ba4.h
12
ba/ba4.h
@ -1,19 +1,11 @@
|
|||||||
#ifndef __BA4_H
|
#ifndef __BA4_H
|
||||||
#define __BA4_H
|
#define __BA4_H
|
||||||
|
|
||||||
#ifdef MAIN
|
|
||||||
#define extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MAIN
|
|
||||||
#undef extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // __BA4_H
|
|
||||||
|
|
||||||
int ba4100(int argc, char* argv[]);
|
int ba4100(int argc, char* argv[]);
|
||||||
int ba4200(int argc, char* argv[]);
|
int ba4200(int argc, char* argv[]);
|
||||||
int ba4300(int argc, char* argv[]);
|
int ba4300(int argc, char* argv[]);
|
||||||
int ba4400(int argc, char* argv[]);
|
int ba4400(int argc, char* argv[]);
|
||||||
int ba4500(int argc, char* argv[]);
|
int ba4500(int argc, char* argv[]);
|
||||||
int ba4600(int argc, char* argv[]);
|
int ba4600(int argc, char* argv[]);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -8,6 +8,7 @@ class TComuni_app : public TRelation_application
|
|||||||
TMask * _msk;
|
TMask * _msk;
|
||||||
TRelation * _rel;
|
TRelation * _rel;
|
||||||
|
|
||||||
|
protected:
|
||||||
virtual bool user_create() ;
|
virtual bool user_create() ;
|
||||||
virtual bool user_destroy() ;
|
virtual bool user_destroy() ;
|
||||||
virtual void init_query_mode(TMask& m);
|
virtual void init_query_mode(TMask& m);
|
||||||
@ -15,11 +16,11 @@ class TComuni_app : public TRelation_application
|
|||||||
virtual void init_insert_mode(TMask& m) { init_modify_mode(m);}
|
virtual void init_insert_mode(TMask& m) { init_modify_mode(m);}
|
||||||
virtual bool changing_mask(int mode) { return FALSE;}
|
virtual bool changing_mask(int mode) { return FALSE;}
|
||||||
virtual TRelation* get_relation() const { return _rel;}
|
virtual TRelation* get_relation() const { return _rel;}
|
||||||
|
virtual TMask* get_mask(int mode) { return _msk;}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual TMask* get_mask(int mode) { return _msk;}
|
TComuni_app() : _msk(NULL), _rel(NULL) { }
|
||||||
TComuni_app() {}
|
virtual ~TComuni_app() { }
|
||||||
virtual ~TComuni_app() {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void TComuni_app::init_query_mode(TMask& m)
|
void TComuni_app::init_query_mode(TMask& m)
|
||||||
@ -36,8 +37,8 @@ TComuni_app & app() { return (TComuni_app &) main_app(); }
|
|||||||
|
|
||||||
bool TComuni_app::user_create()
|
bool TComuni_app::user_create()
|
||||||
{
|
{
|
||||||
_msk = new TMask("ba4100a") ;
|
|
||||||
_rel = new TRelation(LF_COMUNI);
|
_rel = new TRelation(LF_COMUNI);
|
||||||
|
_msk = new TMask("ba4100a") ;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
|
#include <defmask.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <golem.h>
|
#include <golem.h>
|
||||||
#include <mailbox.h>
|
#include <mailbox.h>
|
||||||
#include <relapp.h>
|
#include <relapp.h>
|
||||||
#include <utility.h>
|
|
||||||
#include <urldefid.h>
|
|
||||||
#include <validate.h>
|
#include <validate.h>
|
||||||
|
|
||||||
#include "ba4.h"
|
#include "ba4.h"
|
||||||
@ -13,7 +12,6 @@
|
|||||||
#define FLD_GD1_CODANAGR 127
|
#define FLD_GD1_CODANAGR 127
|
||||||
#define FLD_GD1_CODDITTAH 627
|
#define FLD_GD1_CODDITTAH 627
|
||||||
|
|
||||||
|
|
||||||
class TPersone_app : public TRelation_application
|
class TPersone_app : public TRelation_application
|
||||||
{
|
{
|
||||||
char _tip_ana;
|
char _tip_ana;
|
||||||
@ -21,6 +19,7 @@ class TPersone_app : public TRelation_application
|
|||||||
char _next_ana;
|
char _next_ana;
|
||||||
bool _reset_codreg;
|
bool _reset_codreg;
|
||||||
TString16 _cod_ana ;
|
TString16 _cod_ana ;
|
||||||
|
TString16 _next_key;
|
||||||
TMask* _msk[2] ;
|
TMask* _msk[2] ;
|
||||||
TRelation* _rel[2];
|
TRelation* _rel[2];
|
||||||
TLocalisamfile* _comuni;
|
TLocalisamfile* _comuni;
|
||||||
@ -75,9 +74,10 @@ bool TPersone_app::ba4200_handler(TMask& m, KEY k)
|
|||||||
m.stop_run(K_ESC);
|
m.stop_run(K_ESC);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (k != K_F5 || m.mode() != MODE_MOD) return TRUE;
|
if (k != K_F5 || m.mode() != MODE_MOD)
|
||||||
TToken_string body(16);
|
return TRUE;
|
||||||
|
|
||||||
|
TToken_string body;
|
||||||
body.add(FLD_GD1_CODDITTAH);
|
body.add(FLD_GD1_CODDITTAH);
|
||||||
|
|
||||||
body.add(FLD_GD1_TIPOA);
|
body.add(FLD_GD1_TIPOA);
|
||||||
@ -86,7 +86,7 @@ bool TPersone_app::ba4200_handler(TMask& m, KEY k)
|
|||||||
body.add(FLD_GD1_CODANAGR);
|
body.add(FLD_GD1_CODANAGR);
|
||||||
body << '=' << app.cod_ana();
|
body << '=' << app.cod_ana();
|
||||||
|
|
||||||
const TString16 cmd("ba4 -2");
|
const char* const cmd = "ba4 -2";
|
||||||
TMessage msg(cmd, MSG_FS, body);
|
TMessage msg(cmd, MSG_FS, body);
|
||||||
msg.send();
|
msg.send();
|
||||||
TExternal_app a(cmd);
|
TExternal_app a(cmd);
|
||||||
@ -183,7 +183,8 @@ const char* TPersone_app::get_next_key()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_cod_ana.format("%ld", cod_anagr);
|
_cod_ana.format("%ld", cod_anagr);
|
||||||
return format("%d|%ld", FLD_CODANAGR, cod_anagr);
|
_next_key.format("%d|%ld", FLD_CODANAGR, cod_anagr);
|
||||||
|
return _next_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -577,15 +578,14 @@ TMask* TPersone_app::get_mask(int mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool TPersone_app::user_create()
|
bool TPersone_app::user_create()
|
||||||
|
|
||||||
{
|
{
|
||||||
_msk[MSKF] = NULL;
|
_msk[MSKF] = NULL;
|
||||||
_rel[MSKF] = new TRelation(LF_ANAG);
|
_rel[MSKF] = new TRelation(LF_ANAG);
|
||||||
_rel[MSKF]->add(LF_ANAGFIS, "CODANAGR=CODANAGR", 1, 0, 0);
|
_rel[MSKF]->add(LF_ANAGFIS, "CODANAGR=CODANAGR", 1);
|
||||||
|
|
||||||
_msk[MSKG] = NULL;
|
_msk[MSKG] = NULL;
|
||||||
_rel[MSKG] = new TRelation(LF_ANAG);
|
_rel[MSKG] = new TRelation(LF_ANAG);
|
||||||
_rel[MSKG]->add(LF_ANAGGIU, "CODANAGR=CODANAGR", 1, 0, 0);
|
_rel[MSKG]->add(LF_ANAGGIU, "CODANAGR=CODANAGR", 1);
|
||||||
|
|
||||||
_comuni = new TLocalisamfile(LF_COMUNI) ;
|
_comuni = new TLocalisamfile(LF_COMUNI) ;
|
||||||
_tabcom = new TLocalisamfile(LF_TABCOM) ;
|
_tabcom = new TLocalisamfile(LF_TABCOM) ;
|
||||||
@ -602,7 +602,6 @@ bool TPersone_app::user_create()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TPersone_app::write_enable(bool on)
|
void TPersone_app::write_enable(bool on)
|
||||||
|
|
||||||
{
|
{
|
||||||
_rel[MSKF]->write_enable(0, on);
|
_rel[MSKF]->write_enable(0, on);
|
||||||
_rel[MSKG]->write_enable(0, on);
|
_rel[MSKG]->write_enable(0, on);
|
||||||
@ -610,13 +609,13 @@ void TPersone_app::write_enable(bool on)
|
|||||||
|
|
||||||
bool TPersone_app::user_destroy()
|
bool TPersone_app::user_destroy()
|
||||||
{
|
{
|
||||||
for ( int j = 0 ; j < 2 ; j++ )
|
for (int j = 1; j >= 0; j--)
|
||||||
{
|
{
|
||||||
if (_msk[j]) delete _msk[j] ;
|
if (_msk[j]) delete _msk[j] ;
|
||||||
if (_rel[j]) delete _rel[j] ;
|
if (_rel[j]) delete _rel[j] ;
|
||||||
}
|
}
|
||||||
delete _comuni;
|
|
||||||
delete _tabcom;
|
delete _tabcom;
|
||||||
|
delete _comuni;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -194,17 +194,18 @@ bool TDitte_application::fax_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
bool TDitte_application::user_create() // initvar e arrmask
|
bool TDitte_application::user_create() // initvar e arrmask
|
||||||
{
|
{
|
||||||
_msk = new TMask("ba4300a") ;
|
|
||||||
_msk->set_handler(DLG_FAX, fax_handler);
|
|
||||||
_msk->set_handler(ba4300_handler);
|
|
||||||
|
|
||||||
_rel = new TRelation(LF_NDITTE);
|
_rel = new TRelation(LF_NDITTE);
|
||||||
_anag = new TLocalisamfile(LF_ANAG);
|
_anag = new TLocalisamfile(LF_ANAG);
|
||||||
_unloc = new TLocalisamfile(LF_UNLOC);
|
_unloc = new TLocalisamfile(LF_UNLOC);
|
||||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||||
_tabcom = new TLocalisamfile(LF_TABCOM);
|
_tabcom = new TLocalisamfile(LF_TABCOM);
|
||||||
_cespiti = has_module(CEAUT);
|
_cespiti = has_module(CEAUT);
|
||||||
|
|
||||||
|
_msk = new TMask("ba4300a") ;
|
||||||
|
_msk->set_handler(DLG_FAX, fax_handler);
|
||||||
|
_msk->set_handler(ba4300_handler);
|
||||||
set_search_field(FLD_GD1_CODDITTA);
|
set_search_field(FLD_GD1_CODDITTA);
|
||||||
|
|
||||||
if (argc() > 2)
|
if (argc() > 2)
|
||||||
{
|
{
|
||||||
get_mask(MODE_QUERY);
|
get_mask(MODE_QUERY);
|
||||||
|
@ -45,12 +45,12 @@ HIDDEN bool clear_cap(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
bool BA4400_application::user_create()
|
bool BA4400_application::user_create()
|
||||||
{
|
{
|
||||||
_msk = new TMask("ba4400a") ;
|
|
||||||
_msk->set_handler(FLD_UL1_COMULC, clear_cap);
|
|
||||||
_msk->set_handler(FLD_UL2_COMTRIB, clear_cap);
|
|
||||||
_rel = new TRelation(LF_UNLOC) ;
|
_rel = new TRelation(LF_UNLOC) ;
|
||||||
_anag = new TLocalisamfile(LF_ANAG) ;
|
_anag = new TLocalisamfile(LF_ANAG) ;
|
||||||
_ditte = new TLocalisamfile(LF_NDITTE) ;
|
_ditte = new TLocalisamfile(LF_NDITTE) ;
|
||||||
|
_msk = new TMask("ba4400a") ;
|
||||||
|
_msk->set_handler(FLD_UL1_COMULC, clear_cap);
|
||||||
|
_msk->set_handler(FLD_UL2_COMTRIB, clear_cap);
|
||||||
set_search_field(FLD_UL1_CODULC);
|
set_search_field(FLD_UL1_CODULC);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -113,19 +113,18 @@ HIDDEN bool clear_cap(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
bool TAttivita_application::user_create()
|
bool TAttivita_application::user_create()
|
||||||
{
|
{
|
||||||
_msk = new TMask("ba4500a") ;
|
|
||||||
_msk->set_handler(FLD_AT2_CODANGRDS, gest_res);
|
|
||||||
_msk->set_handler(FLD_AT2_COMCS, clear_cap);
|
|
||||||
_rel = new TRelation(LF_ATTIV) ;
|
_rel = new TRelation(LF_ATTIV) ;
|
||||||
_anag = new TLocalisamfile(LF_ANAG) ;
|
_anag = new TLocalisamfile(LF_ANAG) ;
|
||||||
_ditte = new TLocalisamfile(LF_NDITTE) ;
|
_ditte = new TLocalisamfile(LF_NDITTE) ;
|
||||||
_comuni = new TLocalisamfile(LF_COMUNI) ;
|
_comuni = new TLocalisamfile(LF_COMUNI) ;
|
||||||
|
_msk = new TMask("ba4500a") ;
|
||||||
|
_msk->set_handler(FLD_AT2_CODANGRDS, gest_res);
|
||||||
|
_msk->set_handler(FLD_AT2_COMCS, clear_cap);
|
||||||
set_search_field(FLD_AT1_CODATTH);
|
set_search_field(FLD_AT1_CODATTH);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TAttivita_application::init_query_mode(TMask& m)
|
void TAttivita_application::init_query_mode(TMask& m)
|
||||||
|
|
||||||
{
|
{
|
||||||
m.show(FLD_AT1_CODATTH);
|
m.show(FLD_AT1_CODATTH);
|
||||||
m.hide(FLD_AT1_CODATT);
|
m.hide(FLD_AT1_CODATT);
|
||||||
@ -134,7 +133,6 @@ void TAttivita_application::init_query_mode(TMask& m)
|
|||||||
|
|
||||||
|
|
||||||
void TAttivita_application::init_query_insert_mode(TMask& m)
|
void TAttivita_application::init_query_insert_mode(TMask& m)
|
||||||
|
|
||||||
{
|
{
|
||||||
m.show(FLD_AT1_CODATT);
|
m.show(FLD_AT1_CODATT);
|
||||||
m.hide(FLD_AT1_CODATTH);
|
m.hide(FLD_AT1_CODATTH);
|
||||||
|
26
ba/ba883.cpp
26
ba/ba883.cpp
@ -212,10 +212,10 @@ void TTest_application::fill_trees(TMask& msk)
|
|||||||
st->add_rbrother("son 2");
|
st->add_rbrother("son 2");
|
||||||
st->add_son("child 1");
|
st->add_son("child 1");
|
||||||
st->add_rbrother("child 2");
|
st->add_rbrother("child 2");
|
||||||
// st->expand_all();
|
st->expand_all();
|
||||||
TTree_field& tf = (TTree_field&)msk.fld(f);
|
TTree_field& tf = (TTree_field&)msk.fld(f);
|
||||||
tf.set_tree(st);
|
tf.set_tree(st);
|
||||||
tf.hide_leaves();
|
// tf.hide_leaves();
|
||||||
tf.set_handler(tree_handler);
|
tf.set_handler(tree_handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,24 +323,23 @@ void TBenchmark_application::update_bar(long rec)
|
|||||||
|
|
||||||
void TBenchmark_application::test_file_scan()
|
void TBenchmark_application::test_file_scan()
|
||||||
{
|
{
|
||||||
int found = 0;
|
|
||||||
|
|
||||||
initializing();
|
initializing();
|
||||||
|
|
||||||
TLocalisamfile comuni(LF_COMUNI);
|
TSystemisamfile comuni(LF_COMUNI);
|
||||||
|
int err = comuni.open(_excllock);
|
||||||
|
|
||||||
start_test("Scansione file COMUNI di Reggio Emilia");
|
if (err == NOERR)
|
||||||
|
{
|
||||||
comuni.first();
|
start_test("Scansione file COMUNI in modo esclusivo");
|
||||||
for (TRecnotype rec = 0; !comuni.eof(); rec++)
|
comuni.first();
|
||||||
|
for (TRecnotype rec = 0; comuni.good(); rec++)
|
||||||
{
|
{
|
||||||
if (comuni.get("PROVCOM") == "RE")
|
|
||||||
found++;
|
|
||||||
comuni.next();
|
comuni.next();
|
||||||
update_bar(rec);
|
update_bar(rec);
|
||||||
}
|
}
|
||||||
|
comuni.close();
|
||||||
stop_test();
|
stop_test();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -363,7 +362,6 @@ void TBenchmark_application::test_relation_scan()
|
|||||||
|
|
||||||
void TBenchmark_application::test_cursor_scan()
|
void TBenchmark_application::test_cursor_scan()
|
||||||
{
|
{
|
||||||
int found = 0;
|
|
||||||
initializing();
|
initializing();
|
||||||
|
|
||||||
TRelation comuni(LF_COMUNI);
|
TRelation comuni(LF_COMUNI);
|
||||||
@ -377,8 +375,6 @@ void TBenchmark_application::test_cursor_scan()
|
|||||||
cur = 0L;
|
cur = 0L;
|
||||||
for (TRecnotype c = 0; c < tot; c++)
|
for (TRecnotype c = 0; c < tot; c++)
|
||||||
{
|
{
|
||||||
if (comuni.curr().get("PROVCOM") == "RE")
|
|
||||||
found++;
|
|
||||||
++cur;
|
++cur;
|
||||||
update_bar(c);
|
update_bar(c);
|
||||||
}
|
}
|
||||||
|
@ -430,11 +430,10 @@ bool TForm_editor::edit_formato_data()
|
|||||||
d.set_format(fmt);
|
d.set_format(fmt);
|
||||||
|
|
||||||
m.set(F_DEXAMPLE, d.string());
|
m.set(F_DEXAMPLE, d.string());
|
||||||
|
dirty = m.run() == K_ENTER;
|
||||||
if (dirty = (m.run() == K_ENTER))
|
if (dirty)
|
||||||
{
|
{
|
||||||
char format[6];
|
char format[6];
|
||||||
|
|
||||||
format[0] = m.get(F_DFORMAT)[0];
|
format[0] = m.get(F_DFORMAT)[0];
|
||||||
format[1] = m.get(F_DDAY )[0];
|
format[1] = m.get(F_DDAY )[0];
|
||||||
format[2] = m.get(F_DMONTH )[0];
|
format[2] = m.get(F_DMONTH )[0];
|
||||||
@ -445,7 +444,6 @@ bool TForm_editor::edit_formato_data()
|
|||||||
_form->change_date_format(format);
|
_form->change_date_format(format);
|
||||||
}
|
}
|
||||||
return dirty;
|
return dirty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TForm_editor::edit_relation()
|
bool TForm_editor::edit_relation()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user