523 if not entry_infos["struct"] & OD_MultipleSubindexes or subindex != 0: |
523 if not entry_infos["struct"] & OD_MultipleSubindexes or subindex != 0: |
524 subentry_infos = self.Manager.GetSubentryInfos(index, subindex) |
524 subentry_infos = self.Manager.GetSubentryInfos(index, subindex) |
525 typeinfos = self.Manager.GetEntryInfos(subentry_infos["type"]) |
525 typeinfos = self.Manager.GetEntryInfos(subentry_infos["type"]) |
526 if typeinfos: |
526 if typeinfos: |
527 bus_id = '.'.join(map(str, self.ParentWindow.GetBusId())) |
527 bus_id = '.'.join(map(str, self.ParentWindow.GetBusId())) |
|
528 var_name = "master_%04x_%02x" % (index, subindex) |
528 size = typeinfos["size"] |
529 size = typeinfos["size"] |
529 data = wx.TextDataObject(str(("%s%s.%d.%d"%(SizeConversion[size], bus_id, index, subindex), "location"))) |
530 data = wx.TextDataObject(str(("%s%s.%d.%d"%(SizeConversion[size], bus_id, index, subindex), "location", None, var_name, ""))) |
530 dragSource = wx.DropSource(self.SubindexGrid) |
531 dragSource = wx.DropSource(self.SubindexGrid) |
531 dragSource.SetData(data) |
532 dragSource.SetData(data) |
532 dragSource.DoDragDrop() |
533 dragSource.DoDragDrop() |
533 elif col == 0: |
534 elif col == 0: |
534 selected = self.IndexList.GetSelection() |
535 selected = self.IndexList.GetSelection() |
540 subentry_infos = self.Manager.GetSubentryInfos(index, subindex) |
541 subentry_infos = self.Manager.GetSubentryInfos(index, subindex) |
541 typeinfos = self.Manager.GetEntryInfos(subentry_infos["type"]) |
542 typeinfos = self.Manager.GetEntryInfos(subentry_infos["type"]) |
542 if subentry_infos["pdo"] and typeinfos: |
543 if subentry_infos["pdo"] and typeinfos: |
543 bus_id = '.'.join(map(str, self.ParentWindow.GetBusId())) |
544 bus_id = '.'.join(map(str, self.ParentWindow.GetBusId())) |
544 node_id = self.ParentWindow.GetCurrentNodeId() |
545 node_id = self.ParentWindow.GetCurrentNodeId() |
|
546 var_name = "%s_%04x_%02x" % (self.Manager.GetSlaveName(node_id), index, subindex) |
545 size = typeinfos["size"] |
547 size = typeinfos["size"] |
546 data = wx.TextDataObject(str(("%s%s.%d.%d.%d"%(SizeConversion[size], bus_id, node_id, index, subindex), "location"))) |
548 data = wx.TextDataObject(str(("%s%s.%d.%d.%d"%(SizeConversion[size], bus_id, node_id, index, subindex), "location", None, var_name, ""))) |
547 dragSource = wx.DropSource(self.SubindexGrid) |
549 dragSource = wx.DropSource(self.SubindexGrid) |
548 dragSource.SetData(data) |
550 dragSource.SetData(data) |
549 dragSource.DoDragDrop() |
551 dragSource.DoDragDrop() |
550 event.Skip() |
552 event.Skip() |
551 |
553 |