Skip to content

Commit 7d3d519

Browse files
committed
adapt to WinCCOA 3.16
1 parent f1a5ec9 commit 7d3d519

26 files changed

+154
-152
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929

3030

31-
namespace REMUS
31+
namespace Common
3232
{
3333
template <class Task>
3434
class AsyncRecurringTask
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "Logger.hxx"
1717
#include "Utils.hxx"
1818

19-
namespace REMUS {
19+
namespace Common {
2020

2121
// Common
2222
std::string Constants::drv_name = "kafka";
@@ -42,19 +42,22 @@ namespace REMUS {
4242
{ "DEBUGLVL",
4343
[](const char* data)
4444
{
45-
REMUS::Logger::setLogLvl((int)*reinterpret_cast<const int32_t*>(data));
45+
Common::Logger::globalInfo(Common::Logger::L1, "setLogLvl:", CharString(data));
46+
Common::Logger::setLogLvl((int)std::atoi(data));
4647
}
4748
},
4849
{ "DEBOUNCINGTHREADINTERVAL",
4950
[](const char* data)
5051
{
51-
REMUS::Constants::setDebouncingThreadInterval((int)*reinterpret_cast<const int32_t*>(data));
52+
Common::Logger::globalInfo(Common::Logger::L1, "setDebouncingThreadInterval:", CharString(data));
53+
Common::Constants::setDebouncingThreadInterval((int)std::atoi(data));
5254
}
5355
},
5456
{ "MAXPOLLRECORDS",
5557
[](const char* data)
5658
{
57-
REMUS::Constants::setConsumerMaxPollRecords((size_t)*reinterpret_cast<const int32_t*>(data));
59+
Common::Logger::globalInfo(Common::Logger::L1, "setConsumerMaxPollRecords:", CharString(data));
60+
Common::Constants::setConsumerMaxPollRecords((size_t)std::atoi(data));
5861
}
5962
}
6063

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
**/
3636

3737
#include <map>
38-
#include <REMUS/Utils.hxx>
39-
#include <REMUS/Logger.hxx>
38+
#include <Common/Utils.hxx>
39+
#include <Common/Logger.hxx>
4040

41-
namespace REMUS{
41+
namespace Common{
4242

4343
/*!
4444
* \class Constants
@@ -199,15 +199,15 @@ inline void Constants::setProducerKafkaStatsInterval(){
199199
int milis;
200200
try
201201
{
202-
if(!REMUS::Utils::convertToInt(REMUS::Constants::GetProducerConfig().at(REMUS::Constants::CONFIG_STATISTICS_INTERVAL_MS), milis))
202+
if(!Common::Utils::convertToInt(Common::Constants::GetProducerConfig().at(Common::Constants::CONFIG_STATISTICS_INTERVAL_MS), milis))
203203
{
204-
milis = REMUS::Constants::CONFIG_STATISTICS_INTERVAL_MS_DEFAULT; // DEFAULT
204+
milis = Common::Constants::CONFIG_STATISTICS_INTERVAL_MS_DEFAULT; // DEFAULT
205205
}
206206
}
207207
catch(std::exception& e)
208208
{
209-
REMUS::Logger::globalWarning(__PRETTY_FUNCTION__," Constants ProducerConfig does not have ", REMUS::Constants::CONFIG_STATISTICS_INTERVAL_MS);
210-
milis = REMUS::Constants::CONFIG_STATISTICS_INTERVAL_MS_DEFAULT; // DEFAULT
209+
Common::Logger::globalWarning(__PRETTY_FUNCTION__," Constants ProducerConfig does not have ", Common::Constants::CONFIG_STATISTICS_INTERVAL_MS);
210+
milis = Common::Constants::CONFIG_STATISTICS_INTERVAL_MS_DEFAULT; // DEFAULT
211211
}
212212
PRODUCER_KAFKA_STATS_INTERVAL = milis;
213213
}
@@ -220,15 +220,15 @@ inline void Constants::setConsumerKafkaStatsInterval(){
220220
int milis;
221221
try
222222
{
223-
if(!REMUS::Utils::convertToInt(REMUS::Constants::GetConsumerConfig().at(REMUS::Constants::CONFIG_STATISTICS_INTERVAL_MS), milis))
223+
if(!Common::Utils::convertToInt(Common::Constants::GetConsumerConfig().at(Common::Constants::CONFIG_STATISTICS_INTERVAL_MS), milis))
224224
{
225-
milis = REMUS::Constants::CONFIG_STATISTICS_INTERVAL_MS_DEFAULT; // DEFAULT
225+
milis = Common::Constants::CONFIG_STATISTICS_INTERVAL_MS_DEFAULT; // DEFAULT
226226
}
227227
}
228228
catch(std::exception& e)
229229
{
230-
REMUS::Logger::globalWarning(__PRETTY_FUNCTION__," Constants ConsumerConfig does not have ", REMUS::Constants::CONFIG_STATISTICS_INTERVAL_MS);
231-
milis = REMUS::Constants::CONFIG_STATISTICS_INTERVAL_MS_DEFAULT; // DEFAULT
230+
Common::Logger::globalWarning(__PRETTY_FUNCTION__," Constants ConsumerConfig does not have ", Common::Constants::CONFIG_STATISTICS_INTERVAL_MS);
231+
milis = Common::Constants::CONFIG_STATISTICS_INTERVAL_MS_DEFAULT; // DEFAULT
232232
}
233233
CONSUMER_KAFKA_STATS_INTERVAL = milis;
234234
}

REMUS/Logger.cxx renamed to Common/Logger.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
**/
1414

1515
#include "Logger.hxx"
16-
#include "REMUS/Constants.hxx"
16+
#include "Common/Constants.hxx"
1717
#include <mutex>
1818

19-
namespace REMUS {
19+
namespace Common {
2020

21-
int Logger::loggingLevel = 2;
21+
int Logger::loggingLevel = 1;
2222
const char * Logger::timestrformat = "%a, %d.%m.%Y %H:%M:%S";
2323

2424
void Logger::globalInfo(int lvl, const char *note1, const char* note2, const char* note3){

REMUS/Logger.hxx renamed to Common/Logger.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
using std::mutex;
2727
using std::lock_guard;
2828

29-
namespace REMUS {
29+
namespace Common {
3030

3131
/*!
3232
* \class Debug

REMUS/Utils.hxx renamed to Common/Utils.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ std::ostream& operator << (std::ostream& os, const std::vector<T>& iterable)
3333
}
3434

3535

36-
namespace REMUS {
36+
namespace Common {
3737

3838
using std::future;
3939
using std::future_status;

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ define INSTALL_BODY
2525
fi;
2626
endef
2727

28-
REMUS_SOURCE = $(wildcard REMUS/*.cxx)
29-
REMUS_TYPES = $(REMUS_SOURCE:.cxx=.o)
28+
COMMON_SOURCE = $(wildcard Common/*.cxx)
29+
COMMON_TYPES = $(COMMON_SOURCE:.cxx=.o)
3030

3131
TRANSFORMATIONS_SOURCE = $(wildcard Transformations/*.cxx)
3232
TRANSFORMATIONS = $(TRANSFORMATIONS_SOURCE:.cxx=.o)
3333

3434

35-
WCCOAkafkaDrv: $(MYOBJS) $(REMUS_TYPES) $(TRANSFORMATIONS)
35+
WCCOAkafkaDrv: $(MYOBJS) $(COMMON_TYPES) $(TRANSFORMATIONS)
3636
@rm -f addVerInfo.o
3737
@$(MAKE) addVerInfo.o
3838
$(LINK_CMD) -o $(DRV_NAME) *.o $(OBJS) $(LIBS)
3939

4040

4141
installLibs:
42-
sudo yum install --assumeyes cyrus-sasl-gssapi boost* cmake openssl-devel
42+
sudo yum install --assumeyes cyrus-sasl-gssapi cyrus-sasl-devel boost* cmake openssl-devel
4343
git submodule update --init --recursive
4444
cd ./libs/librdkafka && ./configure && make && sudo make install
4545
cd ./libs/cppkafka && mkdir -p build && cd build && cmake .. && make && sudo make install

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
CERN HSE Computing (HSE-CEN-CO)
1+
CERN HSE Computing (HSE-TS-CS)
22
==================================================
33

44
Contact email: hse-cen-co@cern.ch
55

6-
REMUS WinCC OA Kafka Driver
6+
WinCC OA Kafka Driver
77
==================================================
88

99

Transformations/kafkaBoolTrans.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "kafkaHWMapper.hxx"
1818

19-
#include "REMUS/Logger.hxx"
19+
#include "Common/Logger.hxx"
2020

2121
#include <cmath>
2222

@@ -84,7 +84,7 @@ VariablePtr kafkaBoolTrans::toVar(const PVSSchar *buffer, const PVSSuint dlen, c
8484
return new BitVar(true);
8585
else
8686
{
87-
REMUS::Logger::globalWarning(__PRETTY_FUNCTION__, "Unable to parse boolean for buffer:", (const char*)buffer);
87+
Common::Logger::globalWarning(__PRETTY_FUNCTION__, "Unable to parse boolean for buffer:", (const char*)buffer);
8888
}
8989
}
9090
return NULL;

Transformations/kafkaFloatTrans.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "kafkaHWMapper.hxx"
1818

19-
#include "REMUS/Logger.hxx"
19+
#include "Common/Logger.hxx"
2020

2121
#include <cmath>
2222

@@ -82,7 +82,7 @@ VariablePtr kafkaFloatTrans::toVar(const PVSSchar *buffer, const PVSSuint dlen,
8282
}
8383
catch(std::exception& e)
8484
{
85-
REMUS::Logger::globalWarning(__PRETTY_FUNCTION__, e.what());
85+
Common::Logger::globalWarning(__PRETTY_FUNCTION__, e.what());
8686
}
8787
}
8888

0 commit comments

Comments
 (0)