本文整理汇总了Python中modules.base_module.RanaModule类的典型用法代码示例。如果您正苦于以下问题:Python RanaModule类的具体用法?Python RanaModule怎么用?Python RanaModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RanaModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
self.defaultTheme = constants.DEFAULT_THEME_ID
self.cantLoad = []
self.imageOrderList = [] # for cache trimming
self.maxImages = 200 # default 200
self.images = {}
self.currentTheme = self.defaultTheme
self.themeList = []
# structure -> color_key:color_object
self.defaultColors = {} # default color set
self.colors = {} # main combined color set
defaultThemeConfig = os.path.join(
self.modrana.paths.getThemesFolderPath(),
self.defaultTheme,
'theme.conf'
)
# TODO: make themes GUI toolkit independent
if gs.GUIString == "GTK":
# load the default set of colors
defaultColors = self.loadColorsFromFile(defaultThemeConfig)
self.defaultColors = defaultColors
self.colors = defaultColors.copy()
self.colorInfoSubscribers = {}
#color shortcuts
self.buttonOutlineColor = (0, 0, 0, 1)
self.buttonFillColor = (1, 1, 1, 1)
示例2: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
self.tt = 0
self.connected = False
self.set('speed', None)
self.set('metersPerSecSpeed', None)
self.set('bearing', None)
self.set('elevation', None)
self.status = "Unknown"
self._enabled = False
self.provider = None
self.startSignal = Signal()
self.stopSignal = Signal()
# check if the device handles location by itself
if not self.modrana.dmod.handlesLocation():
method = self.modrana.dmod.getLocationType()
if method == "qt_mobility":
print(" @ location: using Qt Mobility")
from . import qt_mobility
self.provider = qt_mobility.QtMobility(self)
elif method == "gpsd": # GPSD
print(" @ location: using GPSD")
from . import gps_daemon
self.provider = gps_daemon.GPSD(self)
# watch if debugging needs to be enabled
self.modrana.watch("gpsDebugEnabled", self._debugCB, runNow=True)
示例3: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
self.loggingEnabled = False
self.loggingPaused = False
self.loggingStartTimestamp = None
self.logInterval = 1 #loggin interval in seconds
self.saveInterval = 10 #saving interval in seconds
self.lastUpdateTimestamp = None
self.lastCoords = None
self.logName = None #name of the current log
self.logFilename = None #name of the current log
self.logPath = None #path to the current log
self.currentTempLog = []
# primary and secondary AOWay objects for
# persistent log storage during logging
self.log1 = None
self.log2 = None
# timer ids
self.updateLogTimerId = None
self.saveLogTimerId = None
# statistics
self.maxSpeed = None
self.avg1 = 0
self.avg2 = 0
self.avgSpeed = None
self.distance = None
self.toolsMenuDone = False
self.category = 'logs'
# trace
self.traceColor = 'blue'
self.lastTracePoint = None
self.traceIndex = 0
self.pxpyIndex = deque()
示例4: __init__
def __init__(self, *args, **kwargs):
RanaModule.__init__(self, *args, **kwargs)
self.nodes = []
self.pos = 0
self.numNodes = 0
self.updateTime = 0
self.replayPeriod = 1 # second
示例5: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
self.nodes = []
self.pos = 0
self.numNodes = 0
self.updateTime = 0
self.replayPeriod = 1 # second
示例6: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
self.layers = {}
self.threadLayers = {}
self.currentStorageVersion = 1
self.maxDbFileSizeGibiBytes = 3.7 # maximum database file size (to avoid the FAT32 file size limitation) in GibiBytes
self.maxTilesInQueue = 50
self.sqliteTileQueue = Queue.Queue(self.maxTilesInQueue)
"""if there are more tiles in the buffer than maxTilesInBuffer,
the whole buffer will be processed at once (flushed) to avoid a potential memory leak
"""
self.processPerUpdate = 1 #how many tiles will be processed per update (updates should happen every 100ms)
self.commitInterval = 5 # how often we commit to the database (only happens when there is something in the queue)
self.lastCommit = time.time()
self.dirty = set() # a set of connections, that have uncommitted data
# locks
# TODO: this lock might not be needed for python2.6+,
# as their sqlite version should be thread safe
self.lookupConnectionLock = threading.RLock()
self._mapTiles = None
self._mapLayers = None
self.tileFolder = "/dev/null"
示例7: __init__
def __init__(self, *args, **kwargs):
RanaModule.__init__(self, *args, **kwargs)
self.workerThreads = []
self.drawOverlay = False
self.workStartTimestamp = None
self._connectingCondition = threading.Condition()
# TODO: move to location ?
self._initGPSCondition = threading.Condition()
示例8: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
self.espaekProcess = None
# this lock is used to make sure there is only one voice speaking at once
self.voiceLock = threading.Lock()
# default espeak string for manual editing
self.defaultStrings = {"espeak": "espeak -v %language% -s 120 -a %volume% -m %qmessage%"}
self.defaultProvider = "espeak"
示例9: __init__
def __init__(self, *args, **kwargs):
RanaModule.__init__(self, *args, **kwargs)
self.tempOnlinePOI = None # temporary slot for an uncommitted POI from online search
# to which menu to return after the POI is stored
# NOTE: False => unset, None => map screen
self.menuNameAfterStorageComplete = False
# connect to the POI database
self._db = self.connect_to_database()
示例10: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
self.activePOI = None
self.visiblePOI = []
self.listMenusDirty = False
self.drawActivePOI = False
self.expectPoint = False
self.expectLock = threading.Lock()
示例11: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
self.tracklogs = {} # dictionary of all loaded tracklogs, path is the key
#self.set('tracklogs', self.tracklogs) # now we make the list easily acessible to other modules
self.cache = {}
self.tracklogList = []
self.tracklogPathList = []
self.categoryList = []
示例12: __init__
def __init__(self, *args, **kwargs):
RanaModule.__init__(self, *args, **kwargs)
self.beforeDraw()
self.ignoreNextClicks = 0
self.layers = {2: [], 0: []}
self.dragAreas = []
self.dragScreen = None
self.timedActionInProgress = None
示例13: __init__
def __init__(self, *args, **kwargs):
RanaModule.__init__(self, *args, **kwargs)
self.lines = ['hello', 'world']
self.oldLines = ['', '']
self.mode = 0
self.isGraphical = False
self.modes = ['pos', 'gps', 'road', 'speed', 'maxSpeed', 'bearing', 'time']
self.unitString = ""
示例14: __init__
def __init__(self, m, d, i):
RanaModule.__init__(self, m, d, i)
"""
# we consider 2km/h as as stationary
(to filter out the standard GPS drift while not moving)
"""
self.notMovingSpeed = 2
self._updateUnitTable()
示例15: __init__
def __init__(self, *args, **kwargs):
RanaModule.__init__(self, *args, **kwargs)
self.points = []
if 0: # to test
m = self.m.get("menu", None)
if m:
m.clearMenu('sketch', "set:menu:None")
self.set("menu", "sketch")