Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions fmpy/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,15 +652,19 @@ def simulate_fmu(filename,
from fmpy.model_description import read_model_description
from fmpy.util import can_simulate

platforms = supported_platforms(filename)
if fmu_instance is None:

platforms = supported_platforms(filename)

if fmu_instance is None and platform not in platforms and remote_platform is None:
raise Exception(f"The current platform ({platform}) is not supported by the FMU.")
if platform not in platforms and remote_platform is None:
raise Exception(f"The current platform ({platform}) is not supported by the FMU.")

can_sim, remote_platform = can_simulate(platforms, remote_platform)
can_sim, remote_platform = can_simulate(platforms, remote_platform)

if not can_sim:
raise Exception(f"The FMU cannot be simulated on the current platform ({platform}).")
if not can_sim:
raise Exception(f"The FMU cannot be simulated on the current platform ({platform}).")
else:
remote_platform = None

if model_description is None:
model_description = read_model_description(filename, validate=validate)
Expand Down