From: Tero K. <te...@us...> - 2005-08-16 14:01:27
|
Update of /cvsroot/openexvis/openexvis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23924 Modified Files: ChangeLog openexvis.py Log Message: Some box size adjustments. Correct variable value shown in evaluations. Index: openexvis.py =================================================================== RCS file: /cvsroot/openexvis/openexvis/openexvis.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- openexvis.py 15 Aug 2005 23:36:15 -0000 1.14 +++ openexvis.py 16 Aug 2005 14:01:16 -0000 1.15 @@ -192,6 +192,7 @@ self.oevWindow.queue_draw() #print "\nDEBUG: The data:\n", visinfo self.clear_visualization_area() + self.cur_vars = {} for cmd in visinfo: #print "DEBUG: cmd == ", cmd if cmd[0] == 'OUTPUT': @@ -202,8 +203,13 @@ # cmd[1] is the constant list. self.draw_show_constants(cmd[1]) elif cmd[0] == 'SHOW_VARIABLES': - # cmd[1] is the variable list. - self.draw_show_variables(cmd[1]) + # cmd[1] is the variable list, where: + # [0] is the variable name to store to. + # [1] is the variable's new value. + # [2] is the variable's old value. + for v in cmd[1]: + self.cur_vars[v[0]] = [v[1], v[2]] + self.draw_show_variables(True) elif cmd[0] == 'SHOW_STORING': # cmd[1] is a constant to store to a variable. # cmd[2] is the variable to store to. @@ -333,16 +339,17 @@ # NOTE: To grok the following draw_show_* methods, see do_frame_pixmap. def draw_show_eval(self, left, sign, right, result): + """Store the steps to draw an evaluation to self.vis_steps.""" # Create a pixmap for the result and the sign. # The result. res_x = self.eval_result_pos[0] res_ex = self.eval_result_pos[0] + self.gridw * 2 # Hack to delay a bit res_y = self.eval_result_pos[1] - res_w = self.gridw * 3 + res_w = self.gridw * 2 # The sign. sx = self.eval_sign_pos[0] sy = self.eval_sign_pos[1] - sw = self.gridw * 2 + sw = self.gridw * 1 stxt = self.vArea.create_pango_layout(sign) # Height is same for both h = self.gridh @@ -360,6 +367,7 @@ # Names to use the correct pixmaps. result = 'result_' + result # Create the animation. + self.draw_show_variables(False) self.vis_steps.append([left, \ self.eval_left_pos[0], self.eval_left_pos[1]]) self.vis_steps.append([sign, \ @@ -369,24 +377,27 @@ self.vis_steps.append([result, \ self.eval_result_pos[0], self.eval_result_pos[1]]) - def draw_show_variables(self, cur_vars): - """Store displaying the variables in the visualization pixmap.""" + def draw_show_variables(self, old): + """Store displaying the variables to self.vis_steps.""" pos = 0 - for v in cur_vars: + for name, value in self.cur_vars.iteritems(): # Variable name. nx = self.var_name_pos[0] ny = self.var_name_pos[1] - (self.gridh * pos) - nw = self.gridw * 5 - ntxt = self.vArea.create_pango_layout(v[0]) + nw = self.gridw * 4 + ntxt = self.vArea.create_pango_layout(name) # Variable value. vx = self.var_value_pos[0] vy = self.var_value_pos[1] - (self.gridh * pos) vw = self.gridw * 2 - vtxt = self.vArea.create_pango_layout(v[2]) + if old: + vtxt = self.vArea.create_pango_layout(value[1]) + else: + vtxt = self.vArea.create_pango_layout(value[0]) # Height is same for both h = self.gridh - pm1 = v[0] - pm2 = v[0] + '_value' + pm1 = name + pm2 = name + '_value' self.create_element_pixmap(pm1, nx, ny, \ self.var_color, nw, h, ntxt) self.create_element_pixmap(pm2, vx, vy, \ Index: ChangeLog =================================================================== RCS file: /cvsroot/openexvis/openexvis/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChangeLog 15 Aug 2005 23:36:15 -0000 1.11 +++ ChangeLog 16 Aug 2005 14:01:16 -0000 1.12 @@ -5,6 +5,7 @@ * Internal restructuring * Improve the animation a lot + * Correct variable values shown when visualizing an evaluation * The screen is now cleaned up when a new file is loaded * The output area is cleared when beginning a new visualization * Fix showing integer calculation result |