-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenThread.py
67 lines (53 loc) · 2.15 KB
/
openThread.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# -*- coding: utf-8 -*-
"""
/***************************************************************************
vfkPluginDialog
A QGIS plugin
Plugin umoznujici praci s daty katastru nemovitosti
-------------------
begin : 2015-06-11
git sha : $Format:%H$
copyright : (C) 2015 by Stepan Bambula
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from qgis.PyQt.QtCore import QThread, pyqtSignal
class ImportVfkThread(QThread):
working = pyqtSignal(str)
nextLayer = True
def __init__(self, vfk_files):
"""
Class for using multi-thread import of layers
:type vfk_files: list of VFK files to be imported
"""
QThread.__init__(self)
self.vfk_files = vfk_files
def __del__(self):
self.wait()
def run(self):
for vfkFile in self.vfk_files:
self.working.emit(vfkFile)
self.nextLayer = True
while self.nextLayer:
self.sleep(1)
class DownloadPosidentsThread(QThread):
working = pyqtSignal(list)
def __init__(self, listTelId):
"""
Class for using multi-thread import of layers
:type vfk_files: list of VFK files to be imported
"""
QThread.__init__(self)
self.listTelId = listTelId
def __del__(self):
self.wait()
def run(self):
self.working.emit(self.listTelId)