def main():
    a = QApplication(sys.argv)
    spreadsheet = CurrentMouse()
    jsonName = 'SourisDynamique-a348c1bc1c12.json'
    worksheetName = "InterfaceSouris"
    arduino = Arduino.Arduino()

    try:
        print("Connecting to Google SpreadSheet...")
        spreadsheet.spreadsheetOpen(jsonName, worksheetName)
        print("Creating local data...")
        queue = Queue.Queue()
        rfidQueue = Queue.Queue()
        x = ReadThread(spreadsheet, arduino, queue, rfidQueue)
        print("Creating GUI...")
        gui = MainGui(spreadsheet, x, arduino, queue, rfidQueue)
        print('Program is ready')
        a.exec_()
    except:
        print("Error: Unable to open spreadsheet")


    # sys.exit(a.exec_())
    print('Program terminated')
Example #2
0
def main():
    a = QApplication(sys.argv)
    spreadsheet = CurrentMouse()
    jsonName = "SourisDynamique-a348c1bc1c12.json"
    worksheetName = "InterfaceSouris"
    arduino = Arduino.Arduino()

    # try:
    print("Connecting to Google SpreadSheet...")
    spreadsheet.spreadsheetOpen(jsonName, worksheetName)
    print("Creating local data...")
    spreadsheet.openLocalData()  # Used for RFID and time stamp verification
    queue = Queue.Queue()
    x = ReadThread(spreadsheet, arduino, queue)
    print("Creating GUI...")
    gui = MainGui(spreadsheet, x, arduino, queue)
    localMouseInfo = dict()
    print("Program is ready")
    a.exec_()
    # except:
    #    print("Error: Unable to open spreadsheet")

    # sys.exit(a.exec_())
    print("Program terminated")
Example #3
0
import time
import gspread
import json

from CurrentMouse import CurrentMouse


jsonName = 'SourisDynamique-a348c1bc1c12.json'
worksheetName = "InterfaceSouris"

# Read RFID tag
tagRFID = "1.9.12.110.114.72.21.50.93.17.7.61"

mouse = CurrentMouse()
mouse.spreadsheetOpen(jsonName, worksheetName)

mouse.getMouseInfo(tagRFID)
mouse.updateMouseInfo()
mouse.getMouseInfo(tagRFID)
if mouse.canMouseTrain() == True:
    print("Mouse can train")
else:
    print("Training not available")

#TODO: LAST TRAINING, WHAT'S UP WITH IT

#TODO: TIMER TO STOP
# from threading import Timer
#
# def hello():
#     print "hello, world"
Example #4
0
import time
from CurrentMouse import CurrentMouse


jsonName = 'SourisDynamique-a348c1bc1c12.json'
worksheetName = "InterfaceSouris"

# Read RFID tag
tagRFID = "12345"



# time1 = time.time()
mouse = CurrentMouse()
# time2 = time.time()
mouse.spreadsheetOpen(jsonName, worksheetName)
# time3 = time.time()
# mouse.getMouseInfo(tagRFID)
# time4 = time.time()
# mouse.updateMouseInfo()
# time5 = time.time()
mouse.addMouseGoogle("123456", "Mouse4", 3)
print("ALLO")
# time6 = time.time()

# print("Creation objet:", time2-time1)
# print("Ouverture spreadsheet", time3-time2)
# print("Get info", time4-time3)
# print("Update info",time5-time4)
# print("Adding new mouse",time6-time5)
Example #5
0
import time
import gspread
import json

from CurrentMouse import CurrentMouse


jsonName = 'SourisDynamique-a348c1bc1c12.json'
worksheetName = "InterfaceSouris"

# Read RFID tag
tagRFID = "1.9.12.110.114.72.21.50.93.17.7.61"

mouse = CurrentMouse()
mouse.spreadsheetOpen(jsonName, worksheetName)

mouse.getMouseInfo(tagRFID)

mouse.addMouseGoogle("1.2.3.4.5","Alex",2)


print(mouse.localData)
print(mouse.localData[tagRFID])