commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8450 - in grc/trunk/src: grc/elements grc_gnuradio


From: jblum
Subject: [Commit-gnuradio] r8450 - in grc/trunk/src: grc/elements grc_gnuradio
Date: Mon, 19 May 2008 15:38:29 -0600 (MDT)

Author: jblum
Date: 2008-05-19 15:38:29 -0600 (Mon, 19 May 2008)
New Revision: 8450

Modified:
   grc/trunk/src/grc/elements/Element.py
   grc/trunk/src/grc/elements/FlowGraph.py
   grc/trunk/src/grc/elements/Param.py
   grc/trunk/src/grc_gnuradio/FlowGraph.py
   grc/trunk/src/grc_gnuradio/Param.py
Log:
update flagging

Modified: grc/trunk/src/grc/elements/Element.py
===================================================================
--- grc/trunk/src/grc/elements/Element.py       2008-05-19 21:30:58 UTC (rev 
8449)
+++ grc/trunk/src/grc/elements/Element.py       2008-05-19 21:38:29 UTC (rev 
8450)
@@ -25,6 +25,7 @@
        def __init__(self, parent=None):
                self._parent = parent
                self._error_messages = []
+               self.flag()
                
        def test(self):
                """
@@ -71,6 +72,17 @@
                exit(err_str)           
                
        ##############################################
+       ## Update flagging
+       ##############################################                  
+       def is_flagged(self): return self._flag
+       def flag(self): 
+               self._flag = True
+               if self.get_parent(): self.get_parent().flag()
+       def deflag(self): 
+               self._flag = False
+               if self.get_parent(): self.get_parent().deflag()        
+               
+       ##############################################
        ## Type testing methods
        ##############################################          
                

Modified: grc/trunk/src/grc/elements/FlowGraph.py
===================================================================
--- grc/trunk/src/grc/elements/FlowGraph.py     2008-05-19 21:30:58 UTC (rev 
8449)
+++ grc/trunk/src/grc/elements/FlowGraph.py     2008-05-19 21:38:29 UTC (rev 
8450)
@@ -86,6 +86,7 @@
                @param key the block key
                @return the new block or None if not found
                """
+               self.flag()
                if key not in self.get_parent().get_block_keys(): return None
                block = self.get_parent().get_new_block(self, key)              
                self.get_elements().append(block)
@@ -99,6 +100,7 @@
                @throw Exception bad connection
                @return the new connection
                """
+               self.flag()
                connection = self.get_parent().Connection(self, porta, portb)
                self.get_elements().append(connection)
                return connection
@@ -110,6 +112,7 @@
                If the element is a block, remove its connections.
                If the element is a connection, just remove the connection.
                """
+               self.flag()
                if element not in self.get_elements(): return
                #found a port, set to parent signal block
                if element.is_source() or element.is_sink():                    
        

Modified: grc/trunk/src/grc/elements/Param.py
===================================================================
--- grc/trunk/src/grc/elements/Param.py 2008-05-19 21:30:58 UTC (rev 8449)
+++ grc/trunk/src/grc/elements/Param.py 2008-05-19 21:38:29 UTC (rev 8450)
@@ -181,7 +181,9 @@
                        self.set_value(value)
                return value
        
-       def set_value(self, value): self._value = str(value) #must be a string
+       def set_value(self, value): 
+               self.flag()
+               self._value = str(value) #must be a string
        
        def get_type(self): return 
self.get_parent().resolve_dependencies(self._type)
        

Modified: grc/trunk/src/grc_gnuradio/FlowGraph.py
===================================================================
--- grc/trunk/src/grc_gnuradio/FlowGraph.py     2008-05-19 21:30:58 UTC (rev 
8449)
+++ grc/trunk/src/grc_gnuradio/FlowGraph.py     2008-05-19 21:38:29 UTC (rev 
8450)
@@ -33,8 +33,8 @@
                @throw Exception bad expression
                @return the evaluated data
                """
-               if not hasattr(self, '_update_flag') or self._update_flag:
-                       self._update_flag = False               
+               if self.is_flagged():
+                       self.deflag()           
                        #reload namespace
                        self.n = n = dict() #namespace
                        #load imports

Modified: grc/trunk/src/grc_gnuradio/Param.py
===================================================================
--- grc/trunk/src/grc_gnuradio/Param.py 2008-05-19 21:30:58 UTC (rev 8449)
+++ grc/trunk/src/grc_gnuradio/Param.py 2008-05-19 21:38:29 UTC (rev 8450)
@@ -35,15 +35,7 @@
                'source_pad_key', 'sink_pad_key',
                'grid_pos', 'import',
        ]
-       
-       def set_value(self, value):
-               """!
-               Set the value and update the flow graph's update flag.
-               @param value the new value
-               """
-               self.get_parent().get_parent()._update_flag = True
-               _Param.set_value(self, value)
-       
+               
        def evaluate(self):
                """!
                Evaluate the value.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]