Moved to enterprice NX01 char number naming schema
This commit is contained in:
parent
b7cf498999
commit
7c378e5a7c
|
@ -27,17 +27,19 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.PrimitiveIterator;
|
import java.util.PrimitiveIterator;
|
||||||
|
|
||||||
/**
|
///
|
||||||
* CDC1604DashP6 has 27 pie slice number systems "Packed" for MATH and BASIC letters in a "Six" bit encoding.
|
/// CDC1604DashP6 has 27 pie slice number systems "Packed" for MATH and BASIC letters in a "Six" bit encoding.
|
||||||
*
|
///
|
||||||
* This is used as the first 64 word numbers of the china four corner method, and acts like ascii glue for adult 18 bit computers.
|
/// This is used as the first 64 word numbers of the china four corner method, and acts like ascii glue for adult 18 bit computers.
|
||||||
*
|
///
|
||||||
* ASCII 8 bit can only encoding 10 number glyphs, this 6 bit format can encode 378 different number glyphs.
|
/// ASCII 8 bit can only encoding 10 number glyphs, this 6 bit format can encode 378 different number glyphs.
|
||||||
* (1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27)
|
/// (1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27)
|
||||||
*
|
///
|
||||||
* @author Willem Cazander
|
/// With pie's the path to zero is: real ONE, relative ONE, real ONE.
|
||||||
* @version 1.0 Dec 22, 2024
|
///
|
||||||
*/
|
/// @author Willem Cazander
|
||||||
|
/// @version 1.0 Dec 22, 2024
|
||||||
|
///
|
||||||
public enum CDC1604DashP6 {
|
public enum CDC1604DashP6 {
|
||||||
// [__NUL][__PIE][__GLUE][__ESC] [__LINE][__SPACE]?! {[(< }])>
|
// [__NUL][__PIE][__GLUE][__ESC] [__LINE][__SPACE]?! {[(< }])>
|
||||||
// ~+-* ,.:; '"`^ =#$%
|
// ~+-* ,.:; '"`^ =#$%
|
||||||
|
@ -49,11 +51,12 @@ public enum CDC1604DashP6 {
|
||||||
/// Select packed pie number encoding.
|
/// Select packed pie number encoding.
|
||||||
/// A = 1, first P6 is terminator select, than next P6 _A++ select pie part 1-27, until other P6 stops it.
|
/// A = 1, first P6 is terminator select, than next P6 _A++ select pie part 1-27, until other P6 stops it.
|
||||||
/// Example ascii "012" is
|
/// Example ascii "012" is
|
||||||
/// 0 = __PIE _A _A (__PIE T001 PART_1)
|
/// 0 = __PIE NX01_A NX01_A (__PIE T001 PART_1)
|
||||||
/// 12 = __PIE _I _A _B (__PIE T009 PART_1+2)
|
/// 12 = __PIE NX09_I NX01_A N01_B (__PIE T009 PART_1+2)
|
||||||
__PIE('\u0001'),
|
__PIE('\u0001'),
|
||||||
/// Word glue to flag for automatic casing and/or separator in renderer.(by user-pref per context)
|
/// Word glue to flag for automatic casing and/or separator in renderer.(by user-pref per context)
|
||||||
/// Example "__SPACE __GLUE _F _O _O __GLUE _B _A _R" can be rendered as " FooᐧBar" or " fOObAR" or " FOO_BAR" etc/etc.
|
/// The example "__SPACE __GLUE NX06_F NX15_O NX15_O __GLUE NX02_B NX01_A NX18_R"
|
||||||
|
/// Can be rendered as " FooᐧBar" or " fOObAR" or " FOO_BAR" etc/etc.
|
||||||
__GLUE('\u0002'),
|
__GLUE('\u0002'),
|
||||||
/// Escape to direct control code. (note only needed for 6 bit and 8 bit systems)
|
/// Escape to direct control code. (note only needed for 6 bit and 8 bit systems)
|
||||||
__ESC('\u0003'),
|
__ESC('\u0003'),
|
||||||
|
@ -94,34 +97,34 @@ public enum CDC1604DashP6 {
|
||||||
BAR_V_RIGHT('/'),
|
BAR_V_RIGHT('/'),
|
||||||
_AT('@'),
|
_AT('@'),
|
||||||
/// The tone letter 'A' is "one" and is equal to 'a', if your computer is expensive and has a lower-case char ROM, than this is 'a' except after __GLUE marker.
|
/// The tone letter 'A' is "one" and is equal to 'a', if your computer is expensive and has a lower-case char ROM, than this is 'a' except after __GLUE marker.
|
||||||
T001_A('A', "Æ æ Å å Ǻ ǻ Ḁ ḁ ẚ Ă ă Ặ ặ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ȃ ȃ Â â Ậ ậ Ấ ấ Ầ ầ Ẫ ẫ Ẩ ẩ Ả ả Ǎ ǎ Ⱥ ⱥ Ȧ ȧ Ǡ ǡ Ạ ạ Ä ä Ǟ ǟ À à Ȁ ȁ Á á Ā ā Ā̀ ā̀ Ã ã Ą ą Ą́ ą́ Ą̃ ą̃ A̲ a̲ ᶏ"),
|
NX01_A('A', "Æ æ Å å Ǻ ǻ Ḁ ḁ ẚ Ă ă Ặ ặ Ắ ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ȃ ȃ Â â Ậ ậ Ấ ấ Ầ ầ Ẫ ẫ Ẩ ẩ Ả ả Ǎ ǎ Ⱥ ⱥ Ȧ ȧ Ǡ ǡ Ạ ạ Ä ä Ǟ ǟ À à Ȁ ȁ Á á Ā ā Ā̀ ā̀ Ã ã Ą ą Ą́ ą́ Ą̃ ą̃ A̲ a̲ ᶏ"),
|
||||||
T002_B('B', "Ƀ ƀ Ḃ ḃ Ḅ ḅ Ḇ ḇ Ɓ ɓ ᵬ ᶀ"),
|
NX02_B('B', "Ƀ ƀ Ḃ ḃ Ḅ ḅ Ḇ ḇ Ɓ ɓ ᵬ ᶀ"),
|
||||||
T003_C('C', "Ć ć Ĉ ĉ Č č Ċ ċ Ḉ ḉ Ƈ ƈ C̈ c̈ Ȼ ȼ Ç ç Ꞔ ꞔ Ꞓ ꞓ"),
|
NX03_C('C', "Ć ć Ĉ ĉ Č č Ċ ċ Ḉ ḉ Ƈ ƈ C̈ c̈ Ȼ ȼ Ç ç Ꞔ ꞔ Ꞓ ꞓ"),
|
||||||
T004_D('D', "Đ đ Ꟈ ꟈ Ɗ ɗ Ḋ ḋ Ḍ ḍ Ḑ ḑ Ḓ ḓ Ď ď Ḏ ḏ"),
|
NX04_D('D', "Đ đ Ꟈ ꟈ Ɗ ɗ Ḋ ḋ Ḍ ḍ Ḑ ḑ Ḓ ḓ Ď ď Ḏ ḏ"),
|
||||||
T005_E('E', "Ĕ ĕ Ḝ ḝ Ȇ ȇ Ê ê Ê̄ ê̄ Ê̌ ê̌ Ề ề Ế ế Ể ể Ễ ễ Ệ ệ Ẻ ẻ Ḙ ḙ Ě ě Ɇ ɇ Ė ė Ė́ ė́ Ė̃ ė̃ Ẹ ẹ Ë ë È è È̩ è̩ Ȅ ȅ É é É̩ Ē ē Ḕ ḕ Ḗ ḗ Ẽ ẽ Ḛ ḛ Ę ę Ę́ ę́ Ę̃ ę̃ Ȩ ȩ E̩ e̩ ᶒ"),
|
NX05_E('E', "Ĕ ĕ Ḝ ḝ Ȇ ȇ Ê ê Ê̄ ê̄ Ê̌ ê̌ Ề ề Ế ế Ể ể Ễ ễ Ệ ệ Ẻ ẻ Ḙ ḙ Ě ě Ɇ ɇ Ė ė Ė́ ė́ Ė̃ ė̃ Ẹ ẹ Ë ë È è È̩ è̩ Ȅ ȅ É é É̩ Ē ē Ḕ ḕ Ḗ ḗ Ẽ ẽ Ḛ ḛ Ę ę Ę́ ę́ Ę̃ ę̃ Ȩ ȩ E̩ e̩ ᶒ"),
|
||||||
T006_F('F', "Ƒ ƒ Ḟ ḟ ᵮ ᶂ Ꞙ ꞙ"),
|
NX06_F('F', "Ƒ ƒ Ḟ ḟ ᵮ ᶂ Ꞙ ꞙ"),
|
||||||
T007_G('G', "Ǵ ǵ Ǥ ǥ Ĝ ĝ Ǧ ǧ Ğ ğ Ģ ģ Ɠ ɠ Ġ ġ Ḡ ḡ Ꞡ ꞡ ᶃ"),
|
NX07_G('G', "Ǵ ǵ Ǥ ǥ Ĝ ĝ Ǧ ǧ Ğ ğ Ģ ģ Ɠ ɠ Ġ ġ Ḡ ḡ Ꞡ ꞡ ᶃ"),
|
||||||
T008_H('H', "Ĥ ĥ Ȟ ȟ Ħ ħ Ḩ ḩ Ⱨ ⱨ ẖ ẖ Ḥ ḥ Ḣ ḣ Ḧ ḧ Ḫ ḫ ꞕ Ꜧ ꜧ"),
|
NX08_H('H', "Ĥ ĥ Ȟ ȟ Ħ ħ Ḩ ḩ Ⱨ ⱨ ẖ ẖ Ḥ ḥ Ḣ ḣ Ḧ ḧ Ḫ ḫ ꞕ Ꜧ ꜧ"),
|
||||||
T009_I('I', "Ị ị Ĭ ĭ Î î Ǐ ǐ Ɨ ɨ Ï ï Ḯ ḯ Í í Ì ì Ȉ ȉ Į į Į́ Į̃ Ī ī Ī̀ ī̀ ᶖ Ỉ ỉ Ȋ ȋ Ĩ ĩ Ḭ ḭ ᶤ"),
|
NX09_I('I', "Ị ị Ĭ ĭ Î î Ǐ ǐ Ɨ ɨ Ï ï Ḯ ḯ Í í Ì ì Ȉ ȉ Į į Į́ Į̃ Ī ī Ī̀ ī̀ ᶖ Ỉ ỉ Ȋ ȋ Ĩ ĩ Ḭ ḭ ᶤ"),
|
||||||
T010_J('J', "J́ j́ Ĵ ĵ J̌ ǰ Ɉ ɉ J̃ j̇̃"),
|
NX10_J('J', "J́ j́ Ĵ ĵ J̌ ǰ Ɉ ɉ J̃ j̇̃"),
|
||||||
T011_K('K', "Ƙ ƙ Ꝁ ꝁ Ḱ ḱ Ǩ ǩ Ḳ ḳ Ķ ķ ᶄ Ⱪ ⱪ Ḵ ḵ"),
|
NX11_K('K', "Ƙ ƙ Ꝁ ꝁ Ḱ ḱ Ǩ ǩ Ḳ ḳ Ķ ķ ᶄ Ⱪ ⱪ Ḵ ḵ"),
|
||||||
T012_L('L', "Ĺ ĺ Ł ł Ľ ľ Ḹ ḹ L̃ l̃ Ļ ļ Ŀ ŀ Ḷ ḷ Ḻ ḻ Ḽ ḽ Ƚ ƚ Ⱡ ⱡ"),
|
NX12_L('L', "Ĺ ĺ Ł ł Ľ ľ Ḹ ḹ L̃ l̃ Ļ ļ Ŀ ŀ Ḷ ḷ Ḻ ḻ Ḽ ḽ Ƚ ƚ Ⱡ ⱡ"),
|
||||||
T013_M('M', "Ḿ ḿ Ṁ ṁ Ṃ ṃ M̃ m̃ ᵯ"),
|
NX13_M('M', "Ḿ ḿ Ṁ ṁ Ṃ ṃ M̃ m̃ ᵯ"),
|
||||||
T014_N('N', "Ń ń Ñ ñ Ň ň Ǹ ǹ Ṅ ṅ Ṇ ṇ Ņ ņ Ṉ ṉ Ṋ ṋ Ꞥ ꞥ ᵰ ᶇ"),
|
NX14_N('N', "Ń ń Ñ ñ Ň ň Ǹ ǹ Ṅ ṅ Ṇ ṇ Ņ ņ Ṉ ṉ Ṋ ṋ Ꞥ ꞥ ᵰ ᶇ"),
|
||||||
T015_O('O', "Ø ø Ǿ ǿ Ö ö Ȫ ȫ Ó ó Ò ò Ô ô Ố ố Ồ ồ Ổ ổ Ỗ ỗ Ộ ộ Ǒ ǒ Ő ő Ŏ ŏ Ȏ ȏ Ȯ ȯ Ȱ ȱ Ọ ọ Ɵ ɵ ᶱ Ơ ơ Ớ ớ Ờ ờ Ỡ ỡ Ợ ợ Ở ở Ỏ ỏ Ō ō Ṓ ṓ Ṑ ṑ Õ õ Ȭ ȭ Ṍ ṍ Ṏ ṏ Ǫ ǫ Ȍ ȍ O̩ o̩ Ó̩ ó̩ Ò̩ ò̩ Ǭ ǭ O͍ o͍"),
|
NX15_O('O', "Ø ø Ǿ ǿ Ö ö Ȫ ȫ Ó ó Ò ò Ô ô Ố ố Ồ ồ Ổ ổ Ỗ ỗ Ộ ộ Ǒ ǒ Ő ő Ŏ ŏ Ȏ ȏ Ȯ ȯ Ȱ ȱ Ọ ọ Ɵ ɵ ᶱ Ơ ơ Ớ ớ Ờ ờ Ỡ ỡ Ợ ợ Ở ở Ỏ ỏ Ō ō Ṓ ṓ Ṑ ṑ Õ õ Ȭ ȭ Ṍ ṍ Ṏ ṏ Ǫ ǫ Ȍ ȍ O̩ o̩ Ó̩ ó̩ Ò̩ ò̩ Ǭ ǭ O͍ o͍"),
|
||||||
T016_P('P', "Ṕ ṕ Ṗ ṗ Ᵽ ᵽ Ƥ ƥ ᵱ ᶈ"),
|
NX16_P('P', "Ṕ ṕ Ṗ ṗ Ᵽ ᵽ Ƥ ƥ ᵱ ᶈ"),
|
||||||
T017_Q('Q', "ʠ Ɋ ɋ q̃"),
|
NX17_Q('Q', "ʠ Ɋ ɋ q̃"),
|
||||||
T018_R('R', "Ŕ ŕ Ɍ ɍ Ř ř Ŗ ŗ Ṙ ṙ Ȑ ȑ Ȓ ȓ Ṛ ṛ Ṝ ṝ Ṟ ṟ Ꞧ ꞧ Ɽ ɽ R̃ r̃ ᵲ ꭨ ᵳ ᶉ"),
|
NX18_R('R', "Ŕ ŕ Ɍ ɍ Ř ř Ŗ ŗ Ṙ ṙ Ȑ ȑ Ȓ ȓ Ṛ ṛ Ṝ ṝ Ṟ ṟ Ꞧ ꞧ Ɽ ɽ R̃ r̃ ᵲ ꭨ ᵳ ᶉ"),
|
||||||
T019_S('S', "Ś ś Ṡ ṡ ẛ Ṩ ṩ Ṥ ṥ Ṣ ṣ S̩ s̩ Ꞩ ꞩ Ꟊ ꟊ Ŝ ŝ Ṧ ṧ Š š Ş ş Ș ș S̈ s̈ ᶊ Ȿ ȿ ᵴ ᶳ"),
|
NX19_S('S', "Ś ś Ṡ ṡ ẛ Ṩ ṩ Ṥ ṥ Ṣ ṣ S̩ s̩ Ꞩ ꞩ Ꟊ ꟊ Ŝ ŝ Ṧ ṧ Š š Ş ş Ș ș S̈ s̈ ᶊ Ȿ ȿ ᵴ ᶳ"),
|
||||||
T020_T('T', "Ť ť Ṫ ṫ ẗ Ţ ţ Ṭ ṭ Ʈ ʈ Ț ț ƫ Ṱ ṱ Ṯ ṯ Ŧ ŧ Ⱦ ⱦ Ƭ ƭ ᵵ ᶵ"),
|
NX20_T('T', "Ť ť Ṫ ṫ ẗ Ţ ţ Ṭ ṭ Ʈ ʈ Ț ț ƫ Ṱ ṱ Ṯ ṯ Ŧ ŧ Ⱦ ⱦ Ƭ ƭ ᵵ ᶵ"),
|
||||||
T021_U('U', "Ŭ ŭ Ʉ ʉ ᵾ ᶶ Ꞹ ꞹ Ụ ụ Ü ü Ǜ ǜ Ǘ ǘ Ǚ ǚ Ǖ ǖ Ṳ ṳ Ú ú Ù ù Û û Ṷ ṷ Ǔ ǔ Ȗ ȗ Ű ű Ŭ ŭ Ư ư Ứ ứ Ừ ừ Ử ử Ự ự Ữ Ữ Ủ ủ Ū ū Ū̀ ū̀ Ū́ ū́ Ṻ ṻ Ū̃ ū̃ Ũ ũ Ṹ ṹ Ṵ ṵ ᶙ Ų ų Ų́ ų́ Ų̃ ų̃ Ȕ ȕ Ů ů"),
|
NX21_U('U', "Ŭ ŭ Ʉ ʉ ᵾ ᶶ Ꞹ ꞹ Ụ ụ Ü ü Ǜ ǜ Ǘ ǘ Ǚ ǚ Ǖ ǖ Ṳ ṳ Ú ú Ù ù Û û Ṷ ṷ Ǔ ǔ Ȗ ȗ Ű ű Ŭ ŭ Ư ư Ứ ứ Ừ ừ Ử ử Ự ự Ữ Ữ Ủ ủ Ū ū Ū̀ ū̀ Ū́ ū́ Ṻ ṻ Ū̃ ū̃ Ũ ũ Ṹ ṹ Ṵ ṵ ᶙ Ų ų Ų́ ų́ Ų̃ ų̃ Ȕ ȕ Ů ů"),
|
||||||
T022_V('V', "Ṽ ṽ Ṿ ṿ Ʋ ʋ ᶌ"),
|
NX22_V('V', "Ṽ ṽ Ṿ ṿ Ʋ ʋ ᶌ"),
|
||||||
T023_W('W', "Ẃ ẃ Ẁ ẁ Ŵ ŵ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ"),
|
NX23_W('W', "Ẃ ẃ Ẁ ẁ Ŵ ŵ Ẅ ẅ Ẇ ẇ Ẉ ẉ ẘ"),
|
||||||
T024_X('X', "Ẍ ẍ Ẋ ẋ X̂ x̂ ᶍ"),
|
NX24_X('X', "Ẍ ẍ Ẋ ẋ X̂ x̂ ᶍ"),
|
||||||
T025_Y('Y', "Ý ý Ỳ ỳ Ŷ ŷ Ÿ ÿ Ỹ ỹ Ẏ ẏ Ỵ ỵ ẙ Ỷ ỷ Ȳ ȳ Ɏ ɏ Ƴ ƴ"),
|
NX25_Y('Y', "Ý ý Ỳ ỳ Ŷ ŷ Ÿ ÿ Ỹ ỹ Ẏ ẏ Ỵ ỵ ẙ Ỷ ỷ Ȳ ȳ Ɏ ɏ Ƴ ƴ"),
|
||||||
T026_Z('Z', "Ź ź Ẑ ẑ Ž ž Ż ż Ẓ ẓ Ẕ ẕ Ƶ ƶ ᵶ Ᶎ ᶎ Ⱬ ⱬ"),
|
NX26_Z('Z', "Ź ź Ẑ ẑ Ž ž Ż ż Ẓ ẓ Ẕ ẕ Ƶ ƶ ᵶ Ᶎ ᶎ Ⱬ ⱬ"),
|
||||||
/// The 27th letter is at the end of the old english alphabet.
|
/// The 27th letter is at the end of the old english alphabet.
|
||||||
T027_AMPERSAND('&'),
|
NX27_AMPERSAND('&'),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final byte codePoint;
|
private final byte codePoint;
|
||||||
|
@ -171,23 +174,23 @@ public enum CDC1604DashP6 {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ('0' == codePoint) {
|
if ('0' == codePoint) {
|
||||||
if (!CDC1604DashP6.T001_A.equals(cdcNumberTerminator)) {
|
if (!CDC1604DashP6.NX01_A.equals(cdcNumberTerminator)) {
|
||||||
result.add(CDC1604DashP6.__PIE);
|
result.add(CDC1604DashP6.__PIE);
|
||||||
result.add(CDC1604DashP6.T001_A);
|
result.add(CDC1604DashP6.NX01_A);
|
||||||
cdcNumberTerminator = CDC1604DashP6.T001_A;
|
cdcNumberTerminator = CDC1604DashP6.NX01_A;
|
||||||
}
|
}
|
||||||
result.add(CDC1604DashP6.T001_A);
|
result.add(CDC1604DashP6.NX01_A);
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (codePoint >= '1' && codePoint <= '9') {
|
if (codePoint >= '1' && codePoint <= '9') {
|
||||||
if (!CDC1604DashP6.T009_I.equals(cdcNumberTerminator)) {
|
if (!CDC1604DashP6.NX09_I.equals(cdcNumberTerminator)) {
|
||||||
result.add(CDC1604DashP6.__PIE);
|
result.add(CDC1604DashP6.__PIE);
|
||||||
result.add(CDC1604DashP6.T009_I);
|
result.add(CDC1604DashP6.NX09_I);
|
||||||
cdcNumberTerminator = CDC1604DashP6.T009_I;
|
cdcNumberTerminator = CDC1604DashP6.NX09_I;
|
||||||
}
|
}
|
||||||
int cdcNumberOff = codePoint - '1'; // 0 = 1
|
int cdcNumberOff = codePoint - '1'; // 0 = 1
|
||||||
int cdcNumber = CDC1604DashP6.T001_A.ordinal() + cdcNumberOff;
|
int cdcNumber = CDC1604DashP6.NX01_A.ordinal() + cdcNumberOff;
|
||||||
result.add(CDC1604DashP6.values()[cdcNumber]);
|
result.add(CDC1604DashP6.values()[cdcNumber]);
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
@ -229,7 +232,7 @@ public enum CDC1604DashP6 {
|
||||||
if (numberMode != null && (cdcPoint.ordinal() > numberMode.ordinal())) {
|
if (numberMode != null && (cdcPoint.ordinal() > numberMode.ordinal())) {
|
||||||
numberMode = null; // out of range
|
numberMode = null; // out of range
|
||||||
}
|
}
|
||||||
if (numberMode != null && (cdcPoint.ordinal() < CDC1604DashP6.T001_A.ordinal())) {
|
if (numberMode != null && (cdcPoint.ordinal() < CDC1604DashP6.NX01_A.ordinal())) {
|
||||||
numberMode = null; // below index 1 is end number mode
|
numberMode = null; // below index 1 is end number mode
|
||||||
}
|
}
|
||||||
if (CDC1604DashP6.__GLUE.equals(cdcPoint)) {
|
if (CDC1604DashP6.__GLUE.equals(cdcPoint)) {
|
||||||
|
@ -245,8 +248,8 @@ public enum CDC1604DashP6 {
|
||||||
if (numberMode == null) {
|
if (numberMode == null) {
|
||||||
buf.appendCodePoint(cdcPoint.asciiByte());
|
buf.appendCodePoint(cdcPoint.asciiByte());
|
||||||
} else {
|
} else {
|
||||||
int terminatorNum = numberMode.ordinal() - CDC1604DashP6.T001_A.ordinal() + 1;
|
int terminatorNum = numberMode.ordinal() - CDC1604DashP6.NX01_A.ordinal() + 1;
|
||||||
int valueNumber = cdcPoint.ordinal() - CDC1604DashP6.T001_A.ordinal();
|
int valueNumber = cdcPoint.ordinal() - CDC1604DashP6.NX01_A.ordinal();
|
||||||
appendTerminatorNumber(buf, terminatorNum, valueNumber);
|
appendTerminatorNumber(buf, terminatorNum, valueNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,33 +72,33 @@ public enum CDC1604DashP6DEC {
|
||||||
UNDEFINED__BAR_V_LEFT,
|
UNDEFINED__BAR_V_LEFT,
|
||||||
UNDEFINED__BAR_V_RIGHT,
|
UNDEFINED__BAR_V_RIGHT,
|
||||||
UNDEFINED___AT,
|
UNDEFINED___AT,
|
||||||
UNDEFINED__T001_A,
|
UNDEFINED__NX01_A,
|
||||||
UNDEFINED__T002_B,
|
UNDEFINED__NX02_B,
|
||||||
UNDEFINED__T003_C,
|
UNDEFINED__NX03_C,
|
||||||
UNDEFINED__T004_D,
|
UNDEFINED__NX04_D,
|
||||||
UNDEFINED__T005_E,
|
UNDEFINED__NX05_E,
|
||||||
UNDEFINED__T006_F,
|
UNDEFINED__NX06_F,
|
||||||
UNDEFINED__T007_G,
|
UNDEFINED__NX07_G,
|
||||||
UNDEFINED__T008_H,
|
UNDEFINED__NX08_H,
|
||||||
UNDEFINED__T009_I,
|
UNDEFINED__NX09_I,
|
||||||
UNDEFINED__T010_J,
|
UNDEFINED__NX10_J,
|
||||||
UNDEFINED__T011_K,
|
UNDEFINED__NX11_K,
|
||||||
UNDEFINED__T012_L,
|
UNDEFINED__NX12_L,
|
||||||
UNDEFINED__T013_M,
|
UNDEFINED__NX13_M,
|
||||||
UNDEFINED__T014_N,
|
UNDEFINED__NX14_N,
|
||||||
UNDEFINED__T015_O,
|
UNDEFINED__NX15_O,
|
||||||
UNDEFINED__T016_P,
|
UNDEFINED__NX16_P,
|
||||||
UNDEFINED__T017_Q,
|
UNDEFINED__NX17_Q,
|
||||||
UNDEFINED__T018_R,
|
UNDEFINED__NX18_R,
|
||||||
UNDEFINED__T019_S,
|
UNDEFINED__NX19_S,
|
||||||
UNDEFINED__T020_T,
|
UNDEFINED__NX20_T,
|
||||||
UNDEFINED__T021_U,
|
UNDEFINED__NX21_U,
|
||||||
UNDEFINED__T022_V,
|
UNDEFINED__NX22_V,
|
||||||
UNDEFINED__T023_W,
|
UNDEFINED__NX23_W,
|
||||||
UNDEFINED__T024_X,
|
UNDEFINED__NX24_X,
|
||||||
UNDEFINED__T025_Y,
|
UNDEFINED__NX25_Y,
|
||||||
UNDEFINED__T026_Z,
|
UNDEFINED__NX26_Z,
|
||||||
UNDEFINED__T027_AMPERSAND,
|
UNDEFINED__NX27_AMPERSAND,
|
||||||
|
|
||||||
// Encode 21 bit unicode-1 code point ??
|
// Encode 21 bit unicode-1 code point ??
|
||||||
// _RESERVED1_UNICODE1(), // todo move down
|
// _RESERVED1_UNICODE1(), // todo move down
|
||||||
|
@ -106,7 +106,7 @@ public enum CDC1604DashP6DEC {
|
||||||
// _WORD_ESC + _TEST_UNICODE4 + <stroke-amount> + manyStrokeBlocks
|
// _WORD_ESC + _TEST_UNICODE4 + <stroke-amount> + manyStrokeBlocks
|
||||||
// _RESERVED4_UNICODE4(), // todo move down
|
// _RESERVED4_UNICODE4(), // todo move down
|
||||||
//
|
//
|
||||||
// Historical glue for ansi codes, TODO: put on P6 index number of '[' and ']'
|
// Historical glue for ansi codes, TODO: put on P6 index number of '[' and ???
|
||||||
// TAG_ANSI_UPPER,
|
// TAG_ANSI_UPPER,
|
||||||
// TAG_ANSI_LOWER,
|
// TAG_ANSI_LOWER,
|
||||||
//
|
//
|
||||||
|
@ -125,8 +125,8 @@ public enum CDC1604DashP6DEC {
|
||||||
// Moves cursor up. (test)
|
// Moves cursor up. (test)
|
||||||
// On 8 bit ansi system this takes ESC+[+1+A = 4 bytes/32bit to move 1 up
|
// On 8 bit ansi system this takes ESC+[+1+A = 4 bytes/32bit to move 1 up
|
||||||
// with terminator codes;
|
// with terminator codes;
|
||||||
// On 6 bit P6DEC system with takes __ESC+TAG_SQUARE_LEFT+__PIE+T009_I+T001_A
|
// On 6 bit P6DEC system with takes __ESC+TAG_SQUARE_LEFT+__PIE+NX09_I+NX01_A
|
||||||
// On 18 bit P6DEC system with takes TAG_ANSI_UPPER+__PIE+T009_I+T001_A
|
// On 18 bit P6DEC system with takes TAG_ANSI_UPPER+__PIE+NX09_I+NX01_A
|
||||||
;
|
;
|
||||||
|
|
||||||
private CDC1604DashP6DEC() {
|
private CDC1604DashP6DEC() {
|
||||||
|
|
|
@ -61,12 +61,12 @@ public class CDC1604DashP6Test {
|
||||||
Assertions.assertNotNull(cdc);
|
Assertions.assertNotNull(cdc);
|
||||||
Assertions.assertFalse(cdc.isEmpty());
|
Assertions.assertFalse(cdc.isEmpty());
|
||||||
Assertions.assertEquals(6, cdc.size());
|
Assertions.assertEquals(6, cdc.size());
|
||||||
Assertions.assertEquals(CDC1604DashP6.T006_F, cdc.get(0));
|
Assertions.assertEquals(CDC1604DashP6.NX06_F, cdc.get(0));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T015_O, cdc.get(1));
|
Assertions.assertEquals(CDC1604DashP6.NX15_O, cdc.get(1));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T015_O, cdc.get(2));
|
Assertions.assertEquals(CDC1604DashP6.NX15_O, cdc.get(2));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T002_B, cdc.get(3));
|
Assertions.assertEquals(CDC1604DashP6.NX02_B, cdc.get(3));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T001_A, cdc.get(4));
|
Assertions.assertEquals(CDC1604DashP6.NX01_A, cdc.get(4));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T018_R, cdc.get(5));
|
Assertions.assertEquals(CDC1604DashP6.NX18_R, cdc.get(5));
|
||||||
|
|
||||||
String out = CDC1604DashP6.convertToUnicode(cdc);
|
String out = CDC1604DashP6.convertToUnicode(cdc);
|
||||||
Assertions.assertEquals("FOOBAR", out);
|
Assertions.assertEquals("FOOBAR", out);
|
||||||
|
@ -79,21 +79,21 @@ public class CDC1604DashP6Test {
|
||||||
Assertions.assertFalse(cdc.isEmpty());
|
Assertions.assertFalse(cdc.isEmpty());
|
||||||
Assertions.assertEquals(16, cdc.size());
|
Assertions.assertEquals(16, cdc.size());
|
||||||
Assertions.assertEquals(CDC1604DashP6.__PIE, cdc.get(0));
|
Assertions.assertEquals(CDC1604DashP6.__PIE, cdc.get(0));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T001_A, cdc.get(1));
|
Assertions.assertEquals(CDC1604DashP6.NX01_A, cdc.get(1));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T001_A, cdc.get(2)); // 0
|
Assertions.assertEquals(CDC1604DashP6.NX01_A, cdc.get(2)); // 0
|
||||||
Assertions.assertEquals(CDC1604DashP6.__PIE, cdc.get(3));
|
Assertions.assertEquals(CDC1604DashP6.__PIE, cdc.get(3));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T009_I, cdc.get(4));
|
Assertions.assertEquals(CDC1604DashP6.NX09_I, cdc.get(4));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T001_A, cdc.get(5)); // 1
|
Assertions.assertEquals(CDC1604DashP6.NX01_A, cdc.get(5)); // 1
|
||||||
Assertions.assertEquals(CDC1604DashP6.T002_B, cdc.get(6)); // 2
|
Assertions.assertEquals(CDC1604DashP6.NX02_B, cdc.get(6)); // 2
|
||||||
Assertions.assertEquals(CDC1604DashP6.__PIE, cdc.get(7));
|
Assertions.assertEquals(CDC1604DashP6.__PIE, cdc.get(7));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T001_A, cdc.get(8));
|
Assertions.assertEquals(CDC1604DashP6.NX01_A, cdc.get(8));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T001_A, cdc.get(9)); // 0
|
Assertions.assertEquals(CDC1604DashP6.NX01_A, cdc.get(9)); // 0
|
||||||
Assertions.assertEquals(CDC1604DashP6.__PIE, cdc.get(10));
|
Assertions.assertEquals(CDC1604DashP6.__PIE, cdc.get(10));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T009_I, cdc.get(11));
|
Assertions.assertEquals(CDC1604DashP6.NX09_I, cdc.get(11));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T001_A, cdc.get(12)); // 1
|
Assertions.assertEquals(CDC1604DashP6.NX01_A, cdc.get(12)); // 1
|
||||||
Assertions.assertEquals(CDC1604DashP6.T003_C, cdc.get(13)); // 3
|
Assertions.assertEquals(CDC1604DashP6.NX03_C, cdc.get(13)); // 3
|
||||||
Assertions.assertEquals(CDC1604DashP6.T003_C, cdc.get(14)); // 3
|
Assertions.assertEquals(CDC1604DashP6.NX03_C, cdc.get(14)); // 3
|
||||||
Assertions.assertEquals(CDC1604DashP6.T007_G, cdc.get(15)); // 7
|
Assertions.assertEquals(CDC1604DashP6.NX07_G, cdc.get(15)); // 7
|
||||||
|
|
||||||
String out = CDC1604DashP6.convertToUnicode(cdc);
|
String out = CDC1604DashP6.convertToUnicode(cdc);
|
||||||
Assertions.assertEquals("01201337", out);
|
Assertions.assertEquals("01201337", out);
|
||||||
|
@ -103,12 +103,12 @@ public class CDC1604DashP6Test {
|
||||||
public void testNumberPieOutOfRange() throws Exception {
|
public void testNumberPieOutOfRange() throws Exception {
|
||||||
List<CDC1604DashP6> cdc = new ArrayList<>();
|
List<CDC1604DashP6> cdc = new ArrayList<>();
|
||||||
cdc.add(CDC1604DashP6.__PIE);
|
cdc.add(CDC1604DashP6.__PIE);
|
||||||
cdc.add(CDC1604DashP6.T001_A);
|
cdc.add(CDC1604DashP6.NX01_A);
|
||||||
cdc.add(CDC1604DashP6.T002_B); // = B
|
cdc.add(CDC1604DashP6.NX02_B); // = B
|
||||||
cdc.add(CDC1604DashP6.__PIE);
|
cdc.add(CDC1604DashP6.__PIE);
|
||||||
cdc.add(CDC1604DashP6.T009_I);
|
cdc.add(CDC1604DashP6.NX09_I);
|
||||||
cdc.add(CDC1604DashP6.T003_C); // = 3
|
cdc.add(CDC1604DashP6.NX03_C); // = 3
|
||||||
cdc.add(CDC1604DashP6.T010_J); // = J
|
cdc.add(CDC1604DashP6.NX10_J); // = J
|
||||||
|
|
||||||
String out = CDC1604DashP6.convertToUnicode(cdc);
|
String out = CDC1604DashP6.convertToUnicode(cdc);
|
||||||
Assertions.assertEquals("B3J", out);
|
Assertions.assertEquals("B3J", out);
|
||||||
|
@ -120,13 +120,13 @@ public class CDC1604DashP6Test {
|
||||||
Assertions.assertNotNull(cdc);
|
Assertions.assertNotNull(cdc);
|
||||||
Assertions.assertFalse(cdc.isEmpty());
|
Assertions.assertFalse(cdc.isEmpty());
|
||||||
Assertions.assertEquals(8, cdc.size());
|
Assertions.assertEquals(8, cdc.size());
|
||||||
Assertions.assertEquals(CDC1604DashP6.T001_A, cdc.get(0));
|
Assertions.assertEquals(CDC1604DashP6.NX01_A, cdc.get(0));
|
||||||
Assertions.assertEquals(CDC1604DashP6.__LINE, cdc.get(1));
|
Assertions.assertEquals(CDC1604DashP6.__LINE, cdc.get(1));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T002_B, cdc.get(2));
|
Assertions.assertEquals(CDC1604DashP6.NX02_B, cdc.get(2));
|
||||||
Assertions.assertEquals(CDC1604DashP6.__LINE, cdc.get(3));
|
Assertions.assertEquals(CDC1604DashP6.__LINE, cdc.get(3));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T003_C, cdc.get(4));
|
Assertions.assertEquals(CDC1604DashP6.NX03_C, cdc.get(4));
|
||||||
Assertions.assertEquals(CDC1604DashP6.__LINE, cdc.get(5));
|
Assertions.assertEquals(CDC1604DashP6.__LINE, cdc.get(5));
|
||||||
Assertions.assertEquals(CDC1604DashP6.T004_D, cdc.get(6));
|
Assertions.assertEquals(CDC1604DashP6.NX04_D, cdc.get(6));
|
||||||
Assertions.assertEquals(CDC1604DashP6.__LINE, cdc.get(7));
|
Assertions.assertEquals(CDC1604DashP6.__LINE, cdc.get(7));
|
||||||
|
|
||||||
String out = CDC1604DashP6.convertToUnicode(cdc);
|
String out = CDC1604DashP6.convertToUnicode(cdc);
|
||||||
|
|
Loading…
Reference in a new issue