Project

General

Profile

Files » var.h

Frédéric Blanc, 2016-01-29 10:31

 
#ifndef __VAR_DEF_H__
#define __VAR_DEF_H__

#include <time.h>
#include <stdio.h>
#include "proto.h"
#include "T_Batt_2.h"
#include "port.h"

#define VERSION "Forks_2016_01_21"
#define DIR_PROGRAMFILE "Program Files (x86)"
#define DIR_PROGRAMDATA "c:\\ProgramData\\T_Batt"
#define MAX_CYCLE 1024

#define max(a,b) (a>=b?a:b)
#define min(a,b) (a<=b?a:b)
#define MODE_DISCHARGE 0
#define MODE_CHARGE 1
enum {MODE_STOP_STD,MODE_STOP_CMAX,MODE_STOP_TIMER};
//INST
enum {INST_POWER,INST_LOAD,INST_SMU,INST_SAS,INST_PM,INST_TEMP,MAX_INSTRUMENT};
enum {NORMA,WT1600,WT3000,HHZS,IT85xx,PLZ,E4360A,K24xx,AFG3022,SPS6032A,XFR20_60,LOAD6060B};
struct S_instrument
{
struct S_COM port; /**< structure d' inst */
int actif;
int present;
int nbmodule;
int type;
char constructeur[256];
char model[256];
char num_serie[256];
char date_CAL[256];
}instrument[MAX_INSTRUMENT];

//Cycle
struct S_cycle{ /**< structure de cycle */
int mode;
int mode_boost;
int mode_pow;
int mode_stop;
double curr;
double Vmax;
double Vmin;
double Imin;
double Cmax;
time_t Timermax;
double PowLoad;
double Currboost;
double IminBoost;
double VmaxBoost;

}T_cycle[MAX_CYCLE];




//PANEL
enum {PANEL_TOP,PANEL_ABOUT,PANEL_LOG,PANEL_PORT,PANEL_MEASURE,PANEL_CYCLE,PANEL_BATT,PANEL_GRAPH,PANEL_INFO,MAX_PANEL};
int barre_de_menu;

struct S_panel
{
int panel;
int top;
int left;
int height;
int width;
}T_panel[MAX_PANEL];

//control
enum {MODE_EDIT,MODE_SIMUL,MODE_SMU,MODE_POWER_LOAD,MODE_POWER_LOAD_PM};
struct S_ctrl
{
int verbose;
char racine[MAX_PATHNAME_LEN];
char chemin_save_mesure[MAX_PATHNAME_LEN];
char name_Batt[256];
int timer_id;
time_t time_start;
time_t time_elapsed;
time_t time_remaining;
time_t time_cycle;
int stop;
int mode;
FILE *file;
int save;
int nb_cycle;
int cycle;
int loop;
int mode_loop;
int nb_loop;
int vminstop;
double Ah;
double Wh;
}Ctrl;

//FILE
FILE *file_LOG; /**< pointeur du fichier LOG */

#endif
(25-25/25)