Skip to content

Commit 9bc9380

Browse files
authored
Issue #757: Add ability to dump print continuities (#758)
1 parent 82ccc92 commit 9bc9380

5 files changed

Lines changed: 46 additions & 34 deletions

File tree

LATEST_RELEASE_NOTES.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,10 @@
22

33
### New Features
44

5-
* **Bug Reporting**: Users can now report bugs directly from CalChart
6-
* Access via **Help → Report a Bug** or press **Ctrl+Shift+B**
7-
* Automatic system information collection (OS, version, CalChart build info)
8-
* Optional show information and custom details
9-
* Privacy controls: opt-in checkboxes for each data category
10-
* Automatic submission to GitHub issues when configured with a GitHub token
11-
* Clipboard fallback for users without GitHub token setup
12-
* Full error reporting with helpful messages
13-
* See [docs/BugReporting.md](docs/BugReporting.md) for setup instructions
14-
155
Bugs addressed in this release:
166

177
Other changes:
188

19-
* [#635](../../issues/635) Reduce usage of wxString
20-
* [#648](../../issues/648) Make CI go faster
21-
* [#689](../../issues/689) Update wxWidgets to 3.3.1
22-
* [#718](../../issues/718) Bug filing system
23-
* [#729](../../issues/729) Reduce the number of warnings from windows builds
24-
* [#731](../../issues/731) Move tests into the right places
25-
* [#732](../../issues/732) remove wxUI::Custom
26-
* [#735](../../issues/735) Update the CI to have the release or debug in the name
27-
* [#737](../../issues/737) Print the version of wxWidgets used
28-
* [#751](../../issues/751) Add logs to bug report
29-
* [#754](../../issues/754) Add display logging to help debug display issues
9+
* [#757](../../issues/757) Add ability to dump print continuities
10+
3011

core/CalChartShow.cpp

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -457,21 +457,11 @@ auto Show::GetCurrentSheetPrintNumber() const -> std::string
457457
return mSheets.at(mSheetNum).GetPrintNumber();
458458
}
459459

460-
auto Show::GetCurrentSheetRawPrintContinuity() const -> std::string
461-
{
462-
return mSheets.at(mSheetNum).GetRawPrintContinuity();
463-
}
464-
465460
auto Show::GetCurrentSheetBackgroundImages() const -> std::vector<ImageInfo>
466461
{
467462
return mSheets.at(mSheetNum).GetBackgroundImages();
468463
}
469464

470-
auto Show::GetCurrentSheetPrintContinuity() const -> PrintContinuity
471-
{
472-
return mSheets.at(mSheetNum).GetPrintContinuity();
473-
}
474-
475465
auto Show::CopyCurrentSheet() const -> Show::Sheet_container_t
476466
{
477467
return Show::Sheet_container_t(1, mSheets.at(mSheetNum));
@@ -704,6 +694,16 @@ auto Show::GetContinuitiesInUseOnCurrentSheet() const -> std::vector<bool>
704694
return GetContinuitiesInUse(mSheetNum);
705695
}
706696

697+
auto Show::GetCurrentSheetRawPrintContinuity() const -> std::string
698+
{
699+
return mSheets.at(mSheetNum).GetRawPrintContinuity();
700+
}
701+
702+
auto Show::GetCurrentSheetPrintContinuity() const -> PrintContinuity
703+
{
704+
return mSheets.at(mSheetNum).GetPrintContinuity();
705+
}
706+
707707
auto Show::AlreadyHasPrintContinuity() const -> bool
708708
{
709709
for (auto& i : mSheets) {
@@ -714,6 +714,16 @@ auto Show::AlreadyHasPrintContinuity() const -> bool
714714
return false;
715715
}
716716

717+
auto Show::GetAllRawPrintContinuity() const -> std::vector<std::string>
718+
{
719+
return CalChart::Ranges::ToVector<std::string>(mSheets | std::views::transform([](auto&& sheet) { return sheet.GetRawPrintContinuity(); }));
720+
}
721+
722+
auto Show::GetAllPrintContinuity() const -> std::vector<PrintContinuity>
723+
{
724+
return CalChart::Ranges::ToVector<PrintContinuity>(mSheets | std::views::transform([](auto&& sheet) { return sheet.GetPrintContinuity(); }));
725+
}
726+
717727
auto Show::GetSheetsName() const -> std::vector<std::string>
718728
{
719729
return CalChart::Ranges::ToVector<std::string>(mSheets | std::views::transform([](auto&& sheet) { return sheet.GetName(); }));

core/CalChartShow.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ class Show {
129129
[[nodiscard]] auto GetCurrentSheetBeats() const -> CalChart::Beats;
130130
[[nodiscard]] auto GetCurrentSheetSymbols() const -> std::vector<SYMBOL_TYPE>;
131131
[[nodiscard]] auto GetCurrentSheetPrintNumber() const -> std::string;
132-
[[nodiscard]] auto GetCurrentSheetRawPrintContinuity() const -> std::string;
133-
[[nodiscard]] auto GetCurrentSheetPrintContinuity() const -> PrintContinuity;
134132
[[nodiscard]] auto GetCurrentSheetBackgroundImages() const -> std::vector<ImageInfo>;
135133
[[nodiscard]] auto CopyAllSheets() const -> Show::Sheet_container_t { return mSheets; }
136134
[[nodiscard]] auto CopyCurrentSheet() const -> Show::Sheet_container_t;
@@ -157,7 +155,13 @@ class Show {
157155
[[nodiscard]] auto GetContinuitiesOnCurrentSheet() const -> std::vector<Continuity>;
158156
[[nodiscard]] auto GetContinuitiesInUse(int sheet) const -> std::vector<bool>;
159157
[[nodiscard]] auto GetContinuitiesInUseOnCurrentSheet() const -> std::vector<bool>;
158+
159+
[[nodiscard]] auto GetCurrentSheetRawPrintContinuity() const -> std::string;
160+
[[nodiscard]] auto GetCurrentSheetPrintContinuity() const -> PrintContinuity;
160161
[[nodiscard]] auto AlreadyHasPrintContinuity() const -> bool;
162+
[[nodiscard]] auto GetAllRawPrintContinuity() const -> std::vector<std::string>;
163+
[[nodiscard]] auto GetAllPrintContinuity() const -> std::vector<PrintContinuity>;
164+
161165
[[nodiscard]] auto const& GetShowMode() const { return mMode; }
162166
[[nodiscard]] auto GetSheetsName() const -> std::vector<std::string>;
163167
[[nodiscard]] auto GetCurrentReferencePoint() const -> int;

tools/calchart_cmd/calchart_cmd_parse.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ auto DumpJSON(CalChart::Show const& show, std::ostream& os)
118118
os << std::setw(4) << json << "\n";
119119
}
120120

121+
auto DumpPrintContinuity(CalChart::Show const& show, std::ostream& os)
122+
{
123+
auto print_continuities = show.GetAllRawPrintContinuity();
124+
for (auto&& [index, pc] : CalChart::Ranges::enumerate_view(print_continuities)) {
125+
if (pc.empty()) {
126+
continue;
127+
}
128+
os << "Sheet: " << index << "\n";
129+
os << pc << "\n";
130+
}
131+
}
132+
121133
}
122134

123135
namespace CalChartCmd {
@@ -143,6 +155,10 @@ constexpr auto Parse = [](auto args, auto& os) {
143155
if (args["--json"].asBool()) {
144156
DumpJSON(*show, os);
145157
}
158+
if (args["--dump_print_continuity"].asBool()) {
159+
DumpPrintContinuity(*show, os);
160+
}
146161
}
147162
};
163+
148164
}

tools/calchart_cmd/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ constexpr auto USAGE =
3131
Options:
3232
--print_show Parse option to print out the show.
3333
--check_flag Parse option to perform check and print results.
34-
--dump_continuity Parse option to dump the continuting.
34+
--dump_continuity Parse option to dump the continuity.
35+
--dump_print_continuity Parse option to dump the print continuity.
3536
--animate_show Parse option to print the animation.
3637
--json Parse option to dump the JSON for the viewer.
3738
--profile Print profiling data.

0 commit comments

Comments
 (0)