Skip to content

Commit

Permalink
Add fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mwestphal committed Mar 21, 2024
1 parent f20ac48 commit 0b6c509
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion application/F3DOptionsParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void ConfigurationOptions::GetOptions(F3DAppOptions& appOptions, f3d::options& o
this->DeclareOption(grp0, "dry-run", "", "Do not read the configuration file", appOptions.DryRun, HasDefault::YES, MayHaveConfig::NO );
this->DeclareOption(grp0, "no-render", "", "Do not render anything and quit right after loading the first file, use with --verbose to recover information about a file.", appOptions.NoRender, HasDefault::YES, MayHaveConfig::YES );
this->DeclareOption(grp0, "max-size", "", "Maximum size in Mib of a file to load, negative value means unlimited", appOptions.MaxSize, HasDefault::YES, MayHaveConfig::YES, "<size in Mib>");
this->DeclareOption(grp0, "auto-reload", "", "Reload currently loaded file if it is modified on disk", appOptions.AutoReload, HasDefault::YES, MayHaveConfig::YES );
this->DeclareOption(grp0, "watch", "", "Watch current file and automaticaly reload it whenever it is modified on disk", appOptions.Watch, HasDefault::YES, MayHaveConfig::YES );

Check failure on line 314 in application/F3DOptionsParser.cxx

View workflow job for this annotation

GitHub Actions / Codespell Check

automaticaly ==> automatically
this->DeclareOption(grp0, "load-plugins", "", "List of plugins to load separated with a comma", appOptions.Plugins, LocalHasDefaultNo, MayHaveConfig::YES, "<paths or names>");
this->DeclareOption(grp0, "scan-plugins", "", "Scan some directories for plugins (result can be incomplete)");

Expand Down
2 changes: 1 addition & 1 deletion application/F3DOptionsParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct F3DAppOptions
std::string InteractionTestPlayFile = "";
bool NoBackground = false;
bool NoRender = false;
bool AutoReload = false;
bool Watch = false;
double RefThreshold = 50;
double MaxSize = -1.0;

Expand Down
2 changes: 1 addition & 1 deletion application/F3DStarter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ void F3DStarter::LoadFile(int index, bool relativeIndex)

if (this->Internals->LoadedFile)
{
if (this->Internals->AppOptions.AutoReload)
if (this->Internals->AppOptions.Watch)
{
// Always unwatch and watch current folder, even on reload
if (this->Internals->FolderWatchId.id > 0)

Check warning on line 621 in application/F3DStarter.cxx

View check run for this annotation

Codecov / codecov/patch

application/F3DStarter.cxx#L621

Added line #L621 was not covered by tests
Expand Down
4 changes: 2 additions & 2 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,6 @@ if(NOT F3D_MACOS_BUNDLE)
endif()

if(UNIX AND NOT VTK_OPENGL_HAS_EGL)
# Custom bash test for testing auto-reload
add_test (NAME f3d::TestAutoReload COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/auto_reload.sh $<TARGET_FILE:f3d> ${F3D_SOURCE_DIR}/testing/data ${CMAKE_BINARY_DIR}/Testing/Temporary)
# Custom bash test for testing watch option
add_test (NAME f3d::TestWatch COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_watch.sh $<TARGET_FILE:f3d> ${F3D_SOURCE_DIR}/testing/data ${CMAKE_BINARY_DIR}/Testing/Temporary)
endif()
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Test the auto-reload feature by opening a file
# Test the watch feature by opening a file
# rewriting it and checking the the file has been
# automatically reloaded

Expand All @@ -16,7 +16,7 @@ reloaded_data=$tmp_dir/cow.vtp
cp $hires_data $reloaded_data

log=$tmp_dir/output.log
$f3d_cmd --auto-reload --verbose $reloaded_data > $log &
$f3d_cmd --watch --verbose $reloaded_data > $log &
pid=$!

sleep 1
Expand Down
1 change: 1 addition & 0 deletions doc/user/OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Options|Default|Description
\-\-dry-run||Do not read any configuration file and consider only the command line options.
\-\-no-render||Do not render anything and quit just after loading the first file, use with \-\-verbose to recover information about a file.
\-\-max-size=\<size in MiB\>|-1|Prevent F3D to load a file bigger than the provided size in Mib, negative value means unlimited, useful for thumbnails.
\-\-watch||Watch current file and automaticaly reload it whenever it is modified on disk.

Check failure on line 18 in doc/user/OPTIONS.md

View workflow job for this annotation

GitHub Actions / Codespell Check

automaticaly ==> automatically
\-\-load-plugins=\<paths or names\>||List of plugins to load separated with a comma. Official plugins are `alembic`, `assimp`, `draco`, `exodus`, `occt`, `usd`, `vdb`. See [usage](USAGE.md) for more info.

## General Options
Expand Down

0 comments on commit 0b6c509

Please sign in to comment.