Skip to content

Conversation

@anu1217
Copy link
Contributor

@anu1217 anu1217 commented Nov 6, 2025

This PR introduces changes that allow the user to select the units (default or seconds) in which cooling times are printed in the headers of the output tables, if the units keyword is added in the output section of the input file.

Adding this in as a draft for now as this change has had many moving pieces, with changes to function definitions in multiple files, and I anticipate more work being necessary for everything to work as intended.

fixes #137

@gonuke
Copy link
Member

gonuke commented Dec 29, 2025

There is a merge conflict to be resolved here thanks to #215

@anu1217
Copy link
Contributor Author

anu1217 commented Dec 31, 2025

I've pulled from this branch and tested out these changes, and they appear to be working as expected. Some documentation changes are likely still needed.

@anu1217 anu1217 marked this pull request as ready for review December 31, 2025 13:51
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

I'm a little surprised that this compiles, given some mismatches in the header and code.

output information can be given. */
void Loading::write(int response, int writeComp, CoolingTime* coolList,
int targetKza, int normType)
int targetKza, int normType, const OutputFormat* outFmt)
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need outFmt here? it doesn't appear to be used

And if you don't need it, then you don't need to include it's header above.

output information can be given. */
void Mixture::write(int response, int writeComp, CoolingTime* coolList,
int targetKza, int normType)
int targetKza, int normType, const OutputFormat* outFmt)
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need outFmt here? it doesn't appear to be used.

And if you don't need it, then you don't need to include it's header above.

}

void CoolingTime::getCoolTimesStrings(std::vector<std::string>& coolTimesList)
void CoolingTime::getCoolTimesStrings(std::vector<std::string>& coolTimesList, const OutputFormat* outFmt)
Copy link
Member

Choose a reason for hiding this comment

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

The header defines this as an integer not a a pointer to type OutputFormat. I think I like that choice better since it means you don't need to test if outFmt is defined below.

cout << type;
if (strlen(type) < 8)
cout << "\t";
cout << " shutdown ";
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to include the half-life column now as well?

Comment on lines +199 to +200
next->cooltimeType = COOLTIME_DEF;
break;
Copy link
Member

Choose a reason for hiding this comment

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

Thanks to a quirk of C++ you don't need these two lines

Suggested change
next->cooltimeType = COOLTIME_DEF;
break;

break;
case (OUTFMT_CDOSE) :
sprintf(buffer,Out_Types_Str[outTypeNum],
ptr->contactDose->getFileName());
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to write the cooling time units for these ones, too, probably

can be given. */
void Volume::write(int response, int writeComp, CoolingTime* coolList,
int targetKza, int normType)
int targetKza, int normType, const OutputFormat* outFmt)
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need outFmt here? it doesn't appear to be used.

And if you don't need it, then you don't need to include it's header above.

Comment on lines +622 to +623
cooltime_units = 1;
break;
Copy link
Member

Choose a reason for hiding this comment

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

Don't need these lines since the same thing happens in both cases

Suggested change
cooltime_units = 1;
break;

Comment on lines +617 to +626
switch (cooltimeType) {
case COOLTIME_S:
cooltime_units = 2;
break;
case COOLTIME_DEF:
cooltime_units = 1;
break;
default:
cooltime_units = 1;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why not just:

Suggested change
switch (cooltimeType) {
case COOLTIME_S:
cooltime_units = 2;
break;
case COOLTIME_DEF:
cooltime_units = 1;
break;
default:
cooltime_units = 1;
}
cooltime_units = cooltimeType;

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.

add option to print time in seconds in output tables

2 participants