def testCoreParserValue():
           
    print('begin')
    path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100.res')
    slf = SelafinPluginLayer()
    print('slf created')
    slf.load_selafin(path,'TELEMAC')
    print('slf loaded')
    
    print('params',slf.hydrauparser.getVarNames())
    
    print('done')
    
    slf.propertiesdialog.show()
def testToshapeTool():

    print('begin')
    path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100.res')
    slf = SelafinPluginLayer()
    print('slf created')
    #    slf.load_selafin(path,'TELEMAC')
    slf.load_selafin(path)
    print('slf loaded')

    slf.propertiesdialog.debugtoprint = True

    shapetool = ToShapeTool(slf, slf.propertiesdialog)

    shapetool.create_points()

    print('done')
    def testMethod(self):
        self.createMainWin()
        self.mainwin.resize(QtCore.QSize(1000,800))

        if True:

            if int(qgis.PyQt.QtCore.QT_VERSION_STR[0]) == 4:  # qgis2
                reg = qgis.core.QgsPluginLayerRegistry.instance()
            elif int(qgis.PyQt.QtCore.QT_VERSION_STR[0]) == 5:  # qgis3
                reg = qgis.core.QgsApplication.pluginLayerRegistry()

            # qgisRegistryInstance = qgis.core.QgsApplication.pluginLayerRegistry()
            reg.addPluginLayerType(SelafinPluginLayerType())

        if True:
            layer = SelafinPluginLayer(self.tr('Click properties to load selafin file'), specificmapcanvas=self.canvas)


            if True:
                self.dialogslf = layer.propertiesdialog
                self.mainwin.frame_2.layout().addWidget(self.dialogslf)

            if True:
                print('********* SELAFI created ***************************** ')

                pathslf = os.path.join(os.path.dirname(__file__), 'telemac_files', 'r2d_malpasset-fine.slf')

                layer.load_selafin(pathslf,'TELEMAC')


            if True:
                print('********* SELAFI loaded ***************************** ')

                self.canvas.setLayers([layer])
                self.canvas.refresh()

                print('********* SELAFI on canvas ***************************** ')





        print('launch window')
        self.mainwin.exec_()
Beispiel #4
0
def testToshapeTool():

    print('begin')
    path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100.res')
    slf = SelafinPluginLayer()
    print('slf created')
    slf.load_selafin(path, 'TELEMAC')
    print('slf loaded')

    slf.propertiesdialog.debugtoprint = True

    extractmaxtool = ExtractMaxTool(slf, slf.propertiesdialog)

    extractmaxtool.spinBox_max_start.setValue(0)
    extractmaxtool.spinBox_max_end.setValue(100)

    extractmaxtool.calculMaxRes()

    print('done')
def testToshapeTool():

    print('begin')
    path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100.res')
    slf = SelafinPluginLayer()
    print('slf created')
    slf.load_selafin(path, 'TELEMAC')
    print('slf loaded')

    slf.propertiesdialog.debugtoprint = True

    shapetool = ToShapeTool(slf, slf.propertiesdialog)
    shapetool.checkBox_3.setCheckState(2)  #for hillshade rendering

    print(
        'param1',
        str(shapetool.meshlayer.hydrauparser.parametres[
            shapetool.meshlayer.hydrauparser.parambottom][1]))

    shapetool.create_shp_maillage()

    print('done')
Beispiel #6
0
def testCompareTool():

    print('begin')
    #path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100.res')
    path1 = os.path.normpath(
        'C://00_Bureau//00_QGIs//testcompare//SMEAG_R1_ARA_Q100_MAX.res')
    path2 = os.path.normpath(
        'C://00_Bureau//00_QGIs//testcompare//SMEAG_REF_Q5_MAX.res')
    slf = SelafinPluginLayer()
    print('slf created')
    slf.load_selafin(path1, 'TELEMAC')
    print('slf loaded')

    slf.propertiesdialog.debugtoprint = True

    comparetool = CompareTool(slf, slf.propertiesdialog)

    comparetool.initCompare(path2)
    comparetool.checkBox_6.setCheckState(2)

    comparetool.compare1(0)

    print('done')
Beispiel #7
0
def testFlowTool1():

    geomfinal = [[[437043.44736648886, 6392286.143149674],
                  [438331.2797807046, 6392515.9717035955],
                  [438331.2797807046, 6392515.9717035955]]]
    #geomfinal = [[[437043.44736648886, 6392286.143149674], [438331.2797807046, 6392515.9717035955]]]

    geom = qgis.core.QgsGeometry.fromPolyline(
        [qgis.core.QgsPoint(i[0], i[1]) for i in geomfinal[0]])

    print(geom.asPolyline())

    temp = qgis.core.QgsGeometry.fromMultiPolyline(
        [[qgis.core.QgsPoint(i[0], i[1]) for i in geom.asPolyline()]])

    print(geom.asPolyline())
    print(type(geom.asPolyline()))

    if False:

        print('begin')
        path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100.res')
        slf = SelafinPluginLayer()
        print('slf created')
        slf.load_selafin(path, 'TELEMAC')
        print('slf loaded')

        #flowcompute = InitComputeFlow(slf,slf.propertiesdialog)
        flowcompute = computeFlow(slf, 0, geomfinal)
        flowcompute.status.connect(output)
        flowcompute.finished.connect(finishedd)
        flowcompute.error.connect(output)

        flowcompute.computeFlowMain()

    print('done')
def testToshapeTool():

    print('begin')
    path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100.res')
    #    path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100_MAX.res')
    slf = SelafinPluginLayer()
    print('slf created')
    slf.load_selafin(path, 'TELEMAC')
    print('slf loaded')

    slf.propertiesdialog.debugtoprint = True

    temporaltool = TemporalGraphTool(slf, slf.propertiesdialog)

    dlg = qgis.gui.QgsDialog()
    temporaltool.setParent(dlg)
    #    dlg.layout = QVBoxLayout()
    dlg.layout().addWidget(temporaltool)

    temporaltool.setVisible(True)
    temporaltool.computeGraphTemp(qgis.core.QgsPoint(444653.6, 6389525.0))
    dlg.exec_()

    print('done')
Beispiel #9
0
def testToshapeTool():
    
    print('begin')
    path = os.path.normpath('C://00_Bureau//data2//SMEAG_REF_Q100.res')
    slf = SelafinPluginLayer()
    print('slf created')
    slf.load_selafin(path,'TELEMAC')
    print('slf loaded')
    
    slf.changeParam(2)
    slf.changeTime(250)
    slf.meshrenderer.change_lvl_contour([0.05,1,2,3])
    
    slf.propertiesdialog.debugtoprint = True
    
    shapetool = ToShapeTool(slf,slf.propertiesdialog)
    
    
    shapetool.create_shp()
    
    print('done')