19 if (command.
delay != 0.0f)
continue;
22 if (command.
name ==
"PrintReceipt")
24 ZeroMemory(&
hBitmap,
sizeof(HBITMAP));
26 hBitmap =
static_cast<HBITMAP
>(LoadImage(
nullptr, L
"Textures/Receipt/logo.bmp", IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE | LR_VGACOLOR));
35 ZeroMemory(&di,
sizeof(DOCINFO));
36 di.cbSize =
sizeof(DOCINFO);
37 di.lpszDocName = TEXT(
"Receipt") ;
40 cxpage = GetDeviceCaps(prn, HORZRES);
41 cypage = GetDeviceCaps(prn, VERTRES);
42 hdcMem = CreateCompatibleDC(prn);
47 SetMapMode(prn, MM_ISOTROPIC);
51 SetViewportOrgEx(prn, 0, 0,
nullptr);
58 StretchBlt(prn, 0, topmargin,
bxWidth,
bxHeight,
hdcMem, 0, 0,
bxWidth,
bxHeight, SRCCOPY);
65 font = CreateFontA(48, 0, 0, 0, FW_BOLD,
false,
false,
false, 0, 0, 0, 0, 0,
"Microsoft Sans Serif");
66 SelectObject(prn, font);
68 lRect.top = topmargin;
70 lRect.bottom = topmargin;
73 std::string content =
"PARAGALACTIC\nATTRACTIONS";
74 DrawTextA(prn, content.c_str(), -1, &lRect, DT_CENTER);
77 font = CreateFontA(34, 0, 0, 0, FW_BOLD,
true,
false,
false, 0, 0, 0, 0, 0,
"Microsoft Sans Serif");
78 SelectObject(prn, font);
80 lRect.top = topmargin;
82 lRect.bottom = topmargin;
85 content =
"MORE THAN JUST A RIDE";
86 DrawTextA(prn, content.c_str(), -1, &lRect, DT_CENTER);
89 font = CreateFontA(42, 0, 0, 0, FW_NORMAL,
false,
false,
false, 0, 0, 0, 0, 0,
"Microsoft Sans Serif");
90 SelectObject(prn, font);
92 lRect.top = topmargin;
94 lRect.bottom = topmargin;
97 char scenariotimeC[99];
99 std::string scenariotime = scenariotimeC;
103 timeinfo = localtime(&rawtime);
105 strftime(dateC, 99,
"%m/%d/%Y", timeinfo);
106 std::string date = dateC;
108 strftime(timeC, 99,
"%H:%M:%S", timeinfo);
109 std::string time = timeC;
114 content =
"\"WALK IN THE PARK\"\nDATE: " + date +
"\nTIME: " + time +
"\nDURATION: " + scenariotime +
"\nSCORE: " + scorestr;
115 DrawTextA(prn, content.c_str(), -1, &lRect, DT_LEFT);
132 font = CreateFontA(36, 0, 0, 0, FW_NORMAL,
false,
false,
false, 0, 0, 0, 0, 0,
"Microsoft Sans Serif");
133 SelectObject(prn, font);
135 lRect.top = topmargin;
136 topmargin += 36 * 18;
137 lRect.bottom = topmargin;
140 content =
"Please check for your free cockpit video recording after your flight. Share it with your friends!\n\nparagalactic.com?v=" +
bus->
receiptNumber +
"\n_________________________\nBring us to your next birthday party or event!\n\nparagalactic.com/Booking\n\nUse discount code:\n\n" +
bus->
receiptNumber +
"\n\nand receive";
141 DrawTextA(prn, content.c_str(), -1, &lRect, DT_CENTER | DT_WORDBREAK);
144 font = CreateFontA(48, 0, 0, 0, FW_BOLD,
false,
false,
false, 0, 0, 0, 0, 0,
"Microsoft Sans Serif");
145 SelectObject(prn, font);
147 lRect.top = topmargin;
149 lRect.bottom = topmargin;
152 content =
"$50 OFF!";
153 DrawTextA(prn, content.c_str(), -1, &lRect, DT_CENTER);
169 HDC
hdc = CreateDC(L
"WINSPOOL\0", L
"hp LaserJet 1320 PCL 5",
nullptr,
nullptr);
171 hdc = CreateDC(L
"WINSPOOL\0", L
"POS58",
nullptr,
nullptr);
std::vector< Command > commandStream
static HDC GetPrinterDC()
okay, the portable keyboard numbers don't work like the outside keypad because the outside keypad is ...
std::string name
command name
void Initialize(Logger *logger, Bus *prmBus, HWND hWnd)
std::string receiptNumber
float delay
wait number of seconds before executing command