===================================================== Liste_Funktionen_Beginn: Mod_load_all unused Mod_load__ Ein ganz neues Model als MainModel oeffnen; Mod_load_allsm load Models of mdb_dyn-Records; Mod_load_sm load a subModel (ED_work_file / ED_Run) Mod_cre__ create new SubModel Mod_cre_CB Mod_ren__ rename Submodel Mod_ren_CB Mod_del__ delete Submodel Mod_del_CB Mod_chg__ activate other Submodel Mod_chg_CB load selected SubModel Mod_sav__ save Model+Submodel -> File Mod_sav2file__ save the active Submodel WC_modact -> permanent File Mod_sav2file_CB Mod_file2model save submodel > tmp/Model_<name> Mod_savSubBuf1 save Submodel in Buffer1 + active Hidelist Mod_sav_tmp save the active Submodel WC_modact -> TempFile Mod_LoadFile__ Model als Submodel laden Mod_LoadSubmodel ? Mod_get_path resolv "symbol/fnam" or "fnam" Mod_sym_get1 get path from symbol; resolv "symbol/fnam" or "fnam" Mod_sym_get2 get symbol from path Mod_get_ftyp1 give Modeltyp from Filename Mod_get_typ1 give typ from definition Line and extract Modelname Mod_get_typ2 give typ from (complete) Modelname Mod_get_names scan gesamten APT-Buffer nach Modelnames. Mod_get_namAll scan rekursiv die SourceFiles aller basicModels; Mod_get_namSub scan file of Model mb->mnam for Submodels; add Submodels Mod_get_namFil scan File fNam and save all Submodelcalls as level iLev Mod_get_namStore save new BaseModel as mdb_dyn-Record Mod_kill__ delete all tmp/Model_* Mod_chg_tit display submodelname im Titlebar Mod_mkList make list of all Submodels Mod_symOpen_add register symbolic path Mod_symOpen_set register symbolic path Mod_allmod_MS in all subMods modify ModSiz Liste_Funktionen_Ende: ===================================================== SEE ALSO: DB_get_ModRef get Ditto from Index DB_get_ModBas returns ModelBas from its index DB_get_ModNr get (basic-) ModelNr from Modelname DB_list_ModBas Modelnames in korrekter Reihenfolge -> Datei DB_ModBas_namNr get the name of a basic-model from its nr
#include "MS_Def0.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "../gtk/ut_gtk.h"
#include "../gr/ut_UI.h"
#include "../xa/xa_uid.h"
#include "../ut/ut_geo.h"
#include "../ut/ut_txt.h"
#include "../ut/ut_txfil.h"
#include "../ut/ut_os.h"
#include "../ut/ut_memTab.h"
#include "../db/ut_DB.h"
#include "../xa/xa_mem.h"
Functions | |
typedef_MemTab (int) | |
typedef_MemTab (Point) | |
typedef_MemTab (Fac3) | |
typedef_MemTab (EdgeLine) | |
void | Mod_chg_CB (char *modNam) |
==================================================================== | |
int | Mod_file2model (char *buf, FILE *fpi) |
==================================================================== | |
int | Mod_init__ () |
==================================================================== | |
int | Mod_cre_CB (GtkWidget *parent, void *data) |
==================================================================== | |
int | Mod_cre__ () |
==================================================================== | |
int | Mod_m2s_CB (GtkWidget *parent, void *data) |
==================================================================== | |
int | Mod_m2s__ () |
==================================================================== | |
int | Mod_chg__ () |
==================================================================== | |
int | Mod_mkList (int mode) |
==================================================================== | |
int | Mod_chg_tit () |
==================================================================== | |
int | Mod_sav__ (int iCompress, char *filNam) |
==================================================================== | |
int | Mod_savSubBuf1 (char *modNam, int modSiz) |
================================================================ | |
int | Mod_sav2file_CB (char *fnam, char *dirNam) |
===================================================================== | |
int | Mod_sav2file__ () |
==================================================================== | |
int | Mod_LoadSubmodel (char *fnam, char *dirNam) |
===================================================================== | |
int | Mod_LoadFile__ () |
==================================================================== | |
int | Mod_sav_tmp () |
==================================================================== | |
int | Mod_init_path () |
int | Mod_get_path (char *out_path, char *in_path) |
==================================================================== | |
int | Mod_get_ftyp1 (char *fnam) |
================================================================ | |
int | Mod_get_typ1 (char *txbuf, char *cbuf) |
================================================================ | |
int | Mod_get_typ2 (char *txbuf) |
================================================================ | |
int | Mod_get_names () |
==================================================================== | |
int | Mod_sym_get1 (char *out_path, char *in_path, int imod) |
==================================================================== | |
int | Mod_sym_get2 (char *out_sym, char *in_path, int imod) |
==================================================================== | |
int | Mod_symOpen_set (char *sym, char *path) |
================================================================ | |
int | Mod_symOpen_add (char *sym) |
================================================================ | |
int | Mod_kill__ () |
==================================================================== | |
int | Mod_load__ (int mode, char *filNam, int dbResiz) |
==================================================================== | |
int | Mod_aload_sm (int mode, char *lBuf, int bufSiz, FILE *fpi) |
================================================================ | |
int | Mod_ren_CB (GtkWidget *parent, void *data) |
================================================================= | |
int | Mod_ren__ () |
==================================================================== | |
int | Mod_del_CB (GtkWidget *parent, void *data) |
===================================================================== | |
int | Mod_del__ () |
==================================================================== | |
int | Mod_load_allsm () |
================================================================ | |
int | Mod_load_sm (int mTyp, char *mnam) |
================================================================ | |
int | Mod_get_namAll () |
==================================================================== | |
int | Mod_get_namSub (int parNr, int iLev) |
================================================================ | |
int | Mod_get_namFil (char *fNam, int parNr, int iLev) |
================================================================ | |
int | Mod_get_namStore (char *cp, int parNr, int iLev) |
================================================================ | |
int | Mod_allmod_MS (double d1, double d2, double d3) |
================================================================ | |
int | Mod_safeName (char *outNam, char *inNam) |
================================================================ | |
Variables | |
Point | WC_mod_ori |
der Model-Origin | |
char | AP_dir_open [128] |
directory for OPEN | |
char | AP_sym_open [64] |
symbolic directory for OPEN | |
char | WC_modnam [128] |
active Modelname - without path | |
char | WC_modact [128] |
name of the active submodel; def="" (main) | |
int | WC_modnr |
the Nr of the active submodel; -1 = main. | |
int | WC_mod_stat |
-1=primary Model is active; | |
int | AP_src |
AP_SRC_MEM or AP_SRC_EDI. | |
ColRGB | AP_defcol |
die DefaultColor des aktiven (sub)Model | |
int | UI_InpMode |
static ModelBas * | Mod_father |
typedef_MemTab | ( | int | ) |
typedef_MemTab | ( | Point | ) |
typedef_MemTab | ( | Fac3 | ) |
typedef_MemTab | ( | EdgeLine | ) |
void Mod_chg_CB | ( | char * | modNam | ) |
====================================================================
==================================================================== new Submodelname selected;
int Mod_file2model | ( | char * | buf, | |
FILE * | fpi | |||
) |
====================================================================
==================================================================== save submodel > tmp/Model_<name> irc < 0 = Error;
int Mod_init__ | ( | ) |
====================================================================
==================================================================== Bei jedem Init und File/new:
int Mod_cre_CB | ( | GtkWidget * | parent, | |
void * | data | |||
) |
====================================================================
==================================================================== create new SubModel: save new submodelname; provide new (empty) Modelspace
int Mod_cre__ | ( | ) |
====================================================================
==================================================================== create new SubModel:
int Mod_m2s_CB | ( | GtkWidget * | parent, | |
void * | data | |||
) |
====================================================================
==================================================================== move Mainmodel > Submodel
int Mod_m2s__ | ( | ) |
====================================================================
==================================================================== move Mainmodel > Submodel
int Mod_chg__ | ( | ) |
====================================================================
==================================================================== activate other Submodel
int Mod_mkList | ( | int | mode | ) |
====================================================================
==================================================================== make list of all Submodels -> <baseDir>/tmp/Mod.lst mode = 0: mit "-main-" mode = 1: ohne "-main-" Mainmodel wird mit "-main-" in die Liste eingetragen !
int Mod_chg_tit | ( | ) |
====================================================================
==================================================================== display submodelname im Titlebar
int Mod_sav__ | ( | int | iCompress, | |
char * | filNam | |||
) |
====================================================================
==================================================================== save Model+Submodel -> File Filename = WC_modnam Path = AP_dir_open ("/" am Ende) iCompress: 0=do not compress; else compress.
int Mod_savSubBuf1 | ( | char * | modNam, | |
int | modSiz | |||
) |
================================================================
================================================================ save Submodel in Buffer1 + active Hidelist --> File tmp/Model_<modNam> used by Step-Import (schreibt mit UTF_add1_line --> UTF_FilBuf1) see also Grp_exp ..
int Mod_sav2file_CB | ( | char * | fnam, | |
char * | dirNam | |||
) |
=====================================================================
=====================================================================
int Mod_sav2file__ | ( | ) |
====================================================================
==================================================================== save the active Submodel WC_modact -> permanent File
int Mod_LoadSubmodel | ( | char * | fnam, | |
char * | dirNam | |||
) |
=====================================================================
===================================================================== Models/load Submodel from File
int Mod_LoadFile__ | ( | ) |
====================================================================
==================================================================== Model als Submodel laden
int Mod_sav_tmp | ( | ) |
====================================================================
==================================================================== save the active Submodel WC_modact -> TempFile
int Mod_init_path | ( | ) |
int Mod_get_path | ( | char * | out_path, | |
char * | in_path | |||
) |
====================================================================
==================================================================== In: "pfadsymbol/filename" oder nur "filename" der erste Teil (vor dem ersten '/') ist ein Pfadsymbol; expandieren. kein Symbol: "<bas_dir>dat/filename". Out: der komplette Filename (Path + Filename + Filetyp). RetCod: 0 = OK; -1 = Symbol_not_found
int Mod_get_ftyp1 | ( | char * | fnam | ) |
================================================================
================================================================ Mod_get_ftyp1 give Modeltyp from Filename RetCod=fTyp (see AP_ck_ftyp)
int Mod_get_typ1 | ( | char * | txbuf, | |
char * | cbuf | |||
) |
================================================================
================================================================ give typ from definition Line and extract (complete) Modelname --> txbuf Input: cbuf definitionLine; zB M20=CTLG "Profile/4x4_60" .. OutPut: RetCod: -1 = internal model -2 = catalog-model -3 = Error
int Mod_get_typ2 | ( | char * | txbuf | ) |
================================================================
================================================================ Mod_get_typ2 give typ from (complete) Modelname (internal or external!) -3 = Error -2 = catalog-model -1 internal model // M1 = "Submodel1" 0 external/native 1-9 external 10-19 Mockup 20-29 Image
int Mod_get_names | ( | ) |
====================================================================
==================================================================== scan gesamten APT-Buffer nach Modelnames. siehe ED_work_END - DYNAMIC_AREA abarbeiten,
int Mod_sym_get1 | ( | char * | out_path, | |
char * | in_path, | |||
int | imod | |||
) |
====================================================================
==================================================================== get path from symbol imod: 0=get 1=check(no Msg) in_path: "<symbol>/<Filename>" zB: "Data/Niet1.dat" out_path: der echte Pfad zu <symbol> (aus datei xa/dir.lst) RetCod >= 0 OK; path in out_path; Linenumber of symbol in path. -1 Symbol from in_path not found in file
int Mod_sym_get2 | ( | char * | out_sym, | |
char * | in_path, | |||
int | imod | |||
) |
====================================================================
==================================================================== get symbol from path imod: 0=get 1=check(no Msg) in_path: der Pfad (mit "/" am Ende) out_sym: das zugehoerige Symbol (aus datei xa/dir.lst) RetCod 0 OK; symTxt in out_sym; -1 in_path not found in file
int Mod_symOpen_set | ( | char * | sym, | |
char * | path | |||
) |
================================================================
================================================================ Mod_symOpen_set set symbolic path
int Mod_symOpen_add | ( | char * | sym | ) |
================================================================
================================================================ Mod_symOpen_add register symbolic path save in File dir.lst
int Mod_kill__ | ( | ) |
====================================================================
====================================================================
see also OS_file_delete OS_file_delGrp
int Mod_load__ | ( | int | mode, | |
char * | filNam, | |||
int | dbResiz | |||
) |
====================================================================
==================================================================== Ein ganz neues Model als MainModel oeffnen;
int Mod_aload_sm | ( | int | mode, | |
char * | lBuf, | |||
int | bufSiz, | |||
FILE * | fpi | |||
) |
================================================================
================================================================ mode=0 old version; "MODEL modelname" bis "MODEL END" mode=1 new version; "SECTION modelname" bis "SECTIONEND"
int Mod_ren_CB | ( | GtkWidget * | parent, | |
void * | data | |||
) |
=================================================================
================================================================= the callback if OK selected.
int Mod_ren__ | ( | ) |
====================================================================
==================================================================== rename the active Submodel
int Mod_del_CB | ( | GtkWidget * | parent, | |
void * | data | |||
) |
=====================================================================
=====================================================================
int Mod_del__ | ( | ) |
====================================================================
====================================================================
int Mod_load_allsm | ( | ) |
================================================================
================================================================ Load Models of mdb_dyn-Records; Load Models; Reihenfolge=seqNr.
int Mod_load_sm | ( | int | mTyp, | |
char * | mnam | |||
) |
================================================================
================================================================ ein einzelnes subModel laden mnam zB "Submodel1"; das subModel darf keine noch nicht existierenden subModels enthalten !!
int Mod_get_namAll | ( | ) |
====================================================================
==================================================================== scan rekursiv die SourceFiles aller dzt existierenden basicModels; load Submodels as (zusaetzliche) basicModels. basicModels = mdb_dyn-Rec's (DB_StoreModBas) Recurse tru alls Submodels.
int Mod_get_namSub | ( | int | parNr, | |
int | iLev | |||
) |
================================================================
================================================================ scan file of Model Mod_father->mnam for Submodels; add Submodels as seqNr=iLev
int Mod_get_namFil | ( | char * | fNam, | |
int | parNr, | |||
int | iLev | |||
) |
================================================================
================================================================ scan File fNam and save all Submodelcalls as level iLev irc = 0 = OK; -1 = Err.
int Mod_get_namStore | ( | char * | cp, | |
int | parNr, | |||
int | iLev | |||
) |
================================================================
================================================================ save new BaseModel as mdb_dyn-Record Input: cp = line mit "M20=..." basicModelNr of parent (father) == parNr; SourcefileName ist Mod_father->mnam
int Mod_allmod_MS | ( | double | d1, | |
double | d2, | |||
double | d3 | |||
) |
================================================================
================================================================ Mod_allmod_MS in all subMods modify ModSiz
int Mod_safeName | ( | char * | outNam, | |
char * | inNam | |||
) |
================================================================
================================================================ give back Filename im <base>tmp/<safeName>
der Model-Origin
char AP_dir_open[128] |
directory for OPEN
char AP_sym_open[64] |
symbolic directory for OPEN
char WC_modnam[128] |
active Modelname - without path
char WC_modact[128] |
name of the active submodel; def="" (main)
int WC_modnr |
the Nr of the active submodel; -1 = main.
int WC_mod_stat |
-1=primary Model is active;
int AP_src |
AP_SRC_MEM or AP_SRC_EDI.
int UI_InpMode |
ModelBas* Mod_father [static] |