# Copyright (c) 2026, UChicago Argonne, LLC
# BSD OPEN SOURCE LICENSE. Full license can be found in LICENSE
# Copyright (c) 2026, UChicago Argonne, LLC
# BSD OPEN SOURCE LICENSE. Full license can be found in LICENSE
from ..results_analysis.link_maps_dialog import LinkMapCreationDialog


def display_traffic(proj):
    if not proj.open_mode:
        proj.show_message_no_supply()
        return
    pol = proj.polaris_project
    if pol.supply_file is None:
        proj.show_message_no_supply()
        return
    if not proj.result_h5_path.exists():
        proj.show_message_no_results()
        return

    dlg2 = LinkMapCreationDialog(proj)
    dlg2.show()
    dlg2.exec_()
