Commit 5edb94e2 authored by claes's avatar claes

*** empty log message ***

parent 7a61f589
/* /*
* Proview $Id: GeDynXYCurve.java,v 1.1 2007-09-17 15:35:28 claes Exp $ * Proview $Id: GeDynXYCurve.java,v 1.2 2007-09-19 15:08:35 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
...@@ -45,6 +45,8 @@ public class GeDynXYCurve extends GeDynElem { ...@@ -45,6 +45,8 @@ public class GeDynXYCurve extends GeDynElem {
int noofpoints; int noofpoints;
int noOfPoints; int noOfPoints;
int xAttrType;
int yAttrType;
public float[] curveX; public float[] curveX;
public float[] curveY; public float[] curveY;
boolean updateAttrFound; boolean updateAttrFound;
...@@ -96,6 +98,13 @@ public class GeDynXYCurve extends GeDynElem { ...@@ -96,6 +98,13 @@ public class GeDynXYCurve extends GeDynElem {
this.fill_curve = fill_curve; this.fill_curve = fill_curve;
} }
public void connect() { public void connect() {
xAttrType = GeDyn.getTypeId( x_attr);
switch ( datatype) {
case GeDyn.eCurveDataType_XYArrays:
yAttrType = GeDyn.getTypeId( y_attr);
break;
}
String attrName = dyn.getAttrName( update_attr); String attrName = dyn.getAttrName( update_attr);
if ( attrName.compareTo("") != 0) { if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName); GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
...@@ -260,11 +269,93 @@ public class GeDynXYCurve extends GeDynElem { ...@@ -260,11 +269,93 @@ public class GeDynXYCurve extends GeDynElem {
size = noOfPoints * 2 + 1; size = noOfPoints * 2 + 1;
break; break;
} }
// Read x-array
CdhrFloatArray rxf;
CdhrIntArray rxi;
switch ( xAttrType) {
case Pwr.eType_Float32:
rxf = dyn.en.gdh.getObjectInfoFloatArray( attrName, size);
if ( rxf.evenSts())
return;
switch ( datatype) {
case GeDyn.eCurveDataType_XYArrays:
curveX = new float[noOfPoints];
for ( int i = 0; i < noOfPoints; i++)
curveX[i] = (rxf.value[i] - x_min_value) / ( x_max_value - x_min_value);
break;
case GeDyn.eCurveDataType_PointArray:
curveX = new float[noOfPoints];
curveY = new float[noOfPoints];
for ( int i = 0; i < noOfPoints; i++) {
curveX[i] = (rxf.value[2*i] - x_min_value) / ( x_max_value - x_min_value);
curveY[i] = (rxf.value[2*i+1] - y_min_value) / ( y_max_value - y_min_value);
}
dyn.repaintNow = true;
break;
case GeDyn.eCurveDataType_TableObject:
noOfPoints = (int)rxf.value[0];
if ( noOfPoints > noofpoints)
noOfPoints = noofpoints;
if ( attrSize < noOfPoints)
noOfPoints = attrSize;
curveY = new float[noOfPoints];
curveX = new float[noOfPoints];
for ( int i = 0; i < noOfPoints; i++) {
curveX[i] = (rxf.value[2*i+1] - x_min_value) / ( x_max_value - x_min_value);
curveY[i] = (rxf.value[2*i+2] - y_min_value) / ( y_max_value - y_min_value);
}
dyn.repaintNow = true;
break;
}
break;
case Pwr.eType_Int32:
case Pwr.eType_Int16:
case Pwr.eType_Int8:
case Pwr.eType_UInt32:
case Pwr.eType_UInt16:
case Pwr.eType_UInt8:
rxi = dyn.en.gdh.getObjectInfoIntArray( attrName, size);
if ( rxi.evenSts())
return;
CdhrFloatArray rx = dyn.en.gdh.getObjectInfoFloatArray( attrName, size); switch ( datatype) {
if ( rx.evenSts()) case GeDyn.eCurveDataType_XYArrays:
curveX = new float[noOfPoints];
for ( int i = 0; i < noOfPoints; i++)
curveX[i] = ((float)rxi.value[i] - x_min_value) / ( x_max_value - x_min_value);
break;
case GeDyn.eCurveDataType_PointArray:
curveX = new float[noOfPoints];
curveY = new float[noOfPoints];
for ( int i = 0; i < noOfPoints; i++) {
curveX[i] = ((float)rxi.value[2*i] - x_min_value) / ( x_max_value - x_min_value);
curveY[i] = ((float)rxi.value[2*i+1] - y_min_value) / ( y_max_value - y_min_value);
}
dyn.repaintNow = true;
break;
case GeDyn.eCurveDataType_TableObject:
noOfPoints = (int)rxi.value[0];
if ( noOfPoints > noofpoints)
noOfPoints = noofpoints;
if ( attrSize < noOfPoints)
noOfPoints = attrSize;
curveY = new float[noOfPoints];
curveX = new float[noOfPoints];
for ( int i = 0; i < noOfPoints; i++) {
curveX[i] = ((float)rxi.value[2*i+1] - x_min_value) / ( x_max_value - x_min_value);
curveY[i] = ((float)rxi.value[2*i+2] - y_min_value) / ( y_max_value - y_min_value);
}
dyn.repaintNow = true;
break;
}
break;
default:
return; return;
}
// Read y-array
switch ( datatype) { switch ( datatype) {
case GeDyn.eCurveDataType_XYArrays: case GeDyn.eCurveDataType_XYArrays:
attrName = dyn.getAttrName( y_attr); attrName = dyn.getAttrName( y_attr);
...@@ -272,39 +363,39 @@ public class GeDynXYCurve extends GeDynElem { ...@@ -272,39 +363,39 @@ public class GeDynXYCurve extends GeDynElem {
if ( attrSize < noOfPoints) if ( attrSize < noOfPoints)
noOfPoints = attrSize; noOfPoints = attrSize;
CdhrFloatArray ry = dyn.en.gdh.getObjectInfoFloatArray( attrName, noOfPoints);
if ( ry.evenSts())
return;
curveY = new float[noOfPoints];
curveX = new float[noOfPoints];
for ( int i = 0; i < noOfPoints; i++) {
curveY[i] = (ry.value[i] - y_min_value) / ( y_max_value - y_min_value);
curveX[i] = (rx.value[i] - x_min_value) / ( x_max_value - x_min_value);
}
dyn.repaintNow = true;
break;
case GeDyn.eCurveDataType_PointArray:
curveY = new float[noOfPoints]; curveY = new float[noOfPoints];
curveX = new float[noOfPoints];
for ( int i = 0; i < noOfPoints; i++) { CdhrFloatArray ryf;
curveX[i] = (rx.value[2*i] - x_min_value) / ( x_max_value - x_min_value); CdhrIntArray ryi;
curveY[i] = (rx.value[2*i+1] - y_min_value) / ( y_max_value - y_min_value); switch ( yAttrType) {
} case Pwr.eType_Float32:
dyn.repaintNow = true; ryf = dyn.en.gdh.getObjectInfoFloatArray( attrName, noOfPoints);
break; if ( ryf.evenSts())
case GeDyn.eCurveDataType_TableObject: return;
noOfPoints = (int)rx.value[0];
if ( noOfPoints > noofpoints) for ( int i = 0; i < noOfPoints; i++)
noOfPoints = noofpoints; curveY[i] = (ryf.value[i] - y_min_value) / ( y_max_value - y_min_value);
if ( attrSize < noOfPoints) dyn.repaintNow = true;
noOfPoints = attrSize; break;
curveY = new float[noOfPoints]; case Pwr.eType_Int32:
curveX = new float[noOfPoints]; case Pwr.eType_Int16:
for ( int i = 0; i < noOfPoints; i++) { case Pwr.eType_Int8:
curveX[i] = (rx.value[2*i+1] - x_min_value) / ( x_max_value - x_min_value); case Pwr.eType_UInt32:
curveY[i] = (rx.value[2*i+2] - y_min_value) / ( y_max_value - y_min_value); case Pwr.eType_UInt16:
case Pwr.eType_UInt8:
ryi = dyn.en.gdh.getObjectInfoIntArray( attrName, noOfPoints);
if ( ryi.evenSts())
return;
for ( int i = 0; i < noOfPoints; i++)
curveY[i] = ((float)ryi.value[i] - y_min_value) / ( y_max_value - y_min_value);
dyn.repaintNow = true;
break;
default:
return;
} }
dyn.repaintNow = true;
break; break;
} }
......
...@@ -43,4 +43,6 @@ ...@@ -43,4 +43,6 @@
070720 cs co Listwidgets: Doubleclick and Enter activates a row. 070720 cs co Listwidgets: Doubleclick and Enter activates a row.
070821 cs convert Template with includes inserted at structfile generation. 070821 cs convert Template with includes inserted at structfile generation.
070905 cs doc New Guide to I/O Systems. 070905 cs doc New Guide to I/O Systems.
070906 cs statussrv Functionality to view userstatus added. 070906 cs statussrv Functionality to view userstatus added.
\ No newline at end of file 070918 cs wbl New systemclass $ClassLost to replace lost classes.
070919 cs wbl New class XyCurve to view a curve of points with x,y coordiantes.
\ No newline at end of file
This diff is collapsed.
...@@ -70,4 +70,7 @@ ...@@ -70,4 +70,7 @@
070824 cs wb Bugfix in WbEnvironment object, only the first nine pathes were used. 070824 cs wb Bugfix in WbEnvironment object, only the first nine pathes were used.
070827 cs wtt Objects in the navigator beneath a MountObject are viewed with classes from their dbs-file. 070827 cs wtt Objects in the navigator beneath a MountObject are viewed with classes from their dbs-file.
070905 cs utl Bugfix in listdescriptor. Superclass attributes where not printed. 070905 cs utl Bugfix in listdescriptor. Superclass attributes where not printed.
070905 cs wb Bugfix in ldh_GetClassListAttrRef, success status was returned though list was empty. 070905 cs wb Bugfix in ldh_GetClassListAttrRef, success status was returned though list was empty.
\ No newline at end of file 070917 cs plc Bugfix, reference connections could not be set in gtk.
070918 cs wb Lost classes replaced with $ClassLost when reading wb_load file.
070919 cs wb Defaultvalues inserted into template objects when new attribute objects are added to a class.
\ No newline at end of file
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