Commit 9d13b1aa authored by Bruno Laurencich's avatar Bruno Laurencich

panel dummy redrawing working

parent 065a2fad
......@@ -40,11 +40,22 @@ class Chord_Get_Ip(bpy.types.Operator):
return {'CANCELLED'}
if event.type == 'TIMER':
context.object.rotation_euler.y += 0.2
context.window_manager.some_number += 1
if context.window_manager.some_number%3 == 0:
context.window_manager.chordata.state = "Disconnected"
elif context.window_manager.some_number%3 == 1:
context.window_manager.chordata.state = "Searching.."
elif context.window_manager.some_number%3 == 2:
context.window_manager.chordata.state = "Connected"
if self.query_thread.is_alive():
print("ip query ongoing..")
context.window_manager.chordata.state = possible_states()[1][0]
# context.window_manager.chordata.state = possible_states()[1][0]
else:
context.window_manager.chordata.state = possible_states()[2][0]
# context.window_manager.chordata.state = possible_states()[2][0]
with self.query_lock:
print("IP found :", self.found_ip)
......@@ -139,6 +150,10 @@ def register():
bpy.utils.register_class(Chord_Properties)
WindowManager.chordata = \
bpy.props.PointerProperty(type=Chord_Properties)
WindowManager.some_number = \
bpy.props.IntProperty()
bpy.utils.register_module(__name__)
......
......@@ -21,6 +21,8 @@ class Chord_tools_panel(bpy.types.Panel):
layout = self.layout
layout.operator("chordata.get_ip", "Connect")
layout.prop(context.window_manager, "some_number")
layout.prop(context.window_manager.chordata, "state", expand=True)
layout.label(context.window_manager.chordata.state,\
icon= get_conn_state_attr(context, "icon"))
......@@ -28,4 +30,3 @@ class Chord_tools_panel(bpy.types.Panel):
# print(conn_state)
# layout.prop(context.window_manager.chordata, "state", expand=True)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment