-
Notifications
You must be signed in to change notification settings - Fork 1
/
contextSettings.py
46 lines (35 loc) · 1.74 KB
/
contextSettings.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
import sys
import os
from PyQt5.QtCore import QDir
from controllers.mainController import MainController
from controllers.noiseGeneratorController import NoiseGeneratorController
from controllers.colorCorrectorController import ColorCorrectorController
from controllers.filtersController import FiltersController
from controllers.binarizeController import BinarizeController
from controllers.morphologyController import MorphologyController
from controllers.segmentationController import SegmentationController
def setContext(context):
# appDir = os.getcwd()
# print(QDir.currentPath())
appDir = 'file:///' + QDir.currentPath()
# print(appDir)
# # print('appDir:', appDir)
# appDir = 'file:///h:/QtDocuments/AOI'
# print(appDir)
context.setContextProperty('appDir', appDir)
# add controllers
mainController = MainController()
context.setContextProperty('PyConsole', mainController)
context.setContextProperty('mainController', mainController)
colorCorrectorController = ColorCorrectorController()
context.setContextProperty('colorCorrectorController', colorCorrectorController)
noiseGeneratorController = NoiseGeneratorController()
context.setContextProperty('noiseGeneratorController', noiseGeneratorController)
filtersController = FiltersController()
context.setContextProperty('filtersController', filtersController)
binarizeController = BinarizeController()
context.setContextProperty('binarizeController', binarizeController)
morphologyController = MorphologyController()
context.setContextProperty('morphologyController', morphologyController)
segmentationController = SegmentationController()
context.setContextProperty('segmentationController', segmentationController)