fb_data = xmltest.get_data_formula_based_data(fb_tag) print(fb_data) print(fb_data['parameters']) print(fb_data['parameters'][0]['data']) print(type(fb_data)) fb_settings = { 'deelgebied': 1.154566, 'diepte_zom': 0.35, 'doorzicht': 3.0, 'strijklengte': 0 } fb_list = { 'diepte_zom': [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] } fb_list = { 'doorzicht': [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] } fb_settings, fb_list = xmltest.make_fb_first_parametersettings(fb_data) fb_result = xmltest.calculate_fb(fb_data, fb_settings, variableparameter=fb_list) fb_result fig, axes = xmltest.visualize_fb_static(fb_data, fb_result) frame = xmltest.visualize_fb_dynamic(fb_data, fb_result) xmltest.show_PyQt_plot(frame)
import os #for dir creation #xmltest = AutecologyXML(filename = "../../../_knowledgerules/species/Birds/Phalacrocorax carbo.xml") #xmltest = AutecologyXML(filename = "../../../_knowledgerules/species/Molluscs/Dreissena_polymorpha.xml") xmltest = AutecologyXML(filename = "../../../_knowledgerules/species/Birds/Alcedo_atthis.xml") xmltest._readxml() print(type(xmltest.xmlroot)) xmltest._scan() xmltest._scan_modeltype(modeltypename = "HSI") xmltest._scan_system(modeltypename = "HSI", systemname = "adult") xmltest._scan_systemflowdiagrams(modeltypename = "HSI", systemname = "adult") print(xmltest.flowdiagrams) print(xmltest.flowdiagrams_list) #Create a specific flow diagram #flowdiagram = xmltest._read_systemflowdiagram(modeltypename = "HSI", systemname = "adult", diagramname ="livingarea_stagnant_waters" ) flowdiagram = xmltest._read_systemflowdiagram(modeltypename = "HSI", systemname = "adult", diagramname ="breeding_area" ) svg_str = xmltest.create_flowdiagram_image(flowdiagram, output = None) print(svg_str) # #Write to file # directory = "test" # if(not os.path.exists(directory)): # os.makedirs(directory) # xmltest.create_flowdiagram_image(flowdiagram, output = os.path.join(directory,"example_flowdiagram.svg")) #show in PyQt subwindow_flowdiagram = xmltest.visualize_flowdiagram_image(svg_str) xmltest.show_PyQt_plot(subwindow_flowdiagram) print("Done.")