def __execOperation__(self): self.console(u"iniciando operação de interpolação") tabela_data = self.paramentrosIN_carregados['table_data'] atributo_interpolacao = self.paramentrosIN_carregados['atributo'] format_image_data = self.paramentrosIN_carregados['format_image_data'] self.console(u"Preparando interpolacao:") self.WriteVRTfiles(tabela_data.data, atributo_interpolacao) self.WriteCSVfiles(tabela_data.data, atributo_interpolacao) path = tabela_data.data['data_path'] keys = tabela_data.keys() self.console(u"Preparacao completa, interpolando:") print(keys) if len(keys) > 0: for key in keys: if (key != "data_path"): self.console(u"criando tabela de interpolação, key: " + key) informacao = self.CreateInterpolationTable( path, key, atributo_interpolacao, format_image_data) interpolation_table = TableData( "iformacao de interpolacao") interpolation_table.data = informacao interpolador = InterpoladorIvD("interpolando ECMWF") interpolador.data = interpolation_table self.console(interpolador.data) else: informacao = self.CreateInterpolationTable(path, None, atributo_interpolacao, format_image_data) interpolation_table = TableData("iformacao de interpolacao") interpolation_table.data = informacao interpolador = InterpoladorIvD("interpolando ECMWF") interpolador.data = interpolation_table self.console(interpolador.data) self.console(u"Interpolacao completa") return (u"Interpolacao completa")
def executa(self): print "executando.." self.function = Interpola.InterpolaTabela() self.function.console = self.print_text self.print_text("Executando..") separador = SplitTable() dados_separador = TableData() atributos = list() for index in xrange(self.ui.lwGroupAtributes.count()): if self.ui.lwGroupAtributes.item(index).checkState() == 2: atributos.append( str(self.ui.lwGroupAtributes.item(index).text())) vector_table = self.ShapeSelected.readVectorData() dados_separador.data = {'table': vector_table, 'atributos': atributos} dados_separador.data["data_path"] = self.ui.leShapePath.text() dados_interpolador = TableData() image_information = self.ImgRefSelected.getRasterInformation() dados_interpolador['table_data'] = dados_separador dados_interpolador['atributo'] = str(self.ui.cbAtribute.currentText()) dados_interpolador["format_image_data"] = image_information self.print_text("Interpolando") mensagem = self.function.executar(dados_interpolador) self.finalizar()
def __execOperation__(self): self.console(u"iniciando operação de interpolação") tabela_data = self.paramentrosIN_carregados['table_data'] atributo_interpolacao = self.paramentrosIN_carregados['atributo'] format_image_data = self.paramentrosIN_carregados['format_image_data'] self.console(u"Preparando interpolacao:") self.WriteVRTfiles(tabela_data.data, atributo_interpolacao) self.WriteCSVfiles(tabela_data.data, atributo_interpolacao) path = tabela_data.data['data_path'] keys = tabela_data.keys() self.console(u"Preparacao completa, interpolando:") print(keys) if len(keys) > 0: for key in keys: if (key!="data_path"): self.console(u"criando tabela de interpolação, key: " + key) informacao = self.CreateInterpolationTable(path, key, atributo_interpolacao, format_image_data) interpolation_table = TableData("iformacao de interpolacao") interpolation_table.data = informacao interpolador = InterpoladorIvD("interpolando ECMWF") interpolador.data = interpolation_table self.console (interpolador.data) else: informacao = self.CreateInterpolationTable(path, None, atributo_interpolacao, format_image_data) interpolation_table = TableData("iformacao de interpolacao") interpolation_table.data = informacao interpolador = InterpoladorIvD("interpolando ECMWF") interpolador.data = interpolation_table self.console (interpolador.data) self.console (u"Interpolacao completa") return (u"Interpolacao completa")
def executa(self): print "executando.." self.function = Interpola.InterpolaTabela() self.function.console = self.print_text self.print_text("Executando..") separador = SplitTable() dados_separador = TableData() atributos = list() for index in xrange(self.ui.lwGroupAtributes.count()): if self.ui.lwGroupAtributes.item(index).checkState() == 2: atributos.append(str(self.ui.lwGroupAtributes.item(index).text())) vector_table = self.ShapeSelected.readVectorData() dados_separador.data = {'table' : vector_table, 'atributos' : atributos} dados_separador.data["data_path"] = self.ui.leShapePath.text() dados_interpolador = TableData() image_information = self.ImgRefSelected.getRasterInformation() dados_interpolador['table_data'] = dados_separador dados_interpolador['atributo'] = str(self.ui.cbAtribute.currentText()) dados_interpolador["format_image_data"] = image_information self.print_text("Interpolando") mensagem = self.function.executar(dados_interpolador) self.finalizar()