Skip to content

Commit

Permalink
[ICP CON import] Fix open alternate macro
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillGutyrchik committed Dec 13, 2024
1 parent 9b6298f commit efb250d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ProjectImportICP/ModulesImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private WindowMacro OpenMacro(int number)
try
{
var macrosFilePath = Path.Combine(importMacrosPath, $@"750-{number / 100 * 100}\WAGO.750-{number}.ema");
if (string.IsNullOrEmpty(importMacrosPath) || !Directory.Exists(importMacrosPath))
if (!File.Exists(macrosFilePath))
{
macrosFilePath = Path.Combine(macrosPath, $@"750-{number / 100 * 100}\WAGO.750-{number}.ema");
}
Expand All @@ -355,7 +355,15 @@ private WindowMacro OpenMacro(int number)
return new WindowMacro();

var macro = new WindowMacro();
macro.Open(macrosFilePath, project, OVERVIEW, MACRO_VARIANT_E);

try
{
macro.Open(macrosFilePath, project, MULTILINE, MACRO_VARIANT_A);
}
catch
{
macro.Open(macrosFilePath, project, OVERVIEW, MACRO_VARIANT_E);
}

return macro;
}
Expand Down

0 comments on commit efb250d

Please sign in to comment.