read coils 6
This commit is contained in:
@@ -16,6 +16,8 @@ class ProcessImage(Condition):
|
||||
self.numCoils = numCoils
|
||||
self.coils = []
|
||||
self.shadowCoils = [ None ] * numCoils
|
||||
self.readCoils = [ None ] * numCoils
|
||||
self.readShadowCoils = [ None ] * numCoils
|
||||
|
||||
self.numDiscreteInputs = numDiscreteInputs
|
||||
self.discreteInputs = []
|
||||
@@ -31,7 +33,7 @@ class ProcessImage(Condition):
|
||||
return self.initialized
|
||||
|
||||
def hasPendingInputChanges(self):
|
||||
return (self.discreteInputs != self.shadowDiscreteInputs) or (self.analogInputs != self.shadowAnalogInputs)
|
||||
return (self.discreteInputs != self.shadowDiscreteInputs) or (self.analogInputs != self.shadowAnalogInputs) or (self.readCoils != self.readShadowCoils)
|
||||
|
||||
def hasPendingOutputChanges(self):
|
||||
return self.shadowCoils != self.coils
|
||||
@@ -56,7 +58,9 @@ class ProcessImage(Condition):
|
||||
def setCoils(self, coils):
|
||||
if not self.initialized:
|
||||
raise NotInitializedException
|
||||
self.coils = coils
|
||||
self.readCoils = coils
|
||||
if self.coils == []:
|
||||
self.coils = coils
|
||||
|
||||
def setCoil(self, coilNum, value):
|
||||
if not self.initialized:
|
||||
@@ -67,8 +71,8 @@ class ProcessImage(Condition):
|
||||
def getChangedCoils(self):
|
||||
if not self.initialized:
|
||||
raise NotInitializedException
|
||||
changedCoils = zippingFilter(self.coils, self.shadowCoils)
|
||||
# self.shadowCoils = self.coils
|
||||
changedCoils = zippingFilter(self.coils, self.readCoils)
|
||||
self.readShadowCoils = self.coils
|
||||
return changedCoils
|
||||
|
||||
def getCoils(self):
|
||||
|
||||
Reference in New Issue
Block a user