Commit 4c6d9034 authored by aorlati's avatar aorlati Committed by Giuseppe Carboni
Browse files

fix #221: LO under control of L band, introduced ifd command by the u… (#223)

* fix #221: LO under control of L band, introduced ifd command by the use of a python script

* fix#221: change according sugestions

* Fix #221, improved integration for filters bandwidth.
parent abfa4420
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -13,11 +13,6 @@
#ifndef DEFINITIONS_H
#define DEFINITIONS_H

// if this value is changed the modfication should be reflected also in python implementation in module customlogging.py
#ifndef USER_MESSAGE_FIELDNAME 
#define USER_MESSAGE_FIELDNAME "Message-to-User"
#endif

#ifndef NULL
#define NULL 0
#endif
@@ -80,13 +75,6 @@
*/
#define _ADD_EXTRA(OBJ,NAME,VALUE) OBJ.addData(NAME,VALUE)

/**
 * Appends the message to be returned to the user for a completion or an exception.
 * The message i shown in the operatro input by cansequence of a user command
 * @param OBJ object (completion or exception) to which extra data must be appended
 * @param VALUE message to the user
*/
#define _ADD_USER_MESSAGE(OBJ,VALUE) _ADD_EXTRA(OBJ,USER_MESSAGE_FIELDNAME,VALUE)

/**
 * Used to read extra information from a completion or exception
+0 −3
Original line number Diff line number Diff line
@@ -18,8 +18,5 @@ logger = customlogging.getLogger("IRA_SERVICE_LOGGER")
userLogger = customlogging.getLogger("IRA_CUSTOM_LOGGER")
userLogger.isUserLogger=True

def _add_user_message(ex,message):
	ex.addData("Message-to-User",message)

customlogging.Log.setCapacity(1)
customlogging.Log.setBatchSize(1)
+54 −0
Original line number Diff line number Diff line
#include "String.h"
#include <stdlib.h>

namespace IRALibraryTest {

class IRALibrary_String : public ::testing::Test {
public:
	::testing::AssertionResult string_checkLeft() {
		RecordProperty("description","check the CString Left method");
		IRA::CString base("error and error message");		
		IRA::CString token("error ");
		IRA::CString comp("and error message");
		IRA::CString res;		
		res=base.Left(token.GetLength());
		if (res.GetLength()+comp.GetLength()!=base.GetLength()) {
			return ::testing::AssertionFailure() << " the length of the strings does not match";
		}
		if (res!=token) {
			return ::testing::AssertionFailure() << " unexpected function output, the resulting string is'"
			  << (const char *)res << "' instead of '" << (const char *)token << "'";
		}		
		return ::testing::AssertionSuccess();
	}
	
	::testing::AssertionResult string_checkSplit() {
		RecordProperty("description","check the how CString handle string splitting");
		IRA::CString base("That is a test string that must be split");		
		IRA::CString token("is");
		IRA::CString split1,split2;		
		int pos=base.Find((const char *)token);
		split1=base.Left(pos+token.GetLength());
		split2=base.Right(base.GetLength()-(pos+token.GetLength()));
		if (split1.GetLength()+split2.GetLength()!=base.GetLength()) {
			return ::testing::AssertionFailure() << " the length of the strings does not match";
		}
		if (split1!="That is") {
			return ::testing::AssertionFailure() << " unexpected function output, the resulting string is '"
			  << (const char *)split1 << "' instead of 'This is'";
		}
		if (split2!=" a test string that must be split") {
			return ::testing::AssertionFailure() << " unexpected function output, the resulting string is '"
			  << (const char *)split2 << "' instead of ' a test string that must be split'";
		}		
		return ::testing::AssertionSuccess();
	}	

protected:
	virtual void SetUp() {
	}
	virtual void TearDown() {
	}
};

}
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@
#include "CError_regression.i"
#include "CDBTable_regression.i"

#include "CString_test.i"

using namespace IRALibraryTest;

TEST_F(IRALibrary_IRATools, makeDirectory_createSimpleDirectory){
@@ -72,3 +74,11 @@ TEST_F(IRALibrary_CError,copyConstructor_segfault){
TEST_F(IRALibrary_CDataField,typeConversion_fail){
	EXPECT_TRUE(typeConversion_fail());
}

TEST_F(IRALibrary_String,string_checkLeft){
	EXPECT_TRUE(string_checkLeft());
}

TEST_F(IRALibrary_String,string_checkSplit) {
	EXPECT_TRUE(string_checkSplit());
}
+45 −0
Original line number Diff line number Diff line
#include <Definitions.h>
#include <iostream>

// if this value is changed the modification should be reflected also in python implementation
#ifndef USER_MESSAGE_FIELDNAME 
#define USER_MESSAGE_FIELDNAME "Message-to-User"
#endif

/**
 * Appends the message to be returned to the user for a completion or an exception.
 * The message i shown in the operator input by consequence of a user command
 * @param OBJ object (completion or exception) to which extra data must be appended
 * @param VALUE message to the user
*/
#define _ADD_USER_MESSAGE(OBJ,VALUE) _ADD_EXTRA(OBJ,USER_MESSAGE_FIELDNAME,VALUE)

/**
 * Appends the message to be returned to the user for a completion or an exception.
 * The message i shown in the operator input by consequence of a user command.
 * This version will also send a message to the user from a stand-alone program.
 * @param OBJ object (completion or exception) to which extra data must be appended
 * @param VALUE message to the user
*/
#define _ADD_USER_MESSAGE_DIRECT(OBJ,VALUE) { \
	IRA::CString out; \
	_ADD_EXTRA(OBJ,USER_MESSAGE_FIELDNAME,VALUE); \
	exceptionToUser(OBJ,out); \
	std::cerr << "error " << (const char *)out; \
}											 

namespace SimpleParser {
											 										  
template<class EX> class CFormatter {
public:
	static void exceptionToUser(EX& exObj,IRA::CString& output);
private:
	static IRA::CString getMessage(EX& exObj);
};

#include "ParserConnector.i"

}


Loading