Skip to content

Commit

Permalink
Remove layer option to ignore in empty check, fixes #301
Browse files Browse the repository at this point in the history
Reason: the implementation of this feature was never completed
  • Loading branch information
anitagraser committed Jun 19, 2019
1 parent 84a1579 commit 3530733
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 120 deletions.
2 changes: 1 addition & 1 deletion dialogs/vectorlayerdialog.py
Expand Up @@ -130,7 +130,7 @@ def addLayerAttributes(self, idx):
def addConnections(self):
super(VectorLayerDialog, self).addConnections()
self.dialog.comboBoxInterpolation.currentTextChanged.connect(self.maybeEnableIDBox)
self.dialog.exportEmptyCheckbox.setChecked(Qt.Unchecked)
#self.dialog.exportEmptyCheckbox.setChecked(Qt.Unchecked)

def show(self):
"""Update GUI elements and show the dialog"""
Expand Down
7 changes: 6 additions & 1 deletion layers/layer_settings.py
Expand Up @@ -95,7 +95,8 @@ def getSettingsFromAddVectorLayersUI(ui, layerIndexToId):
result.interpolationEnabled = conf.INTERPOLATION_MODES[result.interpolationMode]
result.idAttribute = ui.comboBoxID.currentText() if result.interpolationEnabled else None
result.idAttribute = "" if result.idAttribute == conf.NO_ID_TEXT else result.idAttribute
result.geometriesCount = not ui.exportEmptyCheckbox.checkState() == Qt.Checked
#result.geometriesCount = not ui.exportEmptyCheckbox.checkState() == Qt.Checked
result.accumulate = ui.accumulateFeaturesCheckbox.checkState() == Qt.Checked
result.resetSubsetString = ui.resetSubsetStringCheckbox.checkState() == Qt.Checked
return result

Expand Down Expand Up @@ -130,6 +131,10 @@ def addSettingsToRow(settings, out_table):
item.setText(value)
else:
item.setCheckState(Qt.Checked if value else Qt.Unchecked)
if i == 10: # geometriesCount implementation needs to be finished before this can be reenabled!
item.setFlags(Qt.ItemIsEnabled)
item.setFlags(Qt.ItemIsEditable)
item.setFlags(Qt.ItemIsSelectable)
out_table.setItem(row, i, item)

def getSettingsFromRow(table, rowNum):
Expand Down
3 changes: 0 additions & 3 deletions layers/timelayer.py
Expand Up @@ -73,9 +73,6 @@ def getLayerId(self):
except AttributeError:
return self.layer.getLayerID()

def geometriesCountForExport(self):
return True

def isEnabled(self):
"""Whether timeManagement is enabled for this layer"""
return self.timeEnabled
Expand Down
6 changes: 6 additions & 0 deletions layers/timerasterlayer.py
Expand Up @@ -35,6 +35,12 @@ def hasSubsetStr(self):

def accumulateFeatures(self):
return False

def geometriesCountForExport(self):
return True

def resetSubsetString(self):
return False

def getTimeAttributes(self):
"""return the tuple of timeAttributes (fromTimeAttribute,toTimeAttribute)"""
Expand Down
2 changes: 1 addition & 1 deletion layers/timevectorlayer.py
Expand Up @@ -227,7 +227,7 @@ def getStartTime(self, timePosition, timeFrame):
def getEndTime(self, timePosition, timeFrame):
return timePosition + timeFrame + timedelta(seconds=self.offset)

def getGeometriesCountForExport(self):
def geometriesCountForExport(self):
return self.geometriesCount

def accumulateFeatures(self):
Expand Down
231 changes: 118 additions & 113 deletions ui/addLayer.ui
Expand Up @@ -6,104 +6,91 @@
<rect>
<x>0</x>
<y>0</y>
<width>476</width>
<height>300</height>
<width>352</width>
<height>273</height>
</rect>
</property>
<property name="windowTitle">
<string>Select layer and column(s)</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Layer</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxLayers"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Start time</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxStart"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>End time</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxEnd"/>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_5">
<property name="toolTip">
<string>Interpolate between frames</string>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="1">
<widget class="QSpinBox" name="spinBoxOffset">
<property name="minimum">
<number>-1000000000</number>
</property>
<property name="whatsThis">
<string/>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Interpolation</string>
<string>End time</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>(optional)</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Offset (in sec)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBoxOffset">
<property name="minimum">
<number>-1000000000</number>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>(optional)</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="label_9">
<property name="text">
<string>(optional)</string>
</property>
</widget>
</item>
<item row="5" column="0">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<item row="4" column="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>(optional)</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="comboBoxID">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Offset (in sec)</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Layer</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxStart"/>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>(optional)</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxInterpolation"/>
</item>
<item row="5" column="2">
<widget class="QLabel" name="label_9">
<property name="text">
<string>(optional)</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Start time</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="labelID1">
<property name="enabled">
<bool>false</bool>
Expand All @@ -119,46 +106,64 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxLayers"/>
</item>
<item row="6" column="2">
<widget class="QLabel" name="labelID2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>(for interpolation)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxEnd"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="toolTip">
<string>Interpolate between frames</string>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="text">
<string>Interpolation</string>
</property>
</widget>
</item>
<item row="7" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxInterpolation"/>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxID">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="labelID2">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<widget class="QCheckBox" name="accumulateFeaturesCheckbox">
<property name="text">
<string>(for interpolation)</string>
<string>Accumulate features</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="resetSubsetStringCheckbox">
<property name="text">
<string>Reset subset string</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="exportEmptyCheckbox">
<property name="text">
<string>Ignore this layer when checking if scene is empty (for animation)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down
2 changes: 1 addition & 1 deletion ui/options.ui
Expand Up @@ -86,7 +86,7 @@
</column>
<column>
<property name="text">
<string>Ignore for detect empty</string>
<string>Ignore in empty layer detection</string>
</property>
</column>
<column>
Expand Down

0 comments on commit 3530733

Please sign in to comment.