Beispiel #1
0
 def __init__(self, *args, **kwargs):
     self._app = Application.instance
     self.__topwin = kwargs.pop('topwin')
     Group.__init__(self, *args, **kwargs)
     
     frm = Frame(self)
     self.__uiImages = []
     imageMatFileBtn = ImageTk.PhotoImage(
         file=uiImagePath('Pattern_SaveMat_Button.png')
     )
     self.__uiImages.append(imageMatFileBtn)
     Button(frm, image=imageMatFileBtn, command=self.onSaveMat).pack(side=TOP)
     Button(frm, text='mat', width=6).pack(side=TOP)
     frm.pack(side=LEFT)
     
     frm = Frame(self)
     imageExcelFileBtn = ImageTk.PhotoImage(
         file=uiImagePath('Pattern_SaveExcel_Button.png')
     )
     self.__uiImages.append(imageExcelFileBtn)
     Button(frm, image=imageExcelFileBtn).pack(side=TOP)
     Button(frm, text='xlsx', width=6).pack(side=TOP)
     frm.pack(side=LEFT)
     
     self.name = 'Corr Matrix'
Beispiel #2
0
 def __init__(self, *args, **kwargs):
     self._app = Scripting.root_node
     self.__topwin = kwargs.pop('topwin')
     Group.__init__(self, *args, **kwargs)
     
     frm = Frame(self)
     self.__gui_images = []
     imageMatFileBtn = ImageTk.PhotoImage(
         file=get_gui_image_path('Pattern_SaveMat_Button.png')
     )
     self.__gui_images.append(imageMatFileBtn)
     Button(frm, image=imageMatFileBtn, command=self._on_save_mat_file).pack(side=TOP)
     Button(frm, text='mat', width=6).pack(side=TOP)
     frm.pack(side=LEFT)
     
     frm = Frame(self)
     imageExcelFileBtn = ImageTk.PhotoImage(
         file=get_gui_image_path('Pattern_SaveExcel_Button.png')
     )
     self.__gui_images.append(imageExcelFileBtn)
     Button(frm, image=imageExcelFileBtn).pack(side=TOP)
     Button(frm, text='xlsx', width=6).pack(side=TOP)
     frm.pack(side=LEFT)
     
     self.name = 'Corr Matrix'
Beispiel #3
0
    def __init__(self, *args, **kwargs):
        self.__topwin = kwargs.pop('topwin')
        Group.__init__(self, *args, **kwargs)

        # Todo: 3D surface of CAF

        # see http://matplotlib.org/examples/color/colormaps_reference.html
        self.__cmaps = cmaps = {
            'Sequential': [
                'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges',
                'OrRd', 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds',
                'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd'
            ],
            'Sequential (2)': [
                'afmhot', 'autumn', 'bone', 'cool', 'copper', 'gist_heat',
                'gray', 'hot', 'pink', 'spring', 'summer', 'winter'
            ],
            'Diverging': [
                'BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr', 'RdBu',
                'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'seismic'
            ],
            'Qualitative': [
                'Accent', 'Dark2', 'Paired', 'Pastel1', 'Pastel2', 'Set1',
                'Set2', 'Set3'
            ],
            'Miscellaneous': [
                'gist_earth', 'terrain', 'ocean', 'gist_stern', 'brg',
                'CMRmap', 'cubehelix', 'gnuplot', 'gnuplot2', 'gist_ncar',
                'nipy_spectral', 'jet', 'rainbow', 'gist_rainbow', 'hsv',
                'flag', 'prism'
            ]
        }

        self.__cmapCategoryList = cmapCategoryList = Combobox(
            self, values=cmaps.keys(), takefocus=1, stat='readonly', width=12)
        cmapCategoryList.current(0)
        cmapCategoryList.bind('<<ComboboxSelected>>', self.onCategorySelect)
        cmapCategoryList.pack()

        self.__cmapList = cmapList = Combobox(
            self,
            value=cmaps[cmapCategoryList.get()],
            takefocus=1,
            stat='readonly',
            width=12)
        cmapList.current(0)
        cmapList.pack()

        Button(self, text='Apply', command=self.onApplyClick).pack()

        self.name = 'Color Map'
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        self._app = Application.instance
        self.__uiImages = []
        self.__topwin = kwargs.pop('topwin')
        Group.__init__(self, *args, **kwargs)
        frm = Frame(self)
        frm.pack(side=TOP)

        imageMLbl = ImageTk.PhotoImage(file=uiImagePath('Pattern_M_Label.png'))
        self.__uiImages.append(imageMLbl)
        Label(frm, image=imageMLbl).pack(side=LEFT)

        self.__M = ParamItem(frm)
        self.__M.label.config(text='M')
        self.__M.entryWidth = 6
        self.__M.entryText = 10
        self.__M.entry.bind('<Return>', lambda dumb: self.onSolve())
        self.__M.checkFunc = self._app.checkInt
        self.__M.pack(side=RIGHT)

        self._app.balloon.bind_widget(
            frm, balloonmsg='The number of the array elements.')

        imageSolveBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_Solve_Button.png'))
        self.__uiImages.append(imageSolveBtn)

        self.__btnSolve = Button(self,
                                 image=imageSolveBtn,
                                 command=self.onSolve)
        self.__btnSolve.pack(side=TOP)
        self._app.balloon.bind_widget(
            self.__btnSolve,
            balloonmsg='Launch the solver to synthesize the correlation matrix.'
        )

        frm = Frame(self)
        frm.pack(side=TOP)
        imageDisplayBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_Display_Button.png'))
        self.__uiImages.append(imageDisplayBtn)
        Label(frm, image=imageDisplayBtn).pack(side=LEFT)
        self.__bDisplay = IntVar(0)
        chkDisplay = Checkbutton(frm, text="Display", variable=self.__bDisplay)
        chkDisplay.pack(side=TOP)
        self._app.balloon.bind_widget(frm, balloonmsg='Display solver output.')

        self.name = 'Optimize'
Beispiel #5
0
 def __init__(self, *args, **kwargs):
     #self._app = app = Application.instance
     self.__topwin = kwargs.pop('topwin')
     Group.__init__(self, *args, **kwargs)
     Button(self, text='Load *.mat', command=self.onLoadClick).pack()
     paramX = ParamItem(self)
     paramX.labelText = 'x = '
     paramX.entryWidth = 6
     paramX.pack()
     self.__paramX = paramX
     paramY = ParamItem(self)
     paramY.labelText = 'y = '
     paramY.entryWidth = 6
     paramY.pack()
     self.__paramY = paramY
     self.name = 'Load'
Beispiel #6
0
 def __init__(self, *args, **kwargs):
     #self._app = app = Application.instance
     self.__topwin = kwargs.pop('topwin')
     Group.__init__(self, *args, **kwargs)
     Button(self, text='Load *.mat', command=self.onLoadClick).pack()
     paramX = LabeledEntry(self)
     paramX.label_text = 'x = '
     paramX.entry_width = 6
     paramX.pack()
     self.__paramX = paramX
     paramY = LabeledEntry(self)
     paramY.label_text = 'y = '
     paramY.entry_width = 6
     paramY.pack()
     self.__paramY = paramY
     self.name = 'Load'
Beispiel #7
0
    def __init__(self, *args, **kwargs):
        self._app = Scripting.root_node
        self.__gui_images = []
        self.__topwin = kwargs.pop('topwin')
        Group.__init__(self, *args, **kwargs)
        frm = Frame(self)
        frm.pack(side=TOP)
        
        imageMLbl = ImageTk.PhotoImage(
            file=get_gui_image_path('Pattern_M_Label.png')
        )
        self.__gui_images.append(imageMLbl)
        Label(frm, image=imageMLbl).pack(side=LEFT)
        
        self.__M = LabeledEntry(frm)
        self.__M.label.config(text='M')
        self.__M.entry_width = 6
        self.__M.entry_text = 10
        self.__M.entry.bind('<Return>', lambda dumb: self._on_solve_button_click())
        self.__M.checker_function = self._app.check_int
        self.__M.pack(side=RIGHT)
        
        self._app.balloon.bind_widget(frm, balloonmsg='The number of the array elements.')

        imageSolveBtn = ImageTk.PhotoImage(
            file=get_gui_image_path('Pattern_Solve_Button.png')
        )
        self.__gui_images.append(imageSolveBtn)

        self.__btnSolve = Button(self, image=imageSolveBtn, command=self._on_solve_button_click)
        self.__btnSolve.pack(side=TOP)
        self._app.balloon.bind_widget(self.__btnSolve, balloonmsg='Launch the solver to synthesize the correlation matrix.')
        
        frm = Frame(self)
        frm.pack(side=TOP)
        imageDisplayBtn = ImageTk.PhotoImage(
            file=get_gui_image_path('Pattern_Display_Button.png')
        )
        self.__gui_images.append(imageDisplayBtn)
        Label(frm, image=imageDisplayBtn).pack(side=LEFT)
        self.__bDisplay = IntVar(0)
        chkDisplay = Checkbutton(frm, text="Display", variable=self.__bDisplay)
        chkDisplay.pack(side=TOP)
        self._app.balloon.bind_widget(frm, balloonmsg='Display solver output.')
        
        self.name = 'Optimize'
Beispiel #8
0
    def __init__(self, *args, **kwargs):
        self._app = Application.instance
        self.__uiImages = []
        self.__topwin = kwargs.pop('topwin')
        Group.__init__(self, *args, **kwargs)
        frm = Frame(self)
        frm.pack(side=TOP)
        
        imageMLbl = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_M_Label.png')
        )
        self.__uiImages.append(imageMLbl)
        Label(frm, image=imageMLbl).pack(side=LEFT)
        
        self.__M = ParamItem(frm)
        self.__M.label.config(text='M')
        self.__M.entryWidth = 6
        self.__M.entryText = 10
        self.__M.entry.bind('<Return>', lambda dumb: self.onSolve())
        self.__M.checkFunc = self._app.checkInt
        self.__M.pack(side=RIGHT)
        
        self._app.balloon.bind_widget(frm, balloonmsg='The number of the array elements.')

        imageSolveBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_Solve_Button.png')
        )
        self.__uiImages.append(imageSolveBtn)

        self.__btnSolve = Button(self, image=imageSolveBtn, command=self.onSolve)
        self.__btnSolve.pack(side=TOP)
        self._app.balloon.bind_widget(self.__btnSolve, balloonmsg='Launch the solver to synthesize the correlation matrix.')
        
        frm = Frame(self)
        frm.pack(side=TOP)
        imageDisplayBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_Display_Button.png')
        )
        self.__uiImages.append(imageDisplayBtn)
        Label(frm, image=imageDisplayBtn).pack(side=LEFT)
        self.__bDisplay = IntVar(0)
        chkDisplay = Checkbutton(frm, text="Display", variable=self.__bDisplay)
        chkDisplay.pack(side=TOP)
        self._app.balloon.bind_widget(frm, balloonmsg='Display solver output.')
        
        self.name = 'Optimize'
Beispiel #9
0
    def __init__(self, *args, **kwargs):
        self.__topwin = kwargs.pop('topwin')
        Group.__init__(self, *args, **kwargs)
        
        # Todo: 3D surface of CAF
        
        # see http://matplotlib.org/examples/color/colormaps_reference.html
        self.__cmaps    = cmaps = {'Sequential':     ['Blues', 'BuGn', 'BuPu',
                                     'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd',
                                     'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu',
                                     'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd'],
                 'Sequential (2)': ['afmhot', 'autumn', 'bone', 'cool', 'copper',
                                     'gist_heat', 'gray', 'hot', 'pink',
                                     'spring', 'summer', 'winter'],
                 'Diverging':      ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr',
                                     'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',
                                     'seismic'],
                 'Qualitative':    ['Accent', 'Dark2', 'Paired', 'Pastel1',
                                     'Pastel2', 'Set1', 'Set2', 'Set3'],
                 'Miscellaneous':  ['gist_earth', 'terrain', 'ocean', 'gist_stern',
                                     'brg', 'CMRmap', 'cubehelix',
                                     'gnuplot', 'gnuplot2', 'gist_ncar',
                                     'nipy_spectral', 'jet', 'rainbow',
                                     'gist_rainbow', 'hsv', 'flag', 'prism']}                

        self.__cmapCategoryList     = cmapCategoryList  = Combobox(self, values=cmaps.keys(), takefocus=1, stat='readonly', width=12)
        cmapCategoryList.current(0)
        cmapCategoryList.bind('<<ComboboxSelected>>', self.onCategorySelect)
        cmapCategoryList.pack()
        
        self.__cmapList             = cmapList          = Combobox(self, value=cmaps[cmapCategoryList.get()], takefocus=1, stat='readonly', width=12)
        cmapList.current(0)
        cmapList.pack()
        
        Button(self, text='Apply', command=self.onApplyClick).pack()

        self.name = 'Color Map'
Beispiel #10
0
    def __init__(self, *args, **kwargs):
        self._app = Application.instance
        self.__topwin = kwargs.pop('topwin')
        Group.__init__(self, *args, **kwargs)

        frm = Frame(self)
        self.__uiImages = []
        imageMatFileBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_SaveMat_Button.png'))
        self.__uiImages.append(imageMatFileBtn)
        Button(frm, image=imageMatFileBtn,
               command=self.onSaveMat).pack(side=TOP)
        Button(frm, text='mat', width=6).pack(side=TOP)
        frm.pack(side=LEFT)

        frm = Frame(self)
        imageExcelFileBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_SaveExcel_Button.png'))
        self.__uiImages.append(imageExcelFileBtn)
        Button(frm, image=imageExcelFileBtn).pack(side=TOP)
        Button(frm, text='xlsx', width=6).pack(side=TOP)
        frm.pack(side=LEFT)

        self.name = 'Corr Matrix'
Beispiel #11
0
    def __init__(self, *args, **kwargs):
        self._app = Application.instance
        self.__topwin = kwargs.pop('topwin')
        Group.__init__(self, *args, **kwargs)
        frm = Frame(self)

        self.__center = ParamItem(frm)
        setMultiAttr(self.__center,
                     labelText='center(deg)',
                     entryText=0,
                     checkFunc=self._app.checkInt,
                     entryWidth=5,
                     labelWidth=10)
        self.__center.pack(side=TOP)
        self._app.balloon.bind_widget(
            self.__center, balloonmsg='Specify the beam center here.')

        self.__width = ParamItem(frm)
        setMultiAttr(self.__width,
                     labelText='width(deg)',
                     entryText=20,
                     checkFunc=self._app.checkInt,
                     entryWidth=5,
                     labelWidth=10)
        self.__width.pack(side=TOP)
        self._app.balloon.bind_widget(
            self.__width, balloonmsg='Specify the beam width here.')

        self.__uiImages = []

        imageAddBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_Add_Button.png'))
        self.__uiImages.append(imageAddBtn)
        btn = Button(frm, image=imageAddBtn, command=self.onAdd)
        btn.pack(side=LEFT)
        self._app.balloon.bind_widget(
            btn, balloonmsg='Add new beam to the ideal pattern.')

        imageDelBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_Del_Button.png'))
        self.__uiImages.append(imageDelBtn)
        btn = Button(frm, image=imageDelBtn, command=self.onDel)
        btn.pack(side=LEFT)
        self._app.balloon.bind_widget(
            btn, balloonmsg='Remove the selected beam in the listbox.')

        imageClrBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_Clear_Button.png'))
        self.__uiImages.append(imageClrBtn)
        btn = Button(frm, image=imageClrBtn, command=self.onClear)
        btn.pack(side=LEFT)
        self._app.balloon.bind_widget(
            btn, balloonmsg='Clear the listbox of the beam parameters.')

        imagePlotBtn = ImageTk.PhotoImage(
            file=uiImagePath('Pattern_Plot_Button.png'))
        self.__uiImages.append(imagePlotBtn)
        btn = Button(frm, image=imagePlotBtn, command=self.onPlotIdealPattern)
        btn.pack(side=LEFT)
        self._app.balloon.bind_widget(btn,
                                      balloonmsg='Plot the ideal pattern.')

        frm.pack(side=LEFT, fill=Y)

        self.__paramlist = ScrolledList(self)
        self.__paramlist.list.config(height=4, width=10)
        self.__paramlist.pack(side=LEFT)
        self.name = 'Edit Ideal Pattern'

        self.optgrp = None
Beispiel #12
0
 def __init__(self, *args, **kwargs):
     self._app = Scripting.root_node
     self.__topwin = kwargs.pop('topwin')
     Group.__init__(self, *args, **kwargs)
     frm = Frame(self)
     
     self.__center = LabeledEntry(frm)
     set_attributes(self.__center,        
         label_text   = 'center(deg)',        
         entry_text   = 0,    
         checker_function   = self._app.check_int,
         entry_width  = 5,    
         label_width  = 10
     )                       
     self.__center.pack(side=TOP)        
     self._app.balloon.bind_widget(self.__center, balloonmsg='Specify the beam center here.')
     
     self.__width = LabeledEntry(frm)
     set_attributes(self.__width,
         label_text   = 'width(deg)',
         entry_text   = 20,
         checker_function   = self._app.check_int,
         entry_width  = 5,
         label_width  = 10
     )
     self.__width.pack(side=TOP)
     self._app.balloon.bind_widget(self.__width, balloonmsg='Specify the beam width here.')
     
     self.__gui_images = []
             
             
     imageAddBtn = ImageTk.PhotoImage(
         file=get_gui_image_path('Pattern_Add_Button.png')
     )
     self.__gui_images.append(imageAddBtn)
     btn = Button(frm, image=imageAddBtn, command=self._on_add_button_click)
     btn.pack(side=LEFT)
     self._app.balloon.bind_widget(btn, balloonmsg='Add new beam to the ideal pattern.')
     
     imageDelBtn = ImageTk.PhotoImage(
         file=get_gui_image_path('Pattern_Del_Button.png')
     )
     self.__gui_images.append(imageDelBtn)
     btn = Button(frm, image=imageDelBtn, command=self._on_delete_button_click)
     btn.pack(side=LEFT)
     self._app.balloon.bind_widget(btn, balloonmsg='Remove the selected beam in the listbox.')
     
     imageClrBtn = ImageTk.PhotoImage(
         file=get_gui_image_path('Pattern_Clear_Button.png')
     )
     self.__gui_images.append(imageClrBtn)
     btn = Button(frm, image=imageClrBtn, command=self._on_clear_button_click)
     btn.pack(side=LEFT)
     self._app.balloon.bind_widget(btn, balloonmsg='Clear the listbox of the beam parameters.')
     
     imagePlotBtn = ImageTk.PhotoImage(
         file=get_gui_image_path('Pattern_Plot_Button.png')
     )
     self.__gui_images.append(imagePlotBtn)
     btn = Button(frm, image=imagePlotBtn, command=self._on_plot_ideal_pattern)
     btn.pack(side=LEFT)
     self._app.balloon.bind_widget(btn, balloonmsg='Plot the ideal pattern.')
     
     frm.pack(side=LEFT, fill=Y)
     
     self.__paramlist = ScrolledList(self)
     self.__paramlist.list.config(height=4, width=10)
     self.__paramlist.pack(side=LEFT)
     self.name = 'Edit Ideal Pattern'
     
     self.optgrp = None
Beispiel #13
0
 def __init__(self, *args, **kwargs):
     self._app = Application.instance
     self.__topwin = kwargs.pop('topwin')
     Group.__init__(self, *args, **kwargs)
     frm = Frame(self)
     
     self.__center = ParamItem(frm)
     setMultiAttr(self.__center,        
         labelText   = 'center(deg)',        
         entryText   = 0,    
         checkFunc   = self._app.checkInt,
         entryWidth  = 5,    
         labelWidth  = 10
     )                       
     self.__center.pack(side=TOP)        
     self._app.balloon.bind_widget(self.__center, balloonmsg='Specify the beam center here.')
     
     self.__width = ParamItem(frm)
     setMultiAttr(self.__width,
         labelText   = 'width(deg)',
         entryText   = 20,
         checkFunc   = self._app.checkInt,
         entryWidth  = 5,
         labelWidth  = 10
     )
     self.__width.pack(side=TOP)
     self._app.balloon.bind_widget(self.__width, balloonmsg='Specify the beam width here.')
     
     self.__uiImages = []
             
             
     imageAddBtn = ImageTk.PhotoImage(
         file=uiImagePath('Pattern_Add_Button.png')
     )
     self.__uiImages.append(imageAddBtn)
     btn = Button(frm, image=imageAddBtn, command=self.onAdd)
     btn.pack(side=LEFT)
     self._app.balloon.bind_widget(btn, balloonmsg='Add new beam to the ideal pattern.')
     
     imageDelBtn = ImageTk.PhotoImage(
         file=uiImagePath('Pattern_Del_Button.png')
     )
     self.__uiImages.append(imageDelBtn)
     btn = Button(frm, image=imageDelBtn, command=self.onDel)
     btn.pack(side=LEFT)
     self._app.balloon.bind_widget(btn, balloonmsg='Remove the selected beam in the listbox.')
     
     imageClrBtn = ImageTk.PhotoImage(
         file=uiImagePath('Pattern_Clear_Button.png')
     )
     self.__uiImages.append(imageClrBtn)
     btn = Button(frm, image=imageClrBtn, command=self.onClear)
     btn.pack(side=LEFT)
     self._app.balloon.bind_widget(btn, balloonmsg='Clear the listbox of the beam parameters.')
     
     imagePlotBtn = ImageTk.PhotoImage(
         file=uiImagePath('Pattern_Plot_Button.png')
     )
     self.__uiImages.append(imagePlotBtn)
     btn = Button(frm, image=imagePlotBtn, command=self.onPlotIdealPattern)
     btn.pack(side=LEFT)
     self._app.balloon.bind_widget(btn, balloonmsg='Plot the ideal pattern.')
     
     frm.pack(side=LEFT, fill=Y)
     
     self.__paramlist = ScrolledList(self)
     self.__paramlist.list.config(height=4, width=10)
     self.__paramlist.pack(side=LEFT)
     self.name = 'Edit Ideal Pattern'
     
     self.optgrp = None