@@ -55,14 +55,14 @@ class ExceptionTemplate(Exception):
55
55
def __call__ (self , * args ):
56
56
return self .__class__ (* (self .args + args ))
57
57
58
- class StarbitLowerZero (ExceptionTemplate ): pass
58
+ class StartbitLowerZero (ExceptionTemplate ): pass
59
59
class EncodingComplexMultiplexed (ExceptionTemplate ): pass
60
60
class MissingMuxSignal (ExceptionTemplate ): pass
61
61
class DecodingComplexMultiplexed (ExceptionTemplate ): pass
62
62
class DecodingFrameLength (ExceptionTemplate ): pass
63
63
64
64
@attr .s
65
- class ecu (object ):
65
+ class Ecu (object ):
66
66
"""
67
67
Contains one Boardunit/ECU
68
68
"""
@@ -295,7 +295,7 @@ def set_startbit(self, start_bit, bitNumbering=None, startLittle=None):
295
295
if start_bit < 0 :
296
296
print ("wrong start_bit found Signal: %s Startbit: %d" %
297
297
(self .name , start_bit ))
298
- raise StarbitLowerZero
298
+ raise StartbitLowerZero
299
299
self .start_bit = start_bit
300
300
301
301
def get_startbit (self , bit_numbering = None , start_little = None ):
@@ -418,7 +418,7 @@ def __str__(self):
418
418
419
419
420
420
@attr .s (cmp = False )
421
- class signal_group (object ):
421
+ class SignalGroup (object ):
422
422
"""
423
423
Represents signal-group, containing multiple Signals.
424
424
"""
@@ -467,7 +467,7 @@ def __getitem__(self, name):
467
467
468
468
469
469
@attr .s
470
- class decoded_signal (object ):
470
+ class DecodedSignal (object ):
471
471
"""
472
472
Contains a decoded signal (frame decoding)
473
473
@@ -691,7 +691,7 @@ def add_signal_group(self, Name, Id, signalNames):
691
691
:param int Id: Group id
692
692
:param list of str signalNames: list of Signal names to add. Non existing names are ignored.
693
693
"""
694
- newGroup = signal_group (Name , Id )
694
+ newGroup = SignalGroup (Name , Id )
695
695
self .signalGroups .append (newGroup )
696
696
for signal in signalNames :
697
697
signal = signal .strip ()
@@ -706,7 +706,7 @@ def signal_group_by_name(self, name):
706
706
707
707
:param str name: group name
708
708
:return: SignalGroup by name or None if not found.
709
- :rtype: signal_group
709
+ :rtype: SignalGroup
710
710
"""
711
711
for signalGroup in self .signalGroups :
712
712
if signalGroup .name == name :
@@ -1010,7 +1010,7 @@ def unpack(self, data, report_error=True):
1010
1010
returnDict = dict ()
1011
1011
1012
1012
for s , v in zip (self .signals , unpacked ):
1013
- returnDict [s .name ] = decoded_signal (v , s )
1013
+ returnDict [s .name ] = DecodedSignal (v , s )
1014
1014
1015
1015
return returnDict
1016
1016
@@ -1372,7 +1372,7 @@ def ecu_by_name(self, name):
1372
1372
Returns Boardunit by Name.
1373
1373
1374
1374
:param str name: BoardUnit name
1375
- :rtype: ecu or None
1375
+ :rtype: Ecu or None
1376
1376
"""
1377
1377
for test in self .ecus :
1378
1378
if test .name == name :
@@ -1384,7 +1384,7 @@ def glob_ecus(self, globStr):
1384
1384
Find ECUs by given glob pattern.
1385
1385
1386
1386
:param globStr: glob pattern to filter BoardUnits. See `fnmatch.fnmatchcase`.
1387
- :rtype: list of ecu
1387
+ :rtype: list of Ecu
1388
1388
"""
1389
1389
returnArray = []
1390
1390
for test in self .ecus :
@@ -1470,7 +1470,7 @@ def recalc_dlc(self, strategy):
1470
1470
def rename_ecu (self , old , newName ):
1471
1471
"""Rename ECU in the Matrix. Update references in all Frames.
1472
1472
1473
- :param str or ecu old: old name or ECU instance
1473
+ :param str or Ecu old: old name or ECU instance
1474
1474
:param str newName: new name
1475
1475
"""
1476
1476
if type (old ).__name__ == 'instance' :
@@ -1494,7 +1494,7 @@ def rename_ecu(self, old, newName):
1494
1494
def add_ecu (self , ecu ):
1495
1495
"""Add new ECU to the Matrix. Do nothing if ecu with the same name already exists.
1496
1496
1497
- :param ecu ecu: ECU name to add
1497
+ :param Ecu ecu: ECU name to add
1498
1498
"""
1499
1499
for bu in self .ecus :
1500
1500
if bu .name .strip () == ecu .name :
@@ -1504,7 +1504,7 @@ def add_ecu(self, ecu):
1504
1504
def del_ecu (self , ecu ):
1505
1505
"""Remove ECU from Matrix and all Frames.
1506
1506
1507
- :param str or ecu ecu: ECU instance or glob pattern to remove from list
1507
+ :param str or Ecu ecu: ECU instance or glob pattern to remove from list
1508
1508
"""
1509
1509
if type (ecu ).__name__ == 'instance' :
1510
1510
ecuList = [ecu ]
@@ -1526,11 +1526,11 @@ def update_ecu_list(self):
1526
1526
"""Check all Frames and add unknown ECUs to the Matrix ECU list."""
1527
1527
for frame in self .frames :
1528
1528
for transmit_ecu in frame .transmitters :
1529
- self .add_ecu (canmatrix .ecu (transmit_ecu ))
1529
+ self .add_ecu (canmatrix .Ecu (transmit_ecu ))
1530
1530
frame .update_receiver ()
1531
1531
for signal in frame .signals :
1532
1532
for receive_ecu in signal .receivers :
1533
- self .add_ecu (canmatrix .ecu (receive_ecu ))
1533
+ self .add_ecu (canmatrix .Ecu (receive_ecu ))
1534
1534
1535
1535
def rename_frame (self , old , newName ):
1536
1536
"""Rename Frame.
0 commit comments