-
Notifications
You must be signed in to change notification settings - Fork 0
/
openThread.py
51 lines (42 loc) · 1.77 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
# -*- 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, qDebug
class OpenThread(QThread):
working = pyqtSignal(str)
finished = pyqtSignal()
nextLayer = True
def __init__(self, vfk_files):
"""
Class for using multi-thread import of layers
:type fileName: str
:return:
"""
QThread.__init__(self)
self.vfk_files = vfk_files
def __del__(self):
self.wait()
def run(self):
for i, vfkFile in enumerate(self.vfk_files):
self.working.emit(vfkFile)
self.nextLayer = True
while self.nextLayer:
self.sleep(1)