751 if values != None: |
751 if values != None: |
752 self.UserMapping[index]["values"] = values |
752 self.UserMapping[index]["values"] = values |
753 return True |
753 return True |
754 elif 0 <= subIndex < len(self.UserMapping[index]["values"]) and values != None: |
754 elif 0 <= subIndex < len(self.UserMapping[index]["values"]) and values != None: |
755 if "type" in values: |
755 if "type" in values: |
756 if self.IsStringType(values["type"]) and not self.IsStringType(self.UserMapping[index]["values"][subIndex]["type"]): |
756 if self.UserMapping[index]["struct"] & OD_IdenticalSubindexes: |
757 self.SetEntry(index, subIndex, "") |
757 if self.IsStringType(self.UserMapping[index]["values"][subIndex]["type"]): |
758 elif not self.IsStringType(values["type"]) and self.IsStringType(self.UserMapping[index]["values"][subIndex]["type"]): |
758 if self.IsRealType(values["type"]): |
759 self.SetEntry(index, subIndex, 0) |
759 for i in xrange(len(self.Dictionary[index])): |
|
760 self.SetEntry(index, i + 1, 0.) |
|
761 elif not self.IsStringType(values["type"]): |
|
762 for i in xrange(len(self.Dictionary[index])): |
|
763 self.SetEntry(index, i + 1, 0) |
|
764 elif self.IsRealType(self.UserMapping[index]["values"][subIndex]["type"]): |
|
765 if self.IsStringType(values["type"]): |
|
766 for i in xrange(len(self.Dictionary[index])): |
|
767 self.SetEntry(index, i + 1, "") |
|
768 elif not self.IsRealType(values["type"]): |
|
769 for i in xrange(len(self.Dictionary[index])): |
|
770 self.SetEntry(index, i + 1, 0) |
|
771 elif self.IsStringType(values["type"]): |
|
772 for i in xrange(len(self.Dictionary[index])): |
|
773 self.SetEntry(index, i + 1, "") |
|
774 elif self.IsRealType(values["type"]): |
|
775 for i in xrange(len(self.Dictionary[index])): |
|
776 self.SetEntry(index, i + 1, 0.) |
|
777 else: |
|
778 if self.IsStringType(self.UserMapping[index]["values"][subIndex]["type"]): |
|
779 if self.IsRealType(values["type"]): |
|
780 self.SetEntry(index, subIndex, 0.) |
|
781 elif not self.IsStringType(values["type"]): |
|
782 self.SetEntry(index, subIndex, 0) |
|
783 elif self.IsRealType(self.UserMapping[index]["values"][subIndex]["type"]): |
|
784 if self.IsStringType(values["type"]): |
|
785 self.SetEntry(index, subIndex, "") |
|
786 elif not self.IsRealType(values["type"]): |
|
787 self.SetEntry(index, subIndex, 0) |
|
788 elif self.IsStringType(values["type"]): |
|
789 self.SetEntry(index, subIndex, "") |
|
790 elif self.IsRealType(values["type"]): |
|
791 self.SetEntry(index, subIndex, 0.) |
760 self.UserMapping[index]["values"][subIndex].update(values) |
792 self.UserMapping[index]["values"][subIndex].update(values) |
761 return True |
793 return True |
762 return False |
794 return False |
763 |
795 |
764 """ |
796 """ |
1004 result = self.GetEntry(index, 1) |
1036 result = self.GetEntry(index, 1) |
1005 if result is not None and result in (0x9, 0xA, 0xB): |
1037 if result is not None and result in (0x9, 0xA, 0xB): |
1006 return True |
1038 return True |
1007 return False |
1039 return False |
1008 |
1040 |
|
1041 def IsRealType(self, index): |
|
1042 if index in (0x8, 0x11): |
|
1043 return True |
|
1044 elif 0xA0 <= index < 0x100: |
|
1045 result = self.GetEntry(index, 1) |
|
1046 if result is not None and result in (0x8, 0x11): |
|
1047 return True |
|
1048 return False |
|
1049 |
1009 #------------------------------------------------------------------------------- |
1050 #------------------------------------------------------------------------------- |
1010 # Type and Map Variable Lists |
1051 # Type and Map Variable Lists |
1011 #------------------------------------------------------------------------------- |
1052 #------------------------------------------------------------------------------- |
1012 |
1053 |
1013 def GetTypeList(self): |
1054 def GetTypeList(self): |