-
Notifications
You must be signed in to change notification settings - Fork 20
/
TODO
64 lines (46 loc) · 1.79 KB
/
TODO
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
Add default view format to config.py for io.view()
---------------------------------------
NOTE: the methods below should all be in input_mask() form, right? We're moving away from camelCaps.
-----------------------
Implement __eq__ on _HPGL
-----------------------
Write more examples!
-----------------------
Write more tests!!
-----------------------
The following HPGL commands are pending:
def inputMask(e = 233, s = 0, p = 0):
"""
Set masks for Error LED, Status byte, and Positive serial poll.
Whatever.
"""
return 'IM%d,%d,%d%s' % (e, s, p, TERMINATOR)
def invokeCharSlant(slot = 0, left = None):
if left:
return 'IV%d,%d%s' % (slot, left)
else:
return 'IV%d%d' % (slot, TERMINATOR)
def defineKey(key = None, function = None):
if key:
if function:
return 'KY%d,%d%s' % (key, function, TERMINATOR)
else:
return 'KY%d%s' % (key, TERMINATOR)
else:
return 'KY%s' % (TERMINATOR)
def escapeSetPlotterConfiguration(maxBufSize, dtrControl):
"""
Enables or disables hardwire handshake mode, monitor mode,
and data transmission mode.
maxBufSize: sets maximum buffer size
dtrControl: Data Terminal Ready (CD) line contro.
A number in the range of 0-31
WTF???
"""
return "%c.@[(%d);(%d)];" % (chr(27), maxBufSize, dtrControl)
def escapeXoff(char='19', interchar_speed=0):
"""DCI that tells the plotter what the Xoff character will be."""
return chr(27) + '.N' + str(interchar_speed) + ';' + str(char) + ':'
def escapeHS2(minbytes=81, xon='17' ):
"""Set hand shake mode 2."""
return chr(27) + '.I' + str(minbytes) + ';' + ';' + str(xon) + ':'