diff --git a/Common/Clients/SystemTerminal/src/_tui_SysTerm.py b/Common/Clients/SystemTerminal/src/_tui_SysTerm.py
index dfbc8a579771648f7eb29a7d428ab6fc32165fa3..436552f0386dff4df1ee1e71c712a2c8bcbe03d8 100644
--- a/Common/Clients/SystemTerminal/src/_tui_SysTerm.py
+++ b/Common/Clients/SystemTerminal/src/_tui_SysTerm.py
@@ -133,7 +133,6 @@ def main():
cmd=raw_input("<%d> "%cmdCounter)
except IOError:
cmd='exit'
- pass
else:
cmd="version"
cmdCounter=cmdCounter+1
@@ -157,15 +156,24 @@ def main():
idx = res.find('\\')
cmd_name, response = res[:idx+1], res[idx+1:].rstrip('\\')
if success and response:
- groups = response.split(',')
- for group in groups:
- values = group.split(';')
- if len(values) > 1:
- print cmd_name
- for i, value in enumerate(values):
- print '%02d) %s' %(i, value)
- elif res:
- print res
+ if response.startswith('STR '):
+ # We got a formatted string in return, print it
+ # without any modification
+ response = response[4:]
+ lines = response.split('\n')
+ print cmd_name
+ for line in lines:
+ print line
+ else:
+ groups = response.split(',')
+ for group in groups:
+ values = group.split(';')
+ if len(values) > 1:
+ print cmd_name
+ for i, value in enumerate(values):
+ print '%02d) %s' %(i, value)
+ elif res:
+ print res
elif res:
print res
except Exception, ex:
@@ -173,8 +181,13 @@ def main():
newEx.setAction("command()")
newEx.setReason(ex.message)
newEx.log(simpleClient.getLogger(),ACSLog.ACS_LOG_ERROR)
- except KeyboardInterrupt:
+ except EOFError:
+ # CTRL + D event: Equivalent to the exit command, we stop the loop
stopAll=True
+ except KeyboardInterrupt:
+ # CTRL + C event: Ignore whatever string was written on the
+ # terminal and show a new prompt line
+ print '^C'
readline.write_history_file(historyFile)
simpleClient.releaseComponent(compName)
diff --git a/Common/Interfaces/AntennaInterface/config/CDB/schemas/Station.xsd b/Common/Interfaces/AntennaInterface/config/CDB/schemas/Station.xsd
index 97741a9e787ca346010e1fadc5a7ecc5a1878707..8959f9c44ccbe0b3fd87299850638de9df1b44dc 100644
--- a/Common/Interfaces/AntennaInterface/config/CDB/schemas/Station.xsd
+++ b/Common/Interfaces/AntennaInterface/config/CDB/schemas/Station.xsd
@@ -33,9 +33,11 @@
+
+
-
\ No newline at end of file
+
diff --git a/Common/Interfaces/ManagmentInterface/idl/Scheduler.idl b/Common/Interfaces/ManagmentInterface/idl/Scheduler.idl
index 675fc059e5197b7262a797b85969c0f7662998d7..d1aad1d639d58e3456dc35e4eeb15f4d13547683 100644
--- a/Common/Interfaces/ManagmentInterface/idl/Scheduler.idl
+++ b/Common/Interfaces/ManagmentInterface/idl/Scheduler.idl
@@ -204,11 +204,12 @@ module Management {
/**
* This method sets the current project code. If the project does not exists an error is thrown.
- * @param code code of the project, if blank the selected code will be default one
+ * @param code code of the project, if blank the selected code will be default one
+ * @param message this will returns a wellcome message from the control software
* @throw ManagementErrors::ManagementErrorsEx
* @throw CORBA::SystemExcpetion
*/
- void setProjectCode(in string code) raises (ManagementErrors::ManagementErrorsEx);
+ void setProjectCode(in string code, out string message) raises (ManagementErrors::ManagementErrorsEx);
/**
* It allows to immediately start a scan that involves a primary focus axis or a subreflector axis. The scan is performed of the currently
diff --git a/Common/Libraries/ParserLibrary/include/SP_typeConversion.h b/Common/Libraries/ParserLibrary/include/SP_typeConversion.h
index ed2f9da4482052e38b5fe1cd1fd0fa77e063f51f..822347d116d70aee12242ab70bdc1623e820edd3 100644
--- a/Common/Libraries/ParserLibrary/include/SP_typeConversion.h
+++ b/Common/Libraries/ParserLibrary/include/SP_typeConversion.h
@@ -107,6 +107,19 @@ public:
}
};
+class longString_converter
+{
+public:
+ IRA::CString strToVal(const char * str) throw (ParserErrors::BadTypeFormatExImpl) {
+ return IRA::CString(str);
+ }
+ char *valToStr(const IRA::CString& val) {
+ char *c=new char[val.GetLength()+1];
+ strcpy(c,(const char*)val);
+ return c;
+ }
+};
+
template <_sp_symbols OUT> class angle_converter
{
public:
diff --git a/Common/Libraries/ParserLibrary/include/SP_types.h b/Common/Libraries/ParserLibrary/include/SP_types.h
index 6ec8c6d17580309f23f2eb1b1321eaf25dc55ff8..af1269ccc7c38ade908bbda54391ba4ff98ddd25 100644
--- a/Common/Libraries/ParserLibrary/include/SP_types.h
+++ b/Common/Libraries/ParserLibrary/include/SP_types.h
@@ -163,6 +163,7 @@ typedef basic_type time_type;
typedef basic_type interval_type;
typedef basic_type longSeq_type;
typedef basic_type doubleSeq_type;
+typedef basic_type longString_type;
class string_type: public virtual basic_type
diff --git a/Common/Libraries/ParserLibrary/src/TestParser.cpp b/Common/Libraries/ParserLibrary/src/TestParser.cpp
index 6c8e6a1b7f483a788c49eeeaec58e6d00f582e0e..d621ddddd0c89e4da0bb6557aced06a1a4bc60c4 100644
--- a/Common/Libraries/ParserLibrary/src/TestParser.cpp
+++ b/Common/Libraries/ParserLibrary/src/TestParser.cpp
@@ -47,6 +47,16 @@ void positivo(const long& var,TBools& res) {
void stampa(const char *str) {
printf("%s\n",str);
}
+
+void answer(const char *str,IRA::CString& answer) const
+{
+ if (str!=NULL) {
+ answer.Format("Wellcome %s",str);
+ }
+ else {
+ answer="Wellcome";
+ }
+}
int somma(const int&i,const int&j) {
return i+j;
}
@@ -175,6 +185,9 @@ int main(int argc, char *argv[])
parser.add("sumSeq",new function1 >(&test,&CTest::sumSeq),1);
parser.add("sequence",new function2,I >(&test,&CTest::sequence),1);
parser.add("wait",new function1 >(&test,&CTest::wait),1);
+
+ parser.add("answer",new function2, O >(&test,&CTest::answer),1);
+
parser.add("naviga","firefox",1);
diff --git a/Common/Servers/Scheduler/include/Configuration.h b/Common/Servers/Scheduler/include/Configuration.h
index 700764f2aaf6fdc79dce2cb848ddaacf8826b5c7..e49eb4fb7246aa4b4648899a6b1869736330a0bc 100644
--- a/Common/Servers/Scheduler/include/Configuration.h
+++ b/Common/Servers/Scheduler/include/Configuration.h
@@ -219,6 +219,11 @@ public:
*/
const IRA::CString& getRecordingLockFile() const { return m_recordingLockFile;}
+ /**
+ * @return the welcome message string
+ */
+ const IRA::CString& getWelcomeMessage() const { return m_welcomeMessage;}
+
private:
IRA::CString m_schedDir;
IRA::CString m_dataDir;
@@ -241,6 +246,7 @@ private:
IRA::CString m_proceduresLocation;
IRA::CString m_defaultProceduresFile;
IRA::CString m_defaultProjectCode;
+ IRA::CString m_welcomeMessage;
bool m_checkProjectCode;
long m_minorServoMappings;
long m_fTrackDigits;
diff --git a/Common/Servers/Scheduler/include/Core_Operations.h b/Common/Servers/Scheduler/include/Core_Operations.h
index 6988c0ee6207f96ea9b7edd3e76191bb78ec4367..54b2cdbf4f9dbf17110bb27ebf2029b28da1c78c 100644
--- a/Common/Servers/Scheduler/include/Core_Operations.h
+++ b/Common/Servers/Scheduler/include/Core_Operations.h
@@ -132,9 +132,10 @@ void _setDevice(const long& deviceID) throw (ComponentErrors::CouldntGetComponen
* It allows to set a new project code. If requested by the component configuration (CheckProjectCode) the project is checked to be registered in the system.
* If not present an error is thrown. The check consist in verifying a folder named "code" exists in SchedDir of the configuration.
* @param code new project code
+ * @param message this is a wellcome message from the control system
* @throw ManagementErrors::UnkownProjectCodeErrorExImpl
*/
-void _setProjectCode(const char* code) throw (ManagementErrors::UnkownProjectCodeErrorExImpl);
+void _setProjectCode(const char* code,IRA::CString& message) throw (ManagementErrors::UnkownProjectCodeErrorExImpl);
/**
* called to set proper values for the rest frequency
diff --git a/Common/Servers/Scheduler/include/SchedulerImpl.h b/Common/Servers/Scheduler/include/SchedulerImpl.h
index e022c41d5efa9fa0e7d751521d786f48afd14feb..d700bedf950df572d6f88c734986d1da95e4a7ef 100644
--- a/Common/Servers/Scheduler/include/SchedulerImpl.h
+++ b/Common/Servers/Scheduler/include/SchedulerImpl.h
@@ -305,10 +305,11 @@ public:
* This method allows to set the current running project code. The code will be used to locate schedules files and to store data files on system disks. If the project is not present/registered in the
* system an error is thrown.
* @param code new project code. If an empty string is given the default code is adopted, the default code is part of the component configuration.
+ * @param message a wellcome message from control software
* @throw CORBA::SystemException
* @throw ManagementErrors::ManagementErrorsEx
*/
- virtual void setProjectCode(const char *code) throw (CORBA::SystemException,ManagementErrors::ManagementErrorsEx);
+ virtual void setProjectCode(const char *code,CORBA::String_out message) throw (CORBA::SystemException,ManagementErrors::ManagementErrorsEx);
/**
* This method allow to set the current value for the rest frequency
diff --git a/Common/Servers/Scheduler/src/Configuration.cpp b/Common/Servers/Scheduler/src/Configuration.cpp
index cbd199194b5632a2aedeca2ee48d3dbc9b5dca04..69003a17cde678bb7ed8e27f5ea86feb250cea41 100644
--- a/Common/Servers/Scheduler/src/Configuration.cpp
+++ b/Common/Servers/Scheduler/src/Configuration.cpp
@@ -300,6 +300,19 @@ void CConfiguration::init(maci::ContainerServices *Services) throw (ComponentErr
ACS_LOG(LM_FULL_INFO,"CConfiguration::init()",(LM_WARNING,"Default backend does not exist"));
m_currentBackendIndex=-1;
}
+
+ if (!CIRATools::getDBValue(Services,"welcomeMessage",m_welcomeMessage,"alma/","DataBlock/Station")) {
+ m_welcomeMessage = (const char*)"";
+ }
+ std::string welcomeMessage = std::string(m_welcomeMessage);
+ //Replace every occurrence of the string "\n" (2 characters) with a new line character
+ while(true) {
+ std::size_t found = welcomeMessage.find("\\n");
+ if(found == std::string::npos)
+ break;
+ welcomeMessage.replace(found, 2, "\n");
+ }
+ m_welcomeMessage = welcomeMessage.c_str();
}
Management::TScanAxis CConfiguration::str2Axis(const IRA::CString& axis) const
diff --git a/Common/Servers/Scheduler/src/Core.cpp b/Common/Servers/Scheduler/src/Core.cpp
index 8024f029d11dd91e75e3c03ce761237071f366ef..aaefba4a23bf66dfd4f79130684b19cda150850d 100644
--- a/Common/Servers/Scheduler/src/Core.cpp
+++ b/Common/Servers/Scheduler/src/Core.cpp
@@ -123,7 +123,7 @@ void CCore::execute() throw (ComponentErrors::TimerErrorExImpl,ComponentErrors::
m_parser->add("log",new function1 >(this,&CCore::_changeLogFile),1);
m_parser->add("logMessage",new function1 >(this,&CCore::_logMessage),1);
m_parser->add("wx",new function4,O,O,O >(this,&CCore::_getWeatherStationParameters),0);
- m_parser->add("project",new function1 >(this,&CCore::_setProjectCode),1);
+ m_parser->add("project",new function2,O >(this,&CCore::_setProjectCode),1);
// no range checks because * is allowed
m_parser->add("skydip",new function3 >,I >,I >(this,&CCore::skydip),3);
m_parser->add("agc","_tp_agc",2,"NONE");
diff --git a/Common/Servers/Scheduler/src/Core_Operations.i b/Common/Servers/Scheduler/src/Core_Operations.i
index 8875c6a8d3c9cccb79758882f423fe789eac95f4..bb03cb7b48ce3e799c3c217383b54523105fa6df 100644
--- a/Common/Servers/Scheduler/src/Core_Operations.i
+++ b/Common/Servers/Scheduler/src/Core_Operations.i
@@ -733,7 +733,7 @@ void CCore::_fTrack(const char *dev) throw (ComponentErrors::CouldntGetComponent
}
}
-void CCore::_setProjectCode(const char* code) throw (ManagementErrors::UnkownProjectCodeErrorExImpl)
+void CCore::_setProjectCode(const char* code,IRA::CString& message) throw (ManagementErrors::UnkownProjectCodeErrorExImpl)
{
IRA::CString newCode(code);
if (newCode=="''") { // if '' given...maps to default user
@@ -750,6 +750,11 @@ void CCore::_setProjectCode(const char* code) throw (ManagementErrors::UnkownPro
if (m_schedExecuter) {
m_schedExecuter->setProjectCode(newCode);
}
+ std::string msg = "Welcome to this facility, " + std::string(code) + "!";
+ std::string welcome = std::string(m_config->getWelcomeMessage());
+ if(welcome != "")
+ msg += "\n" + welcome;
+ message.Format("STR %s", msg.c_str());
}
/*void CCore::_winkingMark(const char *arg) throw (ComponentErrors::ValidationErrorExImpl);
diff --git a/Common/Servers/Scheduler/src/SchedulerImpl.cpp b/Common/Servers/Scheduler/src/SchedulerImpl.cpp
index a36f333f49819aaf505476003fa5ffb01915804b..9d39125c138fc6b328e4a6123056b10ed93fa24e 100644
--- a/Common/Servers/Scheduler/src/SchedulerImpl.cpp
+++ b/Common/Servers/Scheduler/src/SchedulerImpl.cpp
@@ -362,10 +362,12 @@ void SchedulerImpl::fTrack(const char* dev) throw (ComponentErrors::ComponentErr
m_core->_fTrack(dev);
}
-void SchedulerImpl::setProjectCode(const char *code) throw (CORBA::SystemException,ManagementErrors::ManagementErrorsEx)
+void SchedulerImpl::setProjectCode(const char *code, CORBA::String_out message) throw (CORBA::SystemException,ManagementErrors::ManagementErrorsEx)
{
+ IRA::CString msg;
try {
- m_core->_setProjectCode(code);
+ m_core->_setProjectCode(code, msg);
+ message=(const char *)msg;
}
catch (ManagementErrors::ManagementErrorsExImpl& ex) {
ex.log(LM_DEBUG);
diff --git a/Medicina/CDB/alma/DataBlock/Station/Station.xml b/Medicina/CDB/alma/DataBlock/Station/Station.xml
index 882640efc8eb90e5f5240fba69b52d72c939e3f5..4f0e8522d522df9522220090de415ff4c36498f0 100644
--- a/Medicina/CDB/alma/DataBlock/Station/Station.xml
+++ b/Medicina/CDB/alma/DataBlock/Station/Station.xml
@@ -16,4 +16,5 @@
height="28.0"
yPolarMotion="0.0"
xPolarMotion="0.0"
- geodeticModel="0" />
+ geodeticModel="0"
+ welcomeMessage="" />
diff --git a/Medicina/CDB/alma/MANAGEMENT/Palmiro/Palmiro.xml b/Medicina/CDB/alma/MANAGEMENT/Palmiro/Palmiro.xml
index 11a5973820f9ed45d5db71e49c20c99741eb10e4..7e0cc626b58f65f8b2bc929cb4f9d6ee962baa7d 100644
--- a/Medicina/CDB/alma/MANAGEMENT/Palmiro/Palmiro.xml
+++ b/Medicina/CDB/alma/MANAGEMENT/Palmiro/Palmiro.xml
@@ -30,7 +30,7 @@
DefaultBackendInstance="BACKENDS/TotalPower"
DefaultDataReceiverInstance="MANAGEMENT/FitsZilla"
DefaultProjectCode="maintenance"
- CheckProjectCode="false"
+ CheckProjectCode="true"
>
diff --git a/Medicina/Configuration/CDB/alma/DataBlock/Station/Station.xml b/Medicina/Configuration/CDB/alma/DataBlock/Station/Station.xml
index 882640efc8eb90e5f5240fba69b52d72c939e3f5..4f0e8522d522df9522220090de415ff4c36498f0 100644
--- a/Medicina/Configuration/CDB/alma/DataBlock/Station/Station.xml
+++ b/Medicina/Configuration/CDB/alma/DataBlock/Station/Station.xml
@@ -16,4 +16,5 @@
height="28.0"
yPolarMotion="0.0"
xPolarMotion="0.0"
- geodeticModel="0" />
+ geodeticModel="0"
+ welcomeMessage="" />
diff --git a/Medicina/Configuration/CDB/alma/MANAGEMENT/Palmiro/Palmiro.xml b/Medicina/Configuration/CDB/alma/MANAGEMENT/Palmiro/Palmiro.xml
index 11a5973820f9ed45d5db71e49c20c99741eb10e4..7e0cc626b58f65f8b2bc929cb4f9d6ee962baa7d 100644
--- a/Medicina/Configuration/CDB/alma/MANAGEMENT/Palmiro/Palmiro.xml
+++ b/Medicina/Configuration/CDB/alma/MANAGEMENT/Palmiro/Palmiro.xml
@@ -30,7 +30,7 @@
DefaultBackendInstance="BACKENDS/TotalPower"
DefaultDataReceiverInstance="MANAGEMENT/FitsZilla"
DefaultProjectCode="maintenance"
- CheckProjectCode="false"
+ CheckProjectCode="true"
>
diff --git a/Noto/CDB/alma/DataBlock/Station/Station.xml b/Noto/CDB/alma/DataBlock/Station/Station.xml
index 6c71799b261cba4e171d205cbd8606520f8b5e0e..ea4f266245cd59f7a6d34a44549a4c76aed84780 100644
--- a/Noto/CDB/alma/DataBlock/Station/Station.xml
+++ b/Noto/CDB/alma/DataBlock/Station/Station.xml
@@ -16,4 +16,5 @@
height="32.0"
yPolarMotion="0.0"
xPolarMotion="0.0"
- geodeticModel="0" />
+ geodeticModel="0"
+ welcomeMessage="" />
diff --git a/Noto/Configuration/CDB/alma/DataBlock/Station/Station.xml b/Noto/Configuration/CDB/alma/DataBlock/Station/Station.xml
index 6c71799b261cba4e171d205cbd8606520f8b5e0e..ea4f266245cd59f7a6d34a44549a4c76aed84780 100644
--- a/Noto/Configuration/CDB/alma/DataBlock/Station/Station.xml
+++ b/Noto/Configuration/CDB/alma/DataBlock/Station/Station.xml
@@ -16,4 +16,5 @@
height="32.0"
yPolarMotion="0.0"
xPolarMotion="0.0"
- geodeticModel="0" />
+ geodeticModel="0"
+ welcomeMessage="" />
diff --git a/SRT/CDB/alma/DataBlock/Station/Station.xml b/SRT/CDB/alma/DataBlock/Station/Station.xml
index b541a6a663b5db28bc7139c0bebd494f268ef6d6..e30eebd0acbb9f70e382411249f9b31c92244258 100644
--- a/SRT/CDB/alma/DataBlock/Station/Station.xml
+++ b/SRT/CDB/alma/DataBlock/Station/Station.xml
@@ -17,4 +17,5 @@
height="700.0"
yPolarMotion="0.0"
xPolarMotion="0.0"
- geodeticModel="0" />
+ geodeticModel="0"
+ welcomeMessage="Before starting to observe, it is important that you check the status of the telescope visiting the following website:\nhttps://bit.ly/2Xf3aUl\nYou can find it as a bookmark in the browser as well." />
diff --git a/SRT/CDB/alma/MANAGEMENT/Gavino/Gavino.xml b/SRT/CDB/alma/MANAGEMENT/Gavino/Gavino.xml
index 7969bde5d97f2653a6178b7ce4877a4bef6ec48c..8bf8de4875ddba9e2e514b05aa7e792d319aa016 100644
--- a/SRT/CDB/alma/MANAGEMENT/Gavino/Gavino.xml
+++ b/SRT/CDB/alma/MANAGEMENT/Gavino/Gavino.xml
@@ -30,7 +30,7 @@
DefaultBackendInstance="BACKENDS/TotalPower"
DefaultDataReceiverInstance="MANAGEMENT/FitsZilla"
DefaultProjectCode="Maintenance"
- CheckProjectCode="false"
+ CheckProjectCode="true"
>
diff --git a/SRT/Configuration/CDB/alma/DataBlock/Station/Station.xml b/SRT/Configuration/CDB/alma/DataBlock/Station/Station.xml
index 7b56a74e5efc5d2e919a1df0bfef62fc3db812fc..2fd571543bfa40a2db57f74d58b1757aa42bef2f 100644
--- a/SRT/Configuration/CDB/alma/DataBlock/Station/Station.xml
+++ b/SRT/Configuration/CDB/alma/DataBlock/Station/Station.xml
@@ -17,4 +17,5 @@
height="650.0"
yPolarMotion="0.0"
xPolarMotion="0.0"
- geodeticModel="0" />
+ geodeticModel="0"
+ welcomeMessage="Before starting to observe, it is important that you check the status of the telescope visiting the following website:\nhttps://bit.ly/2Xf3aUl\nYou can find it as a bookmark in the browser as well." />
diff --git a/SRT/Configuration/CDB/alma/MANAGEMENT/Gavino/Gavino.xml b/SRT/Configuration/CDB/alma/MANAGEMENT/Gavino/Gavino.xml
index fbbdbdcda6defca2d7e36fd6cf7bc5277a73bfeb..0e7feb798bf5c338aab54a15726f8b5bdb48303a 100644
--- a/SRT/Configuration/CDB/alma/MANAGEMENT/Gavino/Gavino.xml
+++ b/SRT/Configuration/CDB/alma/MANAGEMENT/Gavino/Gavino.xml
@@ -30,7 +30,7 @@
DefaultBackendInstance="BACKENDS/TotalPower"
DefaultDataReceiverInstance="MANAGEMENT/FitsZilla"
DefaultProjectCode="Maintenance"
- CheckProjectCode="false"
+ CheckProjectCode="true"
>