116 lines
2.4 KiB
C++
116 lines
2.4 KiB
C++
#pragma once
|
|
#pragma pack(push,1)
|
|
|
|
#ifdef DEVICEMANAGE_EXPORTS
|
|
#define DEVICEMANAGE_API_NUCLIB_C(type) extern "C" _declspec(dllexport) type _stdcall
|
|
#else
|
|
#define DEVICEMANAGE_API_NUCLIB_C(type) extern "C" _declspec(dllexport) type _stdcall
|
|
#endif
|
|
|
|
#define NI_NAME_LEN 32
|
|
|
|
enum eEnergyType
|
|
{
|
|
GammaRay,
|
|
XRay,
|
|
PositronDecay,
|
|
SingleEscape,
|
|
DoubleEscape
|
|
};
|
|
|
|
enum eHalfLifeUnit
|
|
{
|
|
Year,
|
|
Days,
|
|
Hours,
|
|
Min,
|
|
};
|
|
|
|
enum eEnergyFlay
|
|
{
|
|
// KeyLine
|
|
eNI_K,
|
|
// Not In Average
|
|
eNI_A,
|
|
};
|
|
|
|
|
|
typedef struct sOneEnergyLine
|
|
{
|
|
int rank;
|
|
double energy;
|
|
double percent;
|
|
eEnergyType energytype;
|
|
int flag;
|
|
}sOneEnergyLine;
|
|
|
|
enum eNuclideFlag
|
|
{
|
|
eNF_T,
|
|
eNF_F,
|
|
eNF_I,
|
|
eNF_N,
|
|
eNF_P,
|
|
eNF_C,
|
|
eNF_M,
|
|
eNF_A
|
|
};
|
|
|
|
typedef struct sOneNuclideInfo
|
|
{
|
|
char scname[64];
|
|
int flag;
|
|
double halflife;
|
|
eHalfLifeUnit halflifeunit;
|
|
double nuclidecertainty;
|
|
int energylinecount;
|
|
}sOneNuclideInfo;
|
|
|
|
typedef struct sOneNuclide
|
|
{
|
|
sOneNuclideInfo info;
|
|
sOneEnergyLine *pEnergyLine;
|
|
public:
|
|
sOneEnergyLine* GetEnergyLineByEnergy(double energy)
|
|
{
|
|
for (int i = 0; i < info.energylinecount; i++)
|
|
{
|
|
if (pEnergyLine[i].energy == energy)
|
|
{
|
|
return pEnergyLine + i;
|
|
}
|
|
}
|
|
return NULL;
|
|
}
|
|
}sOneNuclide;
|
|
|
|
typedef struct sNuclideLibraryInfo
|
|
{
|
|
int head;
|
|
int version;
|
|
char createtime[NI_NAME_LEN];
|
|
char lastmodifytime[NI_NAME_LEN];
|
|
char nuclidelibname[NI_NAME_LEN];
|
|
int totalnuclidecount;
|
|
int totalenergycount;
|
|
unsigned char reserve[32];
|
|
}sNuclideLibraryInfo;
|
|
|
|
typedef void(__stdcall *ON_UPDATE_NUCLIDE_CALLBACK)(void *pHandle, sNuclideLibraryInfo* pnli, sOneNuclide *pNuclide, void *reserve);
|
|
|
|
#pragma pack(pop)
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
DEVICEMANAGE_API_NUCLIB_C(int) NLGetCurNuclideInfo(ON_UPDATE_NUCLIDE_CALLBACK pnli, char *ErrMsg);
|
|
DEVICEMANAGE_API_NUCLIB_C(void) NLFreeNuclideLibrary();
|
|
DEVICEMANAGE_API_NUCLIB_C(int) NLUpdateCurNuclideToDriver(void *pBuf, int len, char *ErrMsg);
|
|
DEVICEMANAGE_API_NUCLIB_C(int) NLSaveNuclideLibraryToFile(void* phandle, char *ErrMsg);
|
|
DEVICEMANAGE_API_NUCLIB_C(int) NLSaveAsNuclideLibraryToFile(void* phandle, const char *path, char *ErrMsg);
|
|
DEVICEMANAGE_API_NUCLIB_C(void*) NLReadNuclideFromFile(const char *path, char *ErrMsg);
|
|
DEVICEMANAGE_API_NUCLIB_C(int) NLGetNuclideInfo(void* phandle, ON_UPDATE_NUCLIDE_CALLBACK pnli, char *ErrMsg);
|
|
DEVICEMANAGE_API_NUCLIB_C(int) NLSetCurNuclideLibrary(void* phandle, char *ErrMsg);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |