-
Notifications
You must be signed in to change notification settings - Fork 0
/
S5PrinterData.py
58 lines (45 loc) · 1.9 KB
/
S5PrinterData.py
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
class S5PrinterData(object):
_rif=""
_registeredMachineNumber=""
_auditMemoryNumber=0
_auditMemoryTotalCapacity=0
_auditMemoryFreeCapacity=0
_numberRegisteredDocuments=0
def __init__(self, trama):
if (trama != None):
if (len(trama) > 0):
try:
_arrayParameter=str(trama[1:-1]).split(chr(0X0A))
if (len(_arrayParameter) >= 5):
self._setRIF(_arrayParameter[0][2:])
self._setRegisteredMachineNumber(_arrayParameter[1])
self._setNumberMemoryAudit(int(_arrayParameter[2]))
self._setCapacityTotalMemoryAudit(int(_arrayParameter[3]))
self._setAuditMemoryFreeCapacity(int(_arrayParameter[4]))
self._setNumberDocumentRegisters(int(_arrayParameter[5]))
except (ValueError):
return
def RIF(self):
return self._rif
def RegisteredMachineNumber(self):
return self._registeredMachineNumber
def AuditMemoryNumber(self):
return self._auditMemoryNumber
def AuditMemoryTotalCapacity(self):
return self._auditMemoryTotalCapacity
def AuditMemoryFreeCapacity(self):
return self._auditMemoryFreeCapacity
def NumberRegisteredDocuments(self):
return self._numberRegisteredDocuments
def _setRIF(self, RIF):
self._rif = RIF
def _setRegisteredMachineNumber(self, registeredMachineNumber):
self._registeredMachineNumber = registeredMachineNumber
def _setNumberMemoryAudit(self, numberMemoryAudit):
self._auditMemoryNumber = numberMemoryAudit
def _setCapacityTotalMemoryAudit(self, capacityTotalMemoryAudit):
self._auditMemoryTotalCapacity = capacityTotalMemoryAudit
def _setAuditMemoryFreeCapacity(self, pAuditMemoryFreeCapacity):
self._auditMemoryFreeCapacity = pAuditMemoryFreeCapacity
def _setNumberDocumentRegisters(self, numberDocumentRegisters):
self._numberRegisteredDocuments = numberDocumentRegisters