-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparameters.py
71 lines (58 loc) · 2.47 KB
/
parameters.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
68
69
70
71
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class ServicesParameters(object):
"""
Służy do przechowywania informacji o serwisach, jakie podłączone są do serwisu MASTER.
Dodając nowy serwis należy dopisać, informacje o nim i jego adresach do zmiennych statycznych klasy.
Kolejność indeksowania serwisów numerami mówi o kolejności, w jakiej poszczególne serwisy będą przetwarzały obraz.
"""
MASTER_SERVICE = "masterService"
PREPROCESSING_SERVICE = "preprocessingService"
RESIZE_SERVICE = "resizeService"
FILTER_GRAY_SERVICE = "filterGrayService"
SERVICES_ID = {
"masterService": 0,
"preprocessingService": 1,
"resizeService": 2,
"filterGrayService": 3
}
INPUT_VIDEO_CONNECTOR_NAMES = {
0: "masterService_videoInput",
1: "preprocessingService_videoInput",
2: "resizeService_videoInput",
3: "filterGrayService_videoInput"
}
INPUT_SETTINGS_CONNECTOR_NAMES = {
0: "masterService_settingsInput",
1: "preprocessingService_settingsInput",
2: "resizeService_settingsInput",
3: "filterGrayService_settingsInput"
}
OUTPUT_VIDEO_CONNECTOR_NAMES = {
0: "masterService_videoOutput",
1: "preprocessingService_videoOutput",
2: "resizeService_videoOutput",
3: "filterGrayService_videoOutput"
}
OUTPUT_SETTINGS_CONNECTOR_NAMES = {
0: "masterService_settingsOutput",
1: "preprocessingService_settingsOutput",
2: "resizeService_settingsOutput",
3: "filterGrayService_settingsOutput"
}
def getInputVideoConnectorName(self, serviceName):
return self.INPUT_VIDEO_CONNECTOR_NAMES[self.SERVICES_ID[serviceName]]
def getInputSettingsConnectorName(self, serviceName):
return self.INPUT_SETTINGS_CONNECTOR_NAMES[self.SERVICES_ID[serviceName]]
def getOutputVideoConnectorName(self, serviceName):
return self.OUTPUT_VIDEO_CONNECTOR_NAMES[self.SERVICES_ID[serviceName]]
def getOutputSettingsConnectorName(self, serviceName):
return self.OUTPUT_SETTINGS_CONNECTOR_NAMES[self.SERVICES_ID[serviceName]]
def getAllServiceNames(self):
return self.SERVICES_ID.keys()
def getServiceValue(self, serviceName):
return self.SERVICES_ID[serviceName]
def getServiceName(self, value):
for serviceName, serviceValue in self.SERVICES_ID.iteritems():
if serviceValue == value:
return serviceName