-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.xml
163 lines (120 loc) · 4.7 KB
/
module.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<module>
<Login f="nodata">
<Login>
<Users t="dropdown" f="user nocertainty noannotation"/>
<Log_in t="button" l="Control"/>
<Sign_up t="button" l="signup"/>
</Login>
</Login>
<Control f="nodata">
<Main f="noscroll">
<Create_New_Earth_Sample t="button" l="Earth_Sample"/>
<Scan_QR_Code t="button" lq="Earth_Sample"/>
<Existing_Earth_Sample t="list" f="nocertainty noannotation" e="Earth_Sample"/>
</Main>
<IDS>
<autonum/>
</IDS>
<search/>
</Control>
<Earth_Sample>
<Earth_Sample>
<connectToBluetooth t="button"/>
<Print_QR_Code t="button"/>
<Print_Barcode t="button"/>
<IGSN_Identifier f="id" t="input">
<str>
<pos>1</pos>
<fmt>$2 - </fmt>
</str>
</IGSN_Identifier>
<Material f="id" t="input">
<str>
<pos>2</pos>
<fmt>$2 </fmt>
</str>
</Material>
<Description t="input"/>
<gps/>
</Earth_Sample>
</Earth_Sample>
<logic>
String bluetoothMessagePrepend = "";
void connectToBluetooth() {
callback = "onBluetoothInput()";
delay = 0; //turns off reading from device
createBluetoothConnection(callback, delay);
setupmessage = "\n~JC\n";
writeBluetoothMessage(setupmessage);
bluetoothMessagePrepend = "Current Label Height: ";
feedbackMessage="! U1 getvar \"ezpl.label_length_max\"\n";
writeBluetoothMessage(feedbackMessage);
return;
}
void calibrate(){
setupmessage = "^XSY,Y\n~JC\n";
bluetoothMessagePrepend = "Current Label Height: ";
writeBluetoothMessage(setupmessage);
}
onBluetoothInput() {
btmessage = getBluetoothMessage();
showWarning("BLAH",bluetoothMessagePrepend+btmessage);
}
void printQR() {
String identityQuery = "SELECT uuid, response, aenttypename, createdby, datetime(createdat, 'localtime') FROM latestNonDeletedArchEntFormattedIdentifiers JOIN createdmodifiedatby using (uuid) WHERE uuid = {uuid}; ";
searchQuery = replaceFirst(identityQuery, "{uuid}", getUuid("Earth_Sample"));
FetchCallback printCallback = new FetchCallback() {
onFetch(result) {
message = "^XA^POI \n";
message += "^FO15,10^A0,30,30^FD{id}^FS \n";
message += "^FO15,45^A0,30,30^FD{aent}^FS \n";
message += "^FO15,80^A0,30,30^FD{createdat}^FS \n";
message += "^FO15,115^A0,30,30^FD{createdby}^FS \n";
message += "^FO15,145^A0,30,30^FD{modulename}^FS \n";
message += "^FO15,178^A0,30,30^FD{uuid}^FS \n";
message += "^FO450,30 \n";
message += "^BQ,2,5 \n";
message += "^FDHA,http://igsn.org/{uuid}^FS \n";
message += "^FO440,10^A0,20,20^FDigsn.org/{uuid}^FS \n";
message += "^XZ \n";
message = replaceFirst(message, "{uuid}", result.get(0));
message = replaceFirst(message, "{id}", result.get(1));
message = replaceFirst(message, "{aent}", result.get(2));
message = replaceFirst(message, "{createdby}", result.get(3));
message = replaceFirst(message, "{createdat}", result.get(4));
message = replaceFirst(message, "{moduleName}", getModuleName()+" "+getModuleVersion());
//setFieldValue("Earth_Sample/Earth_Sample/Printer_Code", message);
writeBluetoothMessage(message);
}
};
fetchOne(searchQuery, printCallback);
return;
}
void printBarcode() {
String identityQuery = "SELECT uuid, response, aenttypename, createdby, datetime(createdat, 'localtime') FROM latestNonDeletedArchEntFormattedIdentifiers JOIN createdmodifiedatby using (uuid) WHERE uuid = {uuid}; ";
searchQuery = replaceFirst(identityQuery, "{uuid}", getUuid("Earth_Sample"));
FetchCallback printCallback = new FetchCallback() {
onFetch(result) {
message = "\n^XA^PO^FO20,90^XGE:FAIMS-SM.PCX,1.1,1.1^FS^FO15,155^A0,15,15^FDwww.fedarch.org^FS\n";
message += "^FO50,0^BY3^BCN,85,N,N,N^FD{uuid}^FS\n";
message += "^FO140,90^A0,25,25^FD{aent}, {createdby}, {createdat}^FS\n";
message += "^FO140,120^A0,60,60^TBN,650,90^FD{id}^FS\n";
message += "^XZ\n";
message = replaceFirst(message, "{uuid}", result.get(0));
message = replaceFirst(message, "{id}", result.get(1));
message = replaceFirst(message, "{aent}", result.get(2));
message = replaceFirst(message, "{createdby}", result.get(3));
message = replaceFirst(message, "{createdat}", result.get(4));
message = replaceFirst(message, "{moduleName}", getModuleName()+" "+getModuleVersion());
//setFieldValue("Earth_Sample/Earth_Sample/Printer_Code", message);
writeBluetoothMessage(message);
}
};
fetchOne(searchQuery, printCallback);
return;
}
addOnEvent("Earth_Sample/Earth_Sample/connectToBluetooth", "click", "connectToBluetooth()");
addOnEvent("Earth_Sample/Earth_Sample/Print_QR_Code", "click", "printQR()");
addOnEvent("Earth_Sample/Earth_Sample/Print_Barcode", "click", "printBarcode()");
</logic>
</module>