Fix osai axes

This commit is contained in:
Lucio Maranta
2019-04-08 14:06:06 +00:00
parent 9264741ab6
commit e89dc7c3c1
2 changed files with 33 additions and 7 deletions
+32 -6
View File
@@ -1739,8 +1739,14 @@ namespace CMS_CORE_Library.Osai
{
if (ax.AxisName > 0 && axesN.Count() > 0)
{
AxName = ((char)ax.AxisName).ToString();
int id = axesN.FirstOrDefault(x => x.Name == AxName).Id;
int id = 0;
//AxName = ((char)ax.AxisName).ToString();
// Check if axis exist
var axis = axesN.FirstOrDefault(x => x.Name == AxName);
if (axis != null)
id = axis.Id;
val = Axes.FirstOrDefault(X => X.Key == AxName);
if (id > 0)
{
@@ -1797,8 +1803,14 @@ namespace CMS_CORE_Library.Osai
{
if (ax.AxisName > 0 && axesN.Count() > 0)
{
int id = 0;
AxName = ((char)ax.AxisName).ToString();
int id = axesN.FirstOrDefault(x => x.Name == AxName).Id;
// Check if axis exist
var axis = axesN.FirstOrDefault(x => x.Name == AxName);
if (axis != null)
id = axis.Id;
val = Axes.FirstOrDefault(X => X.Key == AxName);
if (id > 0)
{
@@ -1855,8 +1867,14 @@ namespace CMS_CORE_Library.Osai
{
if (ax.AxisName > 0 && axesN.Count() > 0)
{
int id = 0;
AxName = ((char)ax.AxisName).ToString();
int id = axesN.FirstOrDefault(x => x.Name == AxName).Id;
// Check if axis exist
var axis = axesN.FirstOrDefault(x => x.Name == AxName);
if (axis != null)
id = axis.Id;
val = Axes.FirstOrDefault(X => X.Key == AxName);
if (id > 0)
{
@@ -1913,8 +1931,14 @@ namespace CMS_CORE_Library.Osai
{
if (ax.AxisName > 0 && axesN.Count() > 0)
{
int id = 0;
AxName = ((char)ax.AxisName).ToString();
int id = axesN.FirstOrDefault(x => x.Name == AxName).Id;
// Check if axis exist
var axis = axesN.FirstOrDefault(x => x.Name == AxName);
if (axis != null)
id = axis.Id;
val = Axes.FirstOrDefault(X => X.Key == AxName);
if (id > 0)
{
@@ -2297,6 +2321,8 @@ namespace CMS_CORE_Library.Osai
index = 0;
MemIndexTemp++;
}
else
index++;
}
}
else
@@ -2384,7 +2410,7 @@ namespace CMS_CORE_Library.Osai
public override CmsError MEM_RWShortList(bool bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, int Number, ref List<short> Value)
{
List<ushort> ShortValue = Value.ConvertAll(x => (ushort)x);
CmsError cmsError = MEM_RWWordList(bWrite, Process, MemType, MemIndex, 1, ref ShortValue);
CmsError cmsError = MEM_RWWordList(bWrite, Process, MemType, MemIndex, Number, ref ShortValue);
if (cmsError.IsError())
return cmsError;
+1 -1
View File
@@ -4321,7 +4321,7 @@ namespace CMS_CORE_Library.Siemens
private void NcLanguageChanged(string language)
{
SiemensAlmSvc.UnSubscribe(AlarmsChanged);
SiemensAlmSvc.Dispose();
// SiemensAlmSvc.Dispose();
SiemensAlmSvc = new AlarmSvc(language);
SiemensAlmSvc.Subscribe(AlarmsChanged);
}