From 7a3d9fa45574f79e8297abc3df1ad1121cb87292 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Tue, 5 Apr 2016 12:37:21 +0200 Subject: [PATCH] Detect ChemStation B.06.44 and set the sampling rate accordingly --- libhpcs.c | 10 +++++++++- libhpcs_p.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libhpcs.c b/libhpcs.c index 8856ab0..c40b70e 100644 --- a/libhpcs.c +++ b/libhpcs.c @@ -349,6 +349,10 @@ static enum HPCS_ChemStationVer detect_chemstation_version(const char*const vers PR_DEBUG("ChemStation B.06.43\n"); return CHEMSTAT_B0643; } + else if (!strcmp(version_string, CHEMSTAT_B0644_STR)) { + PR_DEBUG("ChemStation B.06.44\n"); + return CHEMSTAT_B0644; + } else if (strlen(version_string) == 0) { PR_DEBUG("ChemStation Untagged\n"); return CHEMSTAT_UNTAGGED; @@ -414,13 +418,17 @@ static void guess_sampling_rate(const enum HPCS_ChemStationVer version, struct H break; case CHEMSTAT_B0626: case CHEMSTAT_B0643: + case CHEMSTAT_B0644: switch (mdata->file_type) { case HPCS_TYPE_CE_DAD: case HPCS_TYPE_CE_CCD: mdata->sampling_rate /= 100; break; default: - mdata->sampling_rate = CE_WORK_PARAM_SAMPRATE; + if (version == CHEMSTAT_B0644) + mdata->sampling_rate /= 100; + else + mdata->sampling_rate = CE_WORK_PARAM_SAMPRATE; break; } break; diff --git a/libhpcs_p.h b/libhpcs_p.h index 1e53636..5e850a2 100644 --- a/libhpcs_p.h +++ b/libhpcs_p.h @@ -135,6 +135,7 @@ enum HPCS_ChemStationVer { CHEMSTAT_B0625, CHEMSTAT_B0626, CHEMSTAT_B0643, + CHEMSTAT_B0644, CHEMSTAT_UNKNOWN }; @@ -142,6 +143,7 @@ enum HPCS_ChemStationVer { const char CHEMSTAT_B0625_STR[] = "B.06.25 [0003]"; const char CHEMSTAT_B0626_STR[] = "B.06.26 [0010]"; const char CHEMSTAT_B0643_STR[] = "B.06.43 [0001]"; +const char CHEMSTAT_B0644_STR[] = "B.06.44 [0001]"; /* Values of markers found in .ch files */ const char BIN_MARKER_A = 0x10; -- 2.43.5