class MainAppController(object):

    def read(self):
        self.view.t1.delete(0,len(self.view.t1.get()))
        self.view.t2.delete(0,len(self.view.t2.get()))
        self.view.t3.delete(0,len(self.view.t3.get()))
        self.view.t4.delete(0,len(self.view.t4.get()))
        self.view.t5.delete(0,len(self.view.t5.get()))
        self.view.t6.delete(0,len(self.view.t6.get()))
        self.view.t7.delete(0,len(self.view.t7.get()))
        self.view.t8.delete(0,len(self.view.t8.get()))
        self.view.t9.delete(0,len(self.view.t9.get()))
        file_name = tk.filedialog.askopenfilename()
        OCR.OCR(file_name)
        data = NLP.NLP()
        self.view.t1.insert(0,data[3])
        self.view.t2.insert(0,data[4])
        self.view.t3.insert(0,data[0])
        self.view.t4.insert(0,data[5])
        self.view.t5.insert(0,data[7])
        self.view.t6.insert(0,data[1])
        self.view.t7.insert(0,data[2])
        self.view.t8.insert(0,data[6])
        self.view.t9.insert(0,data[8])
        

    def init_view(self,root):

        self.view = MainAppView(master=root)

        # Bind buttons with callback methods
        self.view.one["command"] = self.read

        # Start the gui
        self.view.start_gui()
예제 #2
0
class MainAppController(object):
    def visual(self):
        if self.check is None:
            self.mainView.error_msg("No graph found!")
        else:
            self.mainView.update_statusbar("Visualizing graph...")
            start = Visualise()
            start.start_visualizing(self.check)

    def generate(self):
        freq = self.mainView.freq.get()
        duration = self.mainView.duration.get()
        volume = self.mainView.volume.get()

        if freq == "0" or duration == "0" or volume == "0":
            self.mainView.error_msg("Enter a non zero value!")
        else:
            start = Generate(int(duration), int(freq), int(volume))
            self.check = start.start_gen(self.choose_wave())
            self.mainView.update_statusbar("File generated!")

    def choose_wave(self):
        return self.mainView.v.get()

    def __init__(self, root):
        self.check = None
        self.errorCode = -1
        self.mainView = MainAppView(master=root)

        self.mainView.gen["command"] = self.generate
        self.mainView.vis["command"] = self.visual

        # Start the gui
        self.mainView.start_gui()
    def init_view(self,root):

        self.view = MainAppView(master=root)

        # Bind buttons with callback methods
        self.view.one["command"] = self.read

        # Start the gui
        self.view.start_gui()
예제 #4
0
    def __init__(self, root):
        self.check = None
        self.errorCode = -1
        self.mainView = MainAppView(master=root)

        self.mainView.gen["command"] = self.generate
        self.mainView.vis["command"] = self.visual

        # Start the gui
        self.mainView.start_gui()
예제 #5
0
    def init_view(self, root):
        self.view = MainAppView(master=root)

        # Bind buttons with callback methods
        self.view.one["command"] = self.nothing
        self.view.two["command"] = self.nothing
        self.view.three["command"] = self.nothing
        self.view.four["command"] = self.nothing

        # Start the gui
        self.view.start_gui()
예제 #6
0
    def init_view(self, root):
        """Initializes GUI view

        In addition it bindes the Buttons with the callback methods.

           
        """
        self.view = MainAppView(master=root)

        # Bind buttons with callback methods
        self.view.one["command"] = self.nothing
        self.view.two["command"] = self.nothing
        self.view.three["command"] = self.nothing
        self.view.four["command"] = self.nothing

        # Start the gui
        self.view.start_gui()
예제 #7
0
    def init_view(self,root):
        """Initializes GUI view

            In addition it bindes the Buttons with the callback methods.

           
        """
        self.view = MainAppView(master=root)

        self.us = UltrasoundController(comPort = 'COM4')   

        print "After Initialization"
    
        # Bind buttons with callback methods
        self.view.sendTx["command"] = self.TxParametersButton
        self.view.stop["command"] = self.stopCommand
        self.view.three["command"] = self.J
        self.view.four["command"] = self.V

        # Start the gui 
        self.view.start_gui()
예제 #8
0
class MainAppController(object):  


    def J(self):
        print "Josh is Cool"
    
    def V(self):
        print "Vicky is cool"

    def stopCommand(self):
        self.us.stop()

    def TxParametersButton(self):
        self.us.TxParameters(f_pulse=0.5e6,f_repition=1e3,pulses=5)


    def init_view(self,root):
        """Initializes GUI view

            In addition it bindes the Buttons with the callback methods.

           
        """
        self.view = MainAppView(master=root)

        self.us = UltrasoundController(comPort = 'COM4')   

        print "After Initialization"
    
        # Bind buttons with callback methods
        self.view.sendTx["command"] = self.TxParametersButton
        self.view.stop["command"] = self.stopCommand
        self.view.three["command"] = self.J
        self.view.four["command"] = self.V

        # Start the gui 
        self.view.start_gui()

    def close(self):
        self.us.closePort()
예제 #9
0
class MainAppController(object):  


    def nothing(self):
        pass


    def init_view(self,root):
        """Initializes GUI view

            In addition it bindes the Buttons with the callback methods.

           
        """
        self.view = MainAppView(master=root)   
    
        # Bind buttons with callback methods
        self.view.one["command"] = self.nothing
        self.view.two["command"] = self.nothing
        self.view.three["command"] = self.nothing
        self.view.four["command"] = self.nothing

        # Start the gui 
        self.view.start_gui()