def load_tabs(self): for major_key in database.read_stability_specifications().keys(): for key in database.read_stability_specifications( )[major_key].keys(): self.asbTabs.addTab( table_tab(type_=sandbox_data, major_key=major_key, name=key), key) for major_key in database.read_datcom_stability_specifications().keys( ): for key in database.read_datcom_stability_specifications( )[major_key].keys(): self.datcomTabs.addTab( table_tab(type_=datcom_data, major_key=major_key, name=key), key)
def read_sandbox_table_data(type_="", major_key="", key=""): if type_ == datcom_data: values = database.read_datcom_stability_specifications()[major_key] else: values = database.read_stability_specifications()[major_key] val = values.get(key) x_label = alpha alpha_ = get_aoa_range() velocity_ = get_free_stream_velocity_range() y = val return alpha_, velocity_, y
def get_pandas_sandbox_table(type_="", major_key="", name=""): if type_ == datcom_data: values = database.read_datcom_stability_specifications()[major_key] else: values = database.read_stability_specifications()[major_key] y = values.get(name) value = {} for vel, y_ in zip(get_free_stream_velocity_range(), y): value.update({vel: {alpha: get_aoa_range(), name: y_}}) df = pd.DataFrame(value) return df.to_string()
def read_datcom_table_data(type_="", major_key="", key=""): if type_ == datcom_data: values = database.read_datcom_stability_specifications()[major_key] else: values = database.read_stability_specifications()[major_key] val = values.get(key) x_label = alpha alpha_ = get_aoa_range() velocity_ = get_free_stream_velocity_range() for i in val: if i == "NDM": val[val.index(i)] = 0 return alpha_, velocity_, val
def exportValues(): output = "" for major_key in database.read_datcom_stability_specifications().keys(): for key in database.read_datcom_stability_specifications( )[major_key].keys(): alpha_, velocity_, y = read_datcom_table_data(type_=datcom_data, major_key=major_key, key=key) try: value = y[alpha_.index(0)] except: value = 0 output = output + f"{key}:{value}," for key, value in database.read_propulsion_specifications( )["propulsion_dialogs"].items(): output = output + f"{key}:{value}," for key, value in database.read_structures_specifications().items(): try: for k, v in value.items(): output = output + f"{k}:{v}," except: output = output + f"{key}:{value}," writeTxt(sim_export_txt_dir, output)
def get_pandas_datcom_table(type_="", major_key="", name=""): if type_ == datcom_data: values = database.read_datcom_stability_specifications()[major_key] else: values = database.read_stability_specifications()[major_key] val = values.get(name) y = [] j_y = [] prev = 0 for i in range(9, len(val) + 1, 9): y.append(val[prev:i:1]) prev = i for i in y: try: j_y.append(i[0]) except: pass value = {} for vel, y_ in zip(get_free_stream_velocity_range(), y): value.update({vel: {alpha: get_aoa_range(), name: y_}}) df = pd.DataFrame(value) return df.to_string()