Exemplo n.º 1
0
    def create_content(self):

        label0 = Label(self, text=self._briefing_)
        label0.pack(side="top", fill="both", expand=True, padx=50, pady=20)
        #    just a line
        bottom_hline_deco(self)
        # lets create space to do some stuff ...
        self.entr_maxlen = int(len(max(self._entries_, key=len)) * 2.5 / 3.0)
        row2fill = Frame(self)
        #print self._entries_,'\n', self._defvals_,
        #'\n',len(self._entries_),'\n', len(self._defvals_)

        aline = 0
        for e in range(len(self._entries_)):
            if self._entries_[e] == '---':
                aline += 1
                bottom_hline_deco(row2fill)
                #print self._entries_[e]
            else:
                self.ent_c.append(
                    create_entry(row2fill, self._entries_[e],
                                 self._defvals_[e - aline], self.entr_maxlen))

        row2fill.pack(side="top", padx=1, pady=5)

        self.bottom_button_row()
Exemplo n.º 2
0
    def create_content(self):

        self.pop = Toplevel(self.master)
        self.pop.grab_set()  # when you show the popup

        self.pop.wm_title(' ' * 20 + self._title_)
        self.pop.geometry('{:d}x{:d}+{:d}+{:d}'.format(*self._vertex_))

        label0 = Label(self.pop, text=self._briefing_)
        label0.pack(side="top", fill="both", expand=True, padx=100, pady=20)
        #    just a line
        bottom_hline_deco(self.pop)
        # lets create space to do some stuff ...

        row2fill = Frame(self.pop)

        for e in range(len(self._entries_)):
            self.ent_c.append(
                create_entry(row2fill, self._entries_[e], self._defvals_[e],
                             self.entr_maxlen))
        row2fill.pack(side="top", padx=1, pady=5)

        self.bottom_button_row()

        self.master.solv_b.config(bg='gray40', width=45)  #cyan')
 def createWidgets(self):
     'create the script gui'
     #    first header row
     row = Frame(self)
     TEXT1= "\nIn this section you can run scripts "
     Label(row, text=TEXT1, anchor='w').pack(side='top', padx=2, pady=10)
     row.pack( side='top', fill='x', padx=5)
     bottom_hline_deco(self)
     
     
     '''  RUN  section '''
     entr_maxlen = int(8*2.5)
     self.r_entry_c = []
     row2fill = Frame(self)
     row2fill_l = Frame( row2fill)
     
     _def_inname_ = 'in.gro2lam'
     if self.master._convertdata_ <> []:
         _def_dataname_ = self.master._convertdata_['filename']
         _folder_ = '/'.join( _def_dataname_.split('/')[:-1]+[''])
         _def_inname_ =  _folder_ + _def_inname_
     else:
         _def_inname_ = './' + 'in.gro2lam'
     b_enb = ( self.master._convertdata_ == None)
     self.r_entry_c.append( createfileentry( self,
                                            'Select the script to run',
                                            _def_inname_,
                                            ['.in', 'in.*'],
                                            ['lammps input',]*2,
                                            b_enb
                                           )
                         )
     _entries_ = ['Machine', 'Cores']
     _defvals_=[['lammps-daily',
                 [ 'lammps', 'lmp_mpi', 'lmp_ubuntu' ,'lammps-daily']],
                 [ 1, {1}|set(range(3*3*3+1)[::2][1:])|{27,28}] # should be enough
               ]
     for e in range(len(_entries_)):
         self.r_entry_c.append(create_entry(row2fill_l,
                                            _entries_[e],
                                            _defvals_[e],
                                            entr_maxlen))
         
     row2fill_l.pack(side="left")
     row2fill_r = Frame(row2fill)
     
     row2fill_r.pack(side="right")
     row2fill.pack(side="top", padx=1, pady=5)
     
     bottom_hline_deco(self, bottom_hline_deco(self))
     
     self.build_finalbuttons()
     
     if self.master.test:
         self.after(2000, self.master.master.destroy )
         print '\n'+'-'*20 + '  Test ended  ' + '-'*20
Exemplo n.º 4
0
    def create_main_section(self):
        '''Section for main input values    '''
        #=====================================================================
        '''  Create script section '''
        row2fill = Frame(self)
        row2fill_l = Frame(row2fill)
        self.s_entry_c = []
        _mainpage_ = self._container_['mainpage']
        _defvals_ = [ '0.1', '1000',
                     '1000', '300:299', '100',
                     '1000','10:1', '1000', '299:300', '100']
        _def_dataname_ = './data.gro2lam'
        
        if self._convertdata_ <> None:
            _def_dataname_ = self._convertdata_['filename']
        elif _mainpage_ <> []:
            _def_dataname_ = _mainpage_[0]
            _defvals_ = _mainpage_[1:] 
        
        
        
        self.s_entry_c.append( createfileentry( self,
                                               'Lammps data file to work',
                                               _def_dataname_,
                                               ['.data', 'data.*'],
                                               ['lammps data', 'lammps data'],
                                               (self._convertdata_ == None)
                                              )
                            )

        _entries_=  [ 'Timestep [fs]', '-','NVE steps  [#ts]','-',
                     'NVT steps  [#ts]','Temperature at start:end [K]',
                     'Temperature damping [fs]',
                     '-','NPT steps  [#ts]', 'Pressure at start:end  [atm]',
                     'Pressure damping [fs]',
                     'Temperature at start:end [K]', 'Temperature damping [fs]'
                    ]
        
        entr_maxlen = int(len(max(_entries_, key=len))*2.5/3)
        c=0
        for e in range(len(_entries_)):
            if _entries_[e]=='-':
                bottom_hline_deco(row2fill_l)
                c+=1
            else:
                self.s_entry_c.append(create_entry(row2fill_l,
                                                 _entries_[e],
                                                 _defvals_[e-c],
                                                 entr_maxlen))
        row2fill_l.pack( side="left")
        # ====================
        row2fill.pack(side="top", padx=1, pady=5)
Exemplo n.º 5
0
    def create_content(self):

        label0 = Label(self, text=self._briefing_)
        label0.pack(side="top", fill="both", expand=True, padx=50, pady=20)
        #    just a line
        bottom_hline_deco(self)
        # lets create space to do some stuff ...
        self.entr_maxlen = int(
            (len(max(self._entries_, key=len))) * 2.5 / 3.0) + 8

        self.row2fill = Frame(self)

        if self.ch_init == []:
            for e in range(len(self._entries_)):
                self.ent_c.append(
                    create_entry(row2fill, self._entries_[e],
                                 self._defvals_[e], self.entr_maxlen))
        else:
            #self.ent_c=[[],[]]
            for _e_ in range(len(self._entries_)):
                self.create_entry_ck(self.row2fill, _e_)

            if self.extra_checkb == None:
                # - add 1 more x kind line
                self.add_new_line()
                self.ch_init += [0]
            else:
                #print self.extra_checkb
                gr, ids, k_xyz, rns, cks = self.extra_checkb

                for _e_ in range(len(gr)):

                    cnt = gr[_e_], ids[_e_], k_xyz[_e_], rns[_e_]
                    self.create_entry_ck(self.row2fill, None, cnt)

                self.ch_init += cks

            self.set_ckbuttonstate(self.ch_init)

        self.row2fill.pack(side="top", padx=1, pady=5)

        self.bottom_button_row()
Exemplo n.º 6
0
    def createWidgets(self):
        'create the script gui'
        #    first header row
        row = Frame(self)
        TEXT1 = "\nIn this section you can run scripts "
        Label(row, text=TEXT1, anchor='w').pack(side='top', padx=2, pady=10)
        row.pack(side='top', fill='x', padx=5)
        bottom_hline_deco(self)
        '''  RUN  section '''
        entr_maxlen = int(8 * 2.5)
        self.r_entry_c = []
        row2fill = Frame(self)
        row2fill_l = Frame(row2fill)
        self.r_entry_c.append(
            self.master.createfileentry(row2fill_l, 'Select the script to run',
                                        './in.gro2lam'))
        _entries_ = ['Machine', 'Cores']
        _defvals_ = [
            [
                'lammps-daily',
                ['lammps', 'lmp_mpi', 'lmp_ubuntu', 'lammps-daily']
            ],
            [1, range(4 * 4 * 4 + 1)[1:]]  # should be enough
        ]
        for e in range(len(_entries_)):
            self.r_entry_c.append(
                create_entry(row2fill_l, _entries_[e], _defvals_[e],
                             entr_maxlen))

        row2fill_l.pack(side="left")
        row2fill_r = Frame(row2fill)

        row2fill_r.pack(side="right")
        row2fill.pack(side="top", padx=1, pady=5)

        bottom_hline_deco(self, bottom_hline_deco(self))

        self.build_finalbuttons()