Patch level : 12.0 1130
Files correlati : ba1.exe Commento: Aggiunta una funzione "Recupero" per recuperare files che danno errori sulla lunghezza del record. Interno E' protetta da password [ADMIN e (giorno+mese)]
This commit is contained in:
parent
e8c708d56e
commit
06f27089fb
File diff suppressed because it is too large
Load Diff
159
src/ba/ba1100.h
159
src/ba/ba1100.h
@ -1,6 +1,10 @@
|
||||
#ifndef __BA1100_H
|
||||
#define __BA1100_H
|
||||
|
||||
#ifndef __APPLICAT_H
|
||||
#include <applicat.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
@ -17,6 +21,14 @@
|
||||
class TMask_field;
|
||||
#endif
|
||||
|
||||
#ifndef __PRINTER_H
|
||||
#include <printer.h>
|
||||
#endif
|
||||
|
||||
#ifndef __REPUTILS_H
|
||||
#include <reputils.h>
|
||||
#endif
|
||||
|
||||
#include "ba1100a.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -25,71 +37,128 @@ class TMask_field;
|
||||
|
||||
class TDir_sheet : public TSheet
|
||||
{
|
||||
TTrec _rec;
|
||||
TDir _dir;
|
||||
FileDes _s_dir;
|
||||
long _items;
|
||||
TTrec _rec;
|
||||
TDir _dir;
|
||||
FileDes _s_dir;
|
||||
long _items;
|
||||
|
||||
protected:
|
||||
virtual long get_items() const { return _items; }
|
||||
virtual void get_row(long n, TToken_string& r);
|
||||
protected:
|
||||
virtual long get_items() const { return _items; }
|
||||
virtual void get_row(long n, TToken_string& r);
|
||||
|
||||
public:
|
||||
const TDir& dir() const { return _dir; }
|
||||
TDir& dir() { return _dir; }
|
||||
const TTrec& rec() const { return _rec; }
|
||||
TTrec& rec(){ return _rec; }
|
||||
void set_items(long items) { _items = items; }
|
||||
void add();
|
||||
void rebuild() { _items = _dir.items();}
|
||||
const TDir& dir() const { return _dir; }
|
||||
TDir& dir() { return _dir; }
|
||||
const TTrec& rec() const { return _rec; }
|
||||
TTrec& rec() { return _rec; }
|
||||
void set_items(long items) { _items = items; }
|
||||
void add();
|
||||
void rebuild() { _items = _dir.items(); }
|
||||
|
||||
TDir_sheet(const char* title, bool superprassi);
|
||||
TDir_sheet(const char* title, bool superprassi);
|
||||
};
|
||||
|
||||
class TRec_sheet : public TObject
|
||||
{
|
||||
TTrec _rec;
|
||||
TTrec _rec_old;
|
||||
TDir _dir;
|
||||
bool _comfile;
|
||||
TConfig *_descr;
|
||||
static TMask *_mask;
|
||||
TFilename _descfname;
|
||||
TString16 _tab;
|
||||
bool _external;
|
||||
TTrec _rec;
|
||||
TTrec _rec_old;
|
||||
TDir _dir;
|
||||
bool _comfile;
|
||||
TConfig *_descr;
|
||||
static TMask *_mask;
|
||||
TFilename _descfname;
|
||||
TString16 _tab;
|
||||
bool _external;
|
||||
|
||||
protected:
|
||||
bool check_key_expr(int key, const char* key_expr);
|
||||
static bool key_notify(TSheet_field& s, int r, KEY k);
|
||||
static bool fld_notify(TSheet_field& s, int r, KEY k);
|
||||
void save();
|
||||
void save_desc();
|
||||
|
||||
virtual long get_items() const { return _rec.fields(); }
|
||||
bool check_key_expr(int key, const char* key_expr);
|
||||
static bool key_notify(TSheet_field& s, int r, KEY k);
|
||||
static bool fld_notify(TSheet_field& s, int r, KEY k);
|
||||
void save();
|
||||
void save_desc();
|
||||
|
||||
virtual long get_items() const { return _rec.fields(); }
|
||||
|
||||
public:
|
||||
const TDir& dir() const { return _dir; }
|
||||
const TTrec& rec() const { return _rec; }
|
||||
const char* descfname() const { return _descfname;}
|
||||
const char* tab() const { return _tab; }
|
||||
void edit();
|
||||
const TDir& dir() const { return _dir; }
|
||||
const TTrec& rec() const { return _rec; }
|
||||
const char* descfname() const { return _descfname; }
|
||||
const char* tab() const { return _tab; }
|
||||
void edit();
|
||||
|
||||
TRec_sheet(int logicnum, const char* tab);
|
||||
TRec_sheet(TExternisamfile* file);
|
||||
virtual ~TRec_sheet();
|
||||
TRec_sheet(int logicnum, const char* tab);
|
||||
TRec_sheet(TExternisamfile* file);
|
||||
virtual ~TRec_sheet();
|
||||
};
|
||||
|
||||
class TEdit_file : public TObject
|
||||
{
|
||||
protected:
|
||||
void edit_record(TRectype& rec);
|
||||
bool browse_cursor(TCursor& cur, const TFilename& name);
|
||||
void edit_record(TRectype& rec);
|
||||
bool browse_cursor(TCursor& cur, const TFilename& name);
|
||||
|
||||
public:
|
||||
bool browse_file(int logicnum, const TFilename& name, const TString& tab, const int selKey = 1);
|
||||
bool browse_file(TExternisamfile* file, const TFilename& name);
|
||||
TEdit_file() {}
|
||||
virtual ~TEdit_file() {}
|
||||
bool browse_file(int logicnum, const TFilename& name, const TString& tab, const int selKey = 1);
|
||||
bool browse_file(TExternisamfile* file, const TFilename& name);
|
||||
TEdit_file() {}
|
||||
virtual ~TEdit_file() {}
|
||||
};
|
||||
|
||||
class TManutenzione_app : public TSkeleton_application
|
||||
{
|
||||
TDir_sheet* _browse;
|
||||
TArray _dirs;
|
||||
TArray _recs;
|
||||
TMask* _mask;
|
||||
long _firm;
|
||||
long _level;
|
||||
long _history_firm;
|
||||
TRec_sheet* _rec;
|
||||
TLog_report* _log;
|
||||
bool _print_log;
|
||||
|
||||
bool _superprassi;
|
||||
|
||||
protected:
|
||||
virtual void main_loop();
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
void insert_riga(long, TToken_string&);
|
||||
void edit_riga(long, TToken_string&);
|
||||
void edit_riga(const TString&);
|
||||
void delete_riga(long);
|
||||
virtual bool extended_firm() const { return true; }
|
||||
|
||||
bool set_converting();
|
||||
bool reset_converting();
|
||||
|
||||
bool try_to_recover(TSystemisamfile& f, int err);
|
||||
void update();
|
||||
void update_dir();
|
||||
void recover();
|
||||
void convert_dir();
|
||||
virtual void print();
|
||||
virtual void do_print(TPrinter & p, TRec_sheet & r);
|
||||
const char* dumpfilename(const FileDes& dep) const;
|
||||
void load_des();
|
||||
void open_history();
|
||||
void put_history(const char* firm);
|
||||
void close_history();
|
||||
void dump_trc(const char * dir, const bool des_too, const long modules);
|
||||
void repair_file(int i);
|
||||
void save_file(const char * file);
|
||||
|
||||
void open_log();
|
||||
void write_log(const char* line, const int severity = 0);
|
||||
void close_log();
|
||||
|
||||
bool moveable_file(int file) const;
|
||||
public:
|
||||
long get_firm() const { return _firm; }
|
||||
|
||||
TManutenzione_app();
|
||||
};
|
||||
|
||||
inline TManutenzione_app & app() { return (TManutenzione_app &)main_app(); }
|
||||
|
||||
#endif
|
||||
|
@ -49,5 +49,6 @@
|
||||
#define DLG_ADDFILE 609
|
||||
#define DLG_INSFILE 610
|
||||
#define DLG_OTHERFILE 611
|
||||
#define DLG_RECOVER 612
|
||||
|
||||
#endif
|
||||
|
@ -36,8 +36,9 @@ TDir_sheet::TDir_sheet(const char* title, bool superprassi)
|
||||
if (superprassi)
|
||||
{
|
||||
add_button(DLG_OTHERFILE, TR("File Esterni"), K_F5, 113);
|
||||
add_button(DLG_CONVERT, TR("Conversione"), K_F7, 156);
|
||||
if (is_power_station())
|
||||
add_button(DLG_CONVERT, TR("Conversione"), K_F7, 156);
|
||||
add_button(DLG_RECOVER, TR("Recupero"), K_SHIFT + K_F12, 131);
|
||||
if (is_power_station())
|
||||
add_button(DLG_ADDFILE, TR("Nuovo file"), K_F8, TOOL_NEWREC);
|
||||
add_button(DLG_NULL, "", 0); // Separatore
|
||||
}
|
||||
@ -275,9 +276,17 @@ void TRec_sheet::edit()
|
||||
}
|
||||
f2.set_notify(key_notify);
|
||||
f2.set_append(FALSE);
|
||||
int nkeys = _rec.keys();
|
||||
for (i = 0; i < nkeys; i++) f2.row(i) = _rec.keydef(i);
|
||||
f2.disable_cell(0, 1);
|
||||
|
||||
int nkeys = _rec.keys();
|
||||
|
||||
for (i = 0; i < nkeys; i++)
|
||||
f2.row(i) = _rec.keydef(i);
|
||||
f2.disable_cell(0, 1);
|
||||
|
||||
const bool enable_save = (_dir.is_com() && app().get_firm() == 0) ||
|
||||
(_dir.is_firm() && app().get_firm() > 0);
|
||||
|
||||
_mask->enable(DLG_SAVEREC, enable_save);
|
||||
while (true)
|
||||
{
|
||||
f1.force_update(0); // Non togliere, serve per fare l'update della descrizione quando si fa l'import!!
|
||||
|
Loading…
x
Reference in New Issue
Block a user