/[escript]/trunk/pyvisi/py_src/datacollector.py
ViewVC logotype

Diff of /trunk/pyvisi/py_src/datacollector.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1137 by jongui, Tue Apr 17 05:36:24 2007 UTC revision 1138 by gross, Mon May 14 04:15:04 2007 UTC
# Line 66  class DataCollector: Line 66  class DataCollector:
66          if(self.__source == Source.XML):          if(self.__source == Source.XML):
67              # Check whether the specified file exists, otherwise exit.              # Check whether the specified file exists, otherwise exit.
68              if not(os.access(file_name, os.F_OK)):              if not(os.access(file_name, os.F_OK)):
69                  print "\nERROR: '%s' file does NOT exists.\n" % file_name                  raise IOError("ERROR: '%s' file does NOT exists." % file_name)      
                 sys.exit(1)          
70    
71              self.__vtk_xml_reader.SetFileName(file_name)              self.__vtk_xml_reader.SetFileName(file_name)
72              # Update must be called after SetFileName to make the reader              # Update must be called after SetFileName to make the reader
# Line 138  class DataCollector: Line 137  class DataCollector:
137          elif scalar in self.__cell_attribute['scalars']:          elif scalar in self.__cell_attribute['scalars']:
138              self._getOutput().GetCellData().SetActiveScalars(scalar)              self._getOutput().GetCellData().SetActiveScalars(scalar)
139          else:          else:
140              print "\nERROR: No scalar called '%s' is available.\n" % scalar              raise IOError("ERROR: No scalar called '%s' is available." % scalar)
             sys.exit(1)  
141    
142      def setActiveVector(self, vector):      def setActiveVector(self, vector):
143          """          """
# Line 159  class DataCollector: Line 157  class DataCollector:
157          elif vector in self.__cell_attribute['vectors']:          elif vector in self.__cell_attribute['vectors']:
158              self._getOutput().GetCellData().SetActiveVectors(vector)              self._getOutput().GetCellData().SetActiveVectors(vector)
159          else:          else:
160              print "\nERROR: No vector called '%s' is available.\n" % vector              raise IOError("ERROR: No vector called '%s' is available." % vector)
             sys.exit(1)  
161                            
162      def setActiveTensor(self, tensor):      def setActiveTensor(self, tensor):
163          """          """
# Line 180  class DataCollector: Line 177  class DataCollector:
177          elif tensor in self.__cell_attribute['tensors']:          elif tensor in self.__cell_attribute['tensors']:
178              self._getOutput().GetCellData().SetActiveTensors(tensor)              self._getOutput().GetCellData().SetActiveTensors(tensor)
179          else:          else:
180              print "\nERROR: No tensor called '%s' is available.\n" % tensor              raise IOError("ERROR: No tensor called '%s' is available." % tensor)
             sys.exit(0)  
181    
182      # 'object' is set to 'None' because some types of visualization have      # 'object' is set to 'None' because some types of visualization have
183      # two ranges that needs to be updated while others only have one.      # two ranges that needs to be updated while others only have one.
# Line 309  class DataCollector: Line 305  class DataCollector:
305          elif(len(self.__cell_attribute['scalars']) != 0):          elif(len(self.__cell_attribute['scalars']) != 0):
306              return self._getOutput().GetCellData().GetScalars().GetRange(-1)              return self._getOutput().GetCellData().GetScalars().GetRange(-1)
307          else:          else:
308              print "\nERROR: No scalar is available.\n"                raise IOError("ERROR: No scalar is available.")
             sys.exit(1)  
309    
310      def _getVectorRange(self):      def _getVectorRange(self):
311          """          """

Legend:
Removed from v.1137  
changed lines
  Added in v.1138

  ViewVC Help
Powered by ViewVC 1.1.26