5.6 KiB
RKM Value Notation
Resistance, capacitance, inductance and voltage values can be shown in RKM notation, where the unit
letter replaces the decimal point (4K7, 0R22, 2n2, 4u7, 6V3), instead of decimal (4.7K,
0.22uF, 6.3V). Either notation can always be typed, and typing the unit together with the
value (4K7, 2.2nF) also sets the unit.
IEC 60062 defines RKM for resistance and capacitance only. Inductance (4u7, 2n2) and voltage
(3V3, 6V3, zener 5V1) follow common practice. Power, current and frequency are left out:
0W25, 1A6 or 4M43 are rare in practice.
1. User-facing behaviour
Config menu
Config
...
Value Notation > (after Sticky Points; icon IconLoader.Decimal)
(o) Decimal (4.7K, 0.22uF, 6.3V)
( ) RKM (4K7, 0u22, 6V3)
One setting for all four measures: key IPlugInPort.VALUE_NOTATION_KEY = "valueNotation", values
VALUE_NOTATION_DECIMAL / VALUE_NOTATION_RKM (the English menu titles, since ToggleAction
stores its title), default decimal. Switching clears the drawing cache and repaints.
Display
The notation governs toString() of Resistance, Capacitance, Inductance and Voltage, and
so canvas labels, getValueForDisplay(), search, BOM, netlist text and AI assistant context.
The edit dialog's value field is the exception: it always shows the bare decimal number, because
the unit box beside it already shows the unit.
| Value | Decimal | RKM |
|---|---|---|
| 4.7 Ω / 0.22 Ω / 100 Ω | 4.7Ω 0.22Ω 100Ω |
4R7 0R22 100R |
| 4.7 K / 1 M | 4.7K 1M |
4K7 1M |
| 0.22 uF / 2.2 nF / 100 nF | 0.22uF 2.2nF 100nF |
0u22 2n2 100n |
| 4.7 uH / 10 mH | 4.7uH 10mH |
4u7 10m |
| 6.3 V / 400 V | 6.3V 400V |
6V3 400V |
| 500 mV / 1.5 KV | 500mV 1.5KV |
unchanged: 500mV 1.5KV |
Rules: the value stays in its stored unit (4700 Ω is 4700R, never 4K7); R stands for ohms;
capacitance drops F and inductance drops H; whole numbers take the letter as a suffix; digits
are rounded like the 0.#### decimal format. Only volts have an RKM form, since 1m5 or 1k5
would not say the value is a voltage.
Input
Accepted in either notation: a bare number (keeps the current unit), a decimal with a unit
(4.7k, 220 nF, 4.7ohm, 1.5kV), or an RKM code (4K7, R22, 2n2F, 4µ7, 6V3, 1k5V).
Unit text per measure:
- Resistance:
R,Ω,ohm(s)→ Ω;K→ K;M,Meg, and lower-casem→ M (there is no milliohm unit). - Capacitance / inductance:
p,n,u/µ,m, optionally followed byF/H;F/Halone. Case-insensitive with the trailing letter; without it,Mis rejected so it is never read as mega. - Inductance does not accept
R: maker codes print4R7for 4.7 µH, which RKM would read as 4.7 H. - Voltage:
V,mV,kV, case-insensitive.
The property updates on every keystroke (Enter in the dialog commits at once); on focus loss the text is rewritten as the bare decimal number. Unparseable text shows the warning icon.
2. Design
org.diylc.core.measures.ValueNotation— enumDECIMAL, RKMwith the globalgetCurrent()/setCurrent()(a volatile static, read bytoString()on every repaint),formatRkm(value, symbol)andparse(text, unitResolver)returning aParsedMeasure(value, unit)record (unitnullfor a bare number).- Unit enums —
ResistanceUnit,CapacitanceUnit,InductanceUnitandVoltageUnitcarry anrkmSymbol(nullfor mV and KV) and a staticfromSymbol(String)resolver. Constant names andtoString()are unchanged, so.diyfiles are unaffected. - Measures —
toString()returns RKM when selected and the unit has a symbol, elsesuper.toString().parseResistance,parseCapacitance,Inductance.parseCapacitance(historical name) andparseVoltagedelegate toValueNotation.parse, so the AI assistant,V1FileParser,TangoNetlistParserandCapacitorDatasheetServiceread RKM too.parseVoltageused to reject1KV; it now parses it. org.diylc.presenter.ValueNotationBinder— applies the config value and listens for changes. Bound fromConfigPlugin.connect()rather than thePresenterconstructor, because the secondary presenters (previews, thumbnails, batch converter, regression runner) run on in-memory configurations and would reset the global notation to decimal.- Swing —
MeasureTextField(in DIYLC, notbancika-gui-framework, whoselib/swing-framework-1.1.jarwould need re-vendoring) parses without rewriting the text while typing.MeasureEditor.getUnitResolverpicks it for the four measures;DoubleTextFieldserves the rest. A typed unit switches the unit box behind a guard flag.MeasureArrayEditor(MultiSectionCapacitor) parses/-separated sections, each with an optional unit; the box shows the first section's unit and a section in another unit is written with it (47 / 100nF). - Localization —
Value Notation,Decimal (4.7K, 0.22uF, 6.3V)andRKM (4K7, 0u22, 6V3)in every file inlang/.
3. Status and next steps
Implemented; mvn -q test passes, including ValueNotationTest (formatting, parsing, rejection
and round trips for all four measures). With the default decimal notation every string the app
produces is unchanged.
- Try it in the running app: the edit dialog (single value and
MultiSectionCapacitor), inductor and capacitor voltage properties, canvas labels after switching, BOM export. - Run the regression suite to confirm decimal output is unchanged.
- Optional, in
bancika-gui-framework: stopDoubleTextField/DoubleArrayTextFieldaccepting a valid prefix (4R7read as4).