Skip to content
Snippets Groups Projects
Commit 50a30719 authored by gino's avatar gino
Browse files

small bug correction

parent aea02cbe
No related branches found
No related tags found
No related merge requests found
......@@ -70,14 +70,14 @@ class VarUpdater(Thread):
while not self._stopev:
for v in self.var:
ty=v.get_data_type_as_variant_type()
if ty==ua.VariantType.Double:
if ty==ua.VariantType.Double:
if v.get_value()!=None:
v.set_value(v.get_value()+random.uniform(-5,5))
else:
v.set_value(random.uniform(-5,5))
if ty==ua.VariantType.Int16:
if ty==ua.VariantType.Int16:
v.set_value(random.randint(0,8),ua.VariantType.Int16)
if ty==ua.VariantType.Int32:
if ty==ua.VariantType.Int32:
v.set_value(random.randint(0,8),ua.VariantType.Int32)
time.sleep(2)
......@@ -97,11 +97,12 @@ if __name__ == "__main__":
ua.SecurityPolicyType.NoSecurity,
ua.SecurityPolicyType.Basic256Sha256_SignAndEncrypt,
ua.SecurityPolicyType.Basic256Sha256_Sign])
uri = "http://localhost/$Assembly/"
server.import_xml("$Model")
#set $var=$Url.split("//")[1]
uri = "http://$var"
idx = server.register_namespace(uri)
# import some nodes from xml
server.import_xml("$Model")
root = server.get_root_node()
obj=root.get_children()[0].get_children()[1].get_children()
......@@ -113,7 +114,7 @@ if __name__ == "__main__":
# starting Server
server.start()
vup = VarUpdater(get) # update a monitoring variables only Numeric variables
vup.start()
vup.start()
print("Server Started!")
try:
embed()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment