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

Fixed plot problem

parent cec73e93
...@@ -30,7 +30,8 @@ filename(Filename, ExpandedFilename) :- ...@@ -30,7 +30,8 @@ filename(Filename, ExpandedFilename) :-
library_path(LibraryPath), library_path(LibraryPath),
Options = [relative_to(LibraryPath)] Options = [relative_to(LibraryPath)]
; ;
Options = [], working_directory(Dir, Dir),
Options = [relative_to(Dir)],
SubFilename = Filename SubFilename = Filename
), ),
absolute_file_name(SubFilename, ExpandedFilename, [expand(true) | Options]). absolute_file_name(SubFilename, ExpandedFilename, [expand(true) | Options]).
......
...@@ -61,19 +61,10 @@ export_plot_to_png(OutputFile) :- ...@@ -61,19 +61,10 @@ export_plot_to_png(OutputFile) :-
export_plot(FileTemplate, Options) :- export_plot(FileTemplate, Options) :-
format(atom(PlotFile), '~a.plot', [FileTemplate]), format(atom(PlotFile), '~a.plot', [FileTemplate]),
format(atom(CsvFile), '~a.csv', [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), export_table(CsvFile),
working_directory(Dir1, Dir1),
print(user_error(Dir1)), nl(user_error),
get_table_data([HeaderRow | _ ]), get_table_data([HeaderRow | _ ]),
HeaderRow =.. [row, _TimeHeader | Headers], HeaderRow =.. [row, _TimeHeader | Headers],
working_directory(Dir2, Dir2),
print(user_error(Dir2)), nl(user_error),
absolute_file_name(PlotFile, AbsolutePlotFile), absolute_file_name(PlotFile, AbsolutePlotFile),
print(user_error, (PlotFile, CsvFile, AbsolutePlotFile)),
nl(user_error),
setup_call_cleanup( setup_call_cleanup(
open(AbsolutePlotFile, write, Stream), open(AbsolutePlotFile, write, Stream),
export_plot_stream(Stream, CsvFile, Headers, Options), export_plot_stream(Stream, CsvFile, Headers, Options),
......
...@@ -74,9 +74,8 @@ export_table(OutputFile) :- ...@@ -74,9 +74,8 @@ export_table(OutputFile) :-
TitleRow =.. [row | ColumnNames], TitleRow =.. [row | ColumnNames],
Table = [TitleRow | Data] Table = [TitleRow | Data]
), ),
absolute_file_name(FilenameCsv, AbsoluteFilenameCsv), working_directory(Dir, Dir),
print(user_error, (FilenameCsv, AbsoluteFilenameCsv)), absolute_file_name(FilenameCsv, AbsoluteFilenameCsv, [relative_to(Dir)]),
nl(user_error),
csv_write_file(AbsoluteFilenameCsv, Table). 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