Commit Graph

26 Commits

Author SHA1 Message Date
ispyisail f7a79e75af Add alphabetical auto-numbering (a, b, ... z, aa, ab, ...) (#579)
Adds a real base-26 incrementing part type to the autonumbering engine,
alongside the 14 existing NumStrategy leaves. Unlike StringNum (a fixed,
non-incrementing text segment), AlphaNum::next()/previous() carry/borrow
entirely within the part's own value -- the composition loop in
NumerotationContextCommands doesn't need to change, since (unlike #578's
wrap-and-carry) nothing here needs to signal an adjacent part.

- incrementAlpha()/decrementAlpha() implement the spreadsheet-column-name
  algorithm: increment carries right-to-left on 'z'/'Z' overflow,
  prepending a new leading letter if the whole value overflows (z -> aa,
  az -> ba). decrement is the exact inverse, including the symmetric
  shrink case (aa -> z) once every position has borrowed. A single letter
  already at "a"/"A" has no representable predecessor and is clamped
  rather than turned into "z" -- caught via manual testing, since the
  initial implementation mutated the string in the borrow loop before
  checking whether to clamp, silently discarding the original value.
- Registered in NumerotationContext::validRegExpNum() but deliberately
  not in validRegExpNumber(), so addValue() doesn't force alphabetic
  values through int conversion.
- New "Cyclique"-adjacent "Alphabétique" entry in numparteditorw's type
  dropdown, with its own letters-only QRegularExpressionValidator; the
  increase spinbox is disabled since the step is always exactly one
  letter, not a configurable amount.

Also wires the new part type through to actual element/conductor labels,
which turned out to be required for the feature to do anything visible
beyond folio numbering (which applies a NumerotationContext's
represented string directly). Element and conductor numbering instead
go through a separate formula-substitution layer
(autonum::sequentialNumbers + %sequ_/%seqt_/%seqh_-style placeholders in
AssignVariables::assignSequence()) that numerotationContextToFormula()
auto-populates. Without a matching placeholder, an "alpha" part would
silently vanish from the generated formula and never reach the label,
even though the underlying counter was advancing correctly:
- sequentialNumbers gained an `alpha` QStringList member (copy ctor,
  operator=, operator==, toXml/fromXml, clear()).
- numerotationContextToFormula() emits a new %seqa_N placeholder for
  alpha parts, the same way %sequ_N is emitted for unit parts.
- setSequential()/setSequentialToList() populate seqStruct.alpha,
  passing the raw string through as-is rather than the .toInt()-based
  formatting used for the numeric part types.
- AssignVariables::assignSequence() substitutes %seqa_N from
  seqStruct.alpha, mirroring the existing %sequ_N/%seqt_N/%seqh_N
  substitutions.
No "alphafolio" variant was added, matching the discussion's scope (only
unit/ten/hundred have folio-anchored variants).

Verified against production code via the numbering config dialog's own
Suivant/Précédent buttons: from "a", 25 clicks reached "z"; one more
produced "aa"; 25 more reached "az"; one more produced "ba" (carry).
Reversed: "ba"->"az"->(25 clicks)->"aa"->"z" (shrink)->(25 clicks)->"a".
One more "previous" at "a" correctly stayed at "a" after the clamp fix.
Also confirmed the Formule field auto-updates to "%seqa_1" the instant
the type is switched to "Alphabétique", confirming the formula-generation
wiring works live in the UI, not just at the engine level.
2026-08-01 22:45:49 +12:00
ispyisail 68c260342e Add wrap-and-carry (cyclic/modulo) auto-numbering (#578)
Adds a configurable wrap-at-N counter type to the autonumbering engine
(NumerotationContext + NumerotationContextCommands), covering PLC/rack-style
addressing conventions like "e0.0...e0.7, e1.0...e1.7" (8 channels per
card) generally, rather than hardcoding octal specifically.

- New "wrap" part type (WrapNum, alongside the existing UnitNum/TenNum/
  HundredNum strategies) stores a modulus in addition to the existing
  value/increase/initialvalue fields. Its own next()/previous() only wraps
  its own value modulo the configured modulus -- carrying into (or
  borrowing from) the adjacent part requires visibility across parts,
  which only the composition loop has.
- NumerotationContextCommands::next()/previous() gained carry()/borrow()
  helpers: when a wrap part's own next() would reach/exceed its modulus
  (or go below 0 on previous()), the nearest preceding numeric part is
  bumped by exactly one unit, skipping non-numeric parts (e.g. a "."
  string separator). Wrap parts chain correctly if adjacent (e.g. seconds
  wrapping into minutes wrapping into hours).
- For the leading part of a wrap-and-carry pair to stay fixed except when
  carried into (i.e. actually produce "e0.0...e0.7, e1.0..." rather than
  advancing on every step under its own strategy), its own increase must
  be 0. The increase spinbox's minimum was 1, which made this
  configuration impossible through the UI -- lowered to 0 and documented
  with a tooltip, since this wasn't obvious from the UI alone.
- NumerotationContext gained a 5th pipe-separated field (modulus) in its
  serialized string form, defaulting to 0 (non-wrapping) for every
  existing part type; toXml()/fromXml() persist it as a "modulus" XML
  attribute the same way "initialvalue" is already persisted for
  unitfolio/tenfolio/hundredfolio.
- New "Cyclique (modulo)" entry in the part-type dropdown (numparteditorw),
  available for element, conductor, and folio autonumbering alike, since
  all three already go through NumerotationContextCommands.

Verified in the running app via the numbering config dialog's own
Suivant/Précédent buttons (which call the production
NumerotationContextCommands::next()/previous() directly): a two-part
context (unit, increase=0 + wrap mod 8) produced exactly
e0.0→...→e0.7→e1.0→...→e1.7 on repeated "next", and the exact reverse
(with correct borrowing) on repeated "previous".
2026-08-01 19:33:39 +12:00
Laurent Trinques 4044d04cc5 One year
Auto-build doxygen docs / doxygen (push) Has been cancelled
Auto-build doxygen docs / deploy (push) Has been cancelled
2026-01-16 15:24:35 +01:00
Laurent Trinques 77bfe84a4c One year 2025-01-04 13:37:40 +01:00
Laurent Trinques e73cf633ce 2023->2024 2024-03-29 10:09:48 +01:00
Laurent Trinques 9afef79629 Update Copyright date 2023-01-01 17:05:57 +01:00
Laurent Trinques ef58f34c14 Update Copyright date 2021-02-20 12:13:46 +01:00
joshua 2513961cd6 Revert "Update Copyright date"
This reverts commit d04bccc384.
2021-02-06 19:00:48 +01:00
Laurent Trinques d04bccc384 Update Copyright date 2021-02-06 18:33:42 +01:00
Simon De Backer 271fd096e2 Fix deprecated QRegExp
Use QRegularExpression instead.

https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users

This function was introduced in Qt 5
2020-09-19 01:11:28 +02:00
Simon De Backer 5d92393ee7 Wrap code for better readability 2020-09-07 22:03:40 +02:00
Simon De Backer 62d370c99a Wrap code for better readability 2020-08-29 19:21:51 +02:00
Simon De Backer 331918d143 Wrap code for better readability 2020-08-20 21:58:23 +02:00
Simon De Backer 0c00d83b27 Fix some doxygen issues 2020-08-20 21:57:35 +02:00
Simon De Backer d4ee161c07 Mod doc set style de same 2020-08-16 11:19:36 +02:00
Laurent Trinques e10ae8ce2e Update Copyright date 2020-06-15 17:42:53 +02:00
scorpio810 3ed7a4e63b Minor : update Copyright date
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5705 bfdf4180-ca20-0410-9c96-a3a8aa849046
2019-01-13 16:56:12 +00:00
scorpio810 2fe25e74fa Minor : indentation
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5630 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-12-04 22:33:11 +00:00
nuri f27954e507 Correction of some french and english notions and correction of typos. Variable %machine changed in %plant.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5629 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-12-04 19:07:14 +00:00
scorpio810 58fb59491b Revert last commits
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5624 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-12-01 12:55:05 +00:00
scorpio810 ee91337d75 Add new fild and titleblock "Function group"
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5622 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-11-30 23:53:13 +00:00
blacksun fa547a34c8 Fix compilation warning (clang and gcc)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5301 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-04-05 18:49:28 +00:00
scorpio810 9f9b127c04 Modernize-use-nullptr refactors code
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5008 bfdf4180-ca20-0410-9c96-a3a8aa849046
2017-08-05 02:06:59 +00:00
blacksun 945d8562ca Improve some layout and widget item
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4920 bfdf4180-ca20-0410-9c96-a3a8aa849046
2017-02-26 18:30:34 +00:00
scorpio810 54c85db29c Minor update Copyright year
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4860 bfdf4180-ca20-0410-9c96-a3a8aa849046
2017-01-20 10:55:49 +00:00
blacksun 2b952f4189 Move files related to autonum in autoNum directory
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4771 bfdf4180-ca20-0410-9c96-a3a8aa849046
2016-11-07 15:11:12 +00:00