Example #1
0
        def showGraph1(
        ):  #not an instance method, purely a do something methd. Instance methods are inline with the constructor and take self as a default parameter.
            try:
                staticVariables.connectionError = False  #refresh booleans
                staticVariables.notConnectionError = not staticVariables.connectionError
                staticVariables.permissionError = False
                staticVariables.notPermissionError = not staticVariables.permissionError
                staticVariables.isPaused = False
                staticVariables.isStopped = False

                if len(entry1.get()) == 0 or len(entry2.get()) == 0:
                    raise parameterException('Please fill in all fields')
                getDataFields()
                threadObj = SerialCommunication()
                #threadObj2 = AnimationCSV()
                #Thread(target = serialCom).start()
                checkFile()
                while True:
                    if staticVariables.connectionError == True:
                        print("connectionError is true")
                        break
                    elif staticVariables.permissionError == True:
                        messagebox.showerror("Error", "Check .csv file!")
                        break
                    elif (staticVariables.connectionError == False
                          and staticVariables.notConnectionError == True) and (
                              staticVariables.permissionError == False
                              and staticVariables.notPermissionError == True):
                        print("No errors detected")
                        self.destroy(
                        )  #destroys reference to object but object still exists.
                        app = FixedInterval()
                        #root = app
                        staticVariables.aniObj = Animate(
                            200, staticVariables.UCL, staticVariables.LCL, 0,
                            0)
                        ani = animation.FuncAnimation(
                            staticVariables.fig,
                            staticVariables.aniObj.animate,
                            interval=700)
                        break
                for thread in Thread.enumerate():
                    print(thread.name)

                staticVariables.connectionError = False  #refresh booleans
                staticVariables.notConnectionError = not staticVariables.connectionError
                tk.mainloop()
            except parameterException as pe:
                messagebox.showerror("Error", pe)
Example #2
0
            import pdb
            pdb.post_mortem(sys.exc_info()[2])
        #NEWPM.pm(errid)
        return e #pass up to Java

    # Workaround for bugs in OAA 2.3.2
    mod = sys.modules.get("spark.io.oaa")
    if mod:
        # disconnect/stop OAA if it has been loaded
        mod.oaaStop(runAgent)
        # Try to kill off rogue OAA 2.3.2 thread
        try:
            from jarray import zeros
            from java.lang import Thread
            threads = zeros(Thread.activeCount(), Thread)
            num = Thread.enumerate(threads)
            #print num, "active Java threads on exiting SPARK:"
            for t in threads:
                #print " ", t, ("NOT DAEMON", "daemon")[t.isDaemon()]
                if t.name == "pool-1-thread-1":
                    print "Explicitly stopping thread pool-1-thread-1"
                    t.stop()
        except ImportError:
            pass

    dispose(runAgent)
    debugger_cleanup()
    return exitcode

def getProperty(joptname,penvname):
    "Retrieve options from registry or value from environment"
Example #3
0
            import pdb
            pdb.post_mortem(sys.exc_info()[2])
        #NEWPM.pm(errid)
        return e  #pass up to Java

    # Workaround for bugs in OAA 2.3.2
    mod = sys.modules.get("spark.io.oaa")
    if mod:
        # disconnect/stop OAA if it has been loaded
        mod.oaaStop(runAgent)
        # Try to kill off rogue OAA 2.3.2 thread
        try:
            from jarray import zeros
            from java.lang import Thread
            threads = zeros(Thread.activeCount(), Thread)
            num = Thread.enumerate(threads)
            #print num, "active Java threads on exiting SPARK:"
            for t in threads:
                #print " ", t, ("NOT DAEMON", "daemon")[t.isDaemon()]
                if t.name == "pool-1-thread-1":
                    print "Explicitly stopping thread pool-1-thread-1"
                    t.stop()
        except ImportError:
            pass

    dispose(runAgent)
    debugger_cleanup()
    return exitcode


def getProperty(joptname, penvname):