Skip to content

Commit ff6c2aa

Browse files
authored
Merge pull request #607 from mtconnect/swagger_and_logging_fix
Swagger and logging fix
2 parents cc42165 + a572af2 commit ff6c2aa

18 files changed

Lines changed: 180 additions & 52 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set(AGENT_VERSION_MAJOR 2)
33
set(AGENT_VERSION_MINOR 7)
44
set(AGENT_VERSION_PATCH 0)
5-
set(AGENT_VERSION_BUILD 8)
5+
set(AGENT_VERSION_BUILD 9)
66
set(AGENT_VERSION_RC "")
77

88
# This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent

‎conan/profiles/gcc‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ include(default)
33
[settings]
44
compiler.libcxx=libstdc++11
55
compiler.cppstd=20
6-
7-
[system_tools]
8-
cmake/>3.23.0

‎demo/compose/agent/agent.cfg‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
Devices = Devices.xml
22
SchemaVersion = 2.7
33
WorkerThreads = 3
4-
MonitorConfigFiles = yes
54
Port = 5000
6-
JsonVersion = 1
75

86
MinCompressFileSize = 10k
97

‎demo/compose/agent/agentmqtt.cfg‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
Devices = Devices.xml
22
SchemaVersion = 2.7
33
WorkerThreads = 3
4-
MonitorConfigFiles = yes
54
Port = 5000
6-
JsonVersion = 1
5+
JsonVersion = 2
76

87
MinCompressFileSize = 10k
98

‎demo/styles/styles.xsl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"
4-
xmlns:m="urn:mtconnect.org:MTConnectDevices:2.0" xmlns:s="urn:mtconnect.org:MTConnectStreams:2.0" xmlns:e="urn:mtconnect.org:MTConnectError:2.0" xmlns:js="urn:custom-javascript"
4+
xmlns:m="urn:mtconnect.org:MTConnectDevices:2.7" xmlns:s="urn:mtconnect.org:MTConnectStreams:2.7" xmlns:e="urn:mtconnect.org:MTConnectError:2.7" xmlns:js="urn:custom-javascript"
55
exclude-result-prefixes="msxsl js" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
66

77
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

‎src/mtconnect/configuration/agent_config.cpp‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ namespace mtconnect::configuration {
529529

530530
ConfigOptions options;
531531
AddDefaultedOptions(logger, options,
532-
{{"max_size", "2mb"s},
532+
{{"max_size", ""s},
533+
{"rotation_size", ""s}, // for backward compatibility
533534
{"max_archive_size", "10mb"s},
534535
{"max_index", 9},
535536
{"file_name", defaultFileName},
@@ -602,8 +603,11 @@ namespace mtconnect::configuration {
602603
auto &archiveLogDirectory = logChannel.m_archiveLogDirectory;
603604
auto &logFileName = logChannel.m_logFileName;
604605

606+
logRotationSize = 2 * 1024 * 1024; // Default to 2MB for log rotation size
605607
maxLogArchiveSize = ConvertFileSize(options, "max_archive_size", maxLogArchiveSize);
608+
logRotationSize = ConvertFileSize(options, "rotation_size", logRotationSize);
606609
logRotationSize = ConvertFileSize(options, "max_size", logRotationSize);
610+
607611
int max_index = *GetOption<int>(options, "max_index");
608612

609613
if (auto sched = GetOption<string>(options, "schedule"))

‎src/mtconnect/entity/json_parser.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ namespace mtconnect {
177177
return nullptr;
178178
}
179179

180-
EntityPtr JsonParser::parse(FactoryPtr factory, const string& document, const string& version,
181-
ErrorList& errors)
180+
EntityPtr JsonParser::parse(FactoryPtr factory, const string& document, ErrorList& errors)
182181
{
183182
NAMED_SCOPE("entity.json_parser");
184183
EntityPtr entity;

‎src/mtconnect/entity/json_parser.hpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ namespace mtconnect {
4646
/// @param version the version to parse
4747
/// @param errors Errors that occurred creating the entities
4848
/// @return an entity shared pointer if successful
49-
EntityPtr parse(FactoryPtr factory, const std::string &document, const std::string &version,
50-
ErrorList &errors);
49+
EntityPtr parse(FactoryPtr factory, const std::string &document, ErrorList &errors);
5150

5251
protected:
5352
uint32_t m_version;

‎src/mtconnect/observation/change_observer.hpp‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ namespace mtconnect::observation {
306306
AsyncObserver(boost::asio::io_context::strand &strand,
307307
mtconnect::buffer::CircularBuffer &buffer, FilterSet &&filter,
308308
std::chrono::milliseconds interval, std::chrono::milliseconds heartbeat)
309-
: AsyncResponse(interval),
310-
m_heartbeat(heartbeat),
311-
m_last(std::chrono::system_clock::now()),
312-
m_filter(std::move(filter)),
313-
m_strand(strand),
314-
m_observer(strand),
315-
m_buffer(buffer)
309+
: AsyncResponse(interval),
310+
m_heartbeat(heartbeat),
311+
m_last(std::chrono::system_clock::now()),
312+
m_filter(std::move(filter)),
313+
m_strand(strand),
314+
m_observer(strand),
315+
m_buffer(buffer)
316316
{}
317317

318318
/// @brief default destructor
@@ -335,7 +335,7 @@ namespace mtconnect::observation {
335335
void handlerCompleted()
336336
{
337337
NAMED_SCOPE("AsyncObserver::handlerCompleted");
338-
338+
339339
m_last = std::chrono::system_clock::now();
340340
if (m_endOfBuffer)
341341
{

‎src/mtconnect/parser/json_parser.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ namespace mtconnect::parser {
179179
{
180180
entity::ErrorList errors;
181181
entity::JsonParser parser(version);
182-
auto entity = parser.parse(Device::getRoot(), jsonDoc, "2.3", errors);
182+
auto entity = parser.parse(Device::getRoot(), jsonDoc, errors);
183183

184184
if (!errors.empty())
185185
{

0 commit comments

Comments
 (0)