Project

General

Profile

Files » var.h

Frédéric Blanc, 2016-01-29 09:58

 
#ifndef __VAR_DEF_H__
#define __VAR_DEF_H__

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

#define VERSION "Forks_2015_11_30"
#define MAX_LIGNE 1
#define MIN_PWM 1.0
#define max(a,b) (a>=b?a:b)
#define min(a,b) (a<=b?a:b)
#define MODE_IOUT 0
#define MODE_POUT 1
#define MODE_PWM 2
//INST
enum {INST_POWER,INST_LOAD,INST_AFG,INST_AFG_2,INST_PM,MAX_INSTRUMENT};
enum {NORMA,WT,HHZS,IT85xx,PLZ,E4360A,K24xx,AFG3022,SPS6032A,LOAD6060B};
struct S_instrument
{
struct S_COM port; /**< structure d' inst */
int actif;
int present;
int nbmodule;
int type;
char constructeur[255];
char model[255];
char num_serie[255];
char date_CAL[255];
}instrument[MAX_INSTRUMENT];


struct S_consigne{ /**< structure de consigne */
double freq;
double pwm;
double sigma_error;
int phase;
int interleaving;
double Vout;
double Vin;
double Vpower;
double Ipower;
double Iload;
double Vload;
double Vin_START;
double Vin_STOP;
double Vin_STEP;
double Pout_START;
double Pout_STOP;
double Pout_STEP;
double Vout_START;
double Vout_STOP;
double Vout_STEP;
double Vout_MAX;
double Iin_MAX;
double pwm_MAX;
int delays;
double Delay_Cal;
double Kp;
double Ki;
double accuracy;
int nb_cycle;

}consigne[MAX_LIGNE];



struct S_measure{
double Vin,Iin,Pin;
double CalVin,CalIin;
int CalVin_Auto,CalIin_Auto;
double Vout,Iout,Pout;
double CalVout,CalIout;
int CalVout_Auto,CalIout_Auto;
double n;
double ErrVin,ErrIin,ErrPin;
double ErrVout,ErrIout,ErrPout;
double Errnplus;
double Errnmoins;
double V3,V4,I3,I4,P3,P4;
}measure[MAX_LIGNE];
//PANEL
enum {PANEL_TOP,PANEL_ABOUT,PANEL_LOG,PANEL_PORT,PANEL_MEASURE,PANEL_CONTROL,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
struct S_ctrl
{
int verbose;
char racine[MAX_PATHNAME_LEN];
char chemin_save_mesure[MAX_PATHNAME_LEN];
int timer_id;
time_t time_total;
time_t time_elapsed;
time_t time_remaining;
int stop;
int phase1,phase2,phase3,phase4;
int pid;

int m_V3; /**< mesure tentions V3 */
int m_V4; /**< mesure tentions V4 */
int m_I3; /**< mesure courant I3 */
int m_I4; /**< mesure courant I4 */
int m_P3; /**< mesure power P3 */
int m_P4; /**< mesure power P4 */
int Iout; /**< sortie en courant ou puissance */
int Simul; /**< mode simulation */
}Ctrl;

//FILE
FILE *file_LOG; /**< pointeur du fichier LOG */
FILE *file_LOG_mesure;
FILE * pf_mesure;
#endif
(23-23/25)