BigBlueBox
An Inventory Management System for a NYLT Course or other Boy Scout Programs
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
QrInterface.h
Go to the documentation of this file.
1 #ifndef QRINTERFACE_H
2 #define QRINTERFACE_H
3 
4 //********************************************************************************
5 //* QR Code Plan
6 //********************************************************************************
7 // This class will act as an interface for the QrCode Lib.
8 // There will be differnt QrCode categories
9 // * Gear Items - Each Qr will point to a unique item.
10 // * Troop / Patrol Names - Each Qr will check out the gear to the patrol.
11 //
12 //
13 // The process for checking out an item will be as follows...
14 // 1. Scan the Item QrCode
15 // 2. Update Item info in needed
16 // 3. Scan Troop or Patrol QR code on the back of the participants name tag.
17 // 4. Repeat
18 //
19 // The process for checking in an item will be as follows...
20 // 1. Scan the Item QrCode.
21 // 2. Update the Item Info
22 // 3. Click "Check-In"
23 //
24 // ORDER OF SCANNING SHOULD NOT MATTER
25 // They should be able to scan a patrol or Item first.
26 //
27 //
28 //********************************************************************************
29 //
30 // QrCode String Format
31 // To help the program tell the difference between a Troop/Patrol QR and a Item QR,
32 // they need to be formated to a standered.
33 // This is the standard we will be using
34 //
35 // Troop/Patrol/Person
36 // "PID:<troop_ID> (2 digit hex):<patrol_ID> (2 digit hex):<personal_ID>(6 digit hex)
37 //
38 // Item
39 // "ITM:<catagory_num (4 digit hex)>:<item_id (6 digit hex)>"
40 //********************************************************************************
41 
42 #include "qr/QrCode.h"
43 #include <string>
44 #include <vector>
45 #include <QDebug>
47 {
48 public:
49  QrInterface();
50 
51  static QString strToSvg(QString s)
52  {
53  using namespace qrcodegen;
54  QrCode qr0 = QrCode::encodeText(s.toStdString().c_str(), QrCode::Ecc::MEDIUM);
55  std::string svg = qr0.toSvgString(4);
56 
57  return QString::fromStdString(svg);
58  }
59 
60 };
61 
62 #endif // QRINTERFACE_H
Definition: QrCode.h:40
static QString strToSvg(QString s)
Definition: QrInterface.h:51
Definition: QrInterface.h:46
std::string toSvgString(int border) const
Definition: QrCode.cpp:167
QrInterface()
Definition: QrInterface.cpp:3