def callback10(self, instance): Main.plot_screen.main_box.remove_widget(Main.plot_screen.data) self.parent.transition = sp.SlideTransition(direction='left') data = self.inp_x9.text.replace(' ', '').split(',') date1 = data[0] date2 = data[1] Main.plot_screen.data = Label(text=str(fn.select10(date1, date2))) Main.plot_screen.main_box.add_widget(Main.plot_screen.data) self.parent.current = "Plot"
def callback1(self, instance): Main.plot_screen.main_box.remove_widget(Main.plot_screen.data) self.parent.transition = sp.SlideTransition(direction='left') data = self.inp_x0.text.replace(' ', '').split(',') username = data[0] date = data[1] color = data[2] plate = data[3] Main.plot_screen.data = Label( text=fn.select1(username, date, color, plate)) Main.plot_screen.main_box.add_widget(Main.plot_screen.data) self.parent.current = "Plot"
def callback(self, instance): data = self.inp_x0.text, self.inp_y0.text, self.inp_n.text, self.inp_xn.text try: if self.validate_data(data): Main.plot_screen.small_box.remove_widget( Main.plot_screen.graph) Main.error_screen.small_box.remove_widget( Main.error_screen.graph1) Main.error_screen.small_box.remove_widget( Main.error_screen.graph2) x0, y0, xn = [ float(i) for i in [self.inp_x0.text, self.inp_y0.text, self.inp_xn.text] ] n = int(self.inp_n.text) gm = GraphsBuilder(x0, y0, n, xn) gf = gm.get_graph() error_gf = gm.local_error_graph() global_error_gf = gm.global_error_graph() Main.plot_screen.graph = gr.FigureCanvasKivyAgg(gf) Main.error_screen.graph1 = gr.FigureCanvasKivyAgg(error_gf) Main.error_screen.graph2 = gr.FigureCanvasKivyAgg( global_error_gf) Main.plot_screen.small_box.add_widget(Main.plot_screen.graph) Main.error_screen.small_box.add_widget( Main.error_screen.graph1) Main.error_screen.small_box.add_widget( Main.error_screen.graph2) self.parent.transition = sp.SlideTransition(direction='left') self.parent.current = "Plot" else: self.inp_x0.text, self.inp_y0.text, self.inp_n.text, self.inp_xn.text = [ 'WRONG DATA' for i in range(4) ] except ValueError and ZeroDivisionError: self.inp_x0.text, self.inp_y0.text, self.inp_n.text, self.inp_xn.text = [ 'WRONG DATA' for i in range(4) ]
def callback8(self, instance): Main.plot_screen.main_box.remove_widget(Main.plot_screen.data) self.parent.transition = sp.SlideTransition(direction='left') Main.plot_screen.data = Label(text=str(fn.test8(self.inp_x7.text))) Main.plot_screen.main_box.add_widget(Main.plot_screen.data) self.parent.current = "Plot"