From 96764e676aee455f4887bdd247aeb47c5dd390f5 Mon Sep 17 00:00:00 2001 From: Lucio Maranta Date: Fri, 15 Mar 2019 12:10:59 +0000 Subject: [PATCH] fIX SIEMENS axes --- CMS_CORE_Library/Siemens/Nc_Siemens.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMS_CORE_Library/Siemens/Nc_Siemens.cs b/CMS_CORE_Library/Siemens/Nc_Siemens.cs index 54931c9..c7f12dd 100644 --- a/CMS_CORE_Library/Siemens/Nc_Siemens.cs +++ b/CMS_CORE_Library/Siemens/Nc_Siemens.cs @@ -1801,9 +1801,12 @@ namespace CMS_CORE_Library.Siemens // Cycle between axes // The dictionary is written asynchronously so i have to create a copy of the dictionary with .ToList() to avoid exceptions // axes = InterpAxesPosition.ToDictionary(x => x.Key, x => x.Value); This code throws exceptions - foreach (var axis in InterpAxesPosition.ToList()) + lock (InterpAxesPosition) { - axes.Add(axis.Key, axis.Value); + foreach (var axis in InterpAxesPosition.ToList()) + { + axes.Add(axis.Key, axis.Value); + } } } catch (Exception ex)