示例#1
0
def getSettingsFromRow(table, rowNum):
    """Get settings from table widget rowNum"""
    result = LayerSettings()
    result.layer = getLayerFromId(table.item(rowNum, 4).text())
    try:
        result.subsetStr = result.layer.subsetString()
    except Exception:
        # raster layers do not have subset strings
        pass
    result.isEnabled = (table.item(rowNum, 3).checkState() == Qt.Checked)
    # offset
    result.offset = int(table.item(rowNum, 6).text())  # currently

    result.startTimeAttribute = table.item(rowNum, 1).text()
    result.endTimeAttribute = table.item(rowNum, 2).text()
    # time format
    result.timeFormat = table.item(rowNum, 5).text()
    result.interpolationEnabled = (table.item(rowNum,
                                              7).checkState() == Qt.Checked)
    result.idAttribute = table.item(rowNum, 8).text()
    result.interpolationMode = table.item(rowNum, 9).text()
    result.geometriesCount = not (table.item(rowNum, 10).checkState()
                                  == Qt.Checked)
    result.accumulate = (table.item(rowNum, 11).checkState() == Qt.Checked)
    result.resetSubsetString = (table.item(rowNum,
                                           12).checkState() == Qt.Checked)

    return result
示例#2
0
def getSettingsFromRow(table, rowNum):
    """Get settings from table widget rowNum"""
    result = LayerSettings()
    result.layer = getLayerFromId(table.item(rowNum, 4).text())
    try:
        result.subsetStr = result.layer.subsetString()
    except Exception:
        # raster layers do not have subset strings
        pass
    result.isEnabled = (table.item(rowNum, 3).checkState() ==
                        Qt.Checked)
    # offset
    result.offset = int(table.item(rowNum, 6).text())  # currently

    result.startTimeAttribute = table.item(rowNum, 1).text()
    result.endTimeAttribute = table.item(rowNum, 2).text()
    # time format
    result.timeFormat = table.item(rowNum, 5).text()
    result.interpolationEnabled = (table.item(rowNum, 7).checkState() == Qt.Checked)
    result.idAttribute = table.item(rowNum, 8).text()
    result.interpolationMode = table.item(rowNum, 9).text()
    result.geometriesCount = not (table.item(rowNum, 10).checkState() == Qt.Checked)
    result.accumulate = (table.item(rowNum, 11).checkState() == Qt.Checked)
    result.resetSubsetString = (table.item(rowNum, 12).checkState() == Qt.Checked)

    return result
示例#3
0
def getSettingsFromSaveStr(saveStr):
    line = saveStr.split(conf.SAVE_DELIMITER)
    result = LayerSettings()
    result.layerId = line[0]
    result.layer = getLayerFromId(result.layerId)  # get the layer
    result.startTimeAttribute = line[2]
    result.subsetStr = line[1]
    result.endTimeAttribute = line[3]
    result.isEnabled = textToBool(line[4])
    result.timeFormat = line[5]
    try:
        result.offset = int(line[6])
        result.idAttribute = line[7]
        result.interpolationEnabled = textToBool(line[8])
        result.interpolationMode = line[9]
        result.geometriesCount = textToBool(line[10])
        result.accumulate = textToBool(line[11])
        result.resetSubsetString = textToBool(line[12])
    except IndexError:  # for backwards compatibility
        pass  # this will use default values
    return result
示例#4
0
def getSettingsFromSaveStr(saveStr):
    line = saveStr.split(conf.SAVE_DELIMITER)
    result = LayerSettings()
    result.layerId = line[0]
    result.layer = getLayerFromId(result.layerId)  # get the layer
    result.startTimeAttribute = line[2]
    result.subsetStr = line[1]
    result.endTimeAttribute = line[3]
    result.isEnabled = textToBool(line[4])
    result.timeFormat = line[5]
    try:
        result.offset = int(line[6])
        result.idAttribute = line[7]
        result.interpolationEnabled = textToBool(line[8])
        result.interpolationMode = line[9]
        result.geometriesCount = line[10]
        result.accumulate = textToBool(line[11])
        result.resetSubsetString = textToBool(line[12])
    except IndexError:  # for backwards compatibility
        pass  # this will use default values
    return result
 def getSelectedLayer(self):
     idx = self.dialog.comboBoxLayers.currentIndex()
     layerId = self.tempLayerIndexToId[idx]
     return qgs.getLayerFromId(layerId)
 def getSelectedLayer(self):
     idx = self.dialog.comboBoxLayers.currentIndex()
     layerId = self.tempLayerIndexToId[idx]
     return qgs.getLayerFromId(layerId)
示例#7
0
 def repaintJoined(self):
     layerIdsToRefresh = qgs.getAllJoinedLayers(set([x.layer.id() for x in self.model.getActiveVectors()]))
     # info("to refresh {}".format(layerIdsToRefresh))
     layersToRefresh = [qgs.getLayerFromId(x) for x in layerIdsToRefresh]
     list([x.triggerRepaint() for x in layersToRefresh])
 def repaintJoined(self):
     layerIdsToRefresh = qgs.getAllJoinedLayers(set([x.layer.id() for x in self.model.getActiveVectors()]))
     # info("to refresh {}".format(layerIdsToRefresh))
     layersToRefresh = [qgs.getLayerFromId(x) for x in layerIdsToRefresh]
     list([x.triggerRepaint() for x in layersToRefresh])