Closedown
This commit is contained in:
@@ -1,12 +1,57 @@
|
||||
|
||||
class Detector(ReadonlyRegisterBase)
|
||||
def __init__(self):
|
||||
self.status = -1
|
||||
self.det1 = -1
|
||||
self.det2 = -1
|
||||
self.det3 = -1
|
||||
self.det4 = -1
|
||||
|
||||
|
||||
onewire.flush()
|
||||
onewire.write("get,owb,listall1\n")
|
||||
|
||||
count = 1
|
||||
while (True):
|
||||
print onewire.waitString("\n", 1000)
|
||||
class Esera(TcpDevice):
|
||||
def __init__(self, name, server, timeout = 1000, retries = 1):
|
||||
TcpDevice.__init__(self, name, server)
|
||||
setMode(self.Mode.FullDuplex)
|
||||
self.detectors = []
|
||||
for i in range(30):
|
||||
self.detectors.append(Detector())
|
||||
|
||||
print count
|
||||
count = count + 1
|
||||
|
||||
def start(self):
|
||||
onewire.write("set,sys,run,1\n")
|
||||
|
||||
def stop(self):
|
||||
onewire.write("set,sys,run,0\n")
|
||||
|
||||
def list(self):
|
||||
onewire.write("get,owb,listall1\n")
|
||||
|
||||
def doInitialize(self):
|
||||
self.stop()
|
||||
time.sleep(0.1)
|
||||
self.flush()
|
||||
self.detectors = []
|
||||
for i in range(30):
|
||||
self.detectors.append(Detector())
|
||||
self.list()
|
||||
self.start()
|
||||
|
||||
def onString(self, str):
|
||||
print str
|
||||
|
||||
|
||||
|
||||
|
||||
#count = 1
|
||||
#while (True):
|
||||
# print onewire.waitString("\n", 1000)#
|
||||
#
|
||||
# print count
|
||||
# count = count + 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_device(Esera("onewire", "129.129.126.100:1000"), force = True)
|
||||
Reference in New Issue
Block a user