How to use _communication method in fMBT

Best Python code snippet using fMBT_python

Communication.py

Source:Communication.py Github

copy

Full Screen

1# This file was automatically generated by SWIG (http://www.swig.org).2# Version 3.0.123#4# Do not make changes to this file unless you know what you are doing--modify5# the SWIG interface file instead.6from sys import version_info as _swig_python_version_info7if _swig_python_version_info >= (2, 7, 0):8 def swig_import_helper():9 import importlib10 pkg = __name__.rpartition('.')[0]11 mname = '.'.join((pkg, '_Communication')).lstrip('.')12 try:13 return importlib.import_module(mname)14 except ImportError:15 return importlib.import_module('_Communication')16 _Communication = swig_import_helper()17 del swig_import_helper18elif _swig_python_version_info >= (2, 6, 0):19 def swig_import_helper():20 from os.path import dirname21 import imp22 fp = None23 try:24 fp, pathname, description = imp.find_module('_Communication', [dirname(__file__)])25 except ImportError:26 import _Communication27 return _Communication28 try:29 _mod = imp.load_module('_Communication', fp, pathname, description)30 finally:31 if fp is not None:32 fp.close()33 return _mod34 _Communication = swig_import_helper()35 del swig_import_helper36else:37 import _Communication38del _swig_python_version_info39try:40 _swig_property = property41except NameError:42 pass # Python < 2.2 doesn't have 'property'.43try:44 import builtins as __builtin__45except ImportError:46 import __builtin__47def _swig_setattr_nondynamic(self, class_type, name, value, static=1):48 if (name == "thisown"):49 return self.this.own(value)50 if (name == "this"):51 if type(value).__name__ == 'SwigPyObject':52 self.__dict__[name] = value53 return54 method = class_type.__swig_setmethods__.get(name, None)55 if method:56 return method(self, value)57 if (not static):58 if _newclass:59 object.__setattr__(self, name, value)60 else:61 self.__dict__[name] = value62 else:63 raise AttributeError("You cannot add attributes to %s" % self)64def _swig_setattr(self, class_type, name, value):65 return _swig_setattr_nondynamic(self, class_type, name, value, 0)66def _swig_getattr(self, class_type, name):67 if (name == "thisown"):68 return self.this.own()69 method = class_type.__swig_getmethods__.get(name, None)70 if method:71 return method(self)72 raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))73def _swig_repr(self):74 try:75 strthis = "proxy of " + self.this.__repr__()76 except __builtin__.Exception:77 strthis = ""78 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)79try:80 _object = object81 _newclass = 182except __builtin__.Exception:83 class _object:84 pass85 _newclass = 086import seiscomp3.Core87class Protocol(_object):88 __swig_setmethods__ = {}89 __setattr__ = lambda self, name, value: _swig_setattr(self, Protocol, name, value)90 __swig_getmethods__ = {}91 __getattr__ = lambda self, name: _swig_getattr(self, Protocol, name)92 def __init__(self, *args, **kwargs):93 raise AttributeError("No constructor defined")94 __repr__ = _swig_repr95 PRIORITY_DEFAULT = _Communication.Protocol_PRIORITY_DEFAULT96 PRIORITY_HIGH = _Communication.Protocol_PRIORITY_HIGH97 PRIORITY_MEDIUM = _Communication.Protocol_PRIORITY_MEDIUM98 PRIORITY_LOW = _Communication.Protocol_PRIORITY_LOW99 CP_QUANTITY = _Communication.Protocol_CP_QUANTITY100 TYPE_DEFAULT = _Communication.Protocol_TYPE_DEFAULT101 TYPE_ONE = _Communication.Protocol_TYPE_ONE102 TYPE_TWO = _Communication.Protocol_TYPE_TWO103 TYPE_THREE = _Communication.Protocol_TYPE_THREE104 CT_QUANTITY = _Communication.Protocol_CT_QUANTITY105 UNDEFINED_SERVICE_MSG = _Communication.Protocol_UNDEFINED_SERVICE_MSG106 CONNECT_GROUP_MSG = _Communication.Protocol_CONNECT_GROUP_MSG107 CONNECT_GROUP_REJECT_MSG = _Communication.Protocol_CONNECT_GROUP_REJECT_MSG108 ADMIN_REJECT_MSG = _Communication.Protocol_ADMIN_REJECT_MSG109 CONNECT_GROUP_OK_MSG = _Communication.Protocol_CONNECT_GROUP_OK_MSG110 JOIN_GROUP_MSG = _Communication.Protocol_JOIN_GROUP_MSG111 LEAVE_GROUP_MSG = _Communication.Protocol_LEAVE_GROUP_MSG112 CLIENT_DISCONNECTED_MSG = _Communication.Protocol_CLIENT_DISCONNECTED_MSG113 INVALID_GROUP_MSG = _Communication.Protocol_INVALID_GROUP_MSG114 MASTER_DISCONNECTED_MSG = _Communication.Protocol_MASTER_DISCONNECTED_MSG115 ARCHIVE_SERVICE_MSG = _Communication.Protocol_ARCHIVE_SERVICE_MSG116 ARCHIVE_REQUEST_MSG = _Communication.Protocol_ARCHIVE_REQUEST_MSG117 INVAlID_ARCHIVE_REQUEST_MSG = _Communication.Protocol_INVAlID_ARCHIVE_REQUEST_MSG118 INVALID_PROTOCOL_MSG = _Communication.Protocol_INVALID_PROTOCOL_MSG119 STATE_OF_HEALTH_CMD_MSG = _Communication.Protocol_STATE_OF_HEALTH_CMD_MSG120 STATE_OF_HEALTH_RESPONSE_MSG = _Communication.Protocol_STATE_OF_HEALTH_RESPONSE_MSG121 REJECTED_CMD_MSG = _Communication.Protocol_REJECTED_CMD_MSG122 LIST_CONNECTED_CLIENTS_CMD_MSG = _Communication.Protocol_LIST_CONNECTED_CLIENTS_CMD_MSG123 LIST_CONNECTED_CLIENTS_RESPONSE_MSG = _Communication.Protocol_LIST_CONNECTED_CLIENTS_RESPONSE_MSG124 CLIENT_DISCONNECT_CMD_MSG = _Communication.Protocol_CLIENT_DISCONNECT_CMD_MSG125 EMT_QUANTITY = _Communication.Protocol_EMT_QUANTITY126 UNDEFINED_MSG = _Communication.Protocol_UNDEFINED_MSG127 DATA_MSG = _Communication.Protocol_DATA_MSG128 ARCHIVE_MSG = _Communication.Protocol_ARCHIVE_MSG129 MT_QUANTITY = _Communication.Protocol_MT_QUANTITY130 CONTENT_BINARY = _Communication.Protocol_CONTENT_BINARY131 CONTENT_XML = _Communication.Protocol_CONTENT_XML132 CONTENT_UNCOMPRESSED_XML = _Communication.Protocol_CONTENT_UNCOMPRESSED_XML133 CONTENT_IMPORTED_XML = _Communication.Protocol_CONTENT_IMPORTED_XML134 CONTENT_BSON = _Communication.Protocol_CONTENT_BSON135 CONTENT_UNCOMPRESSED_BSON = _Communication.Protocol_CONTENT_UNCOMPRESSED_BSON136 CONTENT_JSON = _Communication.Protocol_CONTENT_JSON137 CONTENT_UNCOMPRESSED_JSON = _Communication.Protocol_CONTENT_UNCOMPRESSED_JSON138 MCT_QUANTITY = _Communication.Protocol_MCT_QUANTITY139 if _newclass:140 MsgTypeToString = staticmethod(_Communication.Protocol_MsgTypeToString)141 else:142 MsgTypeToString = _Communication.Protocol_MsgTypeToString143 if _newclass:144 ClientTypeToString = staticmethod(_Communication.Protocol_ClientTypeToString)145 else:146 ClientTypeToString = _Communication.Protocol_ClientTypeToString147 if _newclass:148 ClientPriorityToString = staticmethod(_Communication.Protocol_ClientPriorityToString)149 else:150 ClientPriorityToString = _Communication.Protocol_ClientPriorityToString151 MAX_SEQ_NUM = _Communication.Protocol_MAX_SEQ_NUM152 MASTER_ARCHIVE_SIZE = _Communication.Protocol_MASTER_ARCHIVE_SIZE153 MAX_GROUPS = _Communication.Protocol_MAX_GROUPS154 STD_MSG_LEN = _Communication.Protocol_STD_MSG_LEN155 __swig_destroy__ = _Communication.delete_Protocol156 __del__ = lambda self: None157Protocol_swigregister = _Communication.Protocol_swigregister158Protocol_swigregister(Protocol)159def Protocol_MsgTypeToString(msgType):160 return _Communication.Protocol_MsgTypeToString(msgType)161Protocol_MsgTypeToString = _Communication.Protocol_MsgTypeToString162def Protocol_ClientTypeToString(type):163 return _Communication.Protocol_ClientTypeToString(type)164Protocol_ClientTypeToString = _Communication.Protocol_ClientTypeToString165def Protocol_ClientPriorityToString(priority):166 return _Communication.Protocol_ClientPriorityToString(priority)167Protocol_ClientPriorityToString = _Communication.Protocol_ClientPriorityToString168cvar = _Communication.cvar169Protocol.PROTOCOL_VERSION = _Communication.cvar.Protocol_PROTOCOL_VERSION170Protocol.PROTOCOL_VERSION_V1_0 = _Communication.cvar.Protocol_PROTOCOL_VERSION_V1_0171Protocol.PROTOCOL_VERSION_V1_1 = _Communication.cvar.Protocol_PROTOCOL_VERSION_V1_1172Protocol.HEADER_GROUP_TAG = _Communication.cvar.Protocol_HEADER_GROUP_TAG173Protocol.HEADER_SERVER_VERSION_TAG = _Communication.cvar.Protocol_HEADER_SERVER_VERSION_TAG174Protocol.HEADER_SCHEMA_VERSION_TAG = _Communication.cvar.Protocol_HEADER_SCHEMA_VERSION_TAG175Protocol.MASTER_CLIENT_NAME = _Communication.cvar.Protocol_MASTER_CLIENT_NAME176Protocol.MASTER_GROUP = _Communication.cvar.Protocol_MASTER_GROUP177Protocol.LISTENER_GROUP = _Communication.cvar.Protocol_LISTENER_GROUP178Protocol.IMPORT_GROUP = _Communication.cvar.Protocol_IMPORT_GROUP179Protocol.ADMIN_GROUP = _Communication.cvar.Protocol_ADMIN_GROUP180Protocol.STATUS_GROUP = _Communication.cvar.Protocol_STATUS_GROUP181Protocol.DEFAULT_ADMIN_CLIENT_NAME = _Communication.cvar.Protocol_DEFAULT_ADMIN_CLIENT_NAME182class SyncRequestMessage(seiscomp3.Core.Message):183 __swig_setmethods__ = {}184 for _s in [seiscomp3.Core.Message]:185 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))186 __setattr__ = lambda self, name, value: _swig_setattr(self, SyncRequestMessage, name, value)187 __swig_getmethods__ = {}188 for _s in [seiscomp3.Core.Message]:189 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))190 __getattr__ = lambda self, name: _swig_getattr(self, SyncRequestMessage, name)191 __repr__ = _swig_repr192 if _newclass:193 ClassName = staticmethod(_Communication.SyncRequestMessage_ClassName)194 else:195 ClassName = _Communication.SyncRequestMessage_ClassName196 if _newclass:197 TypeInfo = staticmethod(_Communication.SyncRequestMessage_TypeInfo)198 else:199 TypeInfo = _Communication.SyncRequestMessage_TypeInfo200 def className(self):201 return _Communication.SyncRequestMessage_className(self)202 def typeInfo(self):203 return _Communication.SyncRequestMessage_typeInfo(self)204 if _newclass:205 Cast = staticmethod(_Communication.SyncRequestMessage_Cast)206 else:207 Cast = _Communication.SyncRequestMessage_Cast208 if _newclass:209 ConstCast = staticmethod(_Communication.SyncRequestMessage_ConstCast)210 else:211 ConstCast = _Communication.SyncRequestMessage_ConstCast212 def serialize(self, ar):213 return _Communication.SyncRequestMessage_serialize(self, ar)214 def __init__(self, *args):215 this = _Communication.new_SyncRequestMessage(*args)216 try:217 self.this.append(this)218 except __builtin__.Exception:219 self.this = this220 def empty(self):221 return _Communication.SyncRequestMessage_empty(self)222 def ID(self):223 return _Communication.SyncRequestMessage_ID(self)224 __swig_destroy__ = _Communication.delete_SyncRequestMessage225 __del__ = lambda self: None226SyncRequestMessage_swigregister = _Communication.SyncRequestMessage_swigregister227SyncRequestMessage_swigregister(SyncRequestMessage)228def SyncRequestMessage_ClassName():229 return _Communication.SyncRequestMessage_ClassName()230SyncRequestMessage_ClassName = _Communication.SyncRequestMessage_ClassName231def SyncRequestMessage_TypeInfo():232 return _Communication.SyncRequestMessage_TypeInfo()233SyncRequestMessage_TypeInfo = _Communication.SyncRequestMessage_TypeInfo234def SyncRequestMessage_Cast(*args):235 return _Communication.SyncRequestMessage_Cast(*args)236SyncRequestMessage_Cast = _Communication.SyncRequestMessage_Cast237def SyncRequestMessage_ConstCast(*args):238 return _Communication.SyncRequestMessage_ConstCast(*args)239SyncRequestMessage_ConstCast = _Communication.SyncRequestMessage_ConstCast240class SyncResponseMessage(seiscomp3.Core.Message):241 __swig_setmethods__ = {}242 for _s in [seiscomp3.Core.Message]:243 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))244 __setattr__ = lambda self, name, value: _swig_setattr(self, SyncResponseMessage, name, value)245 __swig_getmethods__ = {}246 for _s in [seiscomp3.Core.Message]:247 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))248 __getattr__ = lambda self, name: _swig_getattr(self, SyncResponseMessage, name)249 __repr__ = _swig_repr250 if _newclass:251 ClassName = staticmethod(_Communication.SyncResponseMessage_ClassName)252 else:253 ClassName = _Communication.SyncResponseMessage_ClassName254 if _newclass:255 TypeInfo = staticmethod(_Communication.SyncResponseMessage_TypeInfo)256 else:257 TypeInfo = _Communication.SyncResponseMessage_TypeInfo258 def className(self):259 return _Communication.SyncResponseMessage_className(self)260 def typeInfo(self):261 return _Communication.SyncResponseMessage_typeInfo(self)262 if _newclass:263 Cast = staticmethod(_Communication.SyncResponseMessage_Cast)264 else:265 Cast = _Communication.SyncResponseMessage_Cast266 if _newclass:267 ConstCast = staticmethod(_Communication.SyncResponseMessage_ConstCast)268 else:269 ConstCast = _Communication.SyncResponseMessage_ConstCast270 def serialize(self, ar):271 return _Communication.SyncResponseMessage_serialize(self, ar)272 def __init__(self, *args):273 this = _Communication.new_SyncResponseMessage(*args)274 try:275 self.this.append(this)276 except __builtin__.Exception:277 self.this = this278 def empty(self):279 return _Communication.SyncResponseMessage_empty(self)280 def ID(self):281 return _Communication.SyncResponseMessage_ID(self)282 __swig_destroy__ = _Communication.delete_SyncResponseMessage283 __del__ = lambda self: None284SyncResponseMessage_swigregister = _Communication.SyncResponseMessage_swigregister285SyncResponseMessage_swigregister(SyncResponseMessage)286def SyncResponseMessage_ClassName():287 return _Communication.SyncResponseMessage_ClassName()288SyncResponseMessage_ClassName = _Communication.SyncResponseMessage_ClassName289def SyncResponseMessage_TypeInfo():290 return _Communication.SyncResponseMessage_TypeInfo()291SyncResponseMessage_TypeInfo = _Communication.SyncResponseMessage_TypeInfo292def SyncResponseMessage_Cast(*args):293 return _Communication.SyncResponseMessage_Cast(*args)294SyncResponseMessage_Cast = _Communication.SyncResponseMessage_Cast295def SyncResponseMessage_ConstCast(*args):296 return _Communication.SyncResponseMessage_ConstCast(*args)297SyncResponseMessage_ConstCast = _Communication.SyncResponseMessage_ConstCast298class ServiceRequestMessage(seiscomp3.Core.Message):299 __swig_setmethods__ = {}300 for _s in [seiscomp3.Core.Message]:301 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))302 __setattr__ = lambda self, name, value: _swig_setattr(self, ServiceRequestMessage, name, value)303 __swig_getmethods__ = {}304 for _s in [seiscomp3.Core.Message]:305 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))306 __getattr__ = lambda self, name: _swig_getattr(self, ServiceRequestMessage, name)307 def __init__(self, *args, **kwargs):308 raise AttributeError("No constructor defined")309 __repr__ = _swig_repr310 if _newclass:311 ClassName = staticmethod(_Communication.ServiceRequestMessage_ClassName)312 else:313 ClassName = _Communication.ServiceRequestMessage_ClassName314 if _newclass:315 TypeInfo = staticmethod(_Communication.ServiceRequestMessage_TypeInfo)316 else:317 TypeInfo = _Communication.ServiceRequestMessage_TypeInfo318 def className(self):319 return _Communication.ServiceRequestMessage_className(self)320 def typeInfo(self):321 return _Communication.ServiceRequestMessage_typeInfo(self)322 if _newclass:323 Cast = staticmethod(_Communication.ServiceRequestMessage_Cast)324 else:325 Cast = _Communication.ServiceRequestMessage_Cast326 if _newclass:327 ConstCast = staticmethod(_Communication.ServiceRequestMessage_ConstCast)328 else:329 ConstCast = _Communication.ServiceRequestMessage_ConstCast330 def serialize(self, ar):331 return _Communication.ServiceRequestMessage_serialize(self, ar)332 def service(self):333 return _Communication.ServiceRequestMessage_service(self)334 __swig_destroy__ = _Communication.delete_ServiceRequestMessage335 __del__ = lambda self: None336ServiceRequestMessage_swigregister = _Communication.ServiceRequestMessage_swigregister337ServiceRequestMessage_swigregister(ServiceRequestMessage)338def ServiceRequestMessage_ClassName():339 return _Communication.ServiceRequestMessage_ClassName()340ServiceRequestMessage_ClassName = _Communication.ServiceRequestMessage_ClassName341def ServiceRequestMessage_TypeInfo():342 return _Communication.ServiceRequestMessage_TypeInfo()343ServiceRequestMessage_TypeInfo = _Communication.ServiceRequestMessage_TypeInfo344def ServiceRequestMessage_Cast(*args):345 return _Communication.ServiceRequestMessage_Cast(*args)346ServiceRequestMessage_Cast = _Communication.ServiceRequestMessage_Cast347def ServiceRequestMessage_ConstCast(*args):348 return _Communication.ServiceRequestMessage_ConstCast(*args)349ServiceRequestMessage_ConstCast = _Communication.ServiceRequestMessage_ConstCast350class ServiceProvideMessage(seiscomp3.Core.Message):351 __swig_setmethods__ = {}352 for _s in [seiscomp3.Core.Message]:353 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))354 __setattr__ = lambda self, name, value: _swig_setattr(self, ServiceProvideMessage, name, value)355 __swig_getmethods__ = {}356 for _s in [seiscomp3.Core.Message]:357 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))358 __getattr__ = lambda self, name: _swig_getattr(self, ServiceProvideMessage, name)359 def __init__(self, *args, **kwargs):360 raise AttributeError("No constructor defined")361 __repr__ = _swig_repr362 if _newclass:363 ClassName = staticmethod(_Communication.ServiceProvideMessage_ClassName)364 else:365 ClassName = _Communication.ServiceProvideMessage_ClassName366 if _newclass:367 TypeInfo = staticmethod(_Communication.ServiceProvideMessage_TypeInfo)368 else:369 TypeInfo = _Communication.ServiceProvideMessage_TypeInfo370 def className(self):371 return _Communication.ServiceProvideMessage_className(self)372 def typeInfo(self):373 return _Communication.ServiceProvideMessage_typeInfo(self)374 if _newclass:375 Cast = staticmethod(_Communication.ServiceProvideMessage_Cast)376 else:377 Cast = _Communication.ServiceProvideMessage_Cast378 if _newclass:379 ConstCast = staticmethod(_Communication.ServiceProvideMessage_ConstCast)380 else:381 ConstCast = _Communication.ServiceProvideMessage_ConstCast382 def serialize(self, ar):383 return _Communication.ServiceProvideMessage_serialize(self, ar)384 def service(self):385 return _Communication.ServiceProvideMessage_service(self)386 def parameters(self):387 return _Communication.ServiceProvideMessage_parameters(self)388 def empty(self):389 return _Communication.ServiceProvideMessage_empty(self)390 __swig_destroy__ = _Communication.delete_ServiceProvideMessage391 __del__ = lambda self: None392ServiceProvideMessage_swigregister = _Communication.ServiceProvideMessage_swigregister393ServiceProvideMessage_swigregister(ServiceProvideMessage)394def ServiceProvideMessage_ClassName():395 return _Communication.ServiceProvideMessage_ClassName()396ServiceProvideMessage_ClassName = _Communication.ServiceProvideMessage_ClassName397def ServiceProvideMessage_TypeInfo():398 return _Communication.ServiceProvideMessage_TypeInfo()399ServiceProvideMessage_TypeInfo = _Communication.ServiceProvideMessage_TypeInfo400def ServiceProvideMessage_Cast(*args):401 return _Communication.ServiceProvideMessage_Cast(*args)402ServiceProvideMessage_Cast = _Communication.ServiceProvideMessage_Cast403def ServiceProvideMessage_ConstCast(*args):404 return _Communication.ServiceProvideMessage_ConstCast(*args)405ServiceProvideMessage_ConstCast = _Communication.ServiceProvideMessage_ConstCast406class DatabaseRequestMessage(ServiceRequestMessage):407 __swig_setmethods__ = {}408 for _s in [ServiceRequestMessage]:409 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))410 __setattr__ = lambda self, name, value: _swig_setattr(self, DatabaseRequestMessage, name, value)411 __swig_getmethods__ = {}412 for _s in [ServiceRequestMessage]:413 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))414 __getattr__ = lambda self, name: _swig_getattr(self, DatabaseRequestMessage, name)415 __repr__ = _swig_repr416 if _newclass:417 ClassName = staticmethod(_Communication.DatabaseRequestMessage_ClassName)418 else:419 ClassName = _Communication.DatabaseRequestMessage_ClassName420 if _newclass:421 TypeInfo = staticmethod(_Communication.DatabaseRequestMessage_TypeInfo)422 else:423 TypeInfo = _Communication.DatabaseRequestMessage_TypeInfo424 def className(self):425 return _Communication.DatabaseRequestMessage_className(self)426 def typeInfo(self):427 return _Communication.DatabaseRequestMessage_typeInfo(self)428 if _newclass:429 Cast = staticmethod(_Communication.DatabaseRequestMessage_Cast)430 else:431 Cast = _Communication.DatabaseRequestMessage_Cast432 if _newclass:433 ConstCast = staticmethod(_Communication.DatabaseRequestMessage_ConstCast)434 else:435 ConstCast = _Communication.DatabaseRequestMessage_ConstCast436 def __init__(self, *args):437 this = _Communication.new_DatabaseRequestMessage(*args)438 try:439 self.this.append(this)440 except __builtin__.Exception:441 self.this = this442 __swig_destroy__ = _Communication.delete_DatabaseRequestMessage443 __del__ = lambda self: None444DatabaseRequestMessage_swigregister = _Communication.DatabaseRequestMessage_swigregister445DatabaseRequestMessage_swigregister(DatabaseRequestMessage)446def DatabaseRequestMessage_ClassName():447 return _Communication.DatabaseRequestMessage_ClassName()448DatabaseRequestMessage_ClassName = _Communication.DatabaseRequestMessage_ClassName449def DatabaseRequestMessage_TypeInfo():450 return _Communication.DatabaseRequestMessage_TypeInfo()451DatabaseRequestMessage_TypeInfo = _Communication.DatabaseRequestMessage_TypeInfo452def DatabaseRequestMessage_Cast(*args):453 return _Communication.DatabaseRequestMessage_Cast(*args)454DatabaseRequestMessage_Cast = _Communication.DatabaseRequestMessage_Cast455def DatabaseRequestMessage_ConstCast(*args):456 return _Communication.DatabaseRequestMessage_ConstCast(*args)457DatabaseRequestMessage_ConstCast = _Communication.DatabaseRequestMessage_ConstCast458class DatabaseProvideMessage(ServiceProvideMessage):459 __swig_setmethods__ = {}460 for _s in [ServiceProvideMessage]:461 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))462 __setattr__ = lambda self, name, value: _swig_setattr(self, DatabaseProvideMessage, name, value)463 __swig_getmethods__ = {}464 for _s in [ServiceProvideMessage]:465 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))466 __getattr__ = lambda self, name: _swig_getattr(self, DatabaseProvideMessage, name)467 __repr__ = _swig_repr468 if _newclass:469 ClassName = staticmethod(_Communication.DatabaseProvideMessage_ClassName)470 else:471 ClassName = _Communication.DatabaseProvideMessage_ClassName472 if _newclass:473 TypeInfo = staticmethod(_Communication.DatabaseProvideMessage_TypeInfo)474 else:475 TypeInfo = _Communication.DatabaseProvideMessage_TypeInfo476 def className(self):477 return _Communication.DatabaseProvideMessage_className(self)478 def typeInfo(self):479 return _Communication.DatabaseProvideMessage_typeInfo(self)480 if _newclass:481 Cast = staticmethod(_Communication.DatabaseProvideMessage_Cast)482 else:483 Cast = _Communication.DatabaseProvideMessage_Cast484 if _newclass:485 ConstCast = staticmethod(_Communication.DatabaseProvideMessage_ConstCast)486 else:487 ConstCast = _Communication.DatabaseProvideMessage_ConstCast488 def __init__(self, *args):489 this = _Communication.new_DatabaseProvideMessage(*args)490 try:491 self.this.append(this)492 except __builtin__.Exception:493 self.this = this494 def database(self):495 return _Communication.DatabaseProvideMessage_database(self)496 __swig_destroy__ = _Communication.delete_DatabaseProvideMessage497 __del__ = lambda self: None498DatabaseProvideMessage_swigregister = _Communication.DatabaseProvideMessage_swigregister499DatabaseProvideMessage_swigregister(DatabaseProvideMessage)500def DatabaseProvideMessage_ClassName():501 return _Communication.DatabaseProvideMessage_ClassName()502DatabaseProvideMessage_ClassName = _Communication.DatabaseProvideMessage_ClassName503def DatabaseProvideMessage_TypeInfo():504 return _Communication.DatabaseProvideMessage_TypeInfo()505DatabaseProvideMessage_TypeInfo = _Communication.DatabaseProvideMessage_TypeInfo506def DatabaseProvideMessage_Cast(*args):507 return _Communication.DatabaseProvideMessage_Cast(*args)508DatabaseProvideMessage_Cast = _Communication.DatabaseProvideMessage_Cast509def DatabaseProvideMessage_ConstCast(*args):510 return _Communication.DatabaseProvideMessage_ConstCast(*args)511DatabaseProvideMessage_ConstCast = _Communication.DatabaseProvideMessage_ConstCast512class NetworkMessage(seiscomp3.Core.BaseObject):513 __swig_setmethods__ = {}514 for _s in [seiscomp3.Core.BaseObject]:515 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))516 __setattr__ = lambda self, name, value: _swig_setattr(self, NetworkMessage, name, value)517 __swig_getmethods__ = {}518 for _s in [seiscomp3.Core.BaseObject]:519 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))520 __getattr__ = lambda self, name: _swig_getattr(self, NetworkMessage, name)521 __repr__ = _swig_repr522 if _newclass:523 ClassName = staticmethod(_Communication.NetworkMessage_ClassName)524 else:525 ClassName = _Communication.NetworkMessage_ClassName526 if _newclass:527 TypeInfo = staticmethod(_Communication.NetworkMessage_TypeInfo)528 else:529 TypeInfo = _Communication.NetworkMessage_TypeInfo530 def className(self):531 return _Communication.NetworkMessage_className(self)532 def typeInfo(self):533 return _Communication.NetworkMessage_typeInfo(self)534 if _newclass:535 Cast = staticmethod(_Communication.NetworkMessage_Cast)536 else:537 Cast = _Communication.NetworkMessage_Cast538 if _newclass:539 ConstCast = staticmethod(_Communication.NetworkMessage_ConstCast)540 else:541 ConstCast = _Communication.NetworkMessage_ConstCast542 def serialize(self, ar):543 return _Communication.NetworkMessage_serialize(self, ar)544 def __init__(self, *args):545 this = _Communication.new_NetworkMessage(*args)546 try:547 self.this.append(this)548 except __builtin__.Exception:549 self.this = this550 __swig_destroy__ = _Communication.delete_NetworkMessage551 __del__ = lambda self: None552 def privateSenderGroup(self):553 return _Communication.NetworkMessage_privateSenderGroup(self)554 def setPrivateSenderGroup(self, privateGroup):555 return _Communication.NetworkMessage_setPrivateSenderGroup(self, privateGroup)556 def clientName(self):557 return _Communication.NetworkMessage_clientName(self)558 def hostname(self):559 return _Communication.NetworkMessage_hostname(self)560 def type(self):561 return _Communication.NetworkMessage_type(self)562 def setType(self, type):563 return _Communication.NetworkMessage_setType(self, type)564 def messageType(self):565 return _Communication.NetworkMessage_messageType(self)566 def setMessageType(self, type):567 return _Communication.NetworkMessage_setMessageType(self, type)568 def contentType(self):569 return _Communication.NetworkMessage_contentType(self)570 def setContentType(self, type):571 return _Communication.NetworkMessage_setContentType(self, type)572 def destination(self):573 return _Communication.NetworkMessage_destination(self)574 def setDestination(self, destinationGroup):575 return _Communication.NetworkMessage_setDestination(self, destinationGroup)576 def tag(self, seqNum, timeStamp):577 return _Communication.NetworkMessage_tag(self, seqNum, timeStamp)578 def tagged(self):579 return _Communication.NetworkMessage_tagged(self)580 def seqNum(self):581 return _Communication.NetworkMessage_seqNum(self)582 def timestamp(self):583 return _Communication.NetworkMessage_timestamp(self)584 def data(self):585 return _Communication.NetworkMessage_data(self)586 def dataSize(self):587 return _Communication.NetworkMessage_dataSize(self)588 def setData(self, *args):589 return _Communication.NetworkMessage_setData(self, *args)590 def setSize(self, size):591 return _Communication.NetworkMessage_setSize(self, size)592 def size(self):593 return _Communication.NetworkMessage_size(self)594 def read(self, buf, size):595 return _Communication.NetworkMessage_read(self, buf, size)596 def write(self, buf, size):597 return _Communication.NetworkMessage_write(self, buf, size)598 def copy(self):599 return _Communication.NetworkMessage_copy(self)600 if _newclass:601 Encode = staticmethod(_Communication.NetworkMessage_Encode)602 else:603 Encode = _Communication.NetworkMessage_Encode604 def decode(self):605 return _Communication.NetworkMessage_decode(self)606NetworkMessage_swigregister = _Communication.NetworkMessage_swigregister607NetworkMessage_swigregister(NetworkMessage)608def NetworkMessage_ClassName():609 return _Communication.NetworkMessage_ClassName()610NetworkMessage_ClassName = _Communication.NetworkMessage_ClassName611def NetworkMessage_TypeInfo():612 return _Communication.NetworkMessage_TypeInfo()613NetworkMessage_TypeInfo = _Communication.NetworkMessage_TypeInfo614def NetworkMessage_Cast(*args):615 return _Communication.NetworkMessage_Cast(*args)616NetworkMessage_Cast = _Communication.NetworkMessage_Cast617def NetworkMessage_ConstCast(*args):618 return _Communication.NetworkMessage_ConstCast(*args)619NetworkMessage_ConstCast = _Communication.NetworkMessage_ConstCast620def NetworkMessage_Encode(arg1, type, schemaVersion=-1):621 return _Communication.NetworkMessage_Encode(arg1, type, schemaVersion)622NetworkMessage_Encode = _Communication.NetworkMessage_Encode623class ServiceMessage(NetworkMessage):624 __swig_setmethods__ = {}625 for _s in [NetworkMessage]:626 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))627 __setattr__ = lambda self, name, value: _swig_setattr(self, ServiceMessage, name, value)628 __swig_getmethods__ = {}629 for _s in [NetworkMessage]:630 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))631 __getattr__ = lambda self, name: _swig_getattr(self, ServiceMessage, name)632 __repr__ = _swig_repr633 if _newclass:634 ClassName = staticmethod(_Communication.ServiceMessage_ClassName)635 else:636 ClassName = _Communication.ServiceMessage_ClassName637 if _newclass:638 TypeInfo = staticmethod(_Communication.ServiceMessage_TypeInfo)639 else:640 TypeInfo = _Communication.ServiceMessage_TypeInfo641 def className(self):642 return _Communication.ServiceMessage_className(self)643 def typeInfo(self):644 return _Communication.ServiceMessage_typeInfo(self)645 if _newclass:646 Cast = staticmethod(_Communication.ServiceMessage_Cast)647 else:648 Cast = _Communication.ServiceMessage_Cast649 if _newclass:650 ConstCast = staticmethod(_Communication.ServiceMessage_ConstCast)651 else:652 ConstCast = _Communication.ServiceMessage_ConstCast653 def serialize(self, ar):654 return _Communication.ServiceMessage_serialize(self, ar)655 def __init__(self, *args):656 this = _Communication.new_ServiceMessage(*args)657 try:658 self.this.append(this)659 except __builtin__.Exception:660 self.this = this661 __swig_destroy__ = _Communication.delete_ServiceMessage662 __del__ = lambda self: None663 def protocolVersion(self):664 return _Communication.ServiceMessage_protocolVersion(self)665 def setProtocolVersion(self, version):666 return _Communication.ServiceMessage_setProtocolVersion(self, version)667 def clientType(self):668 return _Communication.ServiceMessage_clientType(self)669 def setClientType(self, clientType):670 return _Communication.ServiceMessage_setClientType(self, clientType)671 def clientPriority(self):672 return _Communication.ServiceMessage_clientPriority(self)673 def setClientPriority(self, clientPriority):674 return _Communication.ServiceMessage_setClientPriority(self, clientPriority)675 def copy(self):676 return _Communication.ServiceMessage_copy(self)677 def archiveSeqNum(self):678 return _Communication.ServiceMessage_archiveSeqNum(self)679 def setArchiveSeqNum(self, seqNum):680 return _Communication.ServiceMessage_setArchiveSeqNum(self, seqNum)681 def archiveTimestamp(self):682 return _Communication.ServiceMessage_archiveTimestamp(self)683 def setArchiveTimestamp(self, timestamp):684 return _Communication.ServiceMessage_setArchiveTimestamp(self, timestamp)685 def setPassword(self, password):686 return _Communication.ServiceMessage_setPassword(self, password)687 def password(self):688 return _Communication.ServiceMessage_password(self)689 def setPeerGroup(self, peerGroup):690 return _Communication.ServiceMessage_setPeerGroup(self, peerGroup)691 def peerGroup(self):692 return _Communication.ServiceMessage_peerGroup(self)693ServiceMessage_swigregister = _Communication.ServiceMessage_swigregister694ServiceMessage_swigregister(ServiceMessage)695def ServiceMessage_ClassName():696 return _Communication.ServiceMessage_ClassName()697ServiceMessage_ClassName = _Communication.ServiceMessage_ClassName698def ServiceMessage_TypeInfo():699 return _Communication.ServiceMessage_TypeInfo()700ServiceMessage_TypeInfo = _Communication.ServiceMessage_TypeInfo701def ServiceMessage_Cast(*args):702 return _Communication.ServiceMessage_Cast(*args)703ServiceMessage_Cast = _Communication.ServiceMessage_Cast704def ServiceMessage_ConstCast(*args):705 return _Communication.ServiceMessage_ConstCast(*args)706ServiceMessage_ConstCast = _Communication.ServiceMessage_ConstCast707class NetworkInterface(seiscomp3.Core.BaseObject):708 __swig_setmethods__ = {}709 for _s in [seiscomp3.Core.BaseObject]:710 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))711 __setattr__ = lambda self, name, value: _swig_setattr(self, NetworkInterface, name, value)712 __swig_getmethods__ = {}713 for _s in [seiscomp3.Core.BaseObject]:714 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))715 __getattr__ = lambda self, name: _swig_getattr(self, NetworkInterface, name)716 def __init__(self, *args, **kwargs):717 raise AttributeError("No constructor defined - class is abstract")718 __repr__ = _swig_repr719 if _newclass:720 ClassName = staticmethod(_Communication.NetworkInterface_ClassName)721 else:722 ClassName = _Communication.NetworkInterface_ClassName723 if _newclass:724 TypeInfo = staticmethod(_Communication.NetworkInterface_TypeInfo)725 else:726 TypeInfo = _Communication.NetworkInterface_TypeInfo727 def className(self):728 return _Communication.NetworkInterface_className(self)729 def typeInfo(self):730 return _Communication.NetworkInterface_typeInfo(self)731 if _newclass:732 Cast = staticmethod(_Communication.NetworkInterface_Cast)733 else:734 Cast = _Communication.NetworkInterface_Cast735 if _newclass:736 ConstCast = staticmethod(_Communication.NetworkInterface_ConstCast)737 else:738 ConstCast = _Communication.NetworkInterface_ConstCast739 __swig_destroy__ = _Communication.delete_NetworkInterface740 __del__ = lambda self: None741 def connect(self, serverAddress, clientName):742 return _Communication.NetworkInterface_connect(self, serverAddress, clientName)743 def disconnect(self):744 return _Communication.NetworkInterface_disconnect(self)745 def receive(self, error=None):746 return _Communication.NetworkInterface_receive(self, error)747 def send(self, group, type, msg, selfDiscard=True):748 return _Communication.NetworkInterface_send(self, group, type, msg, selfDiscard)749 def subscribe(self, group):750 return _Communication.NetworkInterface_subscribe(self, group)751 def unsubscribe(self, group):752 return _Communication.NetworkInterface_unsubscribe(self, group)753 def poll(self, error=None):754 return _Communication.NetworkInterface_poll(self, error)755 def isConnected(self):756 return _Communication.NetworkInterface_isConnected(self)757 if _newclass:758 Create = staticmethod(_Communication.NetworkInterface_Create)759 else:760 Create = _Communication.NetworkInterface_Create761 def privateGroup(self):762 return _Communication.NetworkInterface_privateGroup(self)763 def groupOfLastSender(self):764 return _Communication.NetworkInterface_groupOfLastSender(self)765 def setSequenceNumber(self, seq):766 return _Communication.NetworkInterface_setSequenceNumber(self, seq)767 def getSequenceNumber(self):768 return _Communication.NetworkInterface_getSequenceNumber(self)769NetworkInterface_swigregister = _Communication.NetworkInterface_swigregister770NetworkInterface_swigregister(NetworkInterface)771def NetworkInterface_ClassName():772 return _Communication.NetworkInterface_ClassName()773NetworkInterface_ClassName = _Communication.NetworkInterface_ClassName774def NetworkInterface_TypeInfo():775 return _Communication.NetworkInterface_TypeInfo()776NetworkInterface_TypeInfo = _Communication.NetworkInterface_TypeInfo777def NetworkInterface_Cast(*args):778 return _Communication.NetworkInterface_Cast(*args)779NetworkInterface_Cast = _Communication.NetworkInterface_Cast780def NetworkInterface_ConstCast(*args):781 return _Communication.NetworkInterface_ConstCast(*args)782NetworkInterface_ConstCast = _Communication.NetworkInterface_ConstCast783def NetworkInterface_Create(service):784 return _Communication.NetworkInterface_Create(service)785NetworkInterface_Create = _Communication.NetworkInterface_Create786class SystemConnection(seiscomp3.Core.BaseObject):787 __swig_setmethods__ = {}788 for _s in [seiscomp3.Core.BaseObject]:789 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))790 __setattr__ = lambda self, name, value: _swig_setattr(self, SystemConnection, name, value)791 __swig_getmethods__ = {}792 for _s in [seiscomp3.Core.BaseObject]:793 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))794 __getattr__ = lambda self, name: _swig_getattr(self, SystemConnection, name)795 __repr__ = _swig_repr796 NON_THREADED = _Communication.SystemConnection_NON_THREADED797 THREADED = _Communication.SystemConnection_THREADED798 LM_QUANTITY = _Communication.SystemConnection_LM_QUANTITY799 def __init__(self, networkInterface=None):800 this = _Communication.new_SystemConnection(networkInterface)801 try:802 self.this.append(this)803 except __builtin__.Exception:804 self.this = this805 __swig_destroy__ = _Communication.delete_SystemConnection806 __del__ = lambda self: None807 def connect(self, *args):808 return _Communication.SystemConnection_connect(self, *args)809 def reconnect(self):810 return _Communication.SystemConnection_reconnect(self)811 def disconnect(self):812 return _Communication.SystemConnection_disconnect(self)813 def isConnected(self):814 return _Communication.SystemConnection_isConnected(self)815 def subscribe(self, group):816 return _Communication.SystemConnection_subscribe(self, group)817 def unsubscribe(self, group):818 return _Communication.SystemConnection_unsubscribe(self, group)819 def subscribeArchive(self, group):820 return _Communication.SystemConnection_subscribeArchive(self, group)821 def unsubscribeArchive(self, group):822 return _Communication.SystemConnection_unsubscribeArchive(self, group)823 def archiveRequest(self):824 return _Communication.SystemConnection_archiveRequest(self)825 def receive(self, blocking=True, error=None):826 return _Communication.SystemConnection_receive(self, blocking, error)827 def readNetworkMessage(self, blocking=True):828 return _Communication.SystemConnection_readNetworkMessage(self, blocking)829 def readLocalMessage(self):830 return _Communication.SystemConnection_readLocalMessage(self)831 def send(self, *args):832 return _Communication.SystemConnection_send(self, *args)833 def poll(self):834 return _Communication.SystemConnection_poll(self)835 def listen(self, *args):836 return _Communication.SystemConnection_listen(self, *args)837 def stopListening(self):838 return _Communication.SystemConnection_stopListening(self)839 def isListening(self):840 return _Communication.SystemConnection_isListening(self)841 def masterAddress(self):842 return _Communication.SystemConnection_masterAddress(self)843 def peerGroup(self):844 return _Communication.SystemConnection_peerGroup(self)845 def privateGroup(self):846 return _Communication.SystemConnection_privateGroup(self)847 def type(self):848 return _Communication.SystemConnection_type(self)849 def priority(self):850 return _Communication.SystemConnection_priority(self)851 def groupCount(self):852 return _Communication.SystemConnection_groupCount(self)853 def group(self, i):854 return _Communication.SystemConnection_group(self, i)855 def groups(self):856 return _Communication.SystemConnection_groups(self)857 def password(self):858 return _Communication.SystemConnection_password(self)859 def setPassword(self, password):860 return _Communication.SystemConnection_setPassword(self, password)861 def queuedMessageCount(self):862 return _Communication.SystemConnection_queuedMessageCount(self)863 def networkInterface(self):864 return _Communication.SystemConnection_networkInterface(self)865 def setSequenceNumber(self, seq):866 return _Communication.SystemConnection_setSequenceNumber(self, seq)867 def getSequenceNumber(self):868 return _Communication.SystemConnection_getSequenceNumber(self)869 def schemaVersion(self):870 return _Communication.SystemConnection_schemaVersion(self)871SystemConnection_swigregister = _Communication.SystemConnection_swigregister872SystemConnection_swigregister(SystemConnection)873BINARY_ENCODING = _Communication.BINARY_ENCODING874XML_ENCODING = _Communication.XML_ENCODING875EMessageEncodingQuantity = _Communication.EMessageEncodingQuantity876class EMessageEncodingNames(_object):877 __swig_setmethods__ = {}878 __setattr__ = lambda self, name, value: _swig_setattr(self, EMessageEncodingNames, name, value)879 __swig_getmethods__ = {}880 __getattr__ = lambda self, name: _swig_getattr(self, EMessageEncodingNames, name)881 __repr__ = _swig_repr882 def __init__(self):883 this = _Communication.new_EMessageEncodingNames()884 try:885 self.this.append(this)886 except __builtin__.Exception:887 self.this = this888 if _newclass:889 name = staticmethod(_Communication.EMessageEncodingNames_name)890 else:891 name = _Communication.EMessageEncodingNames_name892 __swig_destroy__ = _Communication.delete_EMessageEncodingNames893 __del__ = lambda self: None894EMessageEncodingNames_swigregister = _Communication.EMessageEncodingNames_swigregister895EMessageEncodingNames_swigregister(EMessageEncodingNames)896def EMessageEncodingNames_name(i):897 return _Communication.EMessageEncodingNames_name(i)898EMessageEncodingNames_name = _Communication.EMessageEncodingNames_name899class Connection(SystemConnection):900 __swig_setmethods__ = {}901 for _s in [SystemConnection]:902 __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))903 __setattr__ = lambda self, name, value: _swig_setattr(self, Connection, name, value)904 __swig_getmethods__ = {}905 for _s in [SystemConnection]:906 __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))907 __getattr__ = lambda self, name: _swig_getattr(self, Connection, name)908 def __init__(self, *args, **kwargs):909 raise AttributeError("No constructor defined")910 __repr__ = _swig_repr911 SKIP_UNKNOWN = _Communication.Connection_SKIP_UNKNOWN912 READ_ALL = _Communication.Connection_READ_ALL913 RM_QUANTITY = _Communication.Connection_RM_QUANTITY914 __swig_destroy__ = _Communication.delete_Connection915 __del__ = lambda self: None916 def setEncoding(self, enc):917 return _Communication.Connection_setEncoding(self, enc)918 def encoding(self):919 return _Communication.Connection_encoding(self)920 def readMessage(self, *args):921 return _Communication.Connection_readMessage(self, *args)922 def readQueuedMessage(self, *args):923 return _Communication.Connection_readQueuedMessage(self, *args)924 def send(self, *args):925 return _Communication.Connection_send(self, *args)926 if _newclass:927 Create = staticmethod(_Communication.Connection_Create)928 else:929 Create = _Communication.Connection_Create930 def dispatch(self, arg2):931 return _Communication.Connection_dispatch(self, arg2)932 def transmittedBytes(self):933 return _Communication.Connection_transmittedBytes(self)934 def receivedBytes(self):935 return _Communication.Connection_receivedBytes(self)936Connection_swigregister = _Communication.Connection_swigregister937Connection_swigregister(Connection)938def Connection_Create(*args):939 return _Communication.Connection_Create(*args)940Connection_Create = _Communication.Connection_Create...

Full Screen

Full Screen

fix1.py

Source:fix1.py Github

copy

Full Screen

1import sys2import os 3replaceDict = {4"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_kevinSRU_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/SRU/kevinSRU/lib/kevinSRU_rig_pr.ma",5"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_SunnyHome_Int.Master_share.hero.ma":"P:/Two_Heroes/asset/set/sunny/houseSunnyINT/lib/houseSunnyINT_rig_pr.ma",6"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_spiderGirl_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/god/spiderGirlGod/lib/spiderGirlGod_rig_pr.ma",7"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_th_NurseryRoom_rig_pr.Model_share.hero.ma":"P:/Two_Heroes/asset/set/city/nurseryRoomINT/lib/nurseryRoomINT_rig_pr.ma",8"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_bodyDemon_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/bodyDemon/lib/bodyDemon_rig_pr.ma",9"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_earsDemon_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/earsDemon/lib/earsDemon_rig_pr.ma",10"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_sunnySRU_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/SRU/sunnySRU/lib/sunnySRU_rig_pr.ma",11"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_mayor_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/main/mayorLokCity/lib/mayorLokCity_rig_pr.ma",12"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_obeseMan_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/manObese/lib/manObese_rig_pr.ma",13"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_th_italianRestaurantAll01_rig_pr.Model_share.hero.ma":"P:/Two_Heroes/asset/set/city/italianRestaurantAll01/lib/italianRestaurantAll01_rig_pr.ma",14"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_merchant2_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/merchant02/lib/merchant02_rig_pr.ma",15"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_helicopterSRU01_rig_mk.Rig_share.hero.ma":"P:/Two_Heroes/asset/vehicle/air/helicopterSRU01/lib/helicopterSRU01_rig_pr.ma",16"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_sonGokuAnSuit_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/main/sonGokuAncientArmor/lib/sonGokuAncientArmor_rig_pr.ma",17"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_motocycleSunny01_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/vehicle/motorcycle/motorcycleSunny01/lib/motorcycleSunny01_rig_pr.ma",18"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_tougueDemon_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/tongueDemon/lib/tongueDemon_rig_pr.ma",19"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_merchant3_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/merchant03/lib/merchant03_rig_pr.ma",20"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_headquarterSRU_rig_pr.Model_share.hero.ma":"P:/Two_Heroes/asset/set/city/headquarterSRU/lib/headquarterSRU_rig_pr.ma",21"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_th_princessOfIronFanOld_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/god/princessIronFanOldGod/lib/princessIronFanOldGod_rig_pr.ma",22"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_TrafficLane_model_medAlley_v002.Model_share.hero.ma":"P:/Two_Heroes/asset/set/city/roadStraightJam/lib/roadStraightJam_rig_pr.ma",23"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_photographer1_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/photographer01/lib/photographer01.rig_pr.ma",24"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_skeltonDemon.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/skeletonDemon/lib/skeletonDemon_rig_pr.ma",25"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_threeEyeGod_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/god/threeEyesGod/lib/threeEyesGod_rig_pr.ma",26"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_layoutCamRig_med.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/cameraMan01/lib/cameraMan01_rig.pr.ma",27"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_westernDemonB_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/westernDemon02/lib/westernDemon02_rig_pr.ma",28"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_th_squareBronzeStatue_rig_pr.Model_share.hero.ma":"P:/Two_Heroes/asset/set/city/squareBronzeStatue/lib/squareBronzeStatue_rig_pr.ma",29"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_FireTruck_rig_mk.Master_share.hero.ma":"P:/Two_Heroes/asset/vehicle/service/truckFire01/lib/truckFire01_rig_pr.ma",30"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_powerPlantINT_mk.Rig_share.hero.ma":"P:/Two_Heroes/asset/set/outskirts/reactorINT/lib/reactorINT_rig_pr.ma",31"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_westernDemonA_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/westernDemon01/lib/westernDemon01_rig_pr.ma",32"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_hanumanCasualSuit_med.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/main/hanumanClothesCivil/lib/hanumanClothesCivil_rig_pr.ma",33"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_th_prisonIsland_rig_pr.Master_share.hero.ma":"P:/Two_Heroes/asset/set/outskirts/prisonIsland/lib/prisonIsland_rig_pr.ma",34"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_th_goldenCudgelSonGoku01_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/weapon/god/goldenCudgelSonGoku01/lib/goldenCudgelSonGoku01_rig_pr.ma",35"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_girlStreet_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/generic/girlGeneric01/lib/girlGeneric01_rig_pr.ma",36"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_helicopterSRU01_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/vehicle/air/helicopterSRU01/lib/helicopterSRU01_rig_pr.ma",37"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_th_HospitalHall_rig_pr.Model_share.hero.ma":"P:/Two_Heroes/asset/set/city/nurseryRoomINT/lib/nurseryRoomINT_rig_pr.ma",38"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_th_sunnyHome_mk_pr.Model_share.hero.ma":"P:/Two_Heroes/asset/set/sunny/houseSunnyEXT/lib/houseSunnyEXT_rig_pr.ma",39"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_eyesDemon_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/eyesDemon/lib/eyesDemon_rig_pr.ma",40"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_westernDemonC_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/westernDemon03/lib/westernDemon03_rig_pr.ma",41"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_ericSRU_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/SRU/ericSRU/lib/ericSRU_rig_pr.ma",42"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_skyDogGod_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/god/skyDogGod/lib/skyDogGod_rig_pr.ma",43"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_BronzeStatue_model_monk_v001.Model_share.hero.ma":"P:/Two_Heroes/asset/set/city/squareBronzeStatue/lib/squareBronzeStatue_rig_pr.ma",44"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_bodyguard3_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/service/security03/lib/security03_rig_pr.ma",45"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_thermometer_med.Rig_share.hero.ma":"P:/Two_Heroes/asset/set/city/squareBronzeStatue/lib/squareBronzeStatue_rig_pr.ma",46"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_th_fengshenMalletHanuman01_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/weapon/god/fengshenMalletHanuman01/lib/fengshenMalletHanuman01_rig_pr.ma",47"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_helicopterSRU02_mk.Model_share.hero.ma":"P:/Two_Heroes/asset/vehicle/air/helicopterSRU01/lib/helicopterSRU01_rig_pr.ma",48"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_AirPort_ext_Mk.Model_share.hero.ma":"P:/Two_Heroes/asset/set/airport/airportEXT01/lib/airportEXT01_rig_pr.ma",49"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_COW.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/bullCalf/lib/bullCalf_rig_pr.ma",50"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_bullDemon_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/bullDemon/lib/bullDemon_rig_pr.ma",51"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_th_mayorMeetingRoomINT_rig_pr.Model_share.hero.ma":"P:/Two_Heroes/asset/set/city/mayorMeetingRoomINT/lib/mayorMeetingRoomINT_rig_pr.ma",52"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_merchant1_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/merchant01/lib/merchant01_rig_pr.ma",53"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_bodyguard4_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/service/security04/lib/security04_rig_pr.ma",54"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_NewbornInfant_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/infantGeneric01/lib/infantGeneric01_rig_pr.ma",55"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_famaleReporter_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/womanReporter/lib/womanReporter_rig_pr.ma",56"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_nezhaGod_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/god/nezhaGod/lib/nezhaGod_rig_pr.ma",57"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_captainSRU_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/SRU/captainSRU/lib/captainSRU_rig_pr.ma",58"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_statue_med.Rig_share.hero.ma":"P:/Two_Heroes/asset/prop/statue/bronzeStatue/lib/bronzeStatue_rig.pr.ma",59"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_spider_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/god/spiderSpiderGirlGod/lib/spiderSpiderGirlGod_rig_pr.ma",60"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_lilySRU_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/SRU/lilySRU/lib/lilySRU_rig_pr.ma",61"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_princessOfIronFanOld_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/god/princessIronFanOldGod/lib/princessIronFanOldGod_rig_pr.ma",62"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_th_manHomeless_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/manHomeless/lib/manHomeless_rig_pr.ma",63"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_ancientBeaconGarbage_rig_pr.Model_share.hero.ma":"P:/Two_Heroes/asset/set/outskirts/ancientBeaconGarbage/lib/ancientBeaconGarbage_rig_pr.ma",64"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_femaleNurse_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/service/nurse01/lib/nurse01_rig_pr.ma",65"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_airplane_mk.Master_share.hero.ma":"P:/Two_Heroes/asset/vehicle/air/plane01/lib/plane01_rig_pr.ma",66"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_HeadquartersEquipmentRoom_mk.Rig_share.hero.ma":"P:/Two_Heroes/asset/set/city/equipmentRoomSRU/lib/equipmentRoomSRU_rig_pr.ma",67"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_godDemonWeapon.Rig_share.hero.ma":"P:/Two_Heroes/asset/prop/demon/demonWeapon/lib/demonWeapon_rig_pr.ma",68"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_brainDemon_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/brainDemon/lib/brainDemon_rig_pr.ma",69"P:/Two_Heroes/_communication/freelance/theMonk/assets/set_MainTerrain_mk.Model_share.hero.ma":"P:/Two_Heroes/asset/set/outskirts/mainTerrain/lib/mainTerrain_rig.pr.ma",70"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_merchant5_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/merchant05/lib/merchant05_rig_pr.ma",71"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_merchant4_proxy.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/secondary/merchant04/lib/merchant04_rig_pr.ma",72"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_noseDemon_rig_pr.Rig_share.hero.ma":"P:/Two_Heroes/asset/character/demon/noseDemon/lib/noseDemon_rig_pr.ma",73"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_glider.Rig_share.hero.ma":"",74"P:/Two_Heroes/_communication/freelance/theMonk/assets/prop_statueBroken_med.Rig_share.hero.ma":"P:/Two_Heroes/asset/prop/statue/bronzeStatueBroken/lib/bronzeStatueBroken_rig_pr.ma",75"P:/Two_Heroes/_communication/freelance/theMonk/assets/char_hanumanAnSuit_proxy.Rig_share.hero.ma": "P:/Two_Heroes/asset/character/main/hanumanAncientArmor/lib/hanumanAncientArmor_rig_pr.ma",...

Full Screen

Full Screen

gui.py

Source:gui.py Github

copy

Full Screen

1"""Usage: run-hexagui [options]2Options:3-h, --help Print this message.4-l, --log-to-stdout Send log to stdout.5"""6import logging7import pkg_resources8import sys9import time10from PyQt5 import QtCore11from PyQt5.QtCore import pyqtSignal12from PyQt5.QtWidgets import QApplication, QMainWindow13from docopt import docopt14from hexacommon.common.coordinates import Point2D15from hexacommon.common.gps_data import GPSData16from hexacommon.common.communication import Communication17from hexagui.toolbars.gps_controll_toolbar import GpsControlToolbar18from hexagui.toolbars.logging_toolbar import LoggingToolbar19from hexagui.toolbars.mode_selection_toolbar import ModeSelectionToolbar20from hexagui.toolbars.network_toolbar import NetworkToolbar21from hexagui.toolbars.rc_toolbar import RemoteControlToolbar22from hexagui.toolbars.regulator_toolbar import RegulatorToolbar23from hexagui.utils import recorders24from hexagui.widgets.map_label import MapLabel25class HexapiGUI(QMainWindow):26 update_control_values = pyqtSignal(int, int, int, int, str)27 def __init__(self):28 super(HexapiGUI, self).__init__()29 self.setWindowTitle("Hexacopter controller")30 start_time = time.strftime("%y-%m-%d %H:%M:%S")31 logging.info("==== Starting hexagui " + start_time + " ====")32 self._set_application_style()33 # Parameter initialization:34 self._altitude = -10035 self._pitch = 036 self._yaw = 037 self._roll = 038 self._copter_mode = "ATTI"39 self._latest_copter_position = (58.376801, 15.647814)40 self._auto_return = False41 self._pressed_keys = []42 self._add_map()43 self._start_keyboard_timer()44 self._communication = Communication(in_port=4092, out_port=4094)45 self._connect_callbacks()46 self._communication.start()47 self._add_network_toolbar()48 #self._add_mode_selection_toolbar()49 self._add_rc_toolbar()50 self._add_gps_toolbar()51 self._add_regulator_setting_toolbar()52 self._add_logging_toolbar()53 # Initialization functions54 def _add_map(self):55 self._map = MapLabel(parent=self, center=self._latest_copter_position)56 self.setCentralWidget(self._map)57 self._map.setFocus()58 def _start_keyboard_timer(self):59 key_timer = QtCore.QTimer(self)60 key_timer.timeout.connect(self._handel_key_presses)61 key_timer.start(30)62 def _connect_callbacks(self):63 self._communication.connect_command_callback(self._receive_gps_data, "GPS_DATA")64 self._communication.connect_command_callback(recorders.receive_acc_data, "ACC_DATA")65 self._communication.connect_command_callback(recorders.receive_mag_data, "MAG_DATA")66 self._communication.connect_command_callback(recorders.receive_ang_data, "ANG_DATA")67 def _add_logging_toolbar(self):68 logging_toolbar = LoggingToolbar(self._communication)69 self.addToolBar(QtCore.Qt.RightToolBarArea, logging_toolbar)70 def _add_regulator_setting_toolbar(self):71 regulator_toolbar = RegulatorToolbar(self._communication)72 self.addToolBar(QtCore.Qt.RightToolBarArea, regulator_toolbar)73 def _add_rc_toolbar(self):74 rc_toolbar = RemoteControlToolbar()75 rc_toolbar.start_motors.connect(self._start_motors)76 rc_toolbar.set_auto_return.connect(self._set_auto_return)77 self.update_control_values.connect(rc_toolbar.update_control_values)78 self.addToolBar(QtCore.Qt.RightToolBarArea, rc_toolbar)79 def _add_gps_toolbar(self):80 gps_toolbar = GpsControlToolbar(self._communication, self._map)81 self.addToolBar(QtCore.Qt.RightToolBarArea, gps_toolbar)82 def _add_mode_selection_toolbar(self):83 mode_toolbar = ModeSelectionToolbar(self._communication)84 #mode_toolbar.switch_mode.connect()85 self.addToolBar(QtCore.Qt.TopToolBarArea, mode_toolbar)86 def _add_network_toolbar(self):87 network_toolbar = NetworkToolbar(self._communication)88 network_toolbar.reset_hexacopter_parameters.connect(89 self._reset_controls)90 self.addToolBar(QtCore.Qt.TopToolBarArea, network_toolbar)91 def _set_application_style(self):92 self.setMinimumSize(640, 640)93 style_file_path = pkg_resources.resource_filename(94 __name__, 'resources/app_style.qss')95 with open(style_file_path, 'r') as style_file_object:96 self.setStyleSheet(style_file_object.read())97 # Qt event handling functions98 def closeEvent(self, event):99 self._communication.stop()100 super(HexapiGUI, self).closeEvent(event)101 def keyPressEvent(self, event):102 self._pressed_keys.append(event.key())103 def keyReleaseEvent(self, event):104 if event.key() in self._pressed_keys:105 self._pressed_keys.remove(event.key())106 # Other107 def _update_control_values(self):108 self.update_control_values.emit(109 self._pitch, self._roll, self._yaw, self._altitude,110 self._copter_mode)111 def _receive_gps_data(self, latitude, longitude):112 logging.info("GUI: Copter position, lat: {}, long: {}".format(113 latitude, longitude))114 location = Point2D(float(latitude), float(longitude))115 self._latest_copter_position = (location.x, location.y)116 self._map.add_point(self._latest_copter_position)117 # Slots118 @QtCore.pyqtSlot()119 def _reset_controls(self):120 self._altitude = -100121 self._pitch = 0122 self._yaw = 0123 self._roll = 0124 self._copter_mode = "ATTI"125 self._update_control_values()126 @QtCore.pyqtSlot()127 def _start_motors(self):128 self._communication.send_command("START_MOTORS")129 self._reset_controls()130 self._altitude = -75131 self._update_control_values()132 @QtCore.pyqtSlot()133 def _center_map(self):134 self._map.set_center(self._latest_copter_position)135 @QtCore.pyqtSlot(bool)136 def _set_auto_return(self, auto_return):137 self._auto_return = auto_return138 @QtCore.pyqtSlot()139 def _handel_key_presses(self):140 if self._auto_return:141 if _opposite_sign(self._pitch) or \142 _opposite_sign(self._roll) or \143 _opposite_sign(self._yaw):144 self._pitch += _opposite_sign(self._pitch)145 self._roll += _opposite_sign(self._roll)146 self._yaw += _opposite_sign(self._yaw)147 self._communication.send_command("SET_PITCH", self._pitch)148 self._communication.send_command("SET_ROLL", self._roll)149 self._communication.send_command("SET_YAW", self._yaw)150 self._update_control_values()151 for key in self._pressed_keys:152 if key == QtCore.Qt.Key_W:153 if _in_rang(self._pitch + 2):154 self._pitch += 2155 self._communication.send_command("SET_PITCH", self._pitch)156 if key == QtCore.Qt.Key_S:157 if _in_rang(self._pitch - 2):158 self._pitch -= 2159 self._communication.send_command("SET_PITCH", self._pitch)160 if key == QtCore.Qt.Key_A:161 if _in_rang(self._roll - 2):162 self._roll -= 2163 self._communication.send_command("SET_ROLL", self._roll)164 if key == QtCore.Qt.Key_D:165 if _in_rang(self._roll + 2):166 self._roll += 2167 self._communication.send_command("SET_ROLL", self._roll)168 if key == QtCore.Qt.Key_Q:169 if _in_rang(self._yaw - 2):170 self._yaw -= 2171 self._communication.send_command("SET_YAW", self._yaw)172 if key == QtCore.Qt.Key_E:173 if _in_rang(self._yaw + 2):174 self._yaw += 2175 self._communication.send_command("SET_YAW", self._yaw)176 if key == QtCore.Qt.Key_R:177 if _in_rang(self._altitude + 1):178 self._altitude += 1179 self._communication.send_command("SET_ALTITUDE", self._altitude)180 if key == QtCore.Qt.Key_F:181 if _in_rang(self._altitude - 1):182 self._altitude -= 1183 self._communication.send_command("SET_ALTITUDE", self._altitude)184 if key == QtCore.Qt.Key_1:185 self._copter_mode = "FS"186 self._communication.send_command("SET_MODE", self._copter_mode)187 if key == QtCore.Qt.Key_2:188 self._copter_mode = "MAN"189 self._communication.send_command("SET_MODE", self._copter_mode)190 if key == QtCore.Qt.Key_3:191 self._copter_mode = "ATTI"192 self._communication.send_command("SET_MODE", self._copter_mode)193 if key == QtCore.Qt.Key_C:194 self._pitch = 0195 self._roll = 0196 self._yaw = 0197 self._communication.send_command("SET_PITCH", self._pitch)198 self._communication.send_command("SET_ROLL", self._roll)199 self._communication.send_command("SET_YAW", self._yaw)200 if key == QtCore.Qt.Key_L:201 self._land()202 if key == QtCore.Qt.Key_O:203 self._start_motors()204 if key == QtCore.Qt.Key_K:205 self._kill()206 if key == QtCore.Qt.Key_M:207 self._center_map()208 self._update_control_values()209# Mixes utility functions210def _in_rang(value):211 return -100 <= value <= 100212def _opposite_sign(x):213 if x > 0:214 ans = -1215 elif x < 0:216 ans = 1217 else:218 ans = 0219 return ans220def main():221 arguments = docopt(__doc__)222 if arguments['--log-to-stdout']:223 logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)224 else:225 logging.basicConfig(filename='hexagui.log', level=logging.DEBUG)226 app = QApplication([])227 win = HexapiGUI()228 win.show()229 sys.exit(app.exec_())230if __name__ == "__main__":...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful