mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
get version number for receiver
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@414 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
1d9ae4e316
commit
b62f3dc1dd
@ -287,7 +287,7 @@ enum idMode{
|
||||
DETECTOR_FIRMWARE_VERSION, /**<return detector system firmware version */
|
||||
DETECTOR_SOFTWARE_VERSION, /**<return detector system software version */
|
||||
THIS_SOFTWARE_VERSION, /**<return this software version */
|
||||
DETECTOR_FIRMWARE_SVN_VERSION /**<return detector system firmware svn version */
|
||||
RECEIVER_VERSION /**<return receiver software version */
|
||||
};
|
||||
/**
|
||||
detector digital test modes
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/gotthardDetectorServer"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x411
|
||||
//#define SVNREV 0x413
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTH "bergamaschi"
|
||||
#define SVNREV 0x411
|
||||
#define SVNAUTH "l_maliakal_d"
|
||||
#define SVNREV 0x413
|
||||
#define SVNDATE 0x20121217
|
||||
//
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define MYTHENSVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware/mythenDetectorServer"
|
||||
//#define SVNREPPATH ""
|
||||
#define MYTHENSVNREPUUID "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x411
|
||||
//#define SVNREV 0x412
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define MYTHENSVNAUTH "bergamaschi"
|
||||
#define MYTHENSVNREV 0x411
|
||||
#define MYTHENSVNAUTH "l_maliakal_d"
|
||||
#define MYTHENSVNREV 0x412
|
||||
#define MYTHENSVNDATE 0x20121217
|
||||
//
|
||||
|
@ -1563,9 +1563,10 @@ slsDetectorDefs::externalCommunicationMode slsDetector::setExternalCommunication
|
||||
MODULE_FIRMWARE_VERSION,
|
||||
DETECTOR_SERIAL_NUMBER,
|
||||
DETECTOR_FIRMWARE_VERSION,
|
||||
DETECTOR_SOFTWARE_VERSION
|
||||
DETECTOR_SOFTWARE_VERSION,
|
||||
THIS_SOFTWARE_VERSION,
|
||||
RECEIVER_VERSION
|
||||
}{};
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@ -1590,6 +1591,12 @@ int64_t slsDetector::getId( idMode mode, int imod){
|
||||
ret=OK;
|
||||
retval=SVNREVLIB;
|
||||
retval=(retval<<32) | SVNDATELIB;
|
||||
} else if (mode==RECEIVER_VERSION) {
|
||||
if (setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG) {
|
||||
ret=thisReceiver->getInt(fnum,retval);
|
||||
if(ret==FORCE_UPDATE)
|
||||
ret=updateReceiver();
|
||||
}
|
||||
} else {
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
if (controlSocket) {
|
||||
|
@ -416,7 +416,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN;
|
||||
i++;
|
||||
|
||||
descrToFuncMap[i].m_pFuncName="detectorsvnversion"; //
|
||||
descrToFuncMap[i].m_pFuncName="receiverversion"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSN;
|
||||
i++;
|
||||
|
||||
@ -2749,8 +2749,8 @@ string slsDetectorCommand::cmdSN(int narg, char *args[], int action) {
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
if (cmd=="detectorsvnversion") {
|
||||
sprintf(answer,"%llx",myDet->getId(DETECTOR_FIRMWARE_SVN_VERSION));
|
||||
if (cmd=="receiverversion") {
|
||||
sprintf(answer,"%llx",myDet->getId(RECEIVER_VERSION));
|
||||
return string(answer);
|
||||
}
|
||||
return string("unknown id mode ")+cmd;
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define SVNURLLIB "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware"
|
||||
//#define SVNREPPATH ""
|
||||
#define SVNREPUUIDLIB "951219d9-93cf-4727-9268-0efd64621fa3"
|
||||
//#define SVNREV 0x411
|
||||
//#define SVNREV 0x413
|
||||
//#define SVNKIND ""
|
||||
//#define SVNSCHED ""
|
||||
#define SVNAUTHLIB "bergamaschi"
|
||||
#define SVNREVLIB 0x411
|
||||
#define SVNAUTHLIB "l_maliakal_d"
|
||||
#define SVNREVLIB 0x413
|
||||
#define SVNDATELIB 0x20121217
|
||||
//
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "slsReceiver_funcs.h"
|
||||
#include "slsReceiverFunctionList.h"
|
||||
|
||||
#include "svnInfoReceiver.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -126,6 +126,7 @@ int slsReceiverFuncs::function_table(){
|
||||
flist[F_RESET_FRAMES_CAUGHT] = &slsReceiverFuncs::reset_frames_caught;
|
||||
flist[F_READ_FRAME] = &slsReceiverFuncs::read_frame;
|
||||
flist[F_ENABLE_FILE_WRITE] = &slsReceiverFuncs::enable_file_write;
|
||||
flist[F_GET_ID] = &slsReceiverFuncs::get_version;
|
||||
|
||||
//General Functions
|
||||
flist[F_LOCK_SERVER] = &slsReceiverFuncs::lock_receiver;
|
||||
@ -537,7 +538,7 @@ int slsReceiverFuncs::get_status(){
|
||||
retval=slsReceiverList->getStatus();
|
||||
#endif
|
||||
|
||||
if(ret==OK && socket->differentClients){
|
||||
if(socket->differentClients){
|
||||
cout << "Force update" << endl;
|
||||
ret=FORCE_UPDATE;
|
||||
}
|
||||
@ -560,7 +561,7 @@ int slsReceiverFuncs::get_frames_caught(){
|
||||
#ifdef SLS_RECEIVER_FUNCTION_LIST
|
||||
retval=slsReceiverList->getTotalFramesCaught();
|
||||
#endif
|
||||
if(ret==OK && socket->differentClients){
|
||||
if(socket->differentClients){
|
||||
cout << "Force update" << endl;
|
||||
ret=FORCE_UPDATE;
|
||||
}
|
||||
@ -584,7 +585,7 @@ int slsReceiverFuncs::get_frame_index(){
|
||||
retval=slsReceiverList->getAcquisitionIndex();
|
||||
#endif
|
||||
|
||||
if(ret==OK && socket->differentClients){
|
||||
if(socket->differentClients){
|
||||
cout << "Force update" << endl;
|
||||
ret=FORCE_UPDATE;
|
||||
}
|
||||
@ -801,6 +802,58 @@ int slsReceiverFuncs::enable_file_write(){
|
||||
//return ok/fail
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int slsReceiverFuncs::get_version(){
|
||||
ret=OK;
|
||||
int64_t retval=-1;
|
||||
|
||||
// execute action if the arguments correctly arrived
|
||||
#ifdef SLS_RECEIVER_FUNCTION_LIST
|
||||
retval= SVNREV;
|
||||
retval= (retval <<32) | SVNDATE;
|
||||
#endif
|
||||
|
||||
if(socket->differentClients){
|
||||
cout << "Force update" << endl;
|
||||
ret=FORCE_UPDATE;
|
||||
}
|
||||
|
||||
// send answer
|
||||
socket->SendDataOnly(&ret,sizeof(ret));
|
||||
socket->SendDataOnly(&retval,sizeof(retval));
|
||||
|
||||
//return ok/fail
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -80,6 +80,9 @@ public:
|
||||
/** Enable File Write*/
|
||||
int enable_file_write();
|
||||
|
||||
/** Get Version */
|
||||
int get_version();
|
||||
|
||||
//General Functions
|
||||
/** Locks Receiver */
|
||||
int lock_receiver();
|
||||
|
@ -104,6 +104,21 @@ int receiverInterface::getInt(int fnum, int &retval){
|
||||
|
||||
|
||||
|
||||
int receiverInterface::getInt(int fnum, int64_t &retval){
|
||||
int ret = slsDetectorDefs::FAIL;
|
||||
|
||||
if (dataSocket) {
|
||||
if (dataSocket->Connect()>=0) {
|
||||
dataSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
dataSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
dataSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
}
|
||||
dataSocket->Disconnect();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int receiverInterface::getLastClientIP(int fnum, char retval[]){
|
||||
int ret = slsDetectorDefs::FAIL;
|
||||
|
||||
|
@ -77,6 +77,13 @@ public:
|
||||
*/
|
||||
int getInt(int fnum, int &retval);
|
||||
|
||||
/**
|
||||
* Get an integer value from receiver
|
||||
* @param fnum function enum to determine what parameter
|
||||
* @param retval return value
|
||||
* \returns success of operation
|
||||
*/
|
||||
int getInt(int fnum, int64_t &retval);
|
||||
|
||||
/**
|
||||
* Get last client ip connected to receiver
|
||||
|
Loading…
x
Reference in New Issue
Block a user