-
Notifications
You must be signed in to change notification settings - Fork 3
/
dys_tasks.py
50 lines (32 loc) · 1.02 KB
/
dys_tasks.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
"""
Created on 6. jun. 2016
@author: [email protected]
"""
import sys
import time
import numpy as np
from PyQt4 import QtCore, QtGui
from dys import DySMainWindow
class Tasks(QtCore.QObject):
def __init__(self):
super(Tasks, self).__init__()
self.pool = QtCore.QThreadPool()
self.c_r = np.arange(0, 1, 0.1)
self.pool.setMaxThreadCount(1)
def process_result(self, task):
print 'Receiving', task
def start(self):
app = QtGui.QApplication(sys.argv)
for i in range(0, len(self.c_r)):
print "i =", i
dys_worker = DySMainWindow()
dys_worker.show()
dys_worker.MBD_system.contacts[0].contact_model.c_r = self.c_r[i]
# time.sleep(.5)
dys_worker.simulation_control_widget.simulationStart()
dys_worker.simulation_control_widget.simulationReset()
self.pool.waitForDone()
sys.exit(app.exec_())
if __name__ == "__main__":
main = Tasks()
main.start()