PLCControler.py
changeset 420 c08d053b74b3
parent 391 07447ee3538e
child 421 9855343da6fc
equal deleted inserted replaced
419:8f97ed01a6a6 420:c08d053b74b3
  1226         project = self.GetProject(debug)
  1226         project = self.GetProject(debug)
  1227         if project is not None:
  1227         if project is not None:
  1228             return project.GetBaseType(type)
  1228             return project.GetBaseType(type)
  1229         return None
  1229         return None
  1230 
  1230 
  1231     # Return Base Types
       
  1232     def GetBaseTypes(self):
  1231     def GetBaseTypes(self):
  1233         return [value for value in TypeHierarchy.keys() if not value.startswith("ANY")]
  1232         '''
       
  1233         return the list of datatypes defined in IEC 61131-3.
       
  1234         TypeHierarchy_list has a rough order to it (e.g. SINT, INT, DINT, ...),
       
  1235         which makes it easy for a user to find a type in a menu.
       
  1236         '''
       
  1237         return [x for x,y in TypeHierarchy_list if not x.startswith("ANY")]
  1234 
  1238 
  1235     def IsOfType(self, type, reference, debug = False):
  1239     def IsOfType(self, type, reference, debug = False):
  1236         project = self.GetProject(debug)
  1240         project = self.GetProject(debug)
  1237         if project is not None:
  1241         if project is not None:
  1238             return project.IsOfType(type, reference)
  1242             return project.IsOfType(type, reference)