Skip to content
Snippets Groups Projects
Commit 144f5d78 authored by Haak, R. (Romeo)'s avatar Haak, R. (Romeo)
Browse files

Updated functionality for writing. Not final yet

parent cff06eb9
No related branches found
No related tags found
1 merge request!83Sc 130/updated writing
......@@ -154,14 +154,13 @@ class Controller:
if not self._model.analysis_complete():
self._view.update_message('no comparison')
else:
if self._model.multi_results:
path = self._view.ask_save_location()
results = self._model.multi_results
self._filewriter.write_multiple(path, results)
self._view.update_message('saved')
elif not self._model.multi_results \
and not self._model.analysis_results:
self._view.update_message('nonexistent')
path = self._view.ask_save_location()
mistake_results = self._model.create_mistake_frame()
delay_results = self._model.create_delay_frame()
self._view.update_message('saved')
self._filewriter.write_frame(path, mistake_results, 'mistakes.csv')
self._filewriter.write_frame(path, delay_results, 'delay.csv')
#self._view.update_message('nonexistent')
def _read_folder(self):
"""
......
......@@ -108,7 +108,7 @@ class FileWriter(ABC):
pass
@abstractmethod
def write(self):
def write(self, path, results):
pass
@abstractmethod
......@@ -125,7 +125,7 @@ class TxtWriter(FileWriter):
Write a .txt file of analysis results.
Args:
path: string of paths
result: the results, type unknown
results: the results, type unknown
"""
# For now assume source, shadow, stat format
......@@ -188,6 +188,9 @@ class CSVWriter(FileWriter):
path = self._participant_path(dir, key)
self.write(path, results)
def write_frame(self, path, results, result_type):
results.to_csv(path+result_type)
def _participant_path(self, dir, key):
"""
Create a path for the appropriate participant.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment