Skip to content

Commit cd6f591

Browse files
author
xedaq
committed
ffs
1 parent d1250c0 commit cd6f591

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

CControl_Handler.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void CControl_Handler::StatusUpdate(mongocxx::collection* collection){
163163
<< close_document;
164164
}
165165
auto after_array = in_array << close_array;
166-
auto doc = after_array << close_document << finalize;
166+
auto doc = after_array << finalize;
167167
collection->insert_one(std::move(doc));
168168
return;
169169
/*

DAQController.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int DAQController::Arm(std::shared_ptr<Options>& options){
7575
sleep(2); // <-- this one. Leave it here.
7676
// Seriously. This sleep statement is absolutely vital.
7777
fLog->Entry(MongoLog::Local, "That felt great, thanks.");
78-
std::map<int, std::map<std::string, std::vector<double>>> dac_values;
78+
std::map<int, std::vector<uint16_t>> dac_values;
7979
std::vector<std::thread> init_threads;
8080
init_threads.reserve(fDigitizers.size());
8181
std::map<int,int> rets;
@@ -325,7 +325,7 @@ void DAQController::StatusUpdate(mongocxx::collection* collection) {
325325
doc << std::to_string(pair.first) << short(pair.second>>10); // KB not MB
326326
} << close_document <<
327327
close_document << finalize;
328-
collection->update_one(std::move(doc)); // opts is const&
328+
collection->insert_one(std::move(doc)); // opts is const&
329329
return;
330330
}
331331

@@ -376,7 +376,7 @@ void DAQController::InitLink(std::vector<std::shared_ptr<V1724>>& digis,
376376
}
377377
success += digi->LoadDAC(dac_values[bid]);
378378
// Load all the other fancy stuff
379-
success += digi->SetThresholds(fOptions->GetThresholds(bid), digi->GetNumChannels());
379+
success += digi->SetThresholds(fOptions->GetThresholds(bid));
380380

381381
fLog->Entry(MongoLog::Local, "Board %i programmed", digi->bid());
382382
if(success!=0){

MongoLog.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int MongoLog::Entry(int priority, std::string message, ...){
125125
"user" << fHostname <<
126126
"message" << message <<
127127
"priority" << priority <<
128-
"runid" << fRunid <<
128+
"runid" << fRunId <<
129129
bsoncxx::builder::stream::finalize;
130130
fMongoCollection.insert_one(std::move(d));
131131
}

Options.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,10 @@ std::vector<uint16_t> Options::GetDAC(int bid, int num_chan, uint16_t default_va
337337
using namespace bsoncxx::builder::stream;
338338
std::vector<uint16_t> ret(num_chan, default_value);
339339
auto sort_order = document{} << "_id" << -1 << finalize;
340-
auto q = document{} << bid << open_document << "$exists" << 1 << close_document << finalize;
340+
auto q = document{} << std::to_string(bid) << open_document << "$exists" << 1 << close_document << finalize;
341341
auto opts = mongocxx::options::find{};
342342
opts.sort(sort_order.view());
343-
auto cursor = fDAC_collection.find(q, opts);
343+
auto cursor = fDAC_collection.find(std::move(q), opts);
344344
auto doc = cursor.begin();
345345
if (doc == cursor.end() || doc->find(std::to_string(bid)) == doc->end()) {
346346
fLog->Entry(MongoLog::Local, "No baseline calibrations? You must be new");
@@ -353,7 +353,7 @@ std::vector<uint16_t> Options::GetDAC(int bid, int num_chan, uint16_t default_va
353353
* }
354354
*/
355355
for (int i = 0; i < num_chan; i++)
356-
ret[i] = (*doc)[std::to_string(bid)][i];
356+
ret[i] = (*doc)[std::to_string(bid)][i].get_int32();
357357
return ret;
358358
}
359359

0 commit comments

Comments
 (0)