diff --git a/SRT/Interfaces/SRTDBESMInterface/idl/SRTDBESM.idl b/SRT/Interfaces/SRTDBESMInterface/idl/SRTDBESM.idl index 2104c95d1707a58b38e8bdf7dec5f9f22d0abb01..cf1e88c91f11613b97e69b8e2ae37862809bf159 100644 --- a/SRT/Interfaces/SRTDBESMInterface/idl/SRTDBESM.idl +++ b/SRT/Interfaces/SRTDBESMInterface/idl/SRTDBESM.idl @@ -122,7 +122,33 @@ module Backends { get single DBESM board firmware version info */ void get_firm(in short b_addr) raises (BackendsErrors::BackendsErrorsEx); - + /* + set one or more amplifiers depending on which output is requested + */ + void set_dbeamp(in string out_dbe, in string amp_val) raises (BackendsErrors::BackendsErrorsEx); + + /* + get one or more amplifier values depending on which output is requested + */ + void get_dbeamp(in string out_dbe) raises (BackendsErrors::BackendsErrorsEx); + /* + // set one or more equalizers depending on which output is requested + */ + void set_dbeeq(in string out_dbe, in string eq_val) raises (BackendsErrors::BackendsErrorsEx); + + /* + get one or more equalizer values depending on which output is requested + */ + void get_dbeeq(in string out_dbe) raises (BackendsErrors::BackendsErrorsEx); + /* + set one or more band-pass filters depending on which output is requested + */ + void set_dbebpf(in string out_dbe, in string bpf_val) raises (BackendsErrors::BackendsErrorsEx); + + /* + get one or more band-pass filter values depending on which output is requested + */ + void get_dbebpf(in string out_dbe) raises (BackendsErrors::BackendsErrorsEx); }; }; diff --git a/SRT/Libraries/build.log b/SRT/Libraries/build.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/SRT/Servers/SRTDBESM/include/CommandSocket.h b/SRT/Servers/SRTDBESM/include/CommandSocket.h index 0e7ff0b38e20a5ee71a7a889b1d8c002eac42601..71de69d3a780d1ad585aac970729ecce1e422852 100644 --- a/SRT/Servers/SRTDBESM/include/CommandSocket.h +++ b/SRT/Servers/SRTDBESM/include/CommandSocket.h @@ -86,9 +86,23 @@ public: void parse_double_response(string status_str, string start, string end, double* val); //throw (BackendsErrors::BackendsErrorsEx); - void CCommandSocket::parse_string_response(string status_str, string start, string end, string* val); + void CCommandSocket::parse_long_response(string status_str, string start, string end, long* val); //throw (BackendsErrors::BackendsErrorsEx) + + void parse_string_response(string status_str, string start, string end, string* val); string get_firm(short b_addr); + + string set_dbeamp(const char * out_dbe, const char * amp_val); + + string get_dbeamp(const char * out_dbe); + + string set_dbeeq(const char * out_dbe, const char * eq_val); + + string get_dbeeq(const char * out_dbe); + + string set_dbebpf(const char * out_dbe, const char * bpf_val); + + string get_dbebpf(const char * out_dbe); protected: /** diff --git a/SRT/Servers/SRTDBESM/include/DBESMprotocol.h b/SRT/Servers/SRTDBESM/include/DBESMprotocol.h index ed33bf116321cf08431c974843284c1a8cb8e938..a273baaf2798da2f3eadede1768ac814e2a31deb 100644 --- a/SRT/Servers/SRTDBESM/include/DBESMprotocol.h +++ b/SRT/Servers/SRTDBESM/include/DBESMprotocol.h @@ -41,7 +41,7 @@ class CDBESMCommand inline static string comm_get_dbeeq(string out_dbe){return Commands::m_get_dbeeq + " " + out_dbe + TAIL;} inline static string comm_set_dbebpf(string out_dbe, string bpf_val){return Commands::m_set_dbebpf + " " + out_dbe + " " + bpf_val + TAIL;} inline static string comm_get_dbebpf(string out_dbe){return Commands::m_get_dbebpf + " " + out_dbe + TAIL;} - + private: /* * Commandsf diff --git a/SRT/Servers/SRTDBESM/include/SRTDBESMImpl.h b/SRT/Servers/SRTDBESM/include/SRTDBESMImpl.h index 3b33c4dee52f01d9156bdee9446156d86a1a5304..41bc99a1328371ad9f08fcf4c21eea04fa391c32 100644 --- a/SRT/Servers/SRTDBESM/include/SRTDBESMImpl.h +++ b/SRT/Servers/SRTDBESM/include/SRTDBESMImpl.h @@ -89,8 +89,8 @@ public: virtual void get_firm(short b_addr); virtual void handle_addr(short * b_addr); - - virtual void set_dbeampconst char * out_dbe, const char * amp_val); //throw (BackendsErrors::BackendsErrorsEx); + + virtual void set_dbeamp(const char * out_dbe, const char * amp_val); //throw (BackendsErrors::BackendsErrorsEx); virtual void get_dbeamp(const char * out_dbe); //throw (BackendsErrors::BackendsErrorsEx); diff --git a/SRT/Servers/SRTDBESM/src/CommandSocket.cpp b/SRT/Servers/SRTDBESM/src/CommandSocket.cpp index 81b2f43281fc7b05d1bbd5aa4f914b7db495b51c..34154154e648ecc9a265021b8839a3a1843f2798 100644 --- a/SRT/Servers/SRTDBESM/src/CommandSocket.cpp +++ b/SRT/Servers/SRTDBESM/src/CommandSocket.cpp @@ -138,7 +138,7 @@ string CCommandSocket::set_dbeatt(const char * out_dbe, const char * att_val) // string CCommandSocket::get_dbeatt(const char * out_dbe) //throw (BackendsErrors::BackendsErrorsEx) { - return get_dbeatt_command(out_dbe); + return get_dbeatt_command(out_dbe); } string CCommandSocket::get_firm(short b_addr) //throw (BackendsErrors::BackendsErrorsEx) @@ -146,6 +146,35 @@ string CCommandSocket::get_firm(short b_addr) //throw (BackendsErrors::BackendsE return get_firm_command(b_addr); } +string CCommandSocket::set_dbeamp(const char * out_dbe, const char * amp_val) //throw (BackendsErrors::BackendsErrorsEx) +{ + return set_dbeamp_command(out_dbe, amp_val); +} + +string CCommandSocket::get_dbeamp(const char * out_dbe) //throw (BackendsErrors::BackendsErrorsEx) +{ + return get_dbeamp_command(out_dbe); +} + +string CCommandSocket::set_dbeeq(const char * out_dbe, const char * eq_val) //throw (BackendsErrors::BackendsErrorsEx) +{ + return set_dbeeq_command(out_dbe, eq_val); +} + +string CCommandSocket::get_dbeeq(const char * out_dbe) //throw (BackendsErrors::BackendsErrorsEx) +{ + return get_dbeeq_command(out_dbe); +} + +string CCommandSocket::set_dbebpf(const char * out_dbe, const char * bpf_val) //throw (BackendsErrors::BackendsErrorsEx) +{ + return set_dbebpf_command(out_dbe, bpf_val); +} + +string CCommandSocket::get_dbebpf(const char * out_dbe) //throw (BackendsErrors::BackendsErrorsEx) +{ + return get_dbebpf_command(out_dbe); +} void CCommandSocket::parse_longSeq_response(string status_str, string start, string end, ACS::longSeq* vals) //throw (BackendsErrors::BackendsErrorsEx) { unsigned start_pos = status_str.find(start); @@ -207,6 +236,23 @@ void CCommandSocket::parse_double_response(string status_str, string start, stri } +void CCommandSocket::parse_long_response(string status_str, string start, string end, long* val) //throw (BackendsErrors::BackendsErrorsEx) +{ + unsigned start_pos = status_str.find(start); + unsigned end_pos = status_str.find(end); + + try { + stringstream in(status_str.substr(start_pos + start.length(), end_pos - (start_pos + start.length()))); + long temp; + in >> temp; + *val=temp; + } + catch (std::out_of_range outofrange) { //if the index is out of range + throw outofrange; //throw this exception + } + +} + void CCommandSocket::parse_string_response(string status_str, string start, string end, string* val) //throw (BackendsErrors::BackendsErrorsEx) { unsigned start_pos = status_str.find(start); @@ -692,6 +738,7 @@ string CCommandSocket::get_dbeeq_command(const char * out_dbe) //throw (Backends throw impl; } return response; +} string CCommandSocket::set_dbebpf_command(const char * out_dbe, const char * bpf_val) //throw (BackendsErrors::BackendsErrorsEx) { diff --git a/SRT/Servers/SRTDBESM/src/SRTDBESMImpl.cpp b/SRT/Servers/SRTDBESM/src/SRTDBESMImpl.cpp index aadd45c6efae97e9651059564bc9c2966076f38a..65615293001424ec85d429ac8be4c5a8f6da389d 100644 --- a/SRT/Servers/SRTDBESM/src/SRTDBESMImpl.cpp +++ b/SRT/Servers/SRTDBESM/src/SRTDBESMImpl.cpp @@ -689,7 +689,7 @@ void SRTDBESMImpl::get_cfg() for (int j=0; j< newlines; j++) { string new_str; - ACS::Time timestamp, timestamp2, timestamp3; + ACS::Time timestamp, timestamp2; double b_addr=0; string str = "BOARD xx"; @@ -709,22 +709,22 @@ void SRTDBESMImpl::get_cfg() if (b_addr == m_paddr_1->getDevIO()->read(timestamp)) { - m_pcfg_1->getDevIO()->write(d,timestamp3); + m_pcfg_1->getDevIO()->write(d,timestamp2); } else if (b_addr == m_paddr_2->getDevIO()->read(timestamp)) { - m_pcfg_2->getDevIO()->write(d,timestamp3); + m_pcfg_2->getDevIO()->write(d,timestamp2); } else if (b_addr == m_paddr_3->getDevIO()->read(timestamp)) { - m_pcfg_3->getDevIO()->write(d,timestamp3); + m_pcfg_3->getDevIO()->write(d,timestamp2); } else if (b_addr == m_paddr_4->getDevIO()->read(timestamp)) { - m_pcfg_4->getDevIO()->write(d,timestamp3); + m_pcfg_4->getDevIO()->write(d,timestamp2); } } @@ -969,14 +969,15 @@ void SRTDBESMImpl::get_dbeamp(const char * out_dbe) } for (int j=0; j< newlines; j++) { - ACS::doubleSeq new_seq; + ACS::longSeq new_seq; ACS::Time timestamp, timestamp2, timestamp3; - double b_addr=0, att_ch=0, new_att_val=0; - + double b_addr=0, amp_ch=0; + long new_amp_val=0; + try { m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "BOARD ", " AMP", &b_addr); - m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "AMP ", " VALUE", &att_ch); - m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "VALUE ", "\n", &new_att_val); + m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "AMP ", " VALUE", &_ch); + m_commandSocket.parse_long_response(out_dbe_message.substr(v[j],v[j+1]), "VALUE ", "\n", &new_amp_val); } catch (std::out_of_range) { _EXCPT(BackendsErrors::MalformedAnswerExImpl,impl,"SRTDBESMImpl::get_dbeamp()"); @@ -1094,14 +1095,14 @@ void SRTDBESMImpl::get_dbeeq(const char * out_dbe) } for (int j=0; j< newlines; j++) { - ACS::doubleSeq new_seq; + ACS::longSeq new_seq; ACS::Time timestamp, timestamp2, timestamp3; - double b_addr=0, att_ch=0, new_att_val=0; + double b_addr=0, eq_ch=0, new_eq_val=0; try { m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "BOARD ", " EQ", &b_addr); - m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "AMP ", " VALUE", &att_ch); - m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "VALUE ", "\n", &new_att_val); + m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "AMP ", " VALUE", &eq_ch); + m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "VALUE ", "\n", &new_eq_val); } catch (std::out_of_range) { _EXCPT(BackendsErrors::MalformedAnswerExImpl,impl,"SRTDBESMImpl::get_dbeeq()"); @@ -1220,14 +1221,14 @@ void SRTDBESMImpl::get_dbebpf(const char * out_dbe) } for (int j=0; j< newlines; j++) { - ACS::doubleSeq new_seq; + ACS::longSeq new_seq; ACS::Time timestamp, timestamp2, timestamp3; - double b_addr=0, att_ch=0, new_att_val=0; + double b_addr=0, bpf_ch=0, new_bpf_val=0; try { m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "BOARD ", " BPF", &b_addr); - m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "BPF ", " VALUE", &att_ch); - m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "VALUE ", "\n", &new_att_val); + m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "BPF ", " VALUE", &bpf_ch); + m_commandSocket.parse_double_response(out_dbe_message.substr(v[j],v[j+1]), "VALUE ", "\n", &new_bpf_val); } catch (std::out_of_range) { _EXCPT(BackendsErrors::MalformedAnswerExImpl,impl,"SRTDBESMImpl::get_dbebpf()"); @@ -1275,6 +1276,7 @@ void SRTDBESMImpl::get_dbebpf(const char * out_dbe) CUSTOM_LOG(LM_FULL_INFO,"SRTDBESMImpl::get_dbebpf()",(LM_INFO,c)); } + GET_PROPERTY_REFERENCE(ACS::ROlong,m_paddr_1,addr_1); GET_PROPERTY_REFERENCE(ACS::ROlong,m_paddr_2,addr_2); GET_PROPERTY_REFERENCE(ACS::ROlong,m_paddr_3,addr_3); diff --git a/SRT/Servers/build.log b/SRT/Servers/build.log index 8c1e228ea86ffb9437126f498d67eaa376b85465..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/SRT/Servers/build.log +++ b/SRT/Servers/build.log @@ -1,3 +0,0 @@ -### ==> SRTActiveSurfaceLanServer MODULE NOT FOUND! FAILED! -### ==> SRTActiveSurfaceUSDServer MODULE NOT FOUND! FAILED! -### ==> SRTWeatherStation MODULE NOT FOUND! FAILED!