mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 17:18:00 +02:00
Merge branch 'master' of gitorious.psi.ch:sls_det_software/sls_receiver_software
This commit is contained in:
@ -47,7 +47,7 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
||||
*/
|
||||
virtual ~UDPStandardImplementation();
|
||||
|
||||
|
||||
void configure(map<string, string> config_map);
|
||||
|
||||
/**
|
||||
* delete and free member parameters
|
||||
|
59
slsReceiverSoftware/include/ansi.h
Normal file
59
slsReceiverSoftware/include/ansi.h
Normal file
@ -0,0 +1,59 @@
|
||||
#define RED "\x1b[31m"
|
||||
#define GREEN "\x1b[32m"
|
||||
#define YELLOW "\x1b[33m"
|
||||
#define BLUE "\x1b[34m"
|
||||
#define MAGENTA "\x1b[35m"
|
||||
#define CYAN "\x1b[36m"
|
||||
#define BG_RED "\x1b[41m"
|
||||
#define BG_GREEN "\x1b[42m"
|
||||
#define BG_YELLOW "\x1b[43m"
|
||||
#define BG_BLUE "\x1b[44m"
|
||||
#define BG_MAGENTA "\x1b[45m"
|
||||
#define BG_CYAN "\x1b[46m"
|
||||
#define RESET "\x1b[0m"
|
||||
#define BOLD "\x1b[1m"
|
||||
|
||||
#define cprintf(code, format, ...) printf(code format RESET, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
|
||||
Code examples
|
||||
|
||||
example 1 (a snippet):
|
||||
|
||||
|
||||
#ifdef MARTIN
|
||||
cprintf(BLUE, "LL Write - Len: %2d - If: %X - Data: ",buffer_len, ll->ll_fifo_base);
|
||||
for (i=0; i < buffer_len/4; i++)
|
||||
cprintf(BLUE, "%.8X ",*(((unsigned *) buffer)+i));
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
#ifdef MARTIN
|
||||
cprintf(CYAN, "LL Read - If: %X - Data: ",ll->ll_fifo_base);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
example 2:
|
||||
|
||||
int main()
|
||||
{
|
||||
int i=1;
|
||||
printf("Normal %i\n", i);
|
||||
cprintf(RED, "Red\n");
|
||||
cprintf(GREEN, "Green\n");
|
||||
cprintf(YELLOW, "Yellow\n");
|
||||
cprintf(BLUE, "Blue\n");
|
||||
cprintf(MAGENTA, "Mangenta %i\n", i);
|
||||
cprintf(CYAN, "Cyan %i\n", i);
|
||||
cprintf(BOLD, "White %i\n", i);
|
||||
cprintf(RED BOLD, "Red %i\n", i);
|
||||
cprintf(GREEN BOLD, "Green\n");
|
||||
cprintf(YELLOW BOLD, "Yellow\n");
|
||||
cprintf(BLUE BOLD, "Blue\n");
|
||||
cprintf(MAGENTA BOLD, "Mangenta %i\n", i);
|
||||
cprintf(CYAN BOLD, "Cyan %i\n", i);
|
||||
}
|
||||
|
||||
*/
|
@ -103,7 +103,10 @@ enum communicationProtocol{
|
||||
nsent(0),
|
||||
total_sent(0)// sender (client): where to? ip
|
||||
{
|
||||
|
||||
//memset(&serverAddress, 0, sizeof(sockaddr_in));
|
||||
//memset(&clientAddress, 0, sizeof(sockaddr_in));
|
||||
// serverAddress = {0};
|
||||
// clientAddress = {0};
|
||||
// strcpy(hostname,host_ip_or_name);
|
||||
struct hostent *hostInfo = gethostbyname(host_ip_or_name);
|
||||
if (hostInfo == NULL){
|
||||
@ -159,7 +162,10 @@ enum communicationProtocol{
|
||||
nsent(0),
|
||||
total_sent(0)
|
||||
{
|
||||
|
||||
//memset(&serverAddress, 0, sizeof(sockaddr_in));
|
||||
// memset(&clientAddress, 0, sizeof(sockaddr_in));
|
||||
// serverAddress = {0};
|
||||
// clientAddress = {0};
|
||||
/* // you can specify an IP address: */
|
||||
/* */
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ansi.h"
|
||||
|
||||
typedef double double32_t;
|
||||
typedef float float32_t;
|
||||
|
Reference in New Issue
Block a user