20#define BOOST_TEST_NO_MAIN
21#include <boost/test/unit_test.hpp>
36struct DefaultLayoutFixture
38 DefaultLayoutFixture()
48BOOST_FIXTURE_TEST_SUITE( DrawingSheetReactive, DefaultLayoutFixture )
66 return std::any_of( keys.begin(), keys.end(),
68 { return key.kind == k && key.primary == primary; } );
175 text->m_RepeatCount = 8;
176 text->m_IncrementLabel = 1;
198static std::vector<wxString>
repeatTexts(
const wxString& aBase,
int aCount,
int aLabelStep )
205 text->m_RepeatCount = aCount;
206 text->m_IncrementLabel = aLabelStep;
216 std::vector<wxString> out;
232 const std::vector<wxString> letters =
repeatTexts( wxT(
"y" ), 5, 1 );
233 const std::vector<wxString> expLetters = { wxT(
"y" ), wxT(
"z" ), wxT(
"aa" ), wxT(
"ab" ), wxT(
"ac" ) };
234 BOOST_CHECK_EQUAL_COLLECTIONS( letters.begin(), letters.end(), expLetters.begin(), expLetters.end() );
236 const std::vector<wxString> numbers =
repeatTexts( wxT(
"19" ), 3, 1 );
237 const std::vector<wxString> expNumbers = { wxT(
"19" ), wxT(
"20" ), wxT(
"21" ) };
238 BOOST_CHECK_EQUAL_COLLECTIONS( numbers.begin(), numbers.end(), expNumbers.begin(), expNumbers.end() );
constexpr EDA_IU_SCALE unityScale
Handle the graphic items list to draw/plot the frame and title block.
static DS_DATA_MODEL & GetTheInstance()
Return the instance of DS_DATA_MODEL used in the application.
Base class to handle basic graphic items.
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
DS_DRAW_ITEM_BASE * GetFirst()
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
DS_DRAW_ITEM_BASE * GetNext()
void AttachToTracker(TEXT_VAR_TRACKER *aTracker)
Register this proxy with aTracker as a dependent on every title-block source variable its current tem...
std::vector< TEXT_VAR_REF_KEY > CollectTextVarKeys() const
Walk the current drawing-sheet definition and collect every ${...} reference encountered in its text ...
A base class for most all the KiCad significant classes used in schematics and boards.
Describe the page size and margins of a paper page on which to eventually print or plot.
std::size_t ItemCount() const
std::size_t DependentCount(const TEXT_VAR_REF_KEY &aKey) const
Coordinates the dependency index with change notifications.
ListenerHandle AddInvalidateListener(InvalidateCallback aCallback)
Register a listener that fires for every invalidation.
TEXT_VAR_DEPENDENCY_INDEX & Index()
void InvalidateKey(const TEXT_VAR_REF_KEY &aKey)
Fan out invalidation for a single explicit key — used when a non-item source changes (e....
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Identifies a single resolvable source that a text item's ${...} reference depends on.
static TEXT_VAR_REF_KEY FromToken(const wxString &aToken)
Parse a raw token (the text between ${ and }) into a key using lexical classification only — no looku...
KIND
Categorizes a reference by the source that will produce its value.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
static std::vector< wxString > repeatTexts(const wxString &aBase, int aCount, int aLabelStep)
BOOST_AUTO_TEST_CASE(CollectKeysFindsTitleBlockSources)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< double > VECTOR2D