Ejemplo n.º 1
0
    def __init__(self, xml_slave):
        self.InitCmds = list()
        self.Mailbox = None
        self.DC = None

        self.name_in_res = YoUtil.get_xml_node_as_text(xml_slave,
                                                       'Info/NameInResource')
        self.device_name = YoUtil.get_xml_node_as_text(xml_slave, 'Info/Name')
        self.ProductName = YoUtil.get_xml_node_as_text(xml_slave,
                                                       'Info/ProductName')
        self.vendor_id = YoUtil.get_xml_node_as_int(xml_slave, 'Info/VendorId')
        self.productCode = YoUtil.get_xml_node_as_int(xml_slave,
                                                      'Info/ProductCode')
        self.revisionNo = YoUtil.get_xml_node_as_int(xml_slave,
                                                     'Info/RevisionNo')

        self.ProcessData_Send_BitStart = YoUtil.get_xml_node_as_int(
            xml_slave, 'ProcessData/Send/BitStart')
        self.ProcessData_Send_BitLength = YoUtil.get_xml_node_as_int(
            xml_slave, 'ProcessData/Send/BitLength')
        self.ProcessData_Recv_BitStart = YoUtil.get_xml_node_as_int(
            xml_slave, 'ProcessData/Recv/BitStart')
        self.ProcessData_Recv_BitLength = YoUtil.get_xml_node_as_int(
            xml_slave, 'ProcessData/Recv/BitLength')

        self.load_initCmds(xml_slave)
        self.load_mailbox(xml_slave)
        self.load_DC(xml_slave)
Ejemplo n.º 2
0
    def __init__(self, xml_mailbox):
        self.Protocols = list()
        self.CoEInitCmds = None
        self.Send_Start = None
        self.Send_Length = None
        self.Recv_Start = None
        self.Recv_Length = None
        self.Recv_PollTime = None
        self.Recv_StatusBitAddr = None

        self.Send_Start = YoUtil.get_xml_node_as_int(xml_mailbox, 'Send/Start')
        self.Send_Length = YoUtil.get_xml_node_as_int(xml_mailbox,
                                                      'Send/Length')
        self.Recv_Start = YoUtil.get_xml_node_as_int(xml_mailbox, 'Recv/Start')
        self.Recv_Length = YoUtil.get_xml_node_as_int(xml_mailbox,
                                                      'Recv/Length')
        self.Recv_PollTime = YoUtil.get_xml_node_as_int(
            xml_mailbox, 'Recv/PollTime')
        self.Recv_StatusBitAddr = YoUtil.get_xml_node_as_int(
            xml_mailbox, 'Recv/StatusBitAddr')

        xml_Protocol_list = xml_mailbox.findall('Protocol')
        if xml_Protocol_list != None:
            for xml_protocol in xml_Protocol_list:
                self.Protocols.append(xml_protocol.text)

        xml_initCmd_list = xml_mailbox.findall('CoE/InitCmds/InitCmd')
        if xml_initCmd_list != None:
            self.CoEInitCmds = list()
            for xml_initCmd in xml_initCmd_list:
                initcmd = InitCmd(xml_initCmd)
                self.CoEInitCmds.append(initcmd)
Ejemplo n.º 3
0
	def __init__(self,xml_dc):
		self.ReferenceClock = YoUtil.get_xml_node_as_bool(xml_dc,'ReferenceClock')
		self.CycleTime0 = YoUtil.get_xml_node_as_int(xml_dc,'CycleTime0')
		self.CycleTime1 = YoUtil.get_xml_node_as_int(xml_dc,'CycleTime1')
		self.ShiftTime = YoUtil.get_xml_node_as_int(xml_dc,'ShiftTime')