Beispiel #1
0
    def sensitize_widgets(self, *args):
        debug.mainthreadTest()
        meshctxt = self.currentMeshContext()
        meshok = meshctxt and not meshctxt.outOfSync()
        go_sensitive = bool(
            meshok and self.op_obj.isValid() and self.output_obj.isValid()
            and self.destwidget.isValid() and self.domain_obj.isValid()
            and self.sample_obj.isValid() and self.timeWidget.isValid()
            and self.domain_obj.get_value().compatible(
                self.output_obj.get_value()))

        self.go_button.set_sensitive(go_sensitive)
        namedok = len(namedanalysis.analysisNames()) > 0
        self.sensitizeBottomRow(go_sensitive, namedok)
        self.namedAnalysisChooser.gtk.set_sensitive(namedok)
Beispiel #2
0
 def CreateDelete(self):
     OOF.Named_Analysis.Create(
         name='output1', 
         operation=DirectOutput(),
         data=getOutput('Field:Value',field=Temperature),
         domain=EntireMesh(),
         sampling=GridSampleSet(
             x_points=3,y_points=3,z_points=3,
             show_x=True,show_y=True,show_z=True))
     self.assertEqual(namedanalysis.analysisNames(), ["output1"])
     OOF.Named_Analysis.Create(
         name='output2', 
         operation=AverageOutput(),
         data=getOutput('Field:Value',field=Temperature),
         domain=EntireMesh(),
         sampling=ContinuumSampleSet(order=automatic))
     self.assertEqual(namedanalysis.analysisNames(), ["output1", "output2"])
     OOF.Named_Analysis.Create(
         name='output2', 
         operation=AverageOutput(),
         data=getOutput('Field:Value',field=Temperature),
         domain=EntireMesh(),
         sampling=ContinuumSampleSet(order=automatic))
     self.assertEqual(namedanalysis.analysisNames(),
                      ["output1", "output2", "output2<2>"])
     OOF.Named_Analysis.Delete(
         name="output2<2>")
     self.assertEqual(namedanalysis.analysisNames(), ["output1", "output2"])
     # NamedAnalyses persist after the Microstructure is deleted,
     # so be sure to explicitly delete all NamedAnalyses at the end
     # of each test, to avoid interactions with subsequent tests.
     OOF.Named_Analysis.Delete(
         name="output2")
     OOF.Named_Analysis.Delete(
         name="output1")
     self.assertEqual(namedanalysis.analysisNames(), [])
Beispiel #3
0
    def setNamedAnalysisChooser(self, *args):
        if self.suppressRetrievalLoop:
            return
        # Display the name for the current analysis if the current
        # settings happen to match a named analysis.  Call this
        # whenever anything on the page changes.

        self.namedAnalysisChooser.update([''] + namedanalysis.analysisNames())

        # If the get_value calls fail, the widgets aren't in a valid
        # state, and therefore there's no current name.
        # findNamedAnalysis returns "" if it can't find a match.
        try:
            currentname = namedanalysis.findNamedAnalysis(
                self.op_obj.get_value(), self.output_obj.get_value(),
                self.domain_obj.get_value(), self.sample_obj.get_value())
        except:
            currentname = ""
        self.namedAnalysisChooser.set_state(currentname)
        gtklogger.checkpoint("named analysis chooser set")
Beispiel #4
0
 def getNames(self):
     return (namedanalysis.analysisNames())
Beispiel #5
0
 def Load(self):
     OOF.File.Load.Data(
         filename=reference_file("output_data", "analysisdefs.out"))
     self.assertEqual(namedanalysis.analysisNames(), ["output1", "output2"])