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'
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'
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'
def __init__(self, *args, **kwargs): self._app = Application.instance self.__topwin = kwargs.pop("topwin") super(FigureExportGroup, self).__init__(*args, **kwargs) self.__uiImages = [] imageFigureExportBtn = ImageTk.PhotoImage(file=uiImagePath("Pattern_ExportFigure_Button.png")) self.__uiImages.append(imageFigureExportBtn) frm = Frame(self) frm.pack(side=LEFT) Button(frm, image=imageFigureExportBtn, command=self.onExportMatlabScript).pack(side=TOP) Button(frm, text="Script", command=self.onExportMatlabScript, width=6).pack(side=TOP) self.name = "Figure"
def __init__(self, *args, **kwargs): # app = Application.instance if "valueChecker" in kwargs: valueChecker = kwargs.pop("valueChecker") checkFloat = valueChecker.checkFloat else: checkFloat = None if "balloon" in kwargs: balloonBindWidget = kwargs.pop("balloon").bind_widget else: balloonBindWidget = lambda *args, **kwargs: None super(AxisGroup, self).__init__(*args, **kwargs) self.__params = [StringVar() for i in range(8)] paramfrm = Frame(self) paramfrm.pack() names = ["xmin", "xmax", "ymin", "ymax", "major xtick", "major ytick", "minor xtick", "minor ytick"] images = [ "ViewTab_XMin.png", "ViewTab_XMax.png", "ViewTab_YMin.png", "ViewTab_YMax.png", "ViewTab_MajorXTick.png", "ViewTab_MajorYTick.png", "ViewTab_MinorXTick.png", "ViewTab_MinorYTick.png", ] for c in range(4): for r in range(2): temp = ParamItem(paramfrm) image = ImageTk.PhotoImage(file=uiImagePath(images[c * 2 + r])) setMultiAttr( temp, checkFunc=checkFloat, # labelText = names[c*2+r], labelImage=image, labelWidth=5 if c * 2 + r < 4 else 10, entryWidth=5, entryVar=self.__params[c * 2 + r], ) temp.entry.bind("<Return>", self.onConfirmClick) temp.grid(row=r, column=c) balloonBindWidget(temp, balloonmsg=names[c * 2 + r]) btnfrm = Frame(self) btnfrm.pack() Button(btnfrm, text="Confirm", command=self.onConfirmClick).pack(side=LEFT) Button(btnfrm, text="Auto", command=self.onAutoClick).pack(side=RIGHT) self.name = "Axis" self.__figureObserver = self.FigureObserver(self)
def __init__(self, *args, **kwargs): # app = Application.instance if 'valueChecker' in kwargs: valueChecker = kwargs.pop('valueChecker') checkFloat = valueChecker.checkFloat else: checkFloat = None if 'balloon' in kwargs: balloonBindWidget = kwargs.pop('balloon').bind_widget else: balloonBindWidget = lambda *args, **kwargs: None super(AxisGroup, self).__init__(*args, **kwargs) self.__params = [StringVar() for i in range(8)] paramfrm = Frame(self) paramfrm.pack() names = [ 'xmin', 'xmax', 'ymin', 'ymax', 'major xtick', 'major ytick', 'minor xtick', 'minor ytick' ] images = [ 'ViewTab_XMin.png', 'ViewTab_XMax.png', 'ViewTab_YMin.png', 'ViewTab_YMax.png', 'ViewTab_MajorXTick.png', 'ViewTab_MajorYTick.png', 'ViewTab_MinorXTick.png', 'ViewTab_MinorYTick.png' ] for c in range(4): for r in range(2): temp = ParamItem(paramfrm) image = ImageTk.PhotoImage(file=uiImagePath(images[c * 2 + r])) setMultiAttr( temp, checkFunc=checkFloat, #labelText = names[c*2+r], labelImage=image, labelWidth=5 if c * 2 + r < 4 else 10, entryWidth=5, entryVar=self.__params[c * 2 + r]) temp.entry.bind('<Return>', self.onConfirmClick) temp.grid(row=r, column=c) balloonBindWidget(temp, balloonmsg=names[c * 2 + r]) btnfrm = Frame(self) btnfrm.pack() Button(btnfrm, text='Confirm', command=self.onConfirmClick).pack(side=LEFT) Button(btnfrm, text='Auto', command=self.onAutoClick).pack(side=RIGHT) self.name = 'Axis' self.__figureObserver = self.FigureObserver(self)
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'
def __init__(self, *args, **kwargs): self._app = Application.instance self.__topwin = kwargs.pop('topwin') super(FigureExportGroup, self).__init__(*args, **kwargs) self.__uiImages = [] imageFigureExportBtn = ImageTk.PhotoImage( file=uiImagePath('Pattern_ExportFigure_Button.png')) self.__uiImages.append(imageFigureExportBtn) frm = Frame(self) frm.pack(side=LEFT) Button(frm, image=imageFigureExportBtn, command=self.onExportMatlabScript).pack(side=TOP) Button(frm, text='Script', command=self.onExportMatlabScript, width=6).pack(side=TOP) self.name = 'Figure'
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
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