Commit cec73e93 authored by Thierry Martinez's avatar Thierry Martinez

load_ode

parent 2af4d58e
...@@ -61,11 +61,21 @@ export_plot_to_png(OutputFile) :- ...@@ -61,11 +61,21 @@ 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),
print(user_error, (PlotFile, CsvFile, AbsolutePlotFile)),
nl(user_error),
setup_call_cleanup( setup_call_cleanup(
open(PlotFile, write, Stream), open(AbsolutePlotFile, write, Stream),
export_plot_stream(Stream, CsvFile, Headers, Options), export_plot_stream(Stream, CsvFile, Headers, Options),
close(Stream) close(Stream)
). ).
......
...@@ -74,7 +74,10 @@ export_table(OutputFile) :- ...@@ -74,7 +74,10 @@ export_table(OutputFile) :-
TitleRow =.. [row | ColumnNames], TitleRow =.. [row | ColumnNames],
Table = [TitleRow | Data] Table = [TitleRow | Data]
), ),
csv_write_file(FilenameCsv, Table). absolute_file_name(FilenameCsv, AbsoluteFilenameCsv),
print(user_error, (FilenameCsv, AbsoluteFilenameCsv)),
nl(user_error),
csv_write_file(AbsoluteFilenameCsv, Table).
list_tables :- list_tables :-
......
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