Patch level : 2.2
Files correlati : ca?.exe Ricompilazione Demo : [ ] Commento : Migliorata sensibilmente la velocita' di generazione dei campi analitici. La tipica maschera ora impiega meno di 1 secondo (invece di 6) per comparire. git-svn-id: svn://10.65.10.50/trunk@13347 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
987a23dfb4
commit
6d67a73f1c
@ -43,7 +43,7 @@ public:
|
||||
|
||||
bool TPrint_pdc::create()
|
||||
{
|
||||
TConfig_anal& cfg = ca_config();
|
||||
TConfig& cfg = ca_config();
|
||||
const TString& pdc = cfg.get("Pdci", NULL, 1);
|
||||
|
||||
if (pdc.blank())
|
||||
|
@ -596,7 +596,7 @@ void TMovanal_msk::create_sheet()
|
||||
|
||||
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
||||
|
||||
TConfig_anal& ini = ca_config();
|
||||
TConfig& ini = ca_config();
|
||||
const bool fsc_req = ini.get_bool("FscRequired");
|
||||
|
||||
int y = 3;
|
||||
|
@ -122,7 +122,7 @@ bool TPrint_movimenti_ca_mask::on_field_event(TOperable_field& o, TField_event e
|
||||
TPrint_movimenti_ca_mask::TPrint_movimenti_ca_mask()
|
||||
:TAnal_report_mask("ca3100")
|
||||
{
|
||||
TConfig_anal& cfg = ca_config();
|
||||
TConfig& cfg = ca_config();
|
||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||
|
||||
const int logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
||||
|
@ -119,7 +119,7 @@ bool TPrint_mastrini_ca_mask::on_field_event(TOperable_field& o, TField_event e,
|
||||
TPrint_mastrini_ca_mask::TPrint_mastrini_ca_mask()
|
||||
:TAnal_report_mask("ca3200")
|
||||
{
|
||||
TConfig_anal& cfg = ca_config();
|
||||
TConfig& cfg = ca_config();
|
||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||
|
||||
const int logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
||||
|
@ -174,7 +174,7 @@ void TPrint_bilancio_ca_mask::create_sheet()
|
||||
|
||||
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
||||
|
||||
TConfig_anal& ini = ca_config();
|
||||
TConfig& ini = ca_config();
|
||||
const bool fsc_req = ini.get_bool("FscRequired");
|
||||
|
||||
int y = 1;
|
||||
@ -234,7 +234,7 @@ bool TPrint_bilancio_ca_mask::esistono_riclassificazioni() const
|
||||
TPrint_bilancio_ca_mask::TPrint_bilancio_ca_mask()
|
||||
:TAutomask("ca3300")
|
||||
{
|
||||
TConfig_anal& cfg = ca_config();
|
||||
TConfig& cfg = ca_config();
|
||||
|
||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||
|
||||
|
@ -147,7 +147,7 @@ bool TPrint_rendiconto_ca_mask::esistono_riclassificazioni() const
|
||||
TPrint_rendiconto_ca_mask::TPrint_rendiconto_ca_mask()
|
||||
:TAnal_report_mask("ca3700")
|
||||
{
|
||||
TConfig_anal& cfg = ca_config();
|
||||
TConfig& cfg = ca_config();
|
||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||
|
||||
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
|
||||
@ -795,7 +795,7 @@ void TPrint_rendiconto_ca_recordset::crea_righe_da_rdoc(const TPrint_rendiconto_
|
||||
//Filtro sulle righe documento (e testate collegate)
|
||||
//Controlla sul file di configurazione di CA (ditta.ini,[ca]) se esistono numerazioni da escludere..
|
||||
//..e se, per alcune numerazioni, deve tener conto dello stato del documento
|
||||
TConfig_anal& config = ca_config();
|
||||
TConfig& config = ca_config();
|
||||
|
||||
bool update = false;
|
||||
for (int i = 0;;i++) //scansione delle righe ND(i)=.. sul paragrafo di configurazione CA
|
||||
|
@ -71,7 +71,7 @@ TCode_generator::TCode_generator(int logicnum)
|
||||
|
||||
if (logicnum <= 0)
|
||||
{
|
||||
TConfig_anal& cfg = ca_config();
|
||||
TConfig& cfg = ca_config();
|
||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||
logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <dongle.h>
|
||||
#include <modaut.h>
|
||||
#include <tree.h>
|
||||
|
||||
#include <pconti.h>
|
||||
|
||||
#include "calib01.h"
|
||||
@ -17,6 +18,15 @@
|
||||
///////////////////////////////////////////////////////////
|
||||
// TConfig_anal
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TConfig_anal : public TConfig
|
||||
{
|
||||
bool _has_ca;
|
||||
public:
|
||||
virtual const TString& get(const char* var, const char* section = NULL, int index = -1, const char* def = "");
|
||||
TConfig_anal();
|
||||
};
|
||||
|
||||
TConfig_anal::TConfig_anal() : TConfig(CONFIG_DITTA, "ca"), _has_ca(dongle().active(CAAUT))
|
||||
{
|
||||
}
|
||||
@ -50,7 +60,7 @@ const TString& TConfig_anal::get(const char* var, const char* section, int index
|
||||
return tmp;
|
||||
}
|
||||
|
||||
TConfig_anal& ca_config()
|
||||
TConfig& ca_config()
|
||||
{
|
||||
static TConfig_anal* cfg = NULL;
|
||||
if (cfg == NULL)
|
||||
@ -178,7 +188,7 @@ TMultilevel_code_info::TMultilevel_code_info(int logicnum) : _logicnum(logicnum)
|
||||
}
|
||||
else
|
||||
{
|
||||
TConfig_anal& cfg = ca_config();
|
||||
TConfig& cfg = ca_config();
|
||||
|
||||
if (logicnum == LF_FASI)
|
||||
{
|
||||
@ -222,6 +232,9 @@ TMultilevel_code_info::TMultilevel_code_info(int logicnum) : _logicnum(logicnum)
|
||||
}
|
||||
add_fieldref(2, 0, 0);
|
||||
}
|
||||
|
||||
const TRectype rec(logicnum);
|
||||
rec.get_relapp(_editor);
|
||||
}
|
||||
|
||||
const TMultilevel_code_info& ca_multilevel_code_info(int logicnum)
|
||||
@ -306,8 +319,7 @@ static void ca_append_select_clause(ostream& out, int level, int logic)
|
||||
|
||||
static void ca_append_run_clause(ostream& out, int logicnum)
|
||||
{
|
||||
const TRectype r(logicnum);
|
||||
TString app; r.get_relapp(app);
|
||||
const TString& app = ca_multilevel_code_info(logicnum).editor();
|
||||
if (app.not_empty())
|
||||
out << "AD RU " << app << '\n';
|
||||
}
|
||||
@ -431,6 +443,7 @@ void ca_create_browse2(TEdit_field& kfld, int level, int logic, short key_id, sh
|
||||
int ca_create_fields(TMask& msk, int page, int logicnum, int x, int y,
|
||||
short key_id, short des_id, unsigned int mode, const char* fieldname)
|
||||
{
|
||||
TWait_cursor hourglass;
|
||||
const TMultilevel_code_info& mci = ca_multilevel_code_info(logicnum);
|
||||
|
||||
int maxkeylen = 0, maxdeslen = 0;
|
||||
|
12
ca/calib01.h
12
ca/calib01.h
@ -21,15 +21,7 @@ class TBill;
|
||||
// TConfig_anal
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TConfig_anal : public TConfig
|
||||
{
|
||||
bool _has_ca;
|
||||
public:
|
||||
virtual const TString& get(const char* var, const char* section = NULL, int index = -1, const char* def = "");
|
||||
TConfig_anal();
|
||||
};
|
||||
|
||||
TConfig_anal& ca_config();
|
||||
TConfig& ca_config();
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TConfig_anal
|
||||
@ -43,6 +35,7 @@ class TMultilevel_code_info : public TObject
|
||||
TArray _key1_fields; // TFieldrefs of key 1 mask fields
|
||||
TArray _key2_fields; // TFieldrefs of key 2 mask fields
|
||||
int _parentnum; // Logic number of parent file (LF_FASI only)
|
||||
TString8 _editor; // Riga di comando del programma gestore
|
||||
|
||||
protected:
|
||||
bool get_cfg_vars(TString& key, TString& des) const;
|
||||
@ -59,6 +52,7 @@ public:
|
||||
const TString& prompt(int level) const;
|
||||
const TFieldref& fieldref(int level, int key = 1) const;
|
||||
int parent() const { return _parentnum; }
|
||||
const TString& editor() const { return _editor; }
|
||||
|
||||
TMultilevel_code_info(int logicnum);
|
||||
virtual ~TMultilevel_code_info() { }
|
||||
|
@ -180,9 +180,9 @@ const TVariant& TPconana_recordset::get(const char* field) const
|
||||
bool TPconana_recordset::valid_record(const TRelation& rel) const
|
||||
{
|
||||
TString80 conto;
|
||||
if (_tipo == 'C')
|
||||
const TRectype& curr = rel.curr();
|
||||
if (curr.num() == LF_PCON)
|
||||
{
|
||||
const TRectype& curr = rel.curr();
|
||||
const TBill b(curr);
|
||||
|
||||
int level = 0;
|
||||
@ -204,7 +204,7 @@ bool TPconana_recordset::valid_record(const TRelation& rel) const
|
||||
}
|
||||
else
|
||||
{
|
||||
conto = rel.curr().get(PCONANA_CODCONTO);
|
||||
conto = curr.get(PCONANA_CODCONTO);
|
||||
if (conto.len() <= _conto_minlen)
|
||||
return false;
|
||||
}
|
||||
@ -228,10 +228,10 @@ bool TPconana_recordset::pianoconti_filter(const TRelation* rel)
|
||||
|
||||
void TPconana_recordset::set_custom_filter(TCursor& cursor) const
|
||||
{
|
||||
if (_tipo == 'C')
|
||||
const int logic = cursor.curr().num();
|
||||
TRectype darec(logic), arec(logic);
|
||||
if (logic == LF_PCON)
|
||||
{
|
||||
TRectype darec(LF_PCON), arec(LF_PCON);
|
||||
|
||||
if (_da_conto.not_empty())
|
||||
{
|
||||
darec.put(PCN_GRUPPO, _da_conto.mid(0,3));
|
||||
@ -244,16 +244,14 @@ void TPconana_recordset::set_custom_filter(TCursor& cursor) const
|
||||
arec.put(PCN_CONTO, _a_conto.mid(3,3));
|
||||
arec.put(PCN_SOTTOCONTO, _a_conto.mid(6,6));
|
||||
}
|
||||
cursor.setregion(darec, arec);
|
||||
memset((void*)_is_anal, 0, sizeof(_is_anal)); // Azzera flags di conti analitici
|
||||
}
|
||||
else
|
||||
{
|
||||
TRectype darec(LF_PCONANA), arec(LF_PCONANA);
|
||||
darec.put(PCONANA_CODCONTO, _da_conto);
|
||||
arec.put(PCONANA_CODCONTO, _a_conto);
|
||||
cursor.setregion(darec, arec);
|
||||
}
|
||||
cursor.setregion(darec, arec);
|
||||
|
||||
_current_recset = this;
|
||||
cursor.set_filterfunction(pianoconti_filter);
|
||||
@ -263,7 +261,7 @@ void TPconana_recordset::set_tipo(char tipo)
|
||||
{
|
||||
if (tipo != 'A' && tipo != 'C')
|
||||
{
|
||||
TConfig_anal& cfg = ca_config();
|
||||
TConfig& cfg = ca_config();
|
||||
tipo = cfg.get_bool("UsePdcc") ? 'C' : 'A';
|
||||
}
|
||||
_tipo = tipo;
|
||||
@ -383,19 +381,23 @@ void TAnal_report::msg_format_commessa_costo(TVariant_stack& stack)
|
||||
|
||||
bool TAnal_report::execute_usr_word(unsigned int opcode, TVariant_stack& stack)
|
||||
{
|
||||
if (opcode < _first_msg)
|
||||
return TReport::execute_usr_word(opcode, stack);
|
||||
opcode -= _first_msg;
|
||||
switch (opcode)
|
||||
bool ok = true;
|
||||
if (opcode >= _first_msg)
|
||||
{
|
||||
case 0 : msg_format_costo(stack); break;
|
||||
case 1 : msg_format_commessa(stack); break;
|
||||
case 2 : msg_format_fase(stack); break;
|
||||
case 3 : msg_format_conto(stack); break;
|
||||
case 4 : msg_format_commessa_costo(stack); break;
|
||||
default: break;
|
||||
opcode -= _first_msg;
|
||||
switch (opcode)
|
||||
{
|
||||
case 0 : msg_format_costo(stack); break;
|
||||
case 1 : msg_format_commessa(stack); break;
|
||||
case 2 : msg_format_fase(stack); break;
|
||||
case 3 : msg_format_conto(stack); break;
|
||||
case 4 : msg_format_commessa_costo(stack); break;
|
||||
default: ok = false; break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
else
|
||||
ok = TReport::execute_usr_word(opcode, stack);
|
||||
return ok;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -603,7 +605,6 @@ TRiclassify_cache::TRiclassify_cache() : TCache(7)
|
||||
_conto_min = info.total_len(-1); // Lunghezza conti fino al penultimo livello
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// TSaldi_cache
|
||||
////////////////////////////////////////////////////////
|
||||
@ -996,7 +997,7 @@ void TAnal_report_mask::create_sheet(short sheet_id)
|
||||
|
||||
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
||||
|
||||
TConfig_anal& ini = ca_config();
|
||||
TConfig& ini = ca_config();
|
||||
|
||||
int y = 1;
|
||||
short dlg = S_CDC1 + 100; // id del primo campo da generare
|
||||
|
Loading…
x
Reference in New Issue
Block a user