Commit 528a477e authored by Andrea Orlati's avatar Andrea Orlati Committed by Giuseppe Carboni
Browse files

Fix issue 286 (#295)

* fix #286: implementation done.

* fix issue #286: solved an issue with the version command
parent 3711620e
Loading
Loading
Loading
Loading
+99 −98
Original line number Diff line number Diff line
@@ -127,14 +127,15 @@ def main():
    
	while not stopAll:
		try:
            #sys.stdout.write("<%d> "%cmdCounter)
			cmd=''
			if cmdCounter>0:
				try:
                #cmd=sys.stdin.readline()
					cmd=raw_input("<%d> "%cmdCounter)
				except IOError:
					cmd='exit'
					pass
			else:
				cmd="version"
			cmdCounter=cmdCounter+1
			cmd=cmd.strip()
			if cmd=="exit":
+2 −3
Original line number Diff line number Diff line
@@ -19,10 +19,9 @@

#
# user definable C-compilation flags
# this is deprecated, TARGETSYS will now be transformed into STATION in 64 bit version.....and legal values will be SRT, Medicina, Noto
ifeq ($(TARGETSYS),MED)
ifeq ($(STATION),Medicina)
	USER_CFLAGS = -U 'COMPILE_TARGET_SRT' -U 'COMPILE_TARGET_NT' -D 'COMPILE_TARGET_MED'
else ifeq ($(TARGETSYS),NT)
else ifeq ($(STATION),Noto)
	USER_CFLAGS = -U 'COMPILE_TARGET_SRT' -U 'COMPILE_TARGET_MED' -D 'COMPILE_TARGET_NT'
else
	USER_CFLAGS = -U 'COMPILE_TARGET_MED' -U 'COMPILE_TARGET_NT' -D 'COMPILE_TARGET_SRT'
+5 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@
#include <stdlib.h>
#include <cstdlib>
#include "pstream.h"
#include <DiscosVersion.h>


/**
@@ -118,6 +119,9 @@ namespace SimpleParser {
#define _SP_TIMETAGGEDQUEUECLEARALL "flushAll"
#define _SP_TIMETAGGEDQUEUECLEARALL_PARAMS 0

#define _SP_GETVERSION "version"
#define _SP_GETVERSION_PARAMS 0



/**
@@ -190,6 +194,7 @@ public:
			elem=new TRule(_SP_TIMETAGGEDQUEUECLEARALL,_SP_TIMETAGGEDQUEUECLEARALL_PARAMS);
			m_ruleSet.push_back(elem);
		}
		m_ruleSet.push_back(new TRule(_SP_GETVERSION,_SP_GETVERSION_PARAMS));
		m_object=obj;
		m_levelTwoSupport=levelTwoSupport;
		if (m_levelTwoSupport) {
+5 −2
Original line number Diff line number Diff line
@@ -121,6 +121,9 @@ IRA::CString CParser<OBJ>::executeCommand(const IRA::CString& command,IRA::CStri
  			}
		}
		else if (elem->m_type==KEYCOMMAND) {
			if (instr==_SP_GETVERSION) {
				return instr+m_answerDelimiter+DiscosVersion::CurrentVersion::getVersion();
			}
			if (instr==_SP_TIMETAGGEDQUEUE) {
				return instr+m_answerDelimiter+showTimeBasedCommands();
			}
@@ -225,10 +228,10 @@ typename CParser<OBJ>::TRule *CParser<OBJ>::checkCommand(const IRA::CString& lin
		_EXCPT(ParserErrors::CommandNotFoundExImpl,err,"CParser::checkCommand()");
		throw err;
	}
	if ((elem->m_type==KEYCOMMAND) && (!m_levelTwoSupport)) {
	/*if ((elem->m_type==KEYCOMMAND) && (!m_levelTwoSupport)) {
		_EXCPT(ParserErrors::NotSupportedErrorExImpl,err,"CParser::checkCommand()");
		throw err;
	}
	}*/
	if (timeTagged) {
		if (!parseTime(timeMark,execTime,execInterval)) {
			_EXCPT(ParserErrors::TimeFormatErrorExImpl,err,"CParser::checkCommand()");
+3 −3
Original line number Diff line number Diff line
@@ -45,13 +45,13 @@ PY_SCRIPTS =
#
# <brief description of xxxxx program>
TestFunctions_OBJECTS   = TestFunctions	
TestFunctions_LIBS      = IRALibrary SlaLibrary ParserErrors ComponentErrors
TestFunctions_LIBS      = IRALibrary SlaLibrary ParserErrors ComponentErrors DiscosVersion

TestParser_OBJECTS   = TestParser	
TestParser_LIBS      = IRALibrary SlaLibrary ParserErrors ComponentErrors
TestParser_LIBS      = IRALibrary SlaLibrary ParserErrors ComponentErrors DiscosVersion

TestTypes_OBJECTS   = TestTypes	
TestTypes_LIBS      = IRALibrary SlaLibrary ParserErrors ComponentErrors
TestTypes_LIBS      = IRALibrary SlaLibrary ParserErrors ComponentErrors DiscosVersion


#
Loading