def main(): # Get forecasts and save to DB def get_forecasts(): data = wfs.wfs().get_all_sources() dbase = db.db() dbase.insert_wfs_data(data) dbase.close_connection() # Read data from sensors and save to DB def read_sensors(): data = sensors.sensors().read_all() dbase = db.db() dbase.insert_sensor_data(data) dbase.close_connection() # Screensaver scr = Thread(target = pir.screensaver) scr.daemon = True scr.start() ##test ##get_forecasts() ##read_sensors() # get data from forecasts each hour repeat_get_forecasts = timer.timer(3600, get_forecasts) repeat_get_forecasts.start() # get data from sensors each minute repreat_read_sensors = timer.timer(60, read_sensors) repreat_read_sensors.start() # Send sensor data to openweathermap.com #response = wfs.wfs().send_to_owm() #print (response) # Interface root = gui.Interface() root.mainloop()
MinorDivisions.value, StartMinorAngle.value, Smooth.state) if Origin.value == CURSOR: obj.setLocation(*Blender.Window.GetCursorPos()) if Orientation.value == XZ: pass elif Orientation.value == XY: obj.RotY = pi / 2.0 elif Orientation.value == YZ: obj.RotX = pi / 2.0 # GUI interface = gui.Interface() Create = gui.Button(interface, 'Create', callback=create) Smooth = gui.Toggle(interface, 'Smooth', True) # basic settings MajorRadius = gui.FloatNumber(interface, '', 1.0, 0.00001, 1.0e8) MinorRadius = gui.FloatNumber(interface, '', 0.25, 0.00001, 1.0e8) MajorDivisions = gui.IntNumber(interface, '', 32, 3, 1024) MinorDivisions = gui.IntNumber(interface, '', 16, 3, 1024) StartMinorAngle = gui.FloatSlider(interface, '', 0, 0, 360) # extended StartMajorAngle = gui.FloatSlider(interface, '', 0, 0, 360) EndMajorAngle = gui.FloatSlider(interface, '', 0, 0, 360) CapStart = gui.Toggle(interface, 'cap', True, tooltip="Cap start")
VDivisions.value, Smooth.state ) if Origin.value == CURSOR: obj.setLocation( *Blender.Window.GetCursorPos() ) if Orientation.value == XZ: pass elif Orientation.value == XY: obj.RotY = pi/2.0 elif Orientation.value == YZ: obj.RotX = pi/2.0 interface = gui.Interface('Mesh Sphere $Revision: 1.1.1.1 $') Radius = gui.FloatNumber(interface, '', 1, 0.001, 1.0e8) UDivisions = gui.IntNumber(interface, 'U: ', 16, 3, 1024) VDivisions = gui.IntNumber(interface, 'V: ', 16, 3, 1024) Smooth = gui.Toggle(interface, 'Smooth', True) Create = gui.Button(interface, 'Create', callback=create) Hemisphere = gui.Toggle(interface, 'Hemisphere', False) Cap = gui.Toggle(interface, 'Cap', True) CapMethod = gui.MultipleToggle(interface, ['simple', 'symmetrical'], 0) Percent = gui.FloatSlider(interface, '', 50, 0, 100) Origin = gui.MultipleToggle(interface, [ ('World center',CENTER), ('3D cursor',CURSOR) ], 0, tooltip="Origin") Orientation = gui.RadioButtons(interface, [('xz',XZ), ('xy',XY), ('yz',YZ)], XZ, tooltip="Orientation")
if Origin.value == CURSOR: obj.setLocation( *Blender.Window.GetCursorPos() ) if Orientation.value == XZ: pass elif Orientation.value == XY: obj.RotY = pi/2.0 elif Orientation.value == YZ: obj.RotX = pi/2.0 ###### Make GUI import gui interface = gui.Interface('Mesh tube $Revision: 1.1.1.1 $') ### Make widgets # dimensions InnerRadius = gui.FloatNumber(interface, '', 1.0, 0.0001, 1.0e8, tooltip='Inner radius') OuterRadius = gui.FloatNumber(interface, '', 2.0, 0.0001, 1.0e8, tooltip='Outer radius') Height = gui.FloatNumber(interface, '', 5.0, 0.0001, 1.0e8, tooltip='Height') # accuracy InnerDivisions = gui.IntNumber(interface, '', 1, 1, 512, tooltip="Inner divisions") OuterDivisions = gui.IntNumber(interface, '', 1, 1, 512, tooltip="Outer divisions") CapDivisions = gui.IntNumber(interface, '', 1, 1, 256, tooltip="Cap divisions") Segments = gui.IntNumber(interface, '', 32, 3, 1024, tooltip="Segments") # cut
if Origin.value == CURSOR: obj.setLocation(*Blender.Window.GetCursorPos()) if Orientation.value == XZ: pass elif Orientation.value == XY: obj.RotY = pi / 2.0 elif Orientation.value == YZ: obj.RotX = pi / 2.0 ###### Make GUI import gui interface = gui.Interface('Mesh cylinder $Revision: 1.1.1.1 $') ### Make widgets # dimensions Radius = gui.FloatNumber(interface, '', 1.0, 0.0001, 1.0e8, tooltip='Radius') Height = gui.FloatNumber(interface, '', 3.0, 0.0001, 1.0e8, tooltip='Height') # accuracy CapDivisions = gui.IntNumber(interface, '', 1, 1, 256, tooltip="Cap divisions") OuterDivisions = gui.IntNumber(interface, '', 1, 1, 256, tooltip="Outer divisions")
if LiveUpdate.state: update() def apply(): global vertex_list, mesh if mesh: update() vertex_list = [] mesh = [] Info.text = 'No mesh selected' # make interface interface = gui.Interface('mesh twist $Revision: 1.1.1.1 $') StartFrom = gui.FloatSlider(interface, 'Start: ', 0.0, 0.0, 100.0, callback=live_update) EndAt = gui.FloatSlider(interface, 'End: ', 100.0, 0.0, 100.0, callback=live_update) Axis = gui.RadioButtons(interface, [('X', AXIS_X), ('Y', AXIS_Y), ('Z', AXIS_Z)],