Commit 6a2d651b authored by claes's avatar claes

jopc created

parent 030616ca
package jpwr.jopc;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcIi extends JopcIiGen implements JopDynamic {
boolean slider = false;
int pSlider;
boolean hold = false;
int pHold;
float scanTimeOld = -1F;
int pScanTime;
float presMaxLimitOld = 0;
float presMinLimitOld = 0;
int pPresMaxLimit;
int pPresMinLimit;
PwrtRefId presMaxLimitSubid;
PwrtRefId presMinLimitSubid;
LocalDb ldb;
public JopcIi( JopSession session, String instance, boolean scrollbar) {
super( session, instance, scrollbar, true);
// engine = new JopEngine( 1000, session.getRoot());
// ldb = new LocalDb();
// engine.setLocalDb(ldb);
geInit();
engine.add(this);
}
public Object dynamicGetRoot() {
return this;
}
GeDyn dd;
public void dynamicOpen() {
GdhrRefObjectInfo ret;
ret = engine.ldb.refObjectInfo( this, "$local.SliderDisable##Boolean");
if ( ret.oddSts())
pSlider = ret.id;
else
System.out.println("$local.Slider not found");
ret = engine.ldb.refObjectInfo( this, "$local.TrendHold##Boolean");
if ( ret.oddSts())
pHold = ret.id;
else
System.out.println("$local.Hold not found");
ret = engine.ldb.refObjectInfo( this, "$local.ScanTime##Float32");
if ( ret.oddSts())
pScanTime = ret.id;
else
System.out.println("$local.ScanTime not found");
dd = new GeDyn( null);
dd.setSession( session);
dd.setInstance( engine.getInstance());
String attrName = dd.getAttrName( "$object.PresMinLimit##Float32");
ret = engine.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "JopcAv: " + attrName);
else {
presMinLimitSubid = ret.refid;
pPresMinLimit = ret.id;
}
attrName = dd.getAttrName( "$object.PresMaxLimit##Float32");
ret = engine.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "JopcAv: " + attrName);
else {
presMaxLimitSubid = ret.refid;
pPresMaxLimit = ret.id;
}
}
public void dynamicClose() {
engine.gdh.unrefObjectInfo( presMaxLimitSubid);
engine.gdh.unrefObjectInfo( presMinLimitSubid);
engine.ldb.unrefObjectInfo( pSlider);
engine.ldb.unrefObjectInfo( pHold);
engine.ldb.unrefObjectInfo( pScanTime);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
boolean sliderValue = engine.ldb.getObjectRefInfoBoolean( pSlider);
boolean holdValue = engine.ldb.getObjectRefInfoBoolean( pHold);
float scanTime = engine.ldb.getObjectRefInfoFloat( pScanTime);
float presMinLimit = engine.gdh.getObjectRefInfoFloat( pPresMinLimit);
float presMaxLimit = engine.gdh.getObjectRefInfoFloat( pPresMaxLimit);
if ( engine.gdh.isAuthorized( jopButtontoggle16.dd.access) ) {
if ( sliderValue) {
engine.ldb.setObjectInfo( this, "$local.SliderDisable##Boolean", false);
slider = !slider;
pwr_slider115.setActionDisabled(!slider);
if ( slider)
jopButtontoggle16.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle16.resetFillColor();
jopButtontoggle16.repaintForeground();
}
}
if ( holdValue) {
engine.ldb.setObjectInfo( this, "$local.TrendHold##Boolean", false);
hold = !hold;
jopTrend6.setHold(hold);
if ( hold)
jopButtontoggle12.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle12.resetFillColor();
jopButtontoggle12.repaintForeground();
}
if ( presMaxLimit != presMaxLimitOld || presMinLimit != presMinLimitOld) {
jopTrend6.setMinValue1(presMinLimit);
jopTrend6.setMaxValue1(presMaxLimit);
jopTrend6.reset();
jopBar5.setMinValue(presMinLimit);
jopBar5.setMaxValue(presMaxLimit);
jopBar5.update();
GeDyn dyn = pwr_slider115.dd;
for ( int i = 0; i < dyn.elements.length; i++) {
if ( dyn.elements[i].getActionType() == GeDyn.mActionType_Slider) {
GeDynSlider elem = (GeDynSlider)dyn.elements[i];
elem.setMinValue( presMinLimit);
elem.setMaxValue( presMaxLimit);
elem.update();
}
}
presMaxLimitOld = presMaxLimit;
presMinLimitOld = presMinLimit;
}
if ( scanTime != scanTimeOld) {
// TODO
engine.ldb.setObjectInfo( this, "$local.ScanTime##Float32", 100.0F);
scanTimeOld = scanTime;
}
}
}
package jpwr.jopc;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcAi extends JopcAiGen implements JopDynamic {
boolean slider = false;
int pSlider;
boolean hold = false;
int pHold;
float scanTimeOld = -1F;
int pScanTime;
float presMaxLimitOld = 0;
float presMinLimitOld = 0;
int pPresMaxLimit;
int pPresMinLimit;
PwrtRefId presMaxLimitSubid;
PwrtRefId presMinLimitSubid;
LocalDb ldb;
public JopcAi( JopSession session, String instance, boolean scrollbar) {
super( session, instance, scrollbar, true);
// engine = new JopEngine( 1000, session.getRoot());
// ldb = new LocalDb();
// engine.setLocalDb(ldb);
geInit();
engine.add(this);
}
public Object dynamicGetRoot() {
return this;
}
GeDyn dd;
public void dynamicOpen() {
GdhrRefObjectInfo ret;
ret = engine.ldb.refObjectInfo( this, "$local.SliderDisable##Boolean");
if ( ret.oddSts())
pSlider = ret.id;
else
System.out.println("$local.Slider not found");
ret = engine.ldb.refObjectInfo( this, "$local.TrendHold##Boolean");
if ( ret.oddSts())
pHold = ret.id;
else
System.out.println("$local.Hold not found");
ret = engine.ldb.refObjectInfo( this, "$local.ScanTime##Float32");
if ( ret.oddSts())
pScanTime = ret.id;
else
System.out.println("$local.ScanTime not found");
dd = new GeDyn( null);
dd.setSession( session);
dd.setInstance( engine.getInstance());
String attrName = dd.getAttrName( "$object.PresMinLimit##Float32");
ret = engine.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "JopcAi: " + attrName);
else {
presMinLimitSubid = ret.refid;
pPresMinLimit = ret.id;
}
attrName = dd.getAttrName( "$object.PresMaxLimit##Float32");
ret = engine.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "JopcAi: " + attrName);
else {
presMaxLimitSubid = ret.refid;
pPresMaxLimit = ret.id;
}
pwr_slider115.setActionDisabled(true);
}
public void dynamicClose() {
engine.gdh.unrefObjectInfo( presMaxLimitSubid);
engine.gdh.unrefObjectInfo( presMinLimitSubid);
engine.ldb.unrefObjectInfo( pSlider);
engine.ldb.unrefObjectInfo( pHold);
engine.ldb.unrefObjectInfo( pScanTime);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
boolean sliderValue = engine.ldb.getObjectRefInfoBoolean( pSlider);
boolean holdValue = engine.ldb.getObjectRefInfoBoolean( pHold);
float scanTime = engine.ldb.getObjectRefInfoFloat( pScanTime);
float presMinLimit = engine.gdh.getObjectRefInfoFloat( pPresMinLimit);
float presMaxLimit = engine.gdh.getObjectRefInfoFloat( pPresMaxLimit);
if ( engine.gdh.isAuthorized( jopButtontoggle16.dd.access) ) {
if ( sliderValue) {
engine.ldb.setObjectInfo( this, "$local.SliderDisable##Boolean", false);
slider = !slider;
pwr_slider115.setActionDisabled(!slider);
if ( slider)
jopButtontoggle16.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle16.resetFillColor();
jopButtontoggle16.repaintForeground();
}
}
if ( holdValue) {
engine.ldb.setObjectInfo( this, "$local.TrendHold##Boolean", false);
hold = !hold;
jopTrend6.setHold(hold);
if ( hold)
jopButtontoggle12.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle12.resetFillColor();
jopButtontoggle12.repaintForeground();
}
if ( presMaxLimit != presMaxLimitOld || presMinLimit != presMinLimitOld) {
jopTrend6.setMinValue1(presMinLimit);
jopTrend6.setMaxValue1(presMaxLimit);
jopTrend6.reset();
jopBar5.setMinValue(presMinLimit);
jopBar5.setMaxValue(presMaxLimit);
jopBar5.update();
GeDyn dyn = pwr_slider115.dd;
for ( int i = 0; i < dyn.elements.length; i++) {
if ( dyn.elements[i].getActionType() == GeDyn.mActionType_Slider) {
GeDynSlider elem = (GeDynSlider)dyn.elements[i];
elem.setMinValue( presMinLimit);
elem.setMaxValue( presMaxLimit);
elem.update();
}
}
presMaxLimitOld = presMaxLimit;
presMinLimitOld = presMinLimit;
}
if ( scanTime != scanTimeOld) {
// TODO
engine.ldb.setObjectInfo( this, "$local.ScanTime##Float32", 100.0F);
scanTimeOld = scanTime;
}
}
}
This diff is collapsed.
package jpwr.jopc;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcAo extends JopcAoGen implements JopDynamic {
boolean slider = false;
int pSlider;
boolean hold = false;
int pHold;
float scanTimeOld = -1F;
int pScanTime;
float presMaxLimitOld = 0;
float presMinLimitOld = 0;
int pPresMaxLimit;
int pPresMinLimit;
PwrtRefId presMaxLimitSubid;
PwrtRefId presMinLimitSubid;
LocalDb ldb;
public JopcAo( JopSession session, String instance, boolean scrollbar) {
super( session, instance, scrollbar, true);
// engine = new JopEngine( 1000, session.getRoot());
// ldb = new LocalDb();
// engine.setLocalDb(ldb);
geInit();
engine.add(this);
}
public Object dynamicGetRoot() {
return this;
}
GeDyn dd;
public void dynamicOpen() {
GdhrRefObjectInfo ret;
ret = engine.ldb.refObjectInfo( this, "$local.SliderDisable##Boolean");
if ( ret.oddSts())
pSlider = ret.id;
else
System.out.println("$local.Slider not found");
ret = engine.ldb.refObjectInfo( this, "$local.TrendHold##Boolean");
if ( ret.oddSts())
pHold = ret.id;
else
System.out.println("$local.Hold not found");
ret = engine.ldb.refObjectInfo( this, "$local.ScanTime##Float32");
if ( ret.oddSts())
pScanTime = ret.id;
else
System.out.println("$local.ScanTime not found");
dd = new GeDyn( null);
dd.setSession( session);
dd.setInstance( engine.getInstance());
String attrName = dd.getAttrName( "$object.PresMinLimit##Float32");
ret = engine.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "JopcAo: " + attrName);
else {
presMinLimitSubid = ret.refid;
pPresMinLimit = ret.id;
}
attrName = dd.getAttrName( "$object.PresMaxLimit##Float32");
ret = engine.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "JopcAo: " + attrName);
else {
presMaxLimitSubid = ret.refid;
pPresMaxLimit = ret.id;
}
pwr_slider115.setActionDisabled(true);
}
public void dynamicClose() {
engine.gdh.unrefObjectInfo( presMaxLimitSubid);
engine.gdh.unrefObjectInfo( presMinLimitSubid);
engine.ldb.unrefObjectInfo( pSlider);
engine.ldb.unrefObjectInfo( pHold);
engine.ldb.unrefObjectInfo( pScanTime);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
boolean sliderValue = engine.ldb.getObjectRefInfoBoolean( pSlider);
boolean holdValue = engine.ldb.getObjectRefInfoBoolean( pHold);
float scanTime = engine.ldb.getObjectRefInfoFloat( pScanTime);
float presMinLimit = engine.gdh.getObjectRefInfoFloat( pPresMinLimit);
float presMaxLimit = engine.gdh.getObjectRefInfoFloat( pPresMaxLimit);
if ( engine.gdh.isAuthorized( jopButtontoggle16.dd.access) ) {
if ( sliderValue) {
engine.ldb.setObjectInfo( this, "$local.SliderDisable##Boolean", false);
slider = !slider;
pwr_slider115.setActionDisabled(!slider);
if ( slider)
jopButtontoggle16.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle16.resetFillColor();
jopButtontoggle16.repaintForeground();
}
if ( holdValue) {
engine.ldb.setObjectInfo( this, "$local.TrendHold##Boolean", false);
hold = !hold;
jopTrend6.setHold(hold);
if ( hold)
jopButtontoggle12.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle12.resetFillColor();
jopButtontoggle12.repaintForeground();
}
}
if ( presMaxLimit != presMaxLimitOld || presMinLimit != presMinLimitOld) {
jopTrend6.setMinValue1(presMinLimit);
jopTrend6.setMaxValue1(presMaxLimit);
jopTrend6.reset();
jopBar5.setMinValue(presMinLimit);
jopBar5.setMaxValue(presMaxLimit);
jopBar5.update();
GeDyn dyn = pwr_slider115.dd;
for ( int i = 0; i < dyn.elements.length; i++) {
if ( dyn.elements[i].getActionType() == GeDyn.mActionType_Slider) {
GeDynSlider elem = (GeDynSlider)dyn.elements[i];
elem.setMinValue( presMinLimit);
elem.setMaxValue( presMaxLimit);
elem.update();
}
}
presMaxLimitOld = presMaxLimit;
presMinLimitOld = presMinLimit;
}
if ( scanTime != scanTimeOld) {
// TODO
engine.ldb.setObjectInfo( this, "$local.ScanTime##Float32", 100.0F);
scanTimeOld = scanTime;
}
}
}
This diff is collapsed.
package jpwr.jopc;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcAv extends JopcAvGen implements JopDynamic {
boolean slider = false;
int pSlider;
boolean hold = false;
int pHold;
float scanTimeOld = -1F;
int pScanTime;
float presMaxLimitOld = 0;
float presMinLimitOld = 0;
int pPresMaxLimit;
int pPresMinLimit;
PwrtRefId presMaxLimitSubid;
PwrtRefId presMinLimitSubid;
LocalDb ldb;
public JopcAv( JopSession session, String instance, boolean scrollbar) {
super( session, instance, scrollbar, true);
// engine = new JopEngine( 1000, session.getRoot());
// ldb = new LocalDb();
// engine.setLocalDb(ldb);
geInit();
engine.add(this);
}
public Object dynamicGetRoot() {
return this;
}
GeDyn dd;
public void dynamicOpen() {
GdhrRefObjectInfo ret;
ret = engine.ldb.refObjectInfo( this, "$local.SliderDisable##Boolean");
if ( ret.oddSts())
pSlider = ret.id;
else
System.out.println("$local.Slider not found");
ret = engine.ldb.refObjectInfo( this, "$local.TrendHold##Boolean");
if ( ret.oddSts())
pHold = ret.id;
else
System.out.println("$local.Hold not found");
ret = engine.ldb.refObjectInfo( this, "$local.ScanTime##Float32");
if ( ret.oddSts())
pScanTime = ret.id;
else
System.out.println("$local.ScanTime not found");
dd = new GeDyn( null);
dd.setSession( session);
dd.setInstance( engine.getInstance());
String attrName = dd.getAttrName( "$object.PresMinLimit##Float32");
ret = engine.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "JopcAv: " + attrName);
else {
presMinLimitSubid = ret.refid;
pPresMinLimit = ret.id;
}
attrName = dd.getAttrName( "$object.PresMaxLimit##Float32");
ret = engine.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "JopcAv: " + attrName);
else {
presMaxLimitSubid = ret.refid;
pPresMaxLimit = ret.id;
}
pwr_slider115.setActionDisabled(true);
}
public void dynamicClose() {
engine.gdh.unrefObjectInfo( presMaxLimitSubid);
engine.gdh.unrefObjectInfo( presMinLimitSubid);
engine.ldb.unrefObjectInfo( pSlider);
engine.ldb.unrefObjectInfo( pHold);
engine.ldb.unrefObjectInfo( pScanTime);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
boolean sliderValue = engine.ldb.getObjectRefInfoBoolean( pSlider);
boolean holdValue = engine.ldb.getObjectRefInfoBoolean( pHold);
float scanTime = engine.ldb.getObjectRefInfoFloat( pScanTime);
float presMinLimit = engine.gdh.getObjectRefInfoFloat( pPresMinLimit);
float presMaxLimit = engine.gdh.getObjectRefInfoFloat( pPresMaxLimit);
if ( engine.gdh.isAuthorized( jopButtontoggle16.dd.access) ) {
if ( sliderValue) {
engine.ldb.setObjectInfo( this, "$local.SliderDisable##Boolean", false);
slider = !slider;
pwr_slider115.setActionDisabled(!slider);
if ( slider)
jopButtontoggle16.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle16.resetFillColor();
jopButtontoggle16.repaintForeground();
}
}
if ( holdValue) {
engine.ldb.setObjectInfo( this, "$local.TrendHold##Boolean", false);
hold = !hold;
jopTrend6.setHold(hold);
if ( hold)
jopButtontoggle12.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle12.resetFillColor();
jopButtontoggle12.repaintForeground();
}
if ( presMaxLimit != presMaxLimitOld || presMinLimit != presMinLimitOld) {
jopTrend6.setMinValue1(presMinLimit);
jopTrend6.setMaxValue1(presMaxLimit);
jopTrend6.reset();
jopBar5.setMinValue(presMinLimit);
jopBar5.setMaxValue(presMaxLimit);
jopBar5.update();
GeDyn dyn = pwr_slider115.dd;
for ( int i = 0; i < dyn.elements.length; i++) {
if ( dyn.elements[i].getActionType() == GeDyn.mActionType_Slider) {
GeDynSlider elem = (GeDynSlider)dyn.elements[i];
elem.setMinValue( presMinLimit);
elem.setMaxValue( presMaxLimit);
elem.update();
}
}
presMaxLimitOld = presMaxLimit;
presMinLimitOld = presMinLimit;
}
if ( scanTime != scanTimeOld) {
// TODO
engine.ldb.setObjectInfo( this, "$local.ScanTime##Float32", 100.0F);
scanTimeOld = scanTime;
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package jpwr.jopc;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcDi extends JopcDiGen implements JopDynamic {
boolean hold = false;
int pHold;
float scanTimeOld = -1F;
int pScanTime;
LocalDb ldb;
public JopcDi( JopSession session, String instance, boolean scrollbar) {
super( session, instance, scrollbar, true);
// engine = new JopEngine( 1000, session.getRoot());
// ldb = new LocalDb();
// engine.setLocalDb(ldb);
geInit();
engine.add(this);
}
public Object dynamicGetRoot() {
return this;
}
GeDyn dd;
public void dynamicOpen() {
GdhrRefObjectInfo ret;
ret = engine.ldb.refObjectInfo( this, "$local.TrendHold##Boolean");
if ( ret.oddSts())
pHold = ret.id;
else
System.out.println("$local.Hold not found");
ret = engine.ldb.refObjectInfo( this, "$local.ScanTime##Float32");
if ( ret.oddSts())
pScanTime = ret.id;
else
System.out.println("$local.ScanTime not found");
dd = new GeDyn( null);
dd.setSession( session);
dd.setInstance( engine.getInstance());
}
public void dynamicClose() {
engine.ldb.unrefObjectInfo( pHold);
engine.ldb.unrefObjectInfo( pScanTime);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
boolean holdValue = engine.ldb.getObjectRefInfoBoolean( pHold);
float scanTime = engine.ldb.getObjectRefInfoFloat( pScanTime);
if ( holdValue) {
engine.ldb.setObjectInfo( this, "$local.TrendHold##Boolean", false);
hold = !hold;
jopTrend2.setHold(hold);
if ( hold)
jopButtontoggle6.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle6.resetFillColor();
jopButtontoggle6.repaintForeground();
}
if ( scanTime != scanTimeOld) {
// TODO
engine.ldb.setObjectInfo( this, "$local.ScanTime##Float32", 100.0F);
scanTimeOld = scanTime;
}
}
}
This diff is collapsed.
package jpwr.jopc;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcDo extends JopcDoGen implements JopDynamic {
boolean hold = false;
int pHold;
float scanTimeOld = -1F;
int pScanTime;
LocalDb ldb;
public JopcDo( JopSession session, String instance, boolean scrollbar) {
super( session, instance, scrollbar, true);
// engine = new JopEngine( 1000, session.getRoot());
// ldb = new LocalDb();
// engine.setLocalDb(ldb);
geInit();
engine.add(this);
}
public Object dynamicGetRoot() {
return this;
}
GeDyn dd;
public void dynamicOpen() {
GdhrRefObjectInfo ret;
ret = engine.ldb.refObjectInfo( this, "$local.TrendHold##Boolean");
if ( ret.oddSts())
pHold = ret.id;
else
System.out.println("$local.Hold not found");
ret = engine.ldb.refObjectInfo( this, "$local.ScanTime##Float32");
if ( ret.oddSts())
pScanTime = ret.id;
else
System.out.println("$local.ScanTime not found");
dd = new GeDyn( null);
dd.setSession( session);
dd.setInstance( engine.getInstance());
}
public void dynamicClose() {
engine.ldb.unrefObjectInfo( pHold);
engine.ldb.unrefObjectInfo( pScanTime);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
boolean holdValue = engine.ldb.getObjectRefInfoBoolean( pHold);
float scanTime = engine.ldb.getObjectRefInfoFloat( pScanTime);
if ( holdValue) {
engine.ldb.setObjectInfo( this, "$local.TrendHold##Boolean", false);
hold = !hold;
jopTrend2.setHold(hold);
if ( hold)
jopButtontoggle6.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle6.resetFillColor();
jopButtontoggle6.repaintForeground();
}
if ( scanTime != scanTimeOld) {
// TODO
engine.ldb.setObjectInfo( this, "$local.ScanTime##Float32", 100.0F);
scanTimeOld = scanTime;
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package jpwr.jopc;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcDv extends JopcDvGen implements JopDynamic {
boolean hold = false;
int pHold;
float scanTimeOld = -1F;
int pScanTime;
LocalDb ldb;
public JopcDv( JopSession session, String instance, boolean scrollbar) {
super( session, instance, scrollbar, true);
// engine = new JopEngine( 1000, session.getRoot());
// ldb = new LocalDb();
// engine.setLocalDb(ldb);
geInit();
engine.add(this);
}
public Object dynamicGetRoot() {
return this;
}
GeDyn dd;
public void dynamicOpen() {
GdhrRefObjectInfo ret;
ret = engine.ldb.refObjectInfo( this, "$local.TrendHold##Boolean");
if ( ret.oddSts())
pHold = ret.id;
else
System.out.println("$local.Hold not found");
ret = engine.ldb.refObjectInfo( this, "$local.ScanTime##Float32");
if ( ret.oddSts())
pScanTime = ret.id;
else
System.out.println("$local.ScanTime not found");
dd = new GeDyn( null);
dd.setSession( session);
dd.setInstance( engine.getInstance());
}
public void dynamicClose() {
engine.ldb.unrefObjectInfo( pHold);
engine.ldb.unrefObjectInfo( pScanTime);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
boolean holdValue = engine.ldb.getObjectRefInfoBoolean( pHold);
float scanTime = engine.ldb.getObjectRefInfoFloat( pScanTime);
if ( holdValue) {
engine.ldb.setObjectInfo( this, "$local.TrendHold##Boolean", false);
hold = !hold;
jopTrend2.setHold(hold);
if ( hold)
jopButtontoggle6.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle6.resetFillColor();
jopButtontoggle6.repaintForeground();
}
if ( scanTime != scanTimeOld) {
// TODO
engine.ldb.setObjectInfo( this, "$local.ScanTime##Float32", 100.0F);
scanTimeOld = scanTime;
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package jpwr.jopc;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcPlcthread extends JopcPlcthreadGen implements JopDynamic {
boolean hold = false;
int pHold;
float scanTimeOld = -1F;
int pScanTime;
float maxShowOld = 0;
float minShowOld = 0;
int pMaxShow;
int pMinShow;
PwrtRefId maxShowSubid;
PwrtRefId minShowSubid;
LocalDb ldb;
public JopcPlcthread( JopSession session, String instance, boolean scrollbar) {
super( session, instance, scrollbar, true);
// engine = new JopEngine( 1000, session.getRoot());
// ldb = new LocalDb();
// engine.setLocalDb(ldb);
geInit();
engine.add(this);
}
public Object dynamicGetRoot() {
return this;
}
GeDyn dd;
public void dynamicOpen() {
GdhrRefObjectInfo ret;
ret = engine.ldb.refObjectInfo( this, "$local.TrendHold##Boolean");
if ( ret.oddSts())
pHold = ret.id;
else
System.out.println("$local.Hold not found");
ret = engine.ldb.refObjectInfo( this, "$local.ScanTime##Float32");
if ( ret.oddSts())
pScanTime = ret.id;
else
System.out.println("$local.ScanTime not found");
ret = engine.ldb.refObjectInfo( this, "$local.MinShow##Float32");
if ( ret.oddSts())
pMinShow = ret.id;
else
System.out.println("$local.MinShow not found");
ret = engine.ldb.refObjectInfo( this, "$local.MaxShow##Float32");
if ( ret.oddSts())
pMaxShow = ret.id;
else
System.out.println("$local.MaxShow not found");
dd = new GeDyn( null);
dd.setSession( session);
dd.setInstance( engine.getInstance());
String attrName = dd.getAttrName( "$object.ScanTime##Float32");
CdhrFloat retf = engine.gdh.getObjectInfoFloat( attrName);
if ( retf.evenSts())
System.out.println( "JopcMode: ScanTime");
else
maxShowOld = retf.value * 2;
engine.ldb.setObjectInfo( this, "$local.MaxShow##Float32", maxShowOld);
jopTrend3.setMaxValue1(maxShowOld);
jopBar2.setMaxValue(maxShowOld);
}
public void dynamicClose() {
engine.ldb.unrefObjectInfo( pMaxShow);
engine.ldb.unrefObjectInfo( pMinShow);
engine.ldb.unrefObjectInfo( pHold);
engine.ldb.unrefObjectInfo( pScanTime);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
boolean holdValue = engine.ldb.getObjectRefInfoBoolean( pHold);
float scanTime = engine.ldb.getObjectRefInfoFloat( pScanTime);
float minShow = engine.ldb.getObjectRefInfoFloat( pMinShow);
float maxShow = engine.ldb.getObjectRefInfoFloat( pMaxShow);
if ( holdValue) {
engine.ldb.setObjectInfo( this, "$local.TrendHold##Boolean", false);
hold = !hold;
jopTrend3.setHold(hold);
if ( hold)
jopButtontoggle8.tsetFillColor( GeColor.COLOR_115);
else
jopButtontoggle8.resetFillColor();
jopButtontoggle8.repaintForeground();
}
if ( maxShow != maxShowOld || minShow != minShowOld) {
jopTrend3.setMinValue1(minShow);
jopTrend3.setMaxValue1(maxShow);
jopTrend3.reset();
jopBar2.setMinValue(minShow);
jopBar2.setMaxValue(maxShow);
jopBar2.update();
maxShowOld = maxShow;
minShowOld = minShow;
}
if ( scanTime != scanTimeOld) {
// TODO
engine.ldb.setObjectInfo( this, "$local.ScanTime##Float32", 100.0F);
scanTimeOld = scanTime;
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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