예제 #1
0
    def do_plot(self, id):
        vcs_legacy = None
        priority = 0
        data1 = None
        template = None
        gm_type = None
        gm = None
        vcs_legacy = self.eself.vcs_legacy
        continents = self.eself.continents
        data1 = self.form[id].data1.get()
        template = self.form[id].template.get()
        gm_type = self.form[id].gm.type
        gm = self.form[id].gm.get()

        p_val = string.atoi(self.form[id].priority.get())
        if isinstance(p_val, types.IntType):
            priority = p_val

        gm_min_size = 0
        if string.lower(gm_type) in [
                'boxfill', 'isofill', 'isoline', 'outfill', 'outline',
                'scatter', 'vector'
        ]:
            gm_min_size = 2
        elif string.lower(gm_type) in ['xvsy', 'xyvsy', 'yxvsx']:
            gm_min_size = 1
        try:
            data_size = len(__main__.__dict__[data1].shape)
            if data_size < gm_min_size:
                gui_message.error(
                    "The variable's number of dimensions must be greater than %d."
                    % (gm_min_size - 1))
                self.form[id].data1.setentry('')
                vcs_legacy.clear()
                self.form[id].btn.configure(background='red')
                self.form[id].lbl.configure(label_text='Err')
                if (self.form[id].display is not None):
                    del self.form[id].display
                    self.form[id].display = None
                return
        except:
            pass

        plot_flg = 0
        if (vcs_legacy is not None): plot_flg += 1
        if (len(data1) > 0): plot_flg += 1
        if (len(template) > 0): plot_flg += 1
        if (len(gm_type) > 0): plot_flg += 1
        if (len(gm) > 0): plot_flg += 1
        if plot_flg == 5:
            if self.form[id].display != None:
                self.form[id].display.off = 1
                self.form[id].display.priority = priority
            self.form[id].display = vcs_legacy.plot(__main__.__dict__[data1],
                                                    template,
                                                    gm_type,
                                                    gm,
                                                    continents=continents)
            self.form[id].btn.configure(background=gui_color.seven)
            self.form[id].lbl.configure(label_text='On')
예제 #2
0
파일: pagegui.py 프로젝트: AZed/uvcdat
 def edit_graphics_method(self, vcs):
    try:
       gm_selected = self.gm_listbox.getcurselection()[0]
    except:
       gui_message.error( 'Must select a %s graphics method from the list below.' % self.gm_name )
       return
    vcs.graphicsmethodgui(self.gm_name, gm_selected,
          gui_parent = self.dialog.dialog) # popup the graphics method gui
예제 #3
0
 def edit_graphics_method(self, vcs_legacy):
     try:
         gm_selected = self.gm_listbox.getcurselection()[0]
     except:
         gui_message.error(
             'Must select a %s graphics method from the list below.' %
             self.gm_name)
         return
     vcs_legacy.graphicsmethodgui(
         self.gm_name, gm_selected,
         gui_parent=self.dialog.dialog)  # popup the graphics method gui
예제 #4
0
파일: pagegui.py 프로젝트: AZed/uvcdat
   def do_plot( self, id ):
       vcs = None
       priority = 0
       data1=None
       template=None
       gm_type=None
       gm=None
       vcs = self.eself.vcs
       continents = self.eself.continents
       data1 = self.form[id].data1.get()
       template = self.form[id].template.get()
       gm_type = self.form[id].gm.type
       gm = self.form[id].gm.get()

       p_val = string.atoi(self.form[id].priority.get())
       if isinstance(p_val, types.IntType):
          priority = p_val

       gm_min_size = 0
       if string.lower(gm_type) in ['boxfill', 'isofill', 'isoline', 'outfill', 'outline', 'scatter', 'vector']:
          gm_min_size = 2
       elif string.lower(gm_type) in ['xvsy', 'xyvsy', 'yxvsx']:
          gm_min_size = 1
       try:
          data_size = len(__main__.__dict__[ data1 ].shape)
          if data_size < gm_min_size:
            gui_message.error( "The variable's number of dimensions must be greater than %d." % (gm_min_size-1) )
            self.form[id].data1.setentry( '' )
            vcs.clear()
            self.form[id].btn.configure( background = 'red')
            self.form[id].lbl.configure( label_text = 'Err' )
            if (self.form[id].display is not None):
               del self.form[id].display
               self.form[id].display = None
            return
       except:
           pass

       plot_flg = 0
       if (vcs is not None): plot_flg += 1
       if (len(data1) > 0): plot_flg += 1
       if (len(template) > 0): plot_flg += 1
       if (len(gm_type) > 0): plot_flg += 1
       if (len(gm) > 0): plot_flg += 1
       if plot_flg == 5:
          if self.form[id].display != None:
            self.form[id].display.off = 1
            self.form[id].display.priority = priority
          self.form[id].display = vcs.plot( __main__.__dict__[ data1 ], template, gm_type, gm, continents=continents)
          self.form[id].btn.configure( background = gui_color.seven)
          self.form[id].lbl.configure( label_text = 'On' )