Skip to content

Commit 65295a9

Browse files
authored
Rework native library (#237)
1 parent aef4ee0 commit 65295a9

14 files changed

+955
-1545
lines changed

pythonfmu/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.6.7"
1+
__version__ = "0.6.8"

pythonfmu/fmi2slave.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -308,23 +308,26 @@ def _get_log_queue(self):
308308
return self.log_queue
309309

310310
def log(
311-
self,
312-
msg: str,
313-
status: Fmi2Status = Fmi2Status.ok,
314-
category: Optional[str] = None,
315-
debug: bool = False
311+
self,
312+
msg: str,
313+
status: Fmi2Status = Fmi2Status.ok,
314+
category: Optional[str] = None,
315+
debug=None
316316
):
317317
"""Log a message to the FMU logger.
318318
319319
Args:
320320
msg (str) : Log message
321321
status (Fmi2Status) : Optional, message status (default ok)
322322
category (str or None) : Optional, message category (default derived from status)
323-
debug (bool) : Optional, is this a debug message (default False)
323+
debug (bool) : Deprecated (has no effect)
324324
"""
325+
if debug is not None:
326+
print(f"WARNING: 'debug' argument is deprecated and has no effect.")
327+
325328
if category is None:
326329
category = f"logStatus{status.name.capitalize()}"
327330
if category not in self.log_categories:
328331
category = "logAll"
329-
log_msg = LogMsg(status, category, msg, debug)
332+
log_msg = LogMsg(status, category, msg)
330333
self.log_queue.append(log_msg)

pythonfmu/logmsg.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11

22
class LogMsg:
33

4-
def __init__(self, status: int, category: str, msg: str, debug: bool):
4+
def __init__(self, status: int, category: str, msg: str):
55
self.status = status
66
self.category = category
77
self.msg = msg
8-
self.debug = debug
98

109
def __str__(self) -> str:
11-
return "LogMsg(status={}, category={}, msg={}, debug={}".format(self.status, self.category, self.msg, self.debug)
10+
return "LogMsg(status={}, category={}, msg={}".format(self.status, self.category, self.msg)
1211

1312

1413

pythonfmu/pythonfmu-export/src/CMakeLists.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

22
set(headers
3-
cppfmu/cppfmu_cs.hpp
4-
cppfmu/cppfmu_common.hpp
53

6-
fmi/fmi2Functions.h
7-
fmi/fmi2FunctionTypes.h
8-
fmi/fmi2TypesPlatform.h
4+
"fmi/fmi2Functions.h"
5+
"fmi/fmi2FunctionTypes.h"
6+
"fmi/fmi2TypesPlatform.h"
97

10-
pythonfmu/PySlaveInstance.hpp
11-
pythonfmu/PyState.hpp
8+
"pythonfmu/fmu_except.hpp"
9+
"pythonfmu/Logger.hpp"
10+
11+
"pythonfmu/SlaveInstance.hpp"
12+
"pythonfmu/PyState.hpp"
1213
)
1314

1415
set(sources
15-
cppfmu/cppfmu_cs.cpp
16-
cppfmu/fmi_functions.cpp
17-
pythonfmu/PySlaveInstance.cpp
16+
"pythonfmu/fmi2.cpp"
17+
"pythonfmu/PySlaveInstance.cpp"
1818
)
1919

2020
add_library(pythonfmu-export ${sources} ${headers})

0 commit comments

Comments
 (0)