made default streamer to be the ip related to hostname, otherwise can be specified from the client, also made it compatible with chip test board detector now

This commit is contained in:
Dhanya Maliakal
2017-09-12 15:00:59 +02:00
parent c37d3feae9
commit 5ff574b33f
13 changed files with 324 additions and 34 deletions

View File

@ -47,6 +47,7 @@ void UDPBaseImplementation::initializeMembers(){
acquisitionTime = 0;
subExpTime = 0;
numberOfFrames = 0;
numberOfSamples = 0;
dynamicRange = 16;
tengigaEnable = false;
fifoDepth = 0;
@ -80,6 +81,7 @@ void UDPBaseImplementation::initializeMembers(){
frameToGuiTimerinMS = DEFAULT_STREAMING_TIMER_IN_MS;
dataStreamEnable = false;
streamingPort = 0;
memset(streamingSrcIP, 0, sizeof(streamingSrcIP));
}
UDPBaseImplementation::~UDPBaseImplementation(){}
@ -197,6 +199,8 @@ uint64_t UDPBaseImplementation::getSubExpTime() const{ FILE_LOG(logDEBUG) << __A
uint64_t UDPBaseImplementation::getNumberOfFrames() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; return numberOfFrames;}
uint64_t UDPBaseImplementation::getNumberofSamples() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; return numberOfSamples;}
uint32_t UDPBaseImplementation::getDynamicRange() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; return dynamicRange;}
bool UDPBaseImplementation::getTenGigaEnable() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; return tengigaEnable;}
@ -210,6 +214,15 @@ int UDPBaseImplementation::getActivate() const{FILE_LOG(logDEBUG) << __AT__ << "
uint32_t UDPBaseImplementation::getStreamingPort() const{FILE_LOG(logDEBUG) << __AT__ << " starting"; return streamingPort;}
char *UDPBaseImplementation::getStreamingSourceIP() const{
FILE_LOG(logDEBUG) << __AT__ << " starting";
char* output = new char[MAX_STR_LENGTH]();
strcpy(output,streamingSrcIP);
//freed by calling function
return output;
}
/*************************************************************************
* Setters ***************************************************************
* They modify the local cache of configuration or detector parameters ***
@ -435,6 +448,16 @@ int UDPBaseImplementation::setNumberOfFrames(const uint64_t i){
return OK;
}
int UDPBaseImplementation::setNumberofSamples(const uint64_t i){
FILE_LOG(logDEBUG) << __AT__ << " starting";
numberOfSamples = i;
FILE_LOG(logINFO) << "Number of Samples: " << numberOfSamples;
//overrridden child classes might return FAIL
return OK;
}
int UDPBaseImplementation::setDynamicRange(const uint32_t i){
FILE_LOG(logDEBUG) << __AT__ << " starting";
@ -559,6 +582,12 @@ void UDPBaseImplementation::setStreamingPort(const uint32_t i) {
FILE_LOG(logINFO) << "Streaming Port: " << streamingPort;
}
void UDPBaseImplementation::setStreamingSourceIP(const char c[]){
FILE_LOG(logDEBUG) << __AT__ << " starting";
strcpy(streamingSrcIP, c);
FILE_LOG(logINFO) << "Streaming Source IP: " << streamingSrcIP;
}
/***callback functions***/
void UDPBaseImplementation::registerCallBackStartAcquisition(int (*func)(char*, char*, uint64_t, uint32_t, void*),void *arg){