#pragma once
enum INT_TYPE{CHSS=1,CHDD=2,AD=3,SPO2=4,DIUREZ=5,TEMP=6};
enum INJ_TYPE{cVV=101,cVM=102};
enum UNIT_TYPE {UnitMG=1001,UnitMl=1002};
typedef int DRUG_TYPE;

//--
#define CHK_TOTAL_STOP {if(SetStopGlobal&&*SetStopGlobal){return 0;}}
#define vCHSS (*vCHSS_)
#define vCHDD (*vCHDD_)
#define vSAD (*vSAD_)
#define vDAD (*vDAD_)
#define vAD (*vAD_)
#define vSpO2 (*vSpO2_)
#define vTemp (*vTemp_)
#ifndef SET_FIRST
extern 
#endif
float *vCHSS_,*vCHDD_,*vSAD_,*vDAD_,*vSpO2_,*vTemp_,*vAD_;
#ifndef SET_FIRST
extern 
#endif
int vNULL
#ifdef SET_FIRST
=-3242319
#endif
;
//--
#ifndef SET_FIRST
extern 
#endif
int *SetStopGlobal
#ifdef SET_FIRST
=NULL
#endif
;
//--

double vvod(CString text, double MinValue, double MaxValue);
double vybor(CString text, CString s1,double v1, CString s2="",double v2=vNULL,CString s3="",double v3=vNULL,CString s4="",double v4=vNULL,CString s5="",double v5=vNULL,CString s6="",double v6=vNULL,CString s7="",double v7=vNULL,CString s8="",double v8=vNULL,CString s9="",double v9=vNULL,CString s10="",double v10=vNULL,CString s11="",double v11=vNULL);
double muljltivybor(CString text, CString s1,double *v1, CString s2="",double *v2=NULL,CString s3="",double *v3=NULL,CString s4="",double *v4=NULL,CString s5="",double *v5=NULL,CString s6="",double *v6=NULL,CString s7="",double *v7=NULL,CString s8="",double *v8=NULL,CString s9="",double *v9=NULL,CString s10="",double *v10=NULL,CString s11="",double *v11=NULL);

int SetInjectionQuick(int InusomatNum,DRUG_TYPE DrugType,const char *DrugName,double Value,INJ_TYPE InjectionType,UNIT_TYPE UnitType);
int SetInjection(const char *OutputText,int SetWait,int InusomatNum ,DRUG_TYPE DrugType,const char *DrugName,double Value,UNIT_TYPE UnitType,int T=0 ,double Value2=0,UNIT_TYPE UnitType2=UnitMG,int T2=0 ,double Value3=0,UNIT_TYPE UnitType3=UnitMG,int T3=0 ,double Value4=0,UNIT_TYPE UnitType4=UnitMG,int T4=0 ,double Value5=0,UNIT_TYPE UnitType5=UnitMG,int T5=0);
int SetInjectionVelocity(int InusomatNum,DRUG_TYPE DrugType,const char *DrugName,double Value,UNIT_TYPE UnitType);
int ActivateBlock(int (*obrabotka)(),int CallPreiodSec,const char *sName,int DtFirstWait);
int SetInjectionStop(int InusomatNum);
int FSleep(int Interval);
int SetInterval(INT_TYPE type,int Interval);
int SetDiurez(int Interval);
int CallDoctor(const char *str=NULL,int WaitTime=-1);
int Output(const char *str);
int SleepBeforeOK(const char *str=NULL,int dt=-1);
int StopBlock(void);
int TotalStop(void);
int WaitThreadsEnd();
inline CString ToString(double v){CString s;s.Format("%lg",v);return s;}
//--
#ifndef SET_FIRST
extern 
#endif
void (*AddShowStr)(const char *str)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*FSetInjectionQuick)(const char *OutputText,int InusomatNum,DRUG_TYPE DrugType,const char *DrugName,double Value,INJ_TYPE InjectionType,UNIT_TYPE UnitType)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*FSetInjection)(const char *OutputText,int SetWait,int InusomatNum,DRUG_TYPE DrugType,const char *DrugName,double Value,UNIT_TYPE UnitType,int T ,double Value2,UNIT_TYPE UnitType2,int t2 ,double Value3,UNIT_TYPE UnitType3,int t3 ,double Value4,UNIT_TYPE UnitType4,int t4 ,double Value5,UNIT_TYPE UnitType5,int t5)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*FSetInjectionStop)(int InusomatNum)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*FSetInjectionVelocity)(int InusomatNum,DRUG_TYPE DrugType,const char *DrugName,double Value,UNIT_TYPE UnitType)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int *SetNeedHandsValues
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
double (*InputValue)(const char *str, double MinValue, double MaxValue)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
double (*FSelect)(const char* text, const char* s1,double v1, const char* s2,double v2,const char* s3,double v3,const char* s4,double v4,const char* s5,double v5,const char* s6,double v6,const char* s7,double v7,const char* s8,double v8,const char* s9,double v9,const char* s10,double v10,const char* s11,double v11)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
double (*FMultiSelect)(const char* text, const char* s1,double *v1, const char* s2,double *v2,const char* s3,double *v3,const char* s4,double *v4,const char* s5,double *v5,const char* s6,double *v6,const char* s7,double *v7,const char* s8,double *v8,const char* s9,double *v9,const char* s10,double *v10,const char* s11,double *v11)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*FDoctorCall)(int nSeconds,const char *text,const char *header)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*TimeCountStart)()
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*TimeCountSec)()
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*TimeCountMin)()
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*TimeCountH)()
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*TimeCountTotalSec)()
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--
#ifndef SET_FIRST
extern 
#endif
int (*FGetRealTime)(int)
#ifdef SET_FIRST
=NULL;
#else
;
#endif
//--

extern "C" int PASCAL EXPORT blok1(); // блок блок1
extern "C" int PASCAL EXPORT blok2(); // блок блок2
extern "C" int PASCAL EXPORT blok3(); // блок блок3
extern "C" int PASCAL EXPORT blok4(); // блок блок4
extern "C" int PASCAL EXPORT blok5(); // блок блок5
extern "C" int PASCAL EXPORT blok6(); // блок блок6
extern "C" int PASCAL EXPORT blok7(); // блок блок7
