st-ten-1/src/test/label_printer_ferrari.py

51 lines
1.2 KiB
Python
Raw Normal View History

2024-10-24 10:42:03 +00:00
import sys
from datetime import datetime
from PyQt5.QtWidgets import QApplication
from components import Os_Label_Printer
from lib.helpers import ConfigReader
config = ConfigReader(system_id="test-windows")
time =datetime.now()
context = {
# RECIPE DATA
"RECIPE": "000948653",
"PART": "000948653",
"TFILL": "5",
"TSET": "10",
"TTEST": "10",
"PSETMINP_A": "4750",
"PSETMAXP_A": "5250",
"PTEST": "1500",
"PMIN": "30",
"RESPSET": "1512",
"RESLEAK": "12.34",
"SN4": "1234",
"SN5": "12345",
# TIME DEFINITION
"DATETIME": time.strftime("%d/%m/%Y %H:%M:%S"),
"DATE": time.strftime("%d/%m/%Y"),
"TIME": time.strftime("%H:%M:%S"),
"YYYY": time.strftime("%Y"),
"YY": time.strftime("%y"),
"MO": time.strftime("%m"),
"DD": time.strftime("%d"),
"HH": time.strftime("%H"),
"MI": time.strftime("%M"),
"SS": time.strftime("%S"),
"JJJ": time.strftime("%j"),
# EXTRA DATA
"SHIFT": "1",
"STATION": "ST-TEN-1",
"OPERATOR": "MARIO",
"BADGE_NUM": "999",
}
app = QApplication(sys.argv)
# TEST STANDARD PRINTER
printer = Os_Label_Printer(config=config, name="label_printer")
printer.config_changed()
2024-10-29 12:17:15 +00:00
printer.print_label("ferrari_30x16_203.prn", context=context)