mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-20 08:38:00 +02:00
client moved everythign from common files to slsSupportLin/include
This commit is contained in:
68
slsSupportLib/include/utilities.h
Normal file
68
slsSupportLib/include/utilities.h
Normal file
@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "sls_receiver_defs.h"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <fstream>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/**
|
||||
* Read config file for receiver
|
||||
* @param fname config file name
|
||||
* @param tcpip_port_no pointer to tcp port number
|
||||
* @param map map
|
||||
* @returns OK or FAIL
|
||||
*/
|
||||
int read_config_file(std::string fname, int *tcpip_port_no,
|
||||
std::map<std::string, std::string> * configuration_map);
|
||||
|
||||
|
||||
/** (used by multi and sls)
|
||||
* reads a short int raw data file
|
||||
* @param infile input file stream
|
||||
* @param data array of data values
|
||||
* @param nch number of channels
|
||||
* @param offset start channel value
|
||||
* @returns OK or FAIL if it could not read the file or data=NULL
|
||||
*/
|
||||
int readDataFile(std::ifstream &infile, short int *data, int nch, int offset=0);
|
||||
|
||||
|
||||
/** (used by multi and sls)
|
||||
* reads a short int rawdata file
|
||||
* @param name of the file to be read
|
||||
* @param data array of data value
|
||||
* @param nch number of channels
|
||||
* @returns OK or FAIL if it could not read the file or data=NULL
|
||||
*/
|
||||
int readDataFile(std::string fname, short int *data, int nch);
|
||||
|
||||
|
||||
/** (used by multi and sls)
|
||||
* writes a short int raw data file
|
||||
* @param outfile output file stream
|
||||
* @param nch number of channels
|
||||
* @param data array of data values
|
||||
* @param offset start channel number
|
||||
* @returns OK or FAIL if it could not write the file or data=NULL
|
||||
*/
|
||||
int writeDataFile(std::ofstream &outfile,int nch, short int *data, int offset=0);
|
||||
|
||||
|
||||
|
||||
/** (used by multi and sls)
|
||||
* writes a short int raw data file
|
||||
* @param fname of the file to be written
|
||||
* @param nch number of channels
|
||||
* @param data array of data values
|
||||
* @returns OK or FAIL if it could not write the file or data=NULL
|
||||
*/
|
||||
int writeDataFile(std::string fname,int nch, short int *data);
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user