Ejemplo n.º 1
0
    def __init__(self, master, cpacs_path, cpacs_out_path, submodule_list, **kwargs):
        tk.Frame.__init__(self, master, **kwargs)
        self.pack(fill=tk.BOTH)

        self.submodule_list = submodule_list
        self.cpacs_out_path = cpacs_out_path

        # Notebook for tabs
        self.tabs = ttk.Notebook(self)
        self.tabs.grid(row=0, column=0, columnspan=3)  #pack()#expand=1, side=tk.LEFT)

        self.tixi = cpsf.open_tixi(cpacs_path)

        if len(apm.get_aeromap_uid_list(self.tixi)) == 0 :
            log.warning('No AeroMap in this CPACS file')
            aeromap_uid = 'New_AeroMap'
            description = 'AeroMap create by SettingGUI'
            apm.create_empty_aeromap(self.tixi, aeromap_uid, description)

        # Generate AeroMaps Edition tab
        aeromap_tap = AeroMapTab(self.tabs, self.tixi)

        # Generate Auto Tab =============
        self.tab_list = []
        self._update_all()

        # General button
        self.update_button = tk.Button(self, text='Update', command=self._update_all)
        self.update_button.grid(row=1, column=1,sticky='E')
        self.close_button = tk.Button(self, text='Save & Quit', command=self._save_quit)
        self.close_button.grid(row=1, column=2,sticky='W')
Ejemplo n.º 2
0
    def __init__(self, master, cpacs_path, cpacs_out_path, submodule_list):

        self.submodule_list = submodule_list
        self.cpacs_out_path = cpacs_out_path

        # GUI =============
        self.master = master
        self.master.title('CEASIOMpy Settings GUI')
        self.master.geometry('600x750+500+200')

        self.tabs = ttk.Notebook(self.master)
        self.tabs.pack(side=tk.TOP, fill='both')
        self.tabs.pack(expand=1, fill='both')

        # CPACS =============
        self.tixi = open_tixi(cpacs_path)

        if len(get_aeromap_uid_list(self.tixi)) == 0 :
            log.warning('No AeroMap in this CPACS file')
            aeromap_uid = 'New_AeroMap'
            description = 'AeroMap create by SettingGUI'
            create_empty_aeromap(self.tixi, aeromap_uid, description)

        # Generate AeroMaps Edition tab
        aeromap_tap = AeroMapTab(self.tabs, self.tixi)

        # # Generate Auto Tab =============
        self.tab_list = []
        self._update_all()

        # General buttons =============
        self.close_button = tk.Button(self.master, text='Save & Quit', command=self._save_quit)
        self.close_button.pack(side=tk.RIGHT)
        self.update_button = tk.Button(self.master, text='Update', command=self._update_all)
        self.update_button.pack(side=tk.RIGHT)
Ejemplo n.º 3
0
    def __init__(self, master, cpacs_path, cpacs_out_path, submodule_list, **kwargs):
        tk.Frame.__init__(self, master, **kwargs)
        self.pack(fill=tk.BOTH)

        self.submodule_list = submodule_list
        self.cpacs_out_path = cpacs_out_path

        # Notebook for tabs
        self.tabs = ttk.Notebook(self)
        self.tabs.grid(row=0, column=0, columnspan=3)  #pack()#expand=1, side=tk.LEFT)

        self.tixi = cpsf.open_tixi(cpacs_path)

        if len(apm.get_aeromap_uid_list(self.tixi)) == 0 :
            aeromap_uid = 'AeroMap_1point'
            csv_path = os.path.join(MODULE_DIR,'..','..','test','AeroMaps','Aeromap_1point.csv')
            apm.aeromap_from_csv(self.tixi, aeromap_uid, csv_path)

        # Generate AeroMaps Edition tab
        aeromap_tap = AeroMapTab(self.tabs, self.tixi)

        # Generate Auto Tab =============
        self.tab_list = []
        self._update_all()

        # General button
        self.update_button = tk.Button(self, text='Update', command=self._update_all)
        self.update_button.grid(row=1, column=1,sticky='E')
        self.close_button = tk.Button(self, text='Save & Quit', command=self._save_quit)
        self.close_button.grid(row=1, column=2,sticky='W')
Ejemplo n.º 4
0
    def __init__(self, tabs, tixi):
        """AeroMapTab class

        Args:
            tabs (TODO): TODO
            tixi (handle): Tixi handle
        """

        self.tabs = tabs
        self.tixi = tixi
        row_pos = 0

        self.aerotab = tk.Frame(self.tabs, borderwidth=1)
        tabs.add(self.aerotab, text='AeroMaps')

        aeromap_uid_list = apm.get_aeromap_uid_list(tixi)

        self.selected_list = []
        self.list = aeromap_uid_list

        tk.Label(self.aerotab, text='Existing AeroMaps').grid(column=0, row=row_pos)
        row_pos += 1

        self.listBox = tk.Listbox(self.aerotab, selectmode=tk.SINGLE)
        item_count = len(self.list)
        self.listBox.grid(column=0, row=row_pos, columnspan=3,rowspan=item_count, sticky= tk.W, padx=5, pady=5)
        self.list.sort()
        for item in self.list:
            self.listBox.insert(tk.END, item)
        row_pos += (item_count + 1)

        chooseButton = tk.Button(self.aerotab, text='Select', command=self._select)
        chooseButton.grid(column=0, row=row_pos)
        row_pos += 1

        importButton = tk.Button(self.aerotab, text='Import CSV', command=self._import_csv)
        importButton.grid(column=0, row=row_pos)
        row_pos += 1

        exportButton = tk.Button(self.aerotab, text='Export CSV', command=self._export_csv)
        exportButton.grid(column=0, row=row_pos)
        row_pos += 1

        updateButton = tk.Button(self.aerotab, text='Update', command=self._update)
        updateButton.grid(column=0, row=row_pos)
        row_pos += 1

        deleteButton = tk.Button(self.aerotab, text='Delete', command=self._delete)
        deleteButton.grid(column=0, row=row_pos)
        row_pos += 1
Ejemplo n.º 5
0
def call_select_aeromap(tixi):
    """Function to select one or several aeroMap to plot wit a GUI

    Function 'call_select_aeromap' open a GUI with all the available aeroMaps
    to plot and retruns a list of those selected by the user.

    Args:
        tixi (handles): TIXI Handle of the CPACS file

    Returns:
        selected_aeromap_list (list) : List of selected aeroMap
    """

    aeromap_uid_list = apmf.get_aeromap_uid_list(tixi)

    root = Tk()
    selected_aeromap_list = ListBoxChoice(root, 'Select aeroMap',
                                          'Select aeroMap(s) to plot \t \t',
                                          aeromap_uid_list).returnValue()

    return selected_aeromap_list
Ejemplo n.º 6
0
def get_aeromap_index(tixi, am_uid):
    """Return index of the aeromap to be used.

    With the aeromap uID, the index of this aeromap is returned if there are
    more than one in the CPACS file.

    Args:
        tixi (Tixi3 handle): Handle of the current CPACS file
        am_uid (str): uID of the aeromap that will be used by all modules.

    Returns:
        am_index (str): The index of the aeromap between brackets.

    """
    am_list = apmf.get_aeromap_uid_list(tixi)
    am_index = '[1]'
    for i, uid in enumerate(am_list):
        if uid == am_uid:
            am_index = '[{}]'.format(i + 1)

    return am_index
Ejemplo n.º 7
0
def test_static_stability_analysis():
    """Test function 'staticStabilityAnalysis' """

    MODULE_DIR = os.path.dirname(os.path.abspath(__file__))
    cpacs_path = os.path.join(MODULE_DIR,'ToolInput','CPACSTestStability.xml')
    cpacs_out_path = os.path.join(MODULE_DIR,'ToolInput', 'CPACSTestStability.xml')
    csv_path = MODULE_DIR + '/ToolInput/csvtest.csv'

    tixi = open_tixi(cpacs_path)
    # Get Aeromap UID list
    uid_list = get_aeromap_uid_list(tixi)
    aeromap_uid = uid_list[0]
    # Import aeromap from the CSV to the xml
    aeromap_from_csv(tixi, aeromap_uid, csv_path)
    close_tixi(tixi, cpacs_out_path)

    # Make the static stability analysis, on the modified xml file
    static_stability_analysis(cpacs_path, cpacs_out_path)

    # Assert that all error messages are present
    log_path = os.path.join(LIB_DIR,'StabilityStatic','staticstability.log')

    graph_cruising = False
    errors = ''
    #Open  log file
    with open(log_path, "r") as f :
        # For each line in the log file
        for line in f :
            # if the info insureing that the graph of cruising aoa VS mach has been generated.
            if 'graph : cruising aoa vs mach genrated' in line :
                graph_cruising = True
            # if 'warning' or 'error ' is in line
            if  'ERROR' in line :
                # check if error type (altitude) is in line
                errors += line

    # Assert that all error type happend only once.
    assert graph_cruising == True
Ejemplo n.º 8
0
def add_skin_friction(cpacs_path, cpacs_out_path):
    """ Function to add the skin frinction drag coeffienct to aerodynamic coefficients

    Function 'add_skin_friction' add the skin friction drag 'cd0' to  the
    SU2 and pyTornado aeroMap, if their UID is not geven, it will add skin
    friction to all aeroMap. For each aeroMap it creates a new aeroMap where
    the skin friction drag coeffienct is added with the correct projcetions.

    Args:
        cpacs_path (str):  Path to CPACS file
        cpacs_out_path (str): Path to CPACS output file
    """

    tixi = cpsf.open_tixi(cpacs_path)
    tigl = cpsf.open_tigl(tixi)

    wing_area_max, wing_span_max = get_largest_wing_dim(tixi, tigl)

    analyses_xpath = '/cpacs/toolspecific/CEASIOMpy/geometry/analysis'

    # Requiered input data from CPACS
    wetted_area = cpsf.get_value(tixi, analyses_xpath + '/wettedArea')

    # Wing area/span, default values will be calated if no value found in the CPACS file
    wing_area_xpath = analyses_xpath + '/wingArea'
    wing_area = cpsf.get_value_or_default(tixi, wing_area_xpath, wing_area_max)
    wing_span_xpath = analyses_xpath + '/wingSpan'
    wing_span = cpsf.get_value_or_default(tixi, wing_span_xpath, wing_span_max)

    aeromap_uid_list = []

    # Try to get aeroMapToCalculate
    aeroMap_to_clculate_xpath = SF_XPATH + '/aeroMapToCalculate'
    if tixi.checkElement(aeroMap_to_clculate_xpath):
        aeromap_uid_list = cpsf.get_string_vector(tixi,
                                                  aeroMap_to_clculate_xpath)
    else:
        aeromap_uid_list = []

    # If no aeroMap in aeroMapToCalculate, get all existing aeroMap
    if len(aeromap_uid_list) == 0:
        try:
            aeromap_uid_list = apmf.get_aeromap_uid_list(tixi)
        except:
            raise ValueError(
                'No aeroMap has been found in this CPACS file, skin friction cannot be added!'
            )

    # Get unique aeroMap list
    aeromap_uid_list = list(set(aeromap_uid_list))
    new_aeromap_uid_list = []

    # Add skin friction to all listed aeroMap
    for aeromap_uid in aeromap_uid_list:

        log.info('adding skin friction coefficients to: ' + aeromap_uid)

        # Get orignial aeroPerformanceMap
        AeroCoef = apmf.get_aeromap(tixi, aeromap_uid)
        AeroCoef.complete_with_zeros()

        # Create new aeroCoefficient object to store coef with added skin friction
        AeroCoefSF = apmf.AeroCoefficient()
        AeroCoefSF.alt = AeroCoef.alt
        AeroCoefSF.mach = AeroCoef.mach
        AeroCoefSF.aoa = AeroCoef.aoa
        AeroCoefSF.aos = AeroCoef.aos

        # Iterate over all cases
        case_count = AeroCoef.get_count()
        for case in range(case_count):

            # Get parameters for this case
            alt = AeroCoef.alt[case]
            mach = AeroCoef.mach[case]
            aoa = AeroCoef.aoa[case]
            aos = AeroCoef.aos[case]

            # Calculate Cd0 for this case
            cd0 = estimate_skin_friction_coef(wetted_area,wing_area,wing_span, \
                                              mach,alt)

            # Projection of cd0 on cl, cd and cs axis
            #TODO: Should Cd0 be projected or not???
            aoa_rad = math.radians(aoa)
            aos_rad = math.radians(aos)
            cd0_cl = cd0 * math.sin(aoa_rad)
            cd0_cd = cd0 * math.cos(aoa_rad) * math.cos(aos_rad)
            cd0_cs = cd0 * math.sin(aos_rad)

            # Update aerodynamic coefficients
            cl = AeroCoef.cl[case] + cd0_cl
            cd = AeroCoef.cd[case] + cd0_cd
            cs = AeroCoef.cs[case] + cd0_cs

            # Shoud we change something? e.i. if a force is not apply at aero center...?
            if len(AeroCoef.cml):
                cml = AeroCoef.cml[case]
            else:
                cml = 0.0  # Shoud be change, just to test pyTornado
            if len(AeroCoef.cmd):
                cmd = AeroCoef.cmd[case]
            else:
                cmd = 0.0
            if len(AeroCoef.cms):
                cms = AeroCoef.cms[case]
            else:
                cms = 0.0

            # Add new coefficients into the aeroCoefficient object
            AeroCoefSF.add_coefficients(cl, cd, cs, cml, cmd, cms)

        # Create new aeroMap UID
        aeromap_sf_uid = aeromap_uid + '_SkinFriction'
        new_aeromap_uid_list.append(aeromap_sf_uid)

        # Create new description
        description_xpath = tixi.uIDGetXPath(aeromap_uid) + '/description'
        sf_description = cpsf.get_value(
            tixi,
            description_xpath) + ' Skin friction has been add to this AeroMap.'
        apmf.create_empty_aeromap(tixi, aeromap_sf_uid, sf_description)

        # Save aeroCoefficient object Coef in the CPACS file
        apmf.save_parameters(tixi, aeromap_sf_uid, AeroCoefSF)
        apmf.save_coefficients(tixi, aeromap_sf_uid, AeroCoefSF)

    # Get aeroMap list to plot
    plot_xpath = '/cpacs/toolspecific/CEASIOMpy/aerodynamics/plotAeroCoefficient'
    aeromap_to_plot_xpath = plot_xpath + '/aeroMapToPlot'

    if tixi.checkElement(aeromap_to_plot_xpath):
        aeromap_uid_list = cpsf.get_string_vector(tixi, aeromap_to_plot_xpath)
        new_aeromap_to_plot = aeromap_uid_list + new_aeromap_uid_list
        new_aeromap_to_plot = list(set(new_aeromap_to_plot))
        cpsf.add_string_vector(tixi, aeromap_to_plot_xpath,
                               new_aeromap_to_plot)
    else:
        cpsf.create_branch(tixi, aeromap_to_plot_xpath)
        cpsf.add_string_vector(tixi, aeromap_to_plot_xpath,
                               new_aeromap_uid_list)

    log.info('AeroMap "' + aeromap_uid + '" has been added to the CPACS file')

    cpsf.close_tixi(tixi, cpacs_out_path)
Ejemplo n.º 9
0
    def __init__(self, tabs, tixi, module_name):
        """Tab class

        Note:
            A tab will only be created if the module actually has
            any settings which are to be shown

        Args:
            tabs (TODO): TODO
            tixi (handle): Tixi handle
            module_name (str): String of the module name for which a tab is to be created
        """

        self.var_dict = {}
        self.group_dict = {}

        self.module_name = module_name
        self.tabs = tabs
        self.tixi = tixi
        self.tab = tk.Frame(tabs, borderwidth=1)
        tabs.add(self.tab, text=module_name)

        # Get GUI dict from specs
        specs = mif.get_specs_for_module(module_name)

        self.gui_dict = specs.cpacs_inout.get_gui_dict()

        #canvas has replaced self.tab in the following lines
        space_label = tk.Label(self.tab, text=' ')
        space_label.grid(column=0, row=0)

        row_pos = 1

        for key, (name, def_value, dtype, unit, xpath, description, group) in self.gui_dict.items():
            # Create a LabelFrame for new groupe
            if group:
                if not group in self.group_dict:
                    self.labelframe = tk.LabelFrame(self.tab, text=group)
                    self.labelframe.grid(column=0, row=row_pos, columnspan=3,sticky= tk.W, padx=5, pady=5)
                    self.group_dict[group] = self.labelframe
                parent = self.group_dict[group]
            else:  # if not a group, use tab as parent
                parent = self.tab

            # Name label for variable
            if (name is not '__AEROMAP_SELECTION' and name is not '__AEROMAP_CHECHBOX'):
                self.name_label = tk.Label(parent, text= name)
                self.name_label.grid(column=0, row=row_pos, sticky= tk.W, padx=5, pady=5)

            # Type and Value
            if dtype is bool:
                self.var_dict[key] = tk.BooleanVar()
                value = cpsf.get_value_or_default(self.tixi,xpath,def_value)
                self.var_dict[key].set(value)
                bool_entry = tk.Checkbutton(parent, text='', variable=self.var_dict[key])
                bool_entry.grid(column=1, row=row_pos, padx=5, pady=5)

            elif dtype is int:
                value = cpsf.get_value_or_default(self.tixi, xpath, def_value)
                self.var_dict[key] = tk.IntVar()
                self.var_dict[key].set(int(value))
                value_entry = tk.Entry(parent, bd=2, textvariable=self.var_dict[key])
                value_entry.grid(column=1, row=row_pos, padx=5, pady=5)

            elif dtype is float:
                value = cpsf.get_value_or_default(self.tixi, xpath, def_value)
                self.var_dict[key] = tk.DoubleVar()
                self.var_dict[key].set(value)
                value_entry = tk.Entry(parent, bd=2, textvariable=self.var_dict[key])
                value_entry.grid(column=1, row=row_pos, padx=5, pady=5)

            elif dtype is 'pathtype':

                value = cpsf.get_value_or_default(self.tixi,xpath,def_value)
                self.var_dict[key] = tk.StringVar()
                self.var_dict[key].set(value)
                value_entry = tk.Entry(parent, textvariable=self.var_dict[key])
                value_entry.grid(column=1, row=row_pos, padx=5, pady=5)

                self.key = key
                self.browse_button = tk.Button(parent, text="Browse", command=self._browse_file)
                self.browse_button.grid(column=2, row=row_pos, padx=5, pady=5)


            elif dtype is list:
                if name == '__AEROMAP_SELECTION':

                    # Get the list of all AeroMaps
                    self.aeromap_uid_list = apm.get_aeromap_uid_list(self.tixi)

                    # Try to get the pre-selected AeroMap from the xpath
                    try:
                        selected_aeromap = cpsf.get_value(self.tixi,xpath)
                        selected_aeromap_index = self.aeromap_uid_list.index(selected_aeromap)
                    except:
                        selected_aeromap = ''
                        selected_aeromap_index = 0

                    self.labelframe = tk.LabelFrame(parent, text='Choose an AeroMap')
                    self.labelframe.grid(column=0, row=row_pos, columnspan=3, sticky=tk.W, padx=5, pady=5)

                    # The Combobox is directly use as the varaible
                    self.var_dict[key] = ttk.Combobox(self.labelframe, values=self.aeromap_uid_list)
                    self.var_dict[key].current(selected_aeromap_index)
                    self.var_dict[key].grid(column=1, row=row_pos, padx=5, pady=5)


                elif name == '__AEROMAP_CHECHBOX':

                    # Just to find back the name when data are saved
                    self.var_dict[key] = None
                    # __AEROMAP_CHECHBOX is a bit different, data are saved in their own dictionary
                    self.aeromap_var_dict = {}

                    # Get the list of all AeroMaps
                    self.aeromap_uid_list = apm.get_aeromap_uid_list(self.tixi)
                    self.labelframe = tk.LabelFrame(parent, text='Selecte AeroMap(s)')
                    self.labelframe.grid(column=0, row=row_pos, columnspan=3, sticky=tk.W, padx=5, pady=5)

                    # Try to get pre-selected AeroMaps from the xpath
                    try:
                        selected_aeromap = cpsf.get_string_vector(self.tixi,xpath)
                    except:
                        selected_aeromap = ''

                    # Create one checkbox for each AeroMap
                    for aeromap in self.aeromap_uid_list:
                        self.aeromap_var_dict[aeromap] = tk.BooleanVar()

                        #if aeromap in selected_aeromap:
                        # For now, set all to True
                        self.aeromap_var_dict[aeromap].set(True)

                        aeromap_entry = tk.Checkbutton(self.labelframe,text=aeromap,variable=self.aeromap_var_dict[aeromap])
                        aeromap_entry.pack()#side=tk.TOP, anchor='w')

                else: # Other kind of list (not aeroMap)

                    # 'def_value' will be the list of possibilies in this case

                    # Try to get the pre-selected AeroMap from the xpath
                    try: # TODO Should be retested...
                        selected_value = cpsf.get_value(self.tixi,xpath)
                        selected_value_index = def_value.index(selected_value)
                    except:
                        selected_value = ''
                        selected_value_index = 0

                    # The Combobox is directly use as the varaible
                    self.var_dict[key] = ttk.Combobox(parent, values=def_value)
                    self.var_dict[key].current(selected_value_index)
                    self.var_dict[key].grid(column=1, row=row_pos, padx=5, pady=5)

            else:
                value = cpsf.get_value_or_default(self.tixi,xpath,def_value)
                self.var_dict[key] = tk.StringVar()
                self.var_dict[key].set(value)
                value_entry = tk.Entry(parent, textvariable=self.var_dict[key])
                value_entry.grid(column=1, row=row_pos, padx=5, pady=5)

            # Units
            if unit and unit != '1':
                unit_label = tk.Label(parent, text=pretty_unit(unit))
                unit_label.grid(column=2, row=row_pos, padx=5, pady=5)

            row_pos += 1
Ejemplo n.º 10
0
 def _update(self, event=None):
     self.list = apm.get_aeromap_uid_list(self.tixi)
     self.list.sort()
     self.listBox.delete(0, tk.END)
     for item in self.list:
         self.listBox.insert(tk.END, item)
Ejemplo n.º 11
0
def aeromap_case_gen(modules):
    """
    Generate a CSV file containing a dataset generated with aeromap parameters
    only.

    Args:
        modules (lst) : list of modules to execute.

    Returns:
        file (str) : Path to CSV file.

    """
    file = MODULE_DIR + '/Aeromap_generated.csv'
    infile = mi.get_toolinput_file_path('PredictiveTool')
    outfile = mi.get_tooloutput_file_path('PredictiveTool')

    tixi = cpsf.open_tixi(infile)

    # Inputs
    alt = [0, 0]
    mach = [0.5, 0.5]
    aoa = [-10, 10]
    aos = [0, 0]
    nt = 100
    bounds = np.array([alt, mach, aoa, aos])
    # Sort criterion : ‘center’, ‘maximin’, ‘centermaximin’, ‘correlation’
    crit = 'corr'

    # Generate sample points, LHS or FullFactorial
    sampling = smp.LHS(xlimits=bounds, criterion=crit)
    xd = sampling(nt)
    xd = xd.transpose()
    # Delete the other aeromaps... maybe conserve them ?
    for uid in apmf.get_aeromap_uid_list(tixi):
        apmf.delete_aeromap(tixi, uid)

    # Create new aeromap
    aeromap_uid = 'DoE_Aeromap'
    am_xpath = tls.get_aeromap_path(modules)
    apmf.create_empty_aeromap(tixi, aeromap_uid)
    cpsf.add_string_vector(tixi, am_xpath + '/aeroMapUID', [aeromap_uid])

    # Add parameters to aeromap
    Param = apmf.AeroCoefficient()
    for i in range(0, xd.shape[1]):
        Param.add_param_point(xd[0][i], xd[1][i], xd[2][i], xd[3][i])
    apmf.save_parameters(tixi, aeromap_uid, Param)
    cpsf.close_tixi(tixi, infile)

    wkf.run_subworkflow(modules, cpacs_path_in=infile, cpacs_path_out=outfile)

    # Get Aerocoefficient
    tixi = cpsf.open_tixi(outfile)
    am_xpath = tls.get_aeromap_path(modules)
    aeromap_uid = cpsf.get_value(tixi, am_xpath + '/aeroMapUID')
    AeroCoefficient = apmf.get_aeromap(tixi, aeromap_uid)
    cpsf.close_tixi(tixi, outfile)

    dct = AeroCoefficient.to_dict()

    # Write to CSV
    df = pd.DataFrame(dct)
    df = df.transpose()
    var_type = [
        'obj' if i in objectives else
        'des' if i in ['alt', 'mach', 'aoa', 'aos'] else 'const'
        for i in df.index
    ]
    df.insert(0, 'type', var_type)
    df.to_csv(file, index=True)
    return file
Ejemplo n.º 12
0
    def __init__(self, tabs, tixi):
        """AeroMapTab class

        Args:
            tabs (TODO): TODO
            tixi (handle): Tixi handle
        """

        self.tabs = tabs
        self.tixi = tixi
        row_pos = 0

        self.aerotab = tk.Frame(self.tabs, borderwidth=1)
        tabs.add(self.aerotab, text='AeroMaps')

        aeromap_uid_list = apm.get_aeromap_uid_list(tixi)

        self.selected_list = []
        self.list = aeromap_uid_list

        # tk.Label(self.aerotab, text='Existing AeroMaps').grid(column=0, row=row_pos)
        # row_pos += 1

        self.existframe = tk.LabelFrame(self.aerotab,text='Existing AeroMaps')
        self.existframe.grid(row=row_pos, column=0, padx=15,pady=15)

        self.listBox = tk.Listbox(self.existframe, width=25, selectmode=tk.SINGLE)
        item_count = len(self.list)
        self.listBox.grid(column=0, row=row_pos,rowspan=item_count, padx=5, pady=5)
        self.list.sort()
        for item in self.list:
            self.listBox.insert(tk.END, item)
        row_pos += (item_count + 1)

        importButton = tk.Button(self.existframe, text='Import from CSV', width=15, command=self._import_csv)
        importButton.grid(column=0, row=row_pos)
        row_pos += 1

        exportButton = tk.Button(self.existframe, text='Export to CSV', width=15, command=self._export_csv)
        exportButton.grid(column=0, row=row_pos)
        row_pos += 1

        checkButton = tk.Button(self.existframe, width=15, text='Check AeroMap', command=self._check_aeromap)
        checkButton.grid(column=0, row=row_pos)
        row_pos += 1

        deleteButton = tk.Button(self.existframe, text='Delete', width=15, command=self._delete)
        deleteButton.grid(column=0, row=row_pos)


        # To generate a new aeromap on the GUI
        row_pos =0
        self.generateframe = tk.LabelFrame(self.aerotab,text='Generate an AeroMap')
        self.generateframe.grid(row=row_pos,column=1, padx=15,pady=15, sticky=tk.N)

        self.labelaeromap = tk.Label(self.generateframe,text="Name")
        self.labelaeromap.grid(row=row_pos,column=0, pady=3)
        self.aeromap_name = tk.StringVar()
        self.aeromap_name.set('MyNewAeroMap')
        self.name = tk.Entry(self.generateframe, width=17, textvariable=self.aeromap_name)
        self.name.grid(row=row_pos,column=1)
        row_pos += 1

        altlabel = tk.Label(self.generateframe,text="Altitude")
        altlabel.grid(row=row_pos,column=0, pady=3)
        self.alt = tk.StringVar()
        self.alt.set('0')
        altentry = tk.Entry(self.generateframe, textvariable=self.alt, width=17)
        altentry.grid(row=row_pos,column=1)
        altunitlabel = tk.Label(self.generateframe, text='[m]')
        altunitlabel.grid(column=2, row=row_pos)
        row_pos += 1

        machlabel = tk.Label(self.generateframe,text="Mach")
        machlabel.grid(row=row_pos,column=0, pady=3)
        self.mach = tk.StringVar()
        self.mach.set('0.3')
        machentry = tk.Entry(self.generateframe, textvariable=self.mach, width=17)
        machentry.grid(row=row_pos,column=1, pady=3)
        machunitlabel = tk.Label(self.generateframe, text='[-]')
        machunitlabel.grid(column=2, row=row_pos)
        row_pos += 1

        aoalabel = tk.Label(self.generateframe,text="AoA")
        aoalabel.grid(row=row_pos,column=0, pady=3)
        self.aoa = tk.StringVar()
        self.aoa.set('2')
        aoaentry = tk.Entry(self.generateframe, textvariable=self.aoa, width=17)
        aoaentry.grid(row=row_pos,column=1)
        aoaunitlabel = tk.Label(self.generateframe, text='[deg]')
        aoaunitlabel.grid(column=2, row=row_pos)
        row_pos += 1

        aoslabel = tk.Label(self.generateframe,text="AoS")
        aoslabel.grid(row=row_pos,column=0, pady=3)
        self.aos = tk.StringVar()
        self.aos.set('0')
        aosentry = tk.Entry(self.generateframe, textvariable=self.aos, width=17)
        aosentry.grid(row=row_pos,column=1)
        aosunitlabel = tk.Label(self.generateframe, text='[deg]')
        aosunitlabel.grid(column=2, row=row_pos)
        row_pos += 1

        self.genbutton = tk.Button(self.generateframe, text='Generate', command=self._generate_aeromap)
        self.genbutton.grid(row=row_pos,column=1, pady=3)
        row_pos += 1