Skip to content
Snippets Groups Projects
Commit 454afd01 authored by Robin.Mueller's avatar Robin.Mueller
Browse files

Merge branch 'mueller_branch' of https://git.ksat-stuttgart.de/source/tmtc into mueller_branch

parents f82dc9b0 a31ea1d6
Branches
Tags
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData">
<serverData>
<paths name="pi@RemoteHome">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/../generators/.idea/generators.iml" filepath="$PROJECT_DIR$/../generators/.idea/generators.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/tmtc.iml" filepath="$PROJECT_DIR$/.idea/tmtc.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="generators" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
...@@ -46,7 +46,7 @@ class SequentialCommandSenderReceiver(CommandSenderReceiver): ...@@ -46,7 +46,7 @@ class SequentialCommandSenderReceiver(CommandSenderReceiver):
self.start_time = time.time() self.start_time = time.time()
self.checkForTimeout() self.checkForTimeout()
if self.doPrintToFile: if self.doPrintToFile:
print("Exporting output to log file") print("Exporting output to log file.")
self.tmtcPrinter.printToFile() self.tmtcPrinter.printToFile()
self.comInterface.performListenerMode() self.comInterface.performListenerMode()
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
@brief @brief
Class that performs all printing functionalities Class that performs all printing functionalities
""" """
import os
from config import OBSW_Config as g from config import OBSW_Config as g
...@@ -153,10 +155,16 @@ class TmtcPrinter: ...@@ -153,10 +155,16 @@ class TmtcPrinter:
if self.doPrintToFile: if self.doPrintToFile:
self.fileBuffer = self.fileBuffer + self.printBuffer + "\n" self.fileBuffer = self.fileBuffer + self.printBuffer + "\n"
def printToFile(self, logName="tmtc_log.txt", clearFileBuffer=False): def printToFile(self, logName="log/tmtc_log.txt", clearFileBuffer=False):
file = open(logName, 'w') try:
file = open(logName, 'w')
except FileNotFoundError:
print("Log directory does not exists, creating log folder.")
os.mkdir('log')
file = open(logName, 'w')
file.write(self.fileBuffer) file.write(self.fileBuffer)
if clearFileBuffer: if clearFileBuffer:
self.fileBuffer = "" self.fileBuffer = ""
print("Log file written to " + logName)
file.close() file.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment