示例#1
0
 def tostring(self, type, indent=0):
     ret = ("Slave ('%s','%s', (0x%x,0x%x,0x%x) -> '%s') " %
            (YoUtil.str_strip(
                self.name_in_res), YoUtil.str_strip(
                    self.device_name), self.vendor_id, self.productCode,
             self.revisionNo, YoUtil.str_strip(self.ProductName))) + '\n'
     ret += YoUtil.get_indent(indent + 1) + 'ProcessData '
     if self.ProcessData_Send_BitStart != None:
         ret += ('Send BitStart=%d, BitLength=%d' %
                 (self.ProcessData_Send_BitStart,
                  self.ProcessData_Send_BitLength))
     if self.ProcessData_Recv_BitStart != None:
         ret += (', Recv BitStart=%d, BitLength=%d' %
                 (self.ProcessData_Recv_BitStart,
                  self.ProcessData_Recv_BitLength))
     ret += '\n'
     if self.DC != None:
         ret += self.DC.tostring(indent + 1)
     if self.Mailbox != None:
         ret += '\n' + self.Mailbox.tostring(indent + 1)
     if type >= 1:
         ret += ("%sInitCmds count= %d" %
                 (YoUtil.get_indent(indent + 1), len(self.InitCmds))) + '\n'
         self.InitCmds = sorted(self.InitCmds, key=attrgetter('Ado'))
         for initCmd in self.InitCmds:
             str = initCmd.tostring(indent + 2)
             ret += (str)
     return ret
示例#2
0
 def tostring(self, type, indent=0):
     ret = ("Master name='%s' " % (YoUtil.str_strip(self.name))) + '\n'
     ret += ("%sInitCmds count= %d" %
             (YoUtil.get_indent(indent + 1), len(self.InitCmds))) + '\n'
     self.InitCmds = sorted(self.InitCmds, key=attrgetter('Ado'))
     for initCmd in self.InitCmds:
         str = initCmd.tostring(indent + 2)
         ret += (str)
     return ret
示例#3
0
 def tostring(self, indent=0):
     if self.Ado != None:
         ret = YoUtil.get_indent(
             indent
         ) + 'InitCmd Ado,Adp=(0x%4.4x,0x%4.4x) [%s] - "%s" - Data=[%s] Cnt=[%s] Cmd=[%s] CompleteAccess=[%s]' % (
             self.Ado, self.Adp, self.get_transitions(),
             YoUtil.str_strip(self.Comment), self.Data,
             YoUtil.str_strip(self.Cnt), YoUtil.str_strip(
                 self.Cmd), YoUtil.str_strip(self.CompleteAccess)) + '\n'
     elif self.Index != None:
         ret = YoUtil.get_indent(
             indent
         ) + 'InitCmd Index=(0x%4.4x.%d) [%s] - "%s" - Data=[%s] Cnt=[%s] Cmd=[%s] CompleteAccess=[%s]' % (
             self.Index, self.SubIndex, self.get_transitions(),
             YoUtil.str_strip(self.Comment), self.Data,
             YoUtil.str_strip(self.Cnt), YoUtil.str_strip(
                 self.Cmd), YoUtil.str_strip(self.CompleteAccess)) + '\n'
     return ret