Skip to content
Snippets Groups Projects
Commit 935b75b8 authored by Christian Koernig's avatar Christian Koernig
Browse files

Removed a lot of debug output in the C++ core code

parent 5d74bf64
Branches
No related tags found
No related merge requests found
......@@ -41,12 +41,14 @@ config_names = ["RESC", "CLCK", "TPEA", "GAIF", "GAIN", "RESL", "TFLA", "TPFA",
"SCOT", "SCOG", "MCSL", "MCSH", "MCST", "AUO2", "TPMO", "GPED",
"GPGA", "GPMC", "MCAE", "VOLU", "CON1", "CON2"]
configs = amptek.GetTextConfiguration( config_names )
print("----CURRENT CONFIG-----")
for config in configs:
print(config)
print("-----------------------\n\n")
# prepare a 10 second acquisition
amptek.ClearSpectrum()
amptek.SetPresetAccumulationTime(4)
amptek.SetPresetAccumulationTime(10)
# start acquisition
amptek.Enable()
......@@ -57,12 +59,13 @@ print("Acquisition started")
while True:
time.sleep(1)
status = amptek.updateStatus(-1)
print("\rAccumulation Time: {:.2f}s, Fast Counts: {:d}, Slow Counts: {:d}".format( status.AccTime(), status.FastCount(), status.SlowCount() ), end="", flush=True)
# test if finished
if not status.IsEnabled():
print("")
break
print("\rAccumulation Time: {:.2f}s, Fast Counts: {:d}, Slow Counts: {:d}".format( status.AccTime(), status.FastCount(), status.SlowCount() ), end="", flush=True)
print("Acquisition finished")
# plot finished spectrum
......
......@@ -247,11 +247,11 @@ bool AmptekHardwareInterface::SetPresetCounts(int c){
* @return false on failure
*/
bool AmptekHardwareInterface::SetTextConfiguration(std::vector<std::string> commands){
std::cout << "Configuration is\n";
for (auto cmd :commands){
std::cout << "\t" << cmd << "\n";
}
std::cout << std::endl;
// std::cout << "Configuration is\n";
// for (auto cmd :commands){
// std::cout << "\t" << cmd << "\n";
// }
// std::cout << std::endl;
try{
stringstream cmdstream;
......@@ -263,7 +263,7 @@ bool AmptekHardwareInterface::SetTextConfiguration(std::vector<std::string> comm
// if max packet size (512) would be exceeded when adding this command, send the previous commands and clear the input stringstream
if( streamsize + cmd.size() > 511){
std::cout << "Send " << cmdstream.str() << std::endl;
//std::cout << "Send " << cmdstream.str() << std::endl;
expectAcknowledge( connection_handler->sendAndReceive( Packet::gernerateSetConfigurationRequest( cmdstream.str() ) ) );
cmdstream = stringstream();
}
......@@ -274,7 +274,7 @@ bool AmptekHardwareInterface::SetTextConfiguration(std::vector<std::string> comm
// if this is the last command in the loop, send the stringstream even if max size is not reached
if( i == commands.size()-1 ){
std::cout << "Send " << cmdstream.str() << std::endl;
//std::cout << "Send " << cmdstream.str() << std::endl;
expectAcknowledge( connection_handler->sendAndReceive( Packet::gernerateSetConfigurationRequest( cmdstream.str() ) ) );
}
}
......@@ -661,7 +661,7 @@ std::pair<AmptekSpectrum, AmptekStatus> AmptekHardwareInterface::GetBufferedSpe
int spectrum_bytesize = 3*spectrum_length;
AmptekSpectrum buffered_spectrum( &(spectrumResponse.at(DATA) ), spectrum_length );
AmptekStatus buffered_status(&(spectrumResponse.at(DATA + spectrum_bytesize)));
std:cout << buffered_status.SlowCount() << std::endl;
//std:cout << buffered_status.SlowCount() << std::endl;
return std::pair<AmptekSpectrum, AmptekStatus>( buffered_spectrum, buffered_status );
}
......@@ -689,7 +689,6 @@ bool AmptekHardwareInterface::StartCommtestStreaming(uint16_t min_channel,uint16
std::cout << "Pulse Period: " << period << std::endl;
try{
Packet commtest_packet = Packet::generateCommtestStreamingRequest(min_channel, max_channel, increment, period);
std::cout << commtest_packet.toString() << std::endl;
expectAcknowledge(connection_handler->sendAndReceive( commtest_packet) );
}
catch(AmptekException& e){
......
......@@ -95,7 +95,6 @@ Packet AmptekSimulatorConnectionHandler::sendAndReceive( const Packet& request){
char configs[ request.dataLength + 1 ];
byteToChar( (byte*)&(request.at(DATA)), configs, request.dataLength );
string configstring = buildConfigResponse(configs);
std::cout << configstring << std::endl;
word16 len = configstring.size();
byte arr[len];
charToByte(configstring.c_str(), arr, len);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment