Skip to content

Conversation

@PaulTheLionHeart
Copy link
Contributor

Start with current master and build with updated UI files from last attempt Will try to rebase and see if we are up to date

Start with current master and build with updated UI files from last attempt
Will try to rebase and see if we are up to date
@PaulTheLionHeart
Copy link
Contributor Author

Not quite there yet... Getting closer... Ubuntu working yay!. NJow it's time for bed.

@LegalizeAdulthood
Copy link
Owner

you can run the tests locally with ctest. Assuming you used cmake --preset default to generate the project files, with the source directory as your current directory do:

ctest --preset default

to run the tests.

@LegalizeAdulthood LegalizeAdulthood changed the title Another attempt to rebase the new UI stuff for perturbation in to Id Add perturbation parameters and status display Apr 6, 2025
Copy link
Owner

@LegalizeAdulthood LegalizeAdulthood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are easily unit-testable, so now is a good time to learn about unit testing the changes you're making. There are existing tests for validating parameter handling and validating make_batch_file output (e.g. calls to put_param).

The test file directory structure mimics the directory structure of the code that is being tested.

break;
}
goto x_symmetry;
goto xsym;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't undo the label renames.

if ((int)std::strlen(value) > ID_FILE_MAX_PATH || validate_luts(g_map_name.c_str()))
{
goto bad_color;
goto badcolor;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't undo the renaming of the labels

return CmdArgFlags::FRACTAL_PARAM | CmdArgFlags::PARAM_3D;
}

// tolerance=?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't introduce a new parameter for tolerance; it's an extra value for the perturbation parameter, e.g. perturbation=auto/1e-4

}

// perturbation=?
static CmdArgFlags cmd_perturbation(const Command &cmd)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existing parameters let you specify short unique prefixes for the values, e.g. y, n or a; see the other parameter handlers in this file for examples.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only implementing the "happy path" and needs unit tests. In addition to recognizing the single letter shorthand it needs to reject bad values.

std::string p = cmd.value;
if (p == "auto")
{
g_perturbation = PerturbationMode::AUTO;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding another global variable, add setter/getter functions and encapsulate the state as a static variable or member of the PertEngine class.

}
}

g_use_perturbation = is_perturbation();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add another global variable, create getter/setter functions instead.

if (colors_only)
{
goto do_colors;
goto docolors;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here and elsewhere, don't rename labels


if (g_perturbation != PerturbationMode::AUTO)
{
put_param(" %s=%s", "perturbation", (g_perturbation == PerturbationMode::YES) ? "yes" : "no");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use %s for a string literal, just write the text as part of the format string, e.g. put_param(" perturbation=%s", ...

Needs to handle optional tolerance here

@LegalizeAdulthood
Copy link
Owner

I've been a little busy the last couple weeks, first getting my Utah C++ Programmers presentation ready and then dealing with (ugh) taxes and a trip to Vegas this week. I should be able to look at it later this week when I'm in Vegas.

@PaulTheLionHeart
Copy link
Contributor Author

I also have been preoccupied with Anne's funeral and my health issues. I will be pleased to have these changes integrated into master as it is a pain to do it every time we try to merge my changes.

@LegalizeAdulthood
Copy link
Owner

The first step in getting these pull requests to green builds is to get them rebased onto master.

@PaulTheLionHeart
Copy link
Contributor Author

There have been so many commits since these pull requests were made that it is probably best to close these ones and start again from pulling down the current master and adding changes from there. Then we can create a new pull request and rebase from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants