# HG changeset patch
# User b.taylor@willowglen.ca
# Date 1251989762 21600
# Node ID c08d053b74b30d828b345818f0d0e356cc1ef50c
# Parent  8f97ed01a6a617008d617985cefb12770209fe4a
order the result of GetBaseTypes to make types easier to find in the UI

diff -r 8f97ed01a6a6 -r c08d053b74b3 PLCControler.py
--- a/PLCControler.py	Wed Sep 02 14:55:22 2009 -0600
+++ b/PLCControler.py	Thu Sep 03 08:56:02 2009 -0600
@@ -1228,9 +1228,13 @@
             return project.GetBaseType(type)
         return None
 
-    # Return Base Types
     def GetBaseTypes(self):
-        return [value for value in TypeHierarchy.keys() if not value.startswith("ANY")]
+        '''
+        return the list of datatypes defined in IEC 61131-3.
+        TypeHierarchy_list has a rough order to it (e.g. SINT, INT, DINT, ...),
+        which makes it easy for a user to find a type in a menu.
+        '''
+        return [x for x,y in TypeHierarchy_list if not x.startswith("ANY")]
 
     def IsOfType(self, type, reference, debug = False):
         project = self.GetProject(debug)