Commit 5f43be70 authored by claes's avatar claes

Fixes to avoid exception

parent 2c75bc0d
/* /*
* Proview $Id: GeDyn.java,v 1.10 2007-01-30 06:51:17 claes Exp $ * Proview $Id: GeDyn.java,v 1.11 2007-05-23 08:05:19 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -193,7 +193,10 @@ public class GeDyn { ...@@ -193,7 +193,10 @@ public class GeDyn {
nix = 0; nix = 0;
else { else {
CdhrObjid cdhr_inst = en.gdh.nameToObjid( instance); CdhrObjid cdhr_inst = en.gdh.nameToObjid( instance);
nix = cdhr_inst.objid.vid; if ( cdhr_inst.oddSts())
nix = cdhr_inst.objid.vid;
else
nix = 0;
} }
CdhrObjid cdhr_node = en.gdh.getNodeObject(nix); CdhrObjid cdhr_node = en.gdh.getNodeObject(nix);
if ( cdhr_node.evenSts()) return str; if ( cdhr_node.evenSts()) return str;
......
/* /*
* Proview $Id: GeDynTable.java,v 1.6 2005-09-01 14:57:50 claes Exp $ * Proview $Id: GeDynTable.java,v 1.7 2007-05-23 08:05:19 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -234,29 +234,33 @@ public class GeDynTable extends GeDynElem { ...@@ -234,29 +234,33 @@ public class GeDynTable extends GeDynElem {
else { else {
if ( typeId[i] == Pwr.eType_Float32) { if ( typeId[i] == Pwr.eType_Float32) {
float[] value0 = dyn.en.gdh.getObjectRefInfoFloatArray( p[i], elements[i]); float[] value0 = dyn.en.gdh.getObjectRefInfoFloatArray( p[i], elements[i]);
for ( int j = 0; j < value0.length; j++) { if ( value0 != null) {
if (j >= rows) for ( int j = 0; j < value0.length; j++) {
break; if (j >= rows)
if ( value0[j] != oldValueF[i][j] || firstScan) { break;
sb = cFormat[i].format( value0[j], sb); if ( value0[j] != oldValueF[i][j] || firstScan) {
((GeTable)dyn.comp).setValueAt(new String(sb), j, i); sb = cFormat[i].format( value0[j], sb);
// dyn.repaintNow = true; ((GeTable)dyn.comp).setValueAt(new String(sb), j, i);
oldValueF[i][j] = value0[j]; // dyn.repaintNow = true;
oldValueF[i][j] = value0[j];
}
} }
} }
} }
else if ( typeId[i] == Pwr.eType_Boolean) { else if ( typeId[i] == Pwr.eType_Boolean) {
boolean[] value0 = dyn.en.gdh.getObjectRefInfoBooleanArray( p[i], elements[i]); boolean[] value0 = dyn.en.gdh.getObjectRefInfoBooleanArray( p[i], elements[i]);
for ( int j = 0; j < value0.length; j++) { if ( value0 != null) {
if (j >= rows) for ( int j = 0; j < value0.length; j++) {
break; if (j >= rows)
if ( value0[j] != oldValueB[i][j] || firstScan) { break;
if ( value0[j]) if ( value0[j] != oldValueB[i][j] || firstScan) {
((GeTable)dyn.comp).setValueAt("1", j, i); if ( value0[j])
else ((GeTable)dyn.comp).setValueAt("1", j, i);
((GeTable)dyn.comp).setValueAt("0", j, i); else
// dyn.repaintNow = true; ((GeTable)dyn.comp).setValueAt("0", j, i);
oldValueB[i][j] = value0[j]; // dyn.repaintNow = true;
oldValueB[i][j] = value0[j];
}
} }
} }
} }
...@@ -267,15 +271,17 @@ public class GeDynTable extends GeDynElem { ...@@ -267,15 +271,17 @@ public class GeDynTable extends GeDynElem {
typeId[i] == Pwr.eType_Int8 || typeId[i] == Pwr.eType_Int8 ||
typeId[i] == Pwr.eType_UInt8) { typeId[i] == Pwr.eType_UInt8) {
int value0[] = dyn.en.gdh.getObjectRefInfoIntArray( p[i], elements[i]); int value0[] = dyn.en.gdh.getObjectRefInfoIntArray( p[i], elements[i]);
for ( int j = 0; j < value0.length; j++) { if ( value0 != null) {
if (j >= rows) for ( int j = 0; j < value0.length; j++) {
break; if (j >= rows)
if ( value0[j] != oldValueI[i][j] || firstScan) { break;
sb = cFormat[i].format( value0[j], sb); if ( value0[j] != oldValueI[i][j] || firstScan) {
((GeTable)dyn.comp).setValueAt(new String(sb), j, i); sb = cFormat[i].format( value0[j], sb);
// dyn.repaintNow = true; ((GeTable)dyn.comp).setValueAt(new String(sb), j, i);
oldValueI[i][j] = value0[j]; // dyn.repaintNow = true;
} oldValueI[i][j] = value0[j];
}
}
} }
} }
else if ( typeId[i] == Pwr.eType_String || else if ( typeId[i] == Pwr.eType_String ||
...@@ -283,16 +289,18 @@ public class GeDynTable extends GeDynElem { ...@@ -283,16 +289,18 @@ public class GeDynTable extends GeDynElem {
typeId[i] == Pwr.eType_Time || typeId[i] == Pwr.eType_Time ||
typeId[i] == Pwr.eType_DeltaTime) { typeId[i] == Pwr.eType_DeltaTime) {
String[] value0 = dyn.en.gdh.getObjectRefInfoStringArray( p[i], typeId[i], size[i], elements[i]); String[] value0 = dyn.en.gdh.getObjectRefInfoStringArray( p[i], typeId[i], size[i], elements[i]);
for ( int j = 0; j < value0.length; j++) { if ( value0 != null) {
if (j >= rows) for ( int j = 0; j < value0.length; j++) {
break; if (j >= rows)
if ( firstScan || value0[j].compareTo( oldValueS[i][j]) != 0) { break;
sb = cFormat[i].format( value0[j], sb); if ( firstScan || value0[j].compareTo( oldValueS[i][j]) != 0) {
((GeTable)dyn.comp).setValueAt(new String(sb), j, i); sb = cFormat[i].format( value0[j], sb);
// dyn.repaintNow = true; ((GeTable)dyn.comp).setValueAt(new String(sb), j, i);
// dyn.repaintNow = true;
oldValueS[i][j] = value0[j]; oldValueS[i][j] = value0[j];
} }
}
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment