51 lines
1.2 KiB
Python
51 lines
1.2 KiB
Python
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()
|
|
printer.print_label("ferrari_30x16_203.prn", context=context)
|