Commit 07f2d03f authored by legoc's avatar legoc
Browse files

Added simple header corrector: change version

parent 12dca626
......@@ -64,11 +64,19 @@ target_link_libraries(lstexporter128 PUBLIC
lstdpp128
)
add_executable(lstheadercorrector128
HeaderCorrector.cpp
)
target_link_libraries(lstheadercorrector128 PUBLIC
lstdpp128
)
#------------------------------------------------------------
# Install
#------------------------------------------------------------
install(
TARGETS lstcalibrateinsert128 lstreader128 lstsort128 lstcheck128 lstheader128 lstboardinfo128 lstexporter128
TARGETS lstcalibrateinsert128 lstreader128 lstsort128 lstcheck128 lstheader128 lstboardinfo128 lstexporter128 lstheadercorrector128
DESTINATION bin
)
\ No newline at end of file
......@@ -109,7 +109,7 @@ int main(int argc, char * argv[]) {
}
if (ok) {
cout << "Block size " << blockSize << " is enough for " << fileName << endl;
cout << "block size " << blockSize << " is enough for " << fileName << endl;
break;
} else {
blockSize = (blockSize * 2);
......@@ -117,7 +117,7 @@ int main(int argc, char * argv[]) {
}
} catch (bad_alloc &) {
cout << "Cannot allocate enough memory for processing " << fileName << " without losing events" << endl;
cout << "cannot allocate enough memory for processing " << fileName << " without losing events" << endl;
}
//cout << "#events not inserted = " << algorithm.processor().numberOfEventsNotInserted() << " (" << percentage(algorithm.processor().numberOfEventsNotInserted(), algorithm.processor().numberOfEvents()) << "%)" << endl;
......
......@@ -77,7 +77,7 @@ int main(int argc, char * argv[]) {
is >> maxNumberOfEvents;
}
cout << "Max number of lines is " << maxNumberOfEvents << endl;
cout << "max number of lines is " << maxNumberOfEvents << endl;
Reader reader(BUFFER_SIZE);
......@@ -90,10 +90,10 @@ int main(int argc, char * argv[]) {
cout << listModeContext << endl;
if (listModeContext.nbEvents > maxNumberOfEvents) {
cout << "Warning, the output file will not contain all the events" << endl;
cout << "warning, the output file will not contain all the events" << endl;
}
cout << "Event is rollover ; timestamp ; absolute time ; board type ; crate ; board ; channel ; data ; data plus" << endl;
cout << "event is rollover ; timestamp ; absolute time ; board type ; crate ; board ; channel ; data ; data plus" << endl;
int counter = 0;
......
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://www.osor.eu/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#include <iostream>
#include <stdint.h>
#include <fstream>
#include <cstdlib>
#include <cstdio>
#include <iomanip>
using namespace std;
int main(int argc, char * argv[]) {
if (argc < 3) {
cerr << "usage : headercorrector <file> <version>" << endl;
return EXIT_FAILURE;
}
string outfileName = argv[1];
uint32_t version = stoi(argv[2]);
fstream outputFile;
outputFile.open(outfileName.c_str(), ios::in | ios::binary | ios::out);
outputFile.seekp(0, ios::beg);
outputFile.write((char *)&version, sizeof(uint32_t));
outputFile.close();
cout << "wrote file" << endl;
return EXIT_SUCCESS;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment