-
Notifications
You must be signed in to change notification settings - Fork 0
/
social_burden_calculator_dialog.py
executable file
·140 lines (89 loc) · 4.92 KB
/
social_burden_calculator_dialog.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# -*- coding: utf-8 -*-
"""
/***************************************************************************
SocialBurdenCalculatorDialog
A QGIS plugin
This plugin calculates social burden
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
-------------------
begin : 2022-08-30
git sha : $Format:%H$
email : oehart@sandia.gov
***************************************************************************/
"""
import os
from qgis.PyQt import uic
from qgis.PyQt import QtWidgets
# This loads your .ui file so that PyQt can populate your plugin with the elements from Qt Designer
FORM_CLASS, _ = uic.loadUiType(os.path.join(
os.path.dirname(__file__), 'social_burden_calculator_dialog_base.ui'))
class SocialBurdenCalculatorDialog(QtWidgets.QDialog, FORM_CLASS):
def __init__(self, parent=None):
"""Constructor."""
super(SocialBurdenCalculatorDialog, self).__init__(parent)
# Set up the user interface from Designer through FORM_CLASS.
# After self.setupUi() you can access any designer object by doing
# self.<objectname>, and you can use autoconnect slots - see
# http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html
# #widgets-and-dialogs-with-auto-connect
self.setupUi(self)
# ---------facilities data getters ----------
def getFacilitiesLayerName(self):
return str(self.layerComboBox_facilities.currentText())
def getFacilitiesIndexFieldName(self):
return str(self.FieldComboBox_facilityIndex.currentText())
def getFacilitiesHaveLatLongs(self):
return self.checkBox_facilityLatLongs.isChecked()
def getFacilitiesLatFieldName(self):
return str(self.ComboBox_facilityLat.currentText())
def getFacilitiesLongFieldName(self):
return str(self.ComboBox_facilityLong.currentText())
def getFacilitiesSectorFieldName(self):
return str(self.FieldComboBox_facilitySector.currentText())
# ----------population data getters -------
def getPopulationLayerName(self):
return str(self.layerComboBox_popBlock.currentText())
def getPopulationHasCentroids(self):
return self.checkBox_hasCentroids.isChecked()
def getPopulationLatField(self):
return str(self.ComboBox_centroidLat.currentText()) #field with override latitude
def getPopulationLongField(self):
return str(self.ComboBox_centroidLong.currentText()) #field with override latitude
def getPopulationIndexField(self):
return str(self.FieldComboBox_popIndex.currentText()) #field that holds indices of population groups
def getPopulationPopulationField(self):
return str(self.FieldComboBox_popCount.currentText()) #field that holds populations of each population group
def getPopulationAttainFactorField(self):
return str(self.FieldComboBox_attainmentFactor.currentText())
#------ sector to service mapping table getters ----------
def getSectorToServiceLayerName(self):
return str(self.layerComboBox_sectorServiceMapping.currentText())
def getSectorToServiceSectorField(self):
return str(self.FieldComboBox_sectortoServiceSector.currentText())
def getSectorToServiceEffortPerFootField(self):
return str(self.FieldComboBox_effortPerFoot.currentText())
def getSectorToServiceZeroDistanceEffortField(self):
return str(self.FieldComboBox_effortZeroDistance.currentText())
# --------- exclusion profile getters ------
def getHasExclusionProfile(self):
return self.checkBox_hasExclusionLayer.isChecked()
def getExclusionLayerName(self):
return str(self.layerComboBox_exclusion.currentText())
def getExclusionServiceLevelReduction(self):
#this needs to stay as a string for downstream reasons
return str(self.spinBox_exclusionPctReduction.value())
# ----------- export getters ------------
def exportToCSV(self):
return self.checkBox_exportToCsv.isChecked()
def getPerCapitaCsvOutputPath(self):
return self.lineEdit_outFilePerPopulationGroup.text()
def getAggregatedCsvOutputPath(self):
return self.lineEdit_outFileAggregatedPopulation.text()
def exportToRencat(self):
return self.checkBox_exportToRencat.isChecked()
def getExportToRencatPath(self):
return self.lineEdit_outFileRencatInput.text()
def exportAsRencatOutput(self):
return self.checkBox_exportAsRencatOutput.isChecked()
def getExportAsRencatOutputPath(self):
return self.lineEdit_outFileRencatOutput.text()