2004-11-29 09:52:49 +00:00
|
|
|
#ifndef __CALIB01_H
|
|
|
|
#define __CALIB01_H
|
|
|
|
|
|
|
|
#ifndef __AUTOMASK_H
|
|
|
|
#include <automask.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __RELAPP_H
|
|
|
|
#include <relapp.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TAnal_msk
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TAnal_msk : public TAutomask
|
|
|
|
{
|
2004-12-15 13:55:45 +00:00
|
|
|
TArray _key1_fields;
|
|
|
|
TArray _key2_fields;
|
|
|
|
|
2004-11-29 09:52:49 +00:00
|
|
|
protected:
|
2004-12-15 13:55:45 +00:00
|
|
|
void add_fieldref(const char* name, int from, int to, int key = 1);
|
2004-11-29 09:52:49 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
2004-12-15 13:55:45 +00:00
|
|
|
virtual void read(const char* msk);
|
2004-12-01 14:57:03 +00:00
|
|
|
|
2004-12-15 13:55:45 +00:00
|
|
|
virtual int create_key_fields();
|
2004-12-01 14:57:03 +00:00
|
|
|
virtual short create_tree_field();
|
2004-12-01 10:56:41 +00:00
|
|
|
int compute_offset() const;
|
2004-12-15 13:55:45 +00:00
|
|
|
TAnal_msk() { }
|
2004-11-29 09:52:49 +00:00
|
|
|
|
|
|
|
public:
|
2004-12-15 13:55:45 +00:00
|
|
|
void update_tree_field();
|
|
|
|
|
|
|
|
const TFieldref& fieldref(int n, int key = 1) const;
|
|
|
|
int fieldrefs(int key = 1) const;
|
|
|
|
|
2004-11-29 09:52:49 +00:00
|
|
|
virtual int get_logicnum() const pure;
|
2004-12-15 15:19:24 +00:00
|
|
|
virtual const char* get_tabname() const { return ""; }
|
2004-12-15 13:55:45 +00:00
|
|
|
virtual short get_field_id(int n, int key = 1) const pure;
|
|
|
|
|
|
|
|
virtual const TToken_string& get_key_value(const TRectype& rec, int k = 1) const;
|
|
|
|
virtual const TToken_string& get_key_value(int k = 1) const;
|
|
|
|
|
2004-11-29 09:52:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TSimple_anal_msk
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TSimple_anal_msk : public TAnal_msk
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
virtual const char* get_key_var() const pure;
|
|
|
|
virtual const char* get_des_var() const pure;
|
2004-12-15 13:55:45 +00:00
|
|
|
const char* get_key_fieldname(int k) const;
|
2004-12-15 15:19:24 +00:00
|
|
|
|
2004-12-15 13:55:45 +00:00
|
|
|
void append_select_clause(ostream& out, int level) const;
|
2004-11-29 09:52:49 +00:00
|
|
|
void create_key_browse(TEdit_field& kfld, int level, TConfig& cfg);
|
2004-12-01 10:56:41 +00:00
|
|
|
void create_des_browse(TEdit_field& kfld, int level, TConfig& cfg);
|
2004-11-29 09:52:49 +00:00
|
|
|
virtual int create_key_fields();
|
|
|
|
|
|
|
|
protected:
|
2004-12-15 13:55:45 +00:00
|
|
|
TSimple_anal_msk() { }
|
2004-11-29 09:52:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TAnal_app
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TAnal_app : public TRelation_application
|
|
|
|
{
|
|
|
|
TRelation* _rel;
|
|
|
|
TAnal_msk* _msk;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool changing_mask(int) { return false; }
|
|
|
|
virtual TMask* get_mask(int) { return _msk; }
|
|
|
|
virtual TRelation* get_relation() const { return _rel; }
|
|
|
|
virtual bool user_create();
|
|
|
|
virtual bool user_destroy();
|
2004-12-15 13:55:45 +00:00
|
|
|
virtual int write(const TMask& m);
|
|
|
|
virtual int rewrite(const TMask& m);
|
|
|
|
void init_key_fields() const;
|
|
|
|
virtual void init_query_mode(TMask& m);
|
|
|
|
virtual void init_modify_mode(TMask& m);
|
|
|
|
virtual void init_insert_mode(TMask& m);
|
2004-11-29 09:52:49 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual TAnal_msk* create_mask() const pure;
|
|
|
|
virtual TRelation* create_relation() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|