Commit 0ea63b028cd8603b40d18d884871a99ab6ce0d78
1 parent
983f8c8c
Exists in
master
and in
87 other branches
Support time in double format with DDServer
Showing
1 changed file
with
10 additions
and
1 deletions
Show diff stats
src/ParamGetImpl/DDServerInterface/ParamGetDDBase.cc
... | ... | @@ -148,8 +148,17 @@ namespace AMDA { |
148 | 148 | LOG4CXX_DEBUG(gLogger, "updateTimeInParamData data->VarNumber = " << data->VarNumber); |
149 | 149 | //ParamData is created, add data |
150 | 150 | //The capacity must be == at Data |
151 | + double t = 0.; | |
151 | 152 | for (int index = 0; index < data->VarNumber; index++) { |
152 | - double t = DD_Time2Double((char *) data->Variables[index]); | |
153 | + if (data->type == DD_CHAR) { | |
154 | + t = DD_Time2Double((char *) data->Variables[index]); | |
155 | + } | |
156 | + else if (data->type == DD_DOUBLE) { | |
157 | + t = *((double*)data->Variables[index]); | |
158 | + } | |
159 | + else { | |
160 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::ex_msg("Unknown time type")); | |
161 | + } | |
153 | 162 | _paramData->getTimeList().push_back(t); |
154 | 163 | } |
155 | 164 | } | ... | ... |