Lamp testbench in Rust around the HPCS 6500

lampbench station / export / label / tm30 / calibrate replace the Python
lamp_station.py, lamp_export.py, label_printer.py, tm30.py and
calibration.py that lived in HPCS6500-py. The driver is a submodule
(HPCS6500/, like mppt-testbench). Workspace crates: tm30 (TM-30-18 port of
colour-science 0.4.7), brother-ql (raster protocol, byte-identical to
brother_ql) and lamp-label (QR + ID labels for the QL-820NWB).

Bundles are byte-identical to lamp_export.py's (golden tests); the station
runs end to end in a test against the simulated instrument.
This commit is contained in:
grabowski committed 2026-10-22 17:26:14 +07:00
commit 2a3f28001c
241 files changed
+46390

No files matched your search

+941
View File
@@ -0,0 +1,941 @@
{
"name": "lamp_L0001",
"source": "L0001/spd.csv",
"generator": "crates/tm30/tools/golden.py (tm30.py + colour-science 0.4.7, numpy 2.5.1)",
"wavelengths": [
380.0,
381.92,
383.84,
385.76,
387.68,
389.6,
391.52,
393.44,
395.36,
397.28,
399.2,
401.12,
403.04,
404.96,
406.88,
408.8,
410.72,
412.64,
414.56,
416.48,
418.4,
420.32,
422.23,
424.15,
426.07,
427.99,
429.91,
431.83,
433.75,
435.67,
437.59,
439.51,
441.43,
443.35,
445.27,
447.19,
449.11,
451.03,
452.95,
454.87,
456.79,
458.71,
460.63,
462.55,
464.47,
466.39,
468.31,
470.23,
472.15,
474.07,
475.99,
477.91,
479.83,
481.75,
483.67,
485.59,
487.51,
489.43,
491.35,
493.27,
495.19,
497.11,
499.03,
500.95,
502.87,
504.79,
506.7,
508.62,
510.54,
512.46,
514.38,
516.3,
518.22,
520.14,
522.06,
523.98,
525.9,
527.82,
529.74,
531.66,
533.58,
535.5,
537.42,
539.34,
541.26,
543.18,
545.1,
547.02,
548.94,
550.86,
552.78,
554.7,
556.62,
558.54,
560.46,
562.38,
564.3,
566.22,
568.14,
570.06,
571.98,
573.9,
575.82,
577.74,
579.66,
581.58,
583.5,
585.42,
587.34,
589.26,
591.17,
593.09,
595.01,
596.93,
598.85,
600.77,
602.69,
604.61,
606.53,
608.45,
610.37,
612.29,
614.21,
616.13,
618.05,
619.97,
621.89,
623.81,
625.73,
627.65,
629.57,
631.49,
633.41,
635.33,
637.25,
639.17,
641.09,
643.01,
644.93,
646.85,
648.77,
650.69,
652.61,
654.53,
656.45,
658.37,
660.29,
662.21,
664.13,
666.05,
667.97,
669.89,
671.81,
673.72,
675.64,
677.56,
679.48,
681.4,
683.32,
685.24,
687.16,
689.08,
691.0,
692.92,
694.84,
696.76,
698.68,
700.6,
702.52,
704.44,
706.36,
708.28,
710.2,
712.12,
714.04,
715.96,
717.88,
719.8,
721.72,
723.64,
725.56,
727.48,
729.4,
731.32,
733.24,
735.16,
737.08,
739.0,
740.92,
742.84,
744.76,
746.68,
748.6,
750.52,
752.44,
754.36,
756.28,
758.19,
760.11,
762.03,
763.95,
765.87,
767.79,
769.71,
771.63,
773.55,
775.47,
777.39,
779.31,
781.23,
783.15,
785.07,
786.99,
788.91,
790.83,
792.75,
794.67,
796.59,
798.51,
800.43,
802.35,
804.27,
806.19,
808.11,
810.03,
811.95,
813.87,
815.79,
817.71,
819.63,
821.55,
823.47,
825.39,
827.31,
829.23,
831.15,
833.07,
834.99,
836.91,
838.83,
840.74,
842.66,
844.58,
846.5,
848.42,
850.34,
852.26,
854.18,
856.1,
858.02,
859.94,
861.86,
863.78,
865.7,
867.62,
869.54,
871.46,
873.38,
875.3,
877.22,
879.14,
881.06,
882.98,
884.9,
886.82,
888.74,
890.66,
892.58,
894.5,
896.42,
898.34,
900.26,
902.18,
904.1,
906.02,
907.94,
909.86,
911.78,
913.7,
915.62,
917.54,
919.46,
921.38,
923.3,
925.21,
927.13,
929.05,
930.97,
932.89,
934.81,
936.73,
938.65,
940.57,
942.49,
944.41,
946.33,
948.25,
950.17,
952.09,
954.01,
955.93,
957.85,
959.77,
961.69,
963.61,
965.53,
967.45,
969.37,
971.29,
973.21,
975.13,
977.05,
978.97,
980.89,
982.81,
984.73,
986.65,
988.57,
990.49,
992.41,
994.33,
996.25,
998.17,
1000.09,
1002.01,
1003.93,
1005.85,
1007.77,
1009.68,
1011.6,
1013.52,
1015.44,
1017.36,
1019.28,
1021.2,
1023.12,
1025.04,
1026.96,
1028.88,
1030.8,
1032.72,
1034.64,
1036.56,
1038.48,
1040.4,
1042.32,
1044.24,
1046.16,
1048.08,
1050.0
],
"values": [
0.173954,
0.266255,
0.36761,
0.475484,
0.588793,
0.711825,
0.859452,
1.02066,
1.17508,
1.33937,
1.51489,
1.7049,
1.91109,
2.13056,
2.36004,
2.59258,
2.83133,
3.07465,
3.32401,
3.58211,
3.84338,
4.10513,
4.36389,
4.61194,
4.84417,
5.06707,
5.27714,
5.48244,
5.68101,
5.86675,
6.04176,
6.19296,
6.31636,
6.41876,
6.49622,
6.54376,
6.55781,
6.52994,
6.45722,
6.33781,
6.17428,
5.97071,
5.73037,
5.45992,
5.16722,
4.86511,
4.56307,
4.27054,
3.99017,
3.72361,
3.47269,
3.23981,
3.02713,
2.83346,
2.65746,
2.49517,
2.34634,
2.21013,
2.08613,
1.97317,
1.86921,
1.77487,
1.69002,
1.61577,
1.55214,
1.49715,
1.44736,
1.40751,
1.37707,
1.35754,
1.34825,
1.34778,
1.35726,
1.37632,
1.40814,
1.45304,
1.50707,
1.57352,
1.65211,
1.74205,
1.84199,
1.95239,
2.07322,
2.20528,
2.34857,
2.50144,
2.66389,
2.83537,
3.01512,
3.20287,
3.39768,
3.59574,
3.79758,
4.00148,
4.20716,
4.41504,
4.62188,
4.82736,
5.03069,
5.23103,
5.42729,
5.61932,
5.80546,
5.98719,
6.16375,
6.33542,
6.50026,
6.65556,
6.80347,
6.94454,
7.0826,
7.21254,
7.34254,
7.47942,
7.61179,
7.73903,
7.86399,
7.99002,
8.11767,
8.24569,
8.37502,
8.50726,
8.64522,
8.78531,
8.9269,
9.06876,
9.21281,
9.36286,
9.5166,
9.67051,
9.82156,
9.97156,
10.1237,
10.2823,
10.4464,
10.6113,
10.7764,
10.9416,
11.1085,
11.2778,
11.4481,
11.618,
11.7879,
11.9598,
12.134,
12.308,
12.4815,
12.6531,
12.825,
12.9982,
13.1738,
13.3506,
13.5258,
13.6995,
13.8731,
14.0475,
14.2227,
14.4001,
14.5677,
14.7326,
14.9057,
15.0711,
15.2247,
15.3673,
15.4972,
15.6169,
15.7289,
15.8361,
15.939,
16.0379,
16.1292,
16.2064,
16.2694,
16.3198,
16.3591,
16.3888,
16.4081,
16.4141,
16.4101,
16.3969,
16.3724,
16.3378,
16.2935,
16.2589,
16.2205,
16.1564,
16.0838,
16.0027,
15.9111,
15.811,
15.7016,
15.5826,
15.4552,
15.3185,
15.1741,
15.0211,
14.8595,
14.6916,
14.519,
14.3478,
14.1758,
14.0016,
13.8249,
13.6746,
13.5225,
13.3341,
13.1394,
12.9419,
12.7423,
12.5413,
12.3383,
12.1338,
11.9285,
11.7237,
11.5191,
11.314,
11.1091,
10.906,
10.705,
10.5061,
10.3087,
10.1423,
9.97381,
9.77352,
9.57275,
9.37371,
9.17485,
8.97375,
8.77104,
8.56603,
8.36264,
8.16237,
7.96558,
7.77154,
7.57926,
7.38733,
7.22354,
7.06244,
6.87544,
6.68959,
6.50539,
6.32182,
6.1418,
5.96715,
5.7978,
5.63467,
5.47532,
5.31959,
5.16722,
5.01664,
4.88891,
4.76312,
4.61919,
4.48082,
4.34759,
4.21797,
4.09113,
3.96696,
3.8455,
3.72647,
3.60996,
3.49657,
3.38756,
3.29712,
3.20885,
3.10628,
3.00287,
2.89988,
2.79898,
2.70299,
2.61084,
2.52174,
2.43512,
2.3494,
2.26465,
2.18032,
2.1076,
2.03671,
1.95905,
1.88515,
1.81499,
1.74591,
1.67679,
1.60838,
1.54088,
1.47626,
1.41434,
1.36356,
1.31493,
1.26002,
1.20649,
1.15499,
1.10544,
1.05814,
1.01309,
0.970437,
0.931136,
0.894492,
0.859432,
0.828634,
0.796794,
0.759111,
0.720384,
0.682213,
0.64496,
0.609387,
0.577019,
0.547821,
0.521528,
0.500481,
0.479917,
0.45703,
0.435907,
0.416153,
0.397855,
0.380334,
0.363872,
0.348588,
0.33412,
0.321791,
0.309198,
0.294714,
0.280217,
0.26571,
0.251674,
0.237682,
0.223798,
0.210622,
0.197621,
0.186491,
0.175749,
0.163828,
0.152451,
0.141729,
0.132162,
0.123236,
0.115076,
0.107027,
0.09876,
0.0916038,
0.083752,
0.0751364,
0.0668978,
0.0590985,
0.0523388,
0.0449385,
0.0377408,
0.0302384,
0.0237588,
0.0181567
],
"expected": {
"Rf": 72.38329929879201,
"Rg": 119.8372775942548,
"CCT_K": 2158.0397133551915,
"Duv": -0.052023715296819206,
"bins": [
{
"bin": 1,
"ref_a": 26.115062257912303,
"ref_b": 5.276522593470199,
"test_a": 25.719846321713124,
"test_b": 5.386075429177029,
"ref_a_norm": 0.9801925377316355,
"ref_b_norm": 0.19804693629343573,
"test_a_norm": 0.9653586572825209,
"test_b_norm": 0.20215884960180394,
"Rcs_pct": -1.3746657104320956,
"Rhs": 0.006926850560708237,
"Rf_h": 88.65535678247258
},
{
"bin": 2,
"ref_a": 20.001104831141127,
"ref_b": 13.328858198674363,
"test_a": 17.44270802833978,
"test_b": 16.010158145625503,
"ref_a_norm": 0.832150357775343,
"ref_b_norm": 0.5545500717287563,
"test_a_norm": 0.7257076970945344,
"test_b_norm": 0.6661061447055059,
"Rcs_pct": -2.652660435027867,
"Rhs": 0.1518918585456357,
"Rf_h": 72.49090164831904
},
{
"bin": 3,
"ref_a": 15.807069588084772,
"ref_b": 23.32498729841534,
"test_a": 10.136866993234957,
"test_b": 29.98875779883528,
"ref_a_norm": 0.5610007078844208,
"ref_b_norm": 0.8278153210427908,
"test_a_norm": 0.3597624168885599,
"test_b_norm": 1.064315827799139,
"Rcs_pct": 8.484098044101925,
"Rhs": 0.2987161654426336,
"Rf_h": 41.08216605395147
},
{
"bin": 4,
"ref_a": 3.1499026365111904,
"ref_b": 19.02391709005675,
"test_a": -1.4649383267174183,
"test_b": 25.18181917776837,
"ref_a_norm": 0.16335188588758906,
"ref_b_norm": 0.9865678696252823,
"test_a_norm": -0.07597074131895924,
"test_b_norm": 1.305912635231418,
"Rcs_pct": 26.651911707284654,
"Rhs": 0.29702518318787835,
"Rf_h": 48.19472777800929
},
{
"bin": 5,
"ref_a": -2.4468221137436132,
"ref_b": 14.887824770388088,
"test_a": -5.047654700950897,
"test_b": 19.394216308614574,
"ref_a_norm": -0.16217487777119435,
"ref_b_norm": 0.986762032619769,
"test_a_norm": -0.3345575387601235,
"test_b_norm": 1.2854447577741825,
"Rcs_pct": 32.65738091844998,
"Rhs": 0.11080026746365267,
"Rf_h": 64.54133666924353
},
{
"bin": 6,
"ref_a": -10.943217205796538,
"ref_b": 14.235561158561461,
"test_a": -12.611601170313463,
"test_b": 19.659770713595467,
"ref_a_norm": -0.6094583022885663,
"ref_b_norm": 0.7928181240180743,
"test_a_norm": -0.7023752607531535,
"test_b_norm": 1.0949074899238678,
"Rcs_pct": 30.28000242160553,
"Rhs": -0.09057423197814342,
"Rf_h": 61.64837462087425
},
{
"bin": 7,
"ref_a": -18.90915422946678,
"ref_b": 12.055087069208147,
"test_a": -20.482336359458117,
"test_b": 18.063919995052053,
"ref_a_norm": -0.8432170660454256,
"ref_b_norm": 0.5375732317831164,
"test_a_norm": -0.9133700725685415,
"test_b_norm": 0.8055254843588323,
"Rcs_pct": 20.719638853725094,
"Rhs": -0.183819233383651,
"Rf_h": 57.8574595144496
},
{
"bin": 8,
"ref_a": -17.661483695468846,
"ref_b": 3.685335895179641,
"test_a": -16.725533291715532,
"test_b": 7.6327811870748805,
"ref_a_norm": -0.9789155170010111,
"ref_b_norm": 0.20426553937128855,
"test_a_norm": -0.9270389935347215,
"test_b_norm": 0.4230589043783418,
"Rcs_pct": -0.8195262580011178,
"Rhs": -0.2247099195169248,
"Rf_h": 71.57056525086124
},
{
"bin": 9,
"ref_a": -25.243112953400587,
"ref_b": -5.365667651317104,
"test_a": -25.767642232793097,
"test_b": -2.718067468750532,
"ref_a_norm": -0.9781469832574565,
"ref_b_norm": -0.20791459579437155,
"test_a_norm": -0.9984720015392796,
"test_b_norm": -0.10532256856579195,
"Rcs_pct": -0.008023287357238581,
"Rhs": -0.10458596455410286,
"Rf_h": 79.04825164549948
},
{
"bin": 10,
"ref_a": -18.873803780173787,
"ref_b": -13.50137709515617,
"test_a": -18.936780631333907,
"test_b": -12.59575557108608,
"ref_a_norm": -0.8133238278652302,
"ref_b_norm": -0.5818112675315334,
"test_a_norm": -0.8160376726338322,
"test_b_norm": -0.5427855590345763,
"Rcs_pct": -1.942504250581066,
"Rhs": -0.033956422084268384,
"Rf_h": 88.58537160888947
},
{
"bin": 11,
"ref_a": -11.50556084240589,
"ref_b": -16.973809199291978,
"test_a": -10.200724333124539,
"test_b": -17.398996378304986,
"ref_a_norm": -0.5610879263957349,
"ref_b_norm": -0.8277562073780748,
"test_a_norm": -0.4974553906761611,
"test_b_norm": -0.8484911716158176,
"Rcs_pct": -1.811185002148857,
"Rhs": 0.06442824871779783,
"Rf_h": 79.37819124595464
},
{
"bin": 12,
"ref_a": -5.525064160174467,
"ref_b": -20.201334502962833,
"test_a": -3.338377037898077,
"test_b": -20.810182377844825,
"ref_a_norm": -0.2638110526161154,
"ref_b_norm": -0.9645743768717772,
"test_a_norm": -0.1594010014843974,
"test_b_norm": -0.9936456770592905,
"Rcs_pct": 0.8143312809089416,
"Rhs": 0.10807537059114716,
"Rf_h": 74.10816069805898
},
{
"bin": 13,
"ref_a": 2.70831577332035,
"ref_b": -13.072432148511325,
"test_a": 4.2461019077599484,
"test_b": -14.51614908734479,
"ref_a_norm": 0.20286955093154918,
"ref_b_norm": -0.9792057727080818,
"test_a_norm": 0.31805921441013774,
"test_b_norm": -1.0873490734039022,
"Rcs_pct": 12.853774603764831,
"Rhs": 0.09187861503776662,
"Rf_h": 81.85913770820962
},
{
"bin": 14,
"ref_a": 13.218131407837134,
"ref_b": -19.8831282429124,
"test_a": 16.439957328312744,
"test_b": -22.715525312093334,
"ref_a_norm": 0.5536185378172014,
"ref_b_norm": -0.8327703852714408,
"test_a_norm": 0.6885591357097082,
"test_b_norm": -0.9514004302888444,
"Rcs_pct": 17.36062569529985,
"Rhs": 0.046291684860111544,
"Rf_h": 70.94303420179887
},
{
"bin": 15,
"ref_a": 16.26971401755112,
"ref_b": -10.574958459083005,
"test_a": 17.721350521095495,
"test_b": -12.657216526577917,
"ref_a_norm": 0.8384519912054851,
"ref_b_norm": -0.5449754659097575,
"test_a_norm": 0.9132613895508008,
"test_b_norm": -0.6522836472958234,
"Rcs_pct": 12.181897277633274,
"Rhs": -0.0476616171032001,
"Rf_h": 82.10427690792586
},
{
"bin": 16,
"ref_a": 18.30330409719438,
"ref_b": -3.2805078148339084,
"test_a": 18.567596206910952,
"test_b": -3.368866845236011,
"ref_a_norm": 0.9843151329296822,
"ref_b_norm": -0.1764191573656947,
"test_a_norm": 0.9985282346585558,
"test_b_norm": -0.18117092952081695,
"Rcs_pct": 1.4867025724443015,
"Rhs": -0.0018876295924399051,
"Rf_h": 91.79390516084133
}
]
}
}