예제 #1
0
def first_set_time():
    con = sql.Data("database/smarthome")
    time = con.timer_read()
    global ID
    ID = time[0] + 1
    time_s = time[1].split(",") + time[2].split(",") + time[3].split(
        ",") + time[4].split(",") + time[5].split(",") + time[6].split(",")
    return time_s
예제 #2
0
def setdata():
    con = sql.Data("database/smarthome")
    set_data = con.resolution_input(ID_resolution, mST1.get(), MST1.get(),
                                    mST2.get(), MST2.get(), mST3.get(),
                                    MST3.get(), mST4.get(), MST4.get(),
                                    mSL1.get(), MSL1.get(), mSL2.get(),
                                    MSL2.get(), mSL3.get(), MSL3.get(),
                                    mSL4.get(), MSL4.get(), mSW1.get(),
                                    MSW1.get(), mSW2.get(), MSW2.get(),
                                    mSW3.get(), MSW3.get(), mSW4.get(),
                                    MSW4.get(), mSD1.get(), MSD1.get(),
                                    mSD2.get(), MSD2.get(), mSD3.get(),
                                    MSD3.get(), mSD4.get(), MSD4.get())
    print(set_data)
예제 #3
0
def set_data():
    times_1 = str(
        str(hro1.get()) + "," + str(mro1.get()) + "," + str(hrf1.get()) + "," +
        str(mrf1.get()))
    times_2 = str(
        str(hro2.get()) + "," + str(mro2.get()) + "," + str(hrf2.get()) + "," +
        str(mrf2.get()))
    times_3 = str(
        str(hro3.get()) + "," + str(mro3.get()) + "," + str(hrf3.get()) + "," +
        str(mrf3.get()))
    times_4 = str(
        str(hro4.get()) + "," + str(mro4.get()) + "," + str(hrf4.get()) + "," +
        str(mrf4.get()))
    times_5 = str(
        str(hro5.get()) + "," + str(mro5.get()) + "," + str(hrf5.get()) + "," +
        str(mrf5.get()))
    times_6 = str(
        str(hro6.get()) + "," + str(mro6.get()) + "," + str(hrf6.get()) + "," +
        str(mrf6.get()))
    con = sql.Data("database/smarthome")
    action = con.timer_input(ID, times_1, times_2, times_3, times_4, times_5,
                             times_6)
    print(action)
예제 #4
0
edit.add_command(label="Change your SERVER", command=Change_your_SERVER)
menubar.add_cascade(label="Edit", menu=edit)

edit = Menu(menubar, tearoff=0)
edit.add_command(label="About System", command=About_System)
edit.add_command(label="System Help", command=System_Help)
edit.add_command(label="Application Help", command=Application_Help)
edit.add_separator()
edit.add_command(label="Software Help", command=Software_Help)
menubar.add_cascade(label="Help", menu=edit)

scwt.config(menu=menubar)

times = first_set_time()
print(times)
con = sql.Data("database/smarthome")
sens = []
sens = con.sensor_read()

#sens info :
Label(sensorinfo, font=("Calibri", 20),
      text="Relay 1: %i" % (sens[17])).grid(row=0, column=0)
Label(sensorinfo, font=("Calibri", 20),
      text="\tRelay 2: %i" % (sens[18])).grid(row=0, column=1)
Label(sensorinfo, font=("Calibri", 20),
      text="\tRelay 3: %i" % (sens[19])).grid(row=0, column=2)
Label(sensorinfo, font=("Calibri", 20),
      text="\tRelay 4: %i" % (sens[20])).grid(row=0, column=3)
Label(sensorinfo, font=("Calibri", 20),
      text="\tRelay 5: %i" % (sens[21])).grid(row=0, column=4)
Label(sensorinfo, font=("Calibri", 20),
def set_on():
    smr = sql.Data("database/smarthome")
    action = smr.manualctrl_input(ID,1,1,1,1,1,1)
    print (action)
def set_mode():
    smr = sql.Data("database/smarthome")
    action = smr.manualctrl_input(ID,r1.get(),r2.get(),r3.get(),r4.get(),r5.get(),r6.get())
    print (action)
예제 #7
0
def sem_mode_system():
    localtime = time.asctime( time.localtime(time.time()) )
    set_m = sql.Data("database/smarthome")
    action = set_m.smode_input(ID, ctrl.get(),str(localtime))
    print (action)
    home.destroy()