Commit 48fd4780 authored by Thierry Martinez's avatar Thierry Martinez

Fixed plot problem

parent cec73e93
......@@ -30,7 +30,8 @@ filename(Filename, ExpandedFilename) :-
library_path(LibraryPath),
Options = [relative_to(LibraryPath)]
;
Options = [],
working_directory(Dir, Dir),
Options = [relative_to(Dir)],
SubFilename = Filename
),
absolute_file_name(SubFilename, ExpandedFilename, [expand(true) | Options]).
......
......@@ -61,19 +61,10 @@ export_plot_to_png(OutputFile) :-
export_plot(FileTemplate, Options) :-
format(atom(PlotFile), '~a.plot', [FileTemplate]),
format(atom(CsvFile), '~a.csv', [FileTemplate]),
format(user_error, '~a\n~a\n', [PlotFile, CsvFile]),
working_directory(Dir, Dir),
print(user_error(Dir)), nl(user_error),
export_table(CsvFile),
working_directory(Dir1, Dir1),
print(user_error(Dir1)), nl(user_error),
get_table_data([HeaderRow | _ ]),
HeaderRow =.. [row, _TimeHeader | Headers],
working_directory(Dir2, Dir2),
print(user_error(Dir2)), nl(user_error),
absolute_file_name(PlotFile, AbsolutePlotFile),
print(user_error, (PlotFile, CsvFile, AbsolutePlotFile)),
nl(user_error),
setup_call_cleanup(
open(AbsolutePlotFile, write, Stream),
export_plot_stream(Stream, CsvFile, Headers, Options),
......
......@@ -74,9 +74,8 @@ export_table(OutputFile) :-
TitleRow =.. [row | ColumnNames],
Table = [TitleRow | Data]
),
absolute_file_name(FilenameCsv, AbsoluteFilenameCsv),
print(user_error, (FilenameCsv, AbsoluteFilenameCsv)),
nl(user_error),
working_directory(Dir, Dir),
absolute_file_name(FilenameCsv, AbsoluteFilenameCsv, [relative_to(Dir)]),
csv_write_file(AbsoluteFilenameCsv, Table).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment