Skip to content

Commit a6456f0

Browse files
committed
qtvcp -core: change the function names to more qt like
camelback names are more efficient and Qt like. keep the old names for compatibility sake for now.
1 parent bd87edd commit a6456f0

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

lib/python/qtvcp/core.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ def setUpdateRate(self, cyclerate):
166166
QPin.update_start(cyclerate)
167167

168168
def newpin(self, *a, **kw):
169+
return self.newPin(*a,**kw)
170+
def newPin(self, *a, **kw):
169171
try:
170172
p = QPin(_hal.component.newpin(self.comp, *a, **kw))
171173
except ValueError as e:
@@ -189,34 +191,44 @@ def newpin(self, *a, **kw):
189191
if log.getEffectiveLevel() == logger.VERBOSE:
190192
raise
191193
t = inspect.getframeinfo(inspect.currentframe().f_back)
192-
log.error("Qhal: Error making new HAL pin: {}\n {}\n Line {}\n Function: {}".
194+
log.error("QHal: Error making new HAL pin: {}\n {}\n Line {}\n Function: {}".
193195
format(e, t[0], t[1], t[2]))
194-
log.error("Qhal: {}".format(traceback.format_exc()))
196+
log.error("QHal: {}".format(traceback.format_exc()))
195197
p = DummyPin(*a, ERROR=e)
196198
p.prefix = self.comp.getprefix()
197199
return p
198200

199-
def getpin(self, *a, **kw): return QPin(_hal.component.getpin(self.comp, *a, **kw))
201+
def getpin(self, *a, **kw):
202+
return self.getPinObject(self, *a, **kw)
203+
def getPinObject(self, *a, **kw):
204+
return QPin(_hal.component.getpin(self.comp, *a, **kw))
200205

201206
def getvalue(self, name):
207+
return self.getValue(self, name)
208+
def getValue(self, name):
202209
try:
203210
return hal.get_value(name)
204211
except Exception as e:
205-
raise("Qhal: Error getting value of {}\n {}".format(name, e))
212+
raise("QHal: Error getting value of {}\n {}".format(name, e))
206213

207214
def setp(self,name, value):
215+
return self.setPin(self,name, value)
216+
def setPin(self,name, value):
208217
try:
209218
return hal.set_p(name,value)
210219
except Exception as e:
211-
raise("Qhal: Error setting pin {} to {}\n {}".format(name,value, e))
220+
raise("QHal: Error setting pin {} to {}\n {}".format(name,value, e))
212221

213222
def sets(self,name, value):
223+
return self.setSignal(self,name, value)
224+
def setSignal(self,name, value):
214225
try:
215226
return hal.set_s(name,value)
216227
except Exception as e:
217-
raise("Qhal: Error setting signal {} to {}\n {}".format(name,value, e))
228+
raise("QHal: Error setting signal {} to {}\n {}".format(name,value, e))
218229

219-
def exit(self, *a, **kw): return self.comp.exit(*a, **kw)
230+
def exit(self, *a, **kw):
231+
return self.comp.exit(*a, **kw)
220232

221233
# find a unique HAL pin name by adding '-x' to the base name
222234
# x being an ever increasing number till name is unique

0 commit comments

Comments
 (0)