Commit 782e95a1 authored by Claes Sjofors's avatar Claes Sjofors

PwrXtt android application build tree added

parent 9cf54e99
This diff is collapsed.
package jpwr.app;
import android.view.View;
import jpwr.rt.*;
import jpwr.app.*;
public interface AEvAppl {
public void invalidateView();
public String getPwrHost();
public PlowCmnIfc getCurrentCmn();
}
package jpwr.app;
import java.util.StringTokenizer;
import java.util.Vector;
import jpwr.rt.*;
import jpwr.app.*;
public class AEvItemAlarm extends AXttItemBase {
static double y = 10D;
public MhrEvent e;
public AEvItemAlarm(AEv aev, MhrEvent e,
PlowNode destination, int destCode) {
this.e = e.getCopy();
System.out.println("New itemalarm Status: " + e.eventStatus + " " + e.eventPrio + " " + e.eventText + " " + e.eventName);
switch ( this.e.eventPrio) {
case Mh.mh_eEventPrio_A:
node = new PlowNode(aev.cmnAla, 3D, y, aev.alaNcAAlarm);
break;
case Mh.mh_eEventPrio_B:
node = new PlowNode(aev.cmnAla, 3D, y, aev.alaNcBAlarm);
break;
case Mh.mh_eEventPrio_C:
node = new PlowNode(aev.cmnAla, 3D, y, aev.alaNcCAlarm);
break;
case Mh.mh_eEventPrio_D:
node = new PlowNode(aev.cmnAla, 3D, y, aev.alaNcDAlarm);
break;
}
node.setAnnotation(0, this.e.eventTime, 1);
node.setAnnotation(1, this.e.eventText, 1);
node.setAnnotation(2, this.e.eventName, 1);
if ( (e.eventStatus & Mh.mh_mEventStatus_NotAck) != 0)
node.setAnnotPixmap(0, aev.iconAlarmNotAcked);
else
node.setAnnotPixmap(0, null);
if ( (e.eventStatus & Mh.mh_mEventStatus_NotRet) != 0)
node.setAnnotPixmap(1, aev.iconAlarmActive);
else
node.setAnnotPixmap(1, null);
aev.cmnAla.insertNode(node, destination, destCode);
y += 1.5D;
node.setUserData(this);
}
public void update(AEv aev) {
if ( (e.eventStatus & Mh.mh_mEventStatus_NotAck) != 0)
node.setAnnotPixmap(0, aev.iconAlarmNotAcked);
else
node.setAnnotPixmap(0, null);
if ( (e.eventStatus & Mh.mh_mEventStatus_NotRet) != 0)
node.setAnnotPixmap(1, aev.iconAlarmActive);
else
node.setAnnotPixmap(1, null);
}
}
package jpwr.app;
import java.util.StringTokenizer;
import java.util.Vector;
import jpwr.rt.*;
import jpwr.app.*;
public class AEvItemEvent extends AXttItemBase {
static double y = 10D;
MhrEvent e;
public PlowNodeClass nc;
public AEvItemEvent(AEv aev, MhrEvent e,
PlowNode destination, int destCode) {
this.e = e.getCopy();
System.out.println("New itemevent: " + e.eventPrio + " " + e.eventText + " " + e.eventName);
switch(this.e.eventType) {
case Mh.mh_eEvent_Info:
nc = aev.eveNcInfo;
break;
case Mh.mh_eEvent_Alarm:
switch ( this.e.eventPrio) {
case Mh.mh_eEventPrio_A:
nc = aev.eveNcAAlarm;
break;
case Mh.mh_eEventPrio_B:
nc = aev.eveNcBAlarm;
break;
case Mh.mh_eEventPrio_C:
nc = aev.eveNcCAlarm;
break;
case Mh.mh_eEventPrio_D:
nc = aev.eveNcDAlarm;
break;
default:
nc = aev.eveNcAlarm;
break;
}
break;
default:
nc = aev.eveNcAlarm;
}
node = new PlowNode(aev.cmnAla, 3D, y, nc);
switch(this.e.eventType) {
case Mh.mh_eEvent_Alarm:
node.setAnnotPixmap(0, aev.iconEventAlarm);
break;
case Mh.mh_eEvent_Ack:
node.setAnnotPixmap(0, aev.iconEventAcked);
break;
case Mh.mh_eEvent_Return:
node.setAnnotPixmap(0, aev.iconEventReturn);
break;
case Mh.mh_eEvent_Block:
node.setAnnotPixmap(0, aev.iconEventBlock);
break;
case Mh.mh_eEvent_Unblock:
node.setAnnotPixmap(0, aev.iconEventUnblock);
break;
}
node.setAnnotation(0, this.e.eventTime, 1);
node.setAnnotation(1, this.e.eventText, 1);
node.setAnnotation(2, this.e.eventName, 1);
aev.cmnEve.insertNode(node, destination, destCode);
y += 1.5D;
node.setUserData(this);
}
}
package jpwr.app;
import android.graphics.Color;
import jpwr.pwrxtt.R;
import jpwr.rt.*;
public class AXtt {
public static final int CRR_READ = 0;
public static final int CRR_WRITE = 1;
public static final int CRR_READWRITE = 2;
public Gdh gdh;
public PlowCmn cmn;
public PlowNodeClass ncObject;
public PlowPixmapData iconMap;
public PlowPixmapData iconOpenmap;
public PlowPixmapData iconLeaf;
public PlowPixmapData iconAttr;
public PlowPixmapData iconAttrArray;
public PlowPixmapData iconAttrArrayElem;
public PlowPixmapData iconAttrEnum;
public PlowPixmapData iconObject;
public PlowPixmapData iconCrrRead;
public PlowPixmapData iconCrrWrite;
public AXtt(PlowCmn cmn, Gdh gdh) {
this.gdh = gdh;
this.cmn = cmn;
createPixmaps();
createNodeClasses();
}
public void createPixmaps() {
// iconOpenmap = new PlowPixmapData(cmn, R.drawable.xtthelp_icon_openmap);
iconLeaf = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_leaf8, R.drawable.xnav_bitmap_leaf10,
R.drawable.xnav_bitmap_leaf12, R.drawable.xnav_bitmap_leaf14, R.drawable.xnav_bitmap_leaf16,
R.drawable.xnav_bitmap_leaf18, R.drawable.xnav_bitmap_leaf20, R.drawable.xnav_bitmap_leaf24});
iconOpenmap = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_openmap8, R.drawable.xnav_bitmap_openmap10,
R.drawable.xnav_bitmap_openmap12, R.drawable.xnav_bitmap_openmap14, R.drawable.xnav_bitmap_openmap16,
R.drawable.xnav_bitmap_openmap18, R.drawable.xnav_bitmap_openmap20, R.drawable.xnav_bitmap_openmap24});
iconMap = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_map8, R.drawable.xnav_bitmap_map10,
R.drawable.xnav_bitmap_map12, R.drawable.xnav_bitmap_map14, R.drawable.xnav_bitmap_map16,
R.drawable.xnav_bitmap_map18, R.drawable.xnav_bitmap_map20, R.drawable.xnav_bitmap_map24});
iconAttr = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_attr8, R.drawable.xnav_bitmap_attr10,
R.drawable.xnav_bitmap_attr12, R.drawable.xnav_bitmap_attr14, R.drawable.xnav_bitmap_attr16,
R.drawable.xnav_bitmap_attr18, R.drawable.xnav_bitmap_attr20, R.drawable.xnav_bitmap_attr24});
iconAttrArray = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_attrarra8, R.drawable.xnav_bitmap_attrarra10,
R.drawable.xnav_bitmap_attrarra12, R.drawable.xnav_bitmap_attrarra14, R.drawable.xnav_bitmap_attrarra16,
R.drawable.xnav_bitmap_attrarra18, R.drawable.xnav_bitmap_attrarra20, R.drawable.xnav_bitmap_attrarra24});
iconObject = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_object8, R.drawable.xnav_bitmap_object10,
R.drawable.xnav_bitmap_object12, R.drawable.xnav_bitmap_object14, R.drawable.xnav_bitmap_object16,
R.drawable.xnav_bitmap_object18, R.drawable.xnav_bitmap_object20, R.drawable.xnav_bitmap_object24});
iconAttrArrayElem = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_attrarel8, R.drawable.xnav_bitmap_attrarel10,
R.drawable.xnav_bitmap_attrarel12, R.drawable.xnav_bitmap_attrarel14, R.drawable.xnav_bitmap_attrarel16,
R.drawable.xnav_bitmap_attrarel18, R.drawable.xnav_bitmap_attrarel20, R.drawable.xnav_bitmap_attrarel24});
iconAttrEnum = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_attrenum8, R.drawable.xnav_bitmap_attrenum10,
R.drawable.xnav_bitmap_attrenum12, R.drawable.xnav_bitmap_attrenum14, R.drawable.xnav_bitmap_attrenum16,
R.drawable.xnav_bitmap_attrenum18, R.drawable.xnav_bitmap_attrenum20, R.drawable.xnav_bitmap_attrenum24});
iconCrrRead = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_crrread8, R.drawable.xnav_bitmap_crrread10,
R.drawable.xnav_bitmap_crrread12, R.drawable.xnav_bitmap_crrread14, R.drawable.xnav_bitmap_crrread16,
R.drawable.xnav_bitmap_crrread18, R.drawable.xnav_bitmap_crrread20, R.drawable.xnav_bitmap_crrread24});
iconCrrWrite = new PlowPixmapData(cmn, new int[] {R.drawable.xnav_bitmap_crrwrite8, R.drawable.xnav_bitmap_crrwrite10,
R.drawable.xnav_bitmap_crrwrite12, R.drawable.xnav_bitmap_crrwrite14, R.drawable.xnav_bitmap_crrwrite16,
R.drawable.xnav_bitmap_crrwrite18, R.drawable.xnav_bitmap_crrwrite20, R.drawable.xnav_bitmap_crrwrite24});
}
public void createNodeClasses() {
PlowRect r1 = new PlowRect(cmn, 0D, 0D, 50D, 1.5D, Plow.COLOR_WHITE, Plow.COLOR_BLACK,true,false,false);
PlowAnnot a1 = new PlowAnnot(cmn, 3D, 1.1D, 12, Plow.COLOR_BLACK, 0, PlowAnnot.NEXT_RELATIVE_POSITION, 0);
PlowAnnot a11 = new PlowAnnot(cmn, 9D, 1.1D, 12, Plow.COLOR_BLACK, 0, PlowAnnot.RELATIVE_POSITION, 1);
PlowAnnotPixmap p1 = new PlowAnnotPixmap(cmn, 1D, 0.28D, 0);
ncObject = new PlowNodeClass(cmn);
ncObject.insert(r1);
ncObject.insert(a1);
ncObject.insert(a11);
ncObject.insert(p1);
cmn.insert_nc(ncObject);
}
}
package jpwr.app;
import jpwr.rt.*;
import jpwr.app.*;
public interface AXttAppl {
public Gdh getGdh();
public PlowCmn getPlowCmn();
}
package jpwr.app;
import jpwr.rt.*;
public class AXttItemAttr extends AXttItemBase {
PwrtObjid objid;
String fullName;
String name;
int flags;
int type;
int refId;
PwrtRefId refRefId;
int refTypeId;
boolean firstScan = true;
float oldValueF;
int oldValueI;
boolean oldValueB;
String oldValueS;
AXttItemAttr(AXtt axtt, PwrtObjid objid, String name, String fullName, int flags, int type,
PlowNode destination, int destCode) {
this.objid = objid;
this.name = name;
this.fullName = fullName;
this.flags = flags;
this.type = type;
this.node = node;
node = new PlowNode(axtt.cmn, 0, 0, axtt.ncObject);
node.setAnnotPixmap(0, axtt.iconAttr);
node.setAnnotation(0, name, 22);
axtt.cmn.insertNode(node, destination, destCode);
node.setUserData(this);
String refName;
switch ( type) {
case Pwr.eType_Boolean:
refName = fullName + "##Boolean";
break;
case Pwr.eType_Float32:
refName = fullName + "##Float32";
break;
case Pwr.eType_Int32:
refName = fullName + "##Int32";
break;
case Pwr.eType_UInt32:
refName = fullName + "##UInt32";
break;
case Pwr.eType_String:
refName = fullName + "##String80";
break;
default:
refName = fullName;
}
GdhrRefObjectInfo ret = axtt.gdh.refObjectInfo(refName);
if ( ret.oddSts()) {
refId = ret.id;
refRefId = ret.refid;
refTypeId = ret.typeId;
}
else
refId = 0;
}
public void close(AXtt axtt) {
if ( refRefId != null)
axtt.gdh.unrefObjectInfo(refRefId);
}
public String getFullName() {
return fullName;
}
public int getType() {
return type;
}
@Override
public void scan(AXtt axtt) {
String valueStr = null;
switch ( type) {
case Pwr.eType_Float32: {
float value = axtt.gdh.getObjectRefInfoFloat(refId);
if ( firstScan || value != oldValueF) {
valueStr = "" + value;
oldValueF = value;
}
break;
}
case Pwr.eType_Boolean: {
boolean value = axtt.gdh.getObjectRefInfoBoolean(refId);
if ( firstScan || value != oldValueB) {
valueStr = "" + (int)(value?1:0);
oldValueB = value;
}
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: {
int value = axtt.gdh.getObjectRefInfoInt(refId);
if ( firstScan || value != oldValueI) {
valueStr = "" + value;
oldValueI = value;
}
break;
}
case Pwr.eType_String:
case Pwr.eType_AttrRef:
case Pwr.eType_Objid: {
String value = axtt.gdh.getObjectRefInfoString(refId, refTypeId);
if ( firstScan || value.equals(oldValueS)) {
valueStr = "" + value;
oldValueS = value;
valueStr = value;
}
break;
}
}
if ( valueStr != null)
node.setAnnotation(1, valueStr, 10);
}
}
package jpwr.app;
import java.util.Vector;
import jpwr.rt.CdhrObjAttr;
import jpwr.rt.GdhrRefObjectInfo;
import jpwr.rt.Pwr;
import jpwr.rt.PwrtObjid;
import jpwr.rt.PwrtRefId;
public class AXttItemAttrArray extends AXttItemBase {
PwrtObjid objid;
String fullName;
String name;
int flags;
int type;
int elements;
AXttItemAttrArray(AXtt axtt, PwrtObjid objid, String name, String fullName, int flags, int type,
int elements, PlowNode destination, int destCode) {
this.objid = objid;
this.name = name;
this.fullName = fullName;
this.flags = flags;
this.type = type;
this.elements = elements;
node = new PlowNode(axtt.cmn, 0, 0, axtt.ncObject);
node.setAnnotPixmap(0, axtt.iconAttrArray);
node.setAnnotation(0, name, 22);
axtt.cmn.insertNode(node, destination, destCode);
node.setUserData(this);
}
@Override
public void openAttributes(AXtt axtt) {
if ( (node.getNodeOpen() & Plow.OPEN_ATTRIBUTES) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_ATTRIBUTES);
}
else {
for ( int i = 0; i < elements; i++) {
String fName = fullName + "[" + i + "]";
String aname = name + "[" + i + "]";
if ( (flags & Pwr.mAdef_class) != 0) {
AXttItemAttr item = new AXttItemAttr(axtt, objid, aname, fName,
flags, type, node, Plow.DEST_INTOLAST);
}
else {
AXttItemAttrArrayElem item = new AXttItemAttrArrayElem(axtt, objid, aname, fName,
flags, type, node, Plow.DEST_INTOLAST);
}
}
node.setNodeOpen(Plow.OPEN_ATTRIBUTES);
}
axtt.cmn.configure();
}
@Override
public void close(AXtt axtt) {
}
}
package jpwr.app;
import jpwr.rt.GdhrRefObjectInfo;
import jpwr.rt.Pwr;
import jpwr.rt.PwrtObjid;
import jpwr.rt.PwrtRefId;
public class AXttItemAttrArrayElem extends AXttItemBase {
PwrtObjid objid;
String fullName;
String name;
int flags;
int type;
int refId;
PwrtRefId refRefId;
int refTypeId;
boolean firstScan = true;
float oldValueF;
int oldValueI;
boolean oldValueB;
String oldValueS;
AXttItemAttrArrayElem(AXtt axtt, PwrtObjid objid, String name, String fullName, int flags, int type,
PlowNode destination, int destCode) {
this.objid = objid;
this.name = name;
this.fullName = fullName;
this.flags = flags;
this.type = type;
this.node = node;
node = new PlowNode(axtt.cmn, 0, 0, axtt.ncObject);
node.setAnnotPixmap(0, axtt.iconAttrArrayElem);
node.setAnnotation(0, name, 22);
axtt.cmn.insertNode(node, destination, destCode);
node.setUserData(this);
String refName;
switch ( type) {
case Pwr.eType_Boolean:
refName = fullName + "##Boolean";
break;
case Pwr.eType_Float32:
refName = fullName + "##Float32";
break;
case Pwr.eType_Int32:
refName = fullName + "##Int32";
break;
case Pwr.eType_UInt32:
refName = fullName + "##UInt32";
break;
case Pwr.eType_String:
refName = fullName + "##String80";
break;
default:
refName = fullName;
}
GdhrRefObjectInfo ret = axtt.gdh.refObjectInfo(refName);
if ( ret.oddSts()) {
refId = ret.id;
refRefId = ret.refid;
refTypeId = ret.typeId;
}
else
refId = 0;
}
public void close(AXtt axtt) {
if ( refRefId != null)
axtt.gdh.unrefObjectInfo(refRefId);
}
@Override
public void scan(AXtt axtt) {
String valueStr = null;
switch ( type) {
case Pwr.eType_Float32: {
float value = axtt.gdh.getObjectRefInfoFloat(refId);
if ( firstScan || value != oldValueF) {
valueStr = "" + value;
oldValueF = value;
}
break;
}
case Pwr.eType_Boolean: {
boolean value = axtt.gdh.getObjectRefInfoBoolean(refId);
if ( firstScan || value != oldValueB) {
valueStr = "" + (int)(value?1:0);
oldValueB = value;
}
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: {
int value = axtt.gdh.getObjectRefInfoInt(refId);
if ( firstScan || value != oldValueI) {
valueStr = "" + value;
oldValueI = value;
}
break;
}
case Pwr.eType_String:
case Pwr.eType_AttrRef:
case Pwr.eType_Objid: {
String value = axtt.gdh.getObjectRefInfoString(refId, refTypeId);
if ( firstScan || value.equals(oldValueS)) {
valueStr = "" + value;
oldValueS = value;
valueStr = value;
}
break;
}
}
System.out.println( "Scan value: " + valueStr);
if ( valueStr != null)
node.setAnnotation(1, valueStr, 10);
}
}
package jpwr.app;
import java.util.Vector;
import jpwr.rt.*;
import jpwr.app.*;
public class AXttItemAttrObject extends AXttItemBase {
PwrtObjid objid;
String fullName;
String name;
int flags;
int type;
AXttItemAttrObject(AXtt axtt, PwrtObjid objid, String name, String fullName, int flags, int type,
PlowNode destination, int destCode) {
this.objid = objid;
this.name = name;
this.fullName = fullName;
this.flags = flags;
this.type = type;
node = new PlowNode(axtt.cmn, 0, 0, axtt.ncObject);
node.setAnnotPixmap(0, axtt.iconObject);
node.setAnnotation(0, name, 22);
axtt.cmn.insertNode(node, destination, destCode);
node.setUserData(this);
}
@Override
public void openChildren(AXtt axtt) {
if ( (node.getNodeOpen() & Plow.OPEN_CHILDREN) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_CHILDREN);
node.setAnnotPixmap(0, axtt.iconMap);
}
else {
Vector<GdhrGetXttObj> v = (Vector)axtt.gdh.getAllXttChildren(objid);
for ( int i = 0; i < v.size(); i++) {
GdhrGetXttObj gdhr = v.get(i);
AXttItemObject item = new AXttItemObject(axtt, gdhr.cdhrObjId.objid,
gdhr.fullName, gdhr.hasChildren, node, Plow.DEST_INTOLAST);
}
node.setNodeOpen(Plow.OPEN_CHILDREN);
node.setAnnotPixmap(0, axtt.iconOpenmap);
}
axtt.cmn.configure();
}
@Override
public void openAttributes(AXtt axtt) {
if ( (node.getNodeOpen() & Plow.OPEN_ATTRIBUTES) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_ATTRIBUTES);
}
else if ( (node.getNodeOpen() & Plow.OPEN_CHILDREN) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_CHILDREN);
node.setAnnotPixmap(0, axtt.iconMap);
}
else {
Vector<CdhrObjAttr> v = (Vector)axtt.gdh.getAllClassAttributes(type, objid);
for ( int i = 0; i < v.size(); i++) {
CdhrObjAttr gdhr = v.get(i);
String fName = fullName + "." + gdhr.name;
if ( (gdhr.flags & Pwr.mAdef_pointer) != 0 &&
(gdhr.flags & Pwr.mAdef_private) != 0)
continue;
if ( (gdhr.flags & Pwr.mAdef_array) != 0) {
AXttItemAttrArray item = new AXttItemAttrArray(axtt, gdhr.objid, gdhr.name, fName,
gdhr.flags, gdhr.type, gdhr.elements, node, Plow.DEST_INTOLAST);
}
else if ( (gdhr.flags & Pwr.mAdef_class) != 0) {
AXttItemAttrObject item = new AXttItemAttrObject(axtt, gdhr.objid, gdhr.name, fName,
gdhr.flags, gdhr.type, node, Plow.DEST_INTOLAST);
}
else {
AXttItemAttr item = new AXttItemAttr(axtt, gdhr.objid, gdhr.name, fName,
gdhr.flags, gdhr.type, node, Plow.DEST_INTOLAST);
}
}
node.setNodeOpen(Plow.OPEN_ATTRIBUTES);
}
axtt.cmn.configure();
}
}
package jpwr.app;
import jpwr.rt.*;
public class AXttItemBase {
PlowNode node;
public AXttItemBase() {}
public boolean hasChildren() { return false;}
public void openChildren(AXtt axtt) {}
public void openAttributes(AXtt axtt) {}
public void openCrossreferences(AXtt axtt) {}
public void scan(AXtt axtt) {}
public void close(AXtt axtt) {}
}
package jpwr.app;
import jpwr.rt.PwrtObjid;
public class AXttItemCrr extends AXttItemBase {
String text;
int type;
AXttItemCrr(AXtt axtt, String text, int type, PlowNode destination, int destCode) {
this.text = text;
this.type = type;
node = new PlowNode(axtt.cmn, 0, 0, axtt.ncObject);
switch ( type) {
case AXtt.CRR_READ:
node.setAnnotPixmap(0, axtt.iconCrrRead);
break;
case AXtt.CRR_WRITE:
node.setAnnotPixmap(0, axtt.iconCrrWrite);
break;
case AXtt.CRR_READWRITE:
node.setAnnotPixmap(0, axtt.iconCrrRead);
node.setAnnotPixmap(1, axtt.iconCrrWrite);
break;
}
node.setAnnotation(0, text, 22);
axtt.cmn.insertNode(node, destination, destCode);
node.setUserData(this);
}
public String getText() {
return text;
}
}
package jpwr.app;
import java.util.StringTokenizer;
import java.util.Vector;
import jpwr.rt.*;
import jpwr.app.*;
public class AXttItemObject extends AXttItemBase {
static double y = 10D;
PwrtObjid objid;
PwrtObjid windowObjid;
int classid;
boolean hasChildren;
String fullName;
public AXttItemObject(AXtt axtt, PwrtObjid objid, String fullName, boolean hasChildren,
PlowNode destination, int destCode) {
this.objid = objid;
this.fullName = fullName;
this.hasChildren = hasChildren;
this.windowObjid = null;
CdhrClassId cret = axtt.gdh.getObjectClass(objid);
if (cret.evenSts()) return;
classid = cret.classId;
CdhrObjid coidret = axtt.gdh.classIdToObjid(cret.classId);
if ( coidret.evenSts()) return;
CdhrString cnameret = axtt.gdh.objidToName(coidret.objid, Cdh.mName_object);
if (cnameret.evenSts()) return;
CdhrString ret = axtt.gdh.objidToName(objid, Cdh.mName_object);
if (ret.evenSts()) return;
System.out.println("Item: " + ret.str + " " + cnameret.str);
if ( fullName == null)
fullName = cnameret.str;
if ( classid == Pwrb.cClass_plc) {
coidret = axtt.gdh.getChild(objid);
if ( coidret.oddSts())
windowObjid = coidret.objid;
}
node = new PlowNode(axtt.cmn, 3D, y, axtt.ncObject);
if ( hasChildren)
node.setAnnotPixmap(0, axtt.iconMap);
else
node.setAnnotPixmap(0, axtt.iconLeaf);
node.setAnnotation(0, ret.str, 22);
node.setAnnotation(1, cnameret.str, 11);
axtt.cmn.insertNode(node, destination, destCode);
y += 1.5D;
node.setUserData(this);
}
public int getClassid() {
return classid;
}
public PwrtObjid getObjid() {
return objid;
}
public PwrtObjid getWindowObjid() {
return windowObjid;
}
@Override
public boolean hasChildren() {
return hasChildren;
}
static public void openRoot(AXtt axtt) {
CdhrObjid reto = axtt.gdh.getRootList();
if (reto.oddSts()) {
reto.objid.oix = 0;
Vector<GdhrGetXttObj> v = (Vector)axtt.gdh.getAllXttChildren(reto.objid);
for ( int i = 0; i < v.size(); i++) {
GdhrGetXttObj gdhr = v.get(i);
AXttItemObject item = new AXttItemObject(axtt, gdhr.cdhrObjId.objid,
gdhr.fullName, gdhr.hasChildren, null, Plow.DEST_INTOLAST);
}
}
}
@Override
public void openChildren(AXtt axtt) {
if ( (node.getNodeOpen() & Plow.OPEN_CHILDREN) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_CHILDREN);
node.setAnnotPixmap(0, axtt.iconMap);
}
else if ( (node.getNodeOpen() & Plow.OPEN_ATTRIBUTES) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_ATTRIBUTES);
}
else if ( (node.getNodeOpen() & Plow.OPEN_CROSSREFERENCES) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_CROSSREFERENCES);
}
else {
Vector<GdhrGetXttObj> v = (Vector)axtt.gdh.getAllXttChildren(objid);
for ( int i = 0; i < v.size(); i++) {
GdhrGetXttObj gdhr = v.get(i);
AXttItemObject item = new AXttItemObject(axtt, gdhr.cdhrObjId.objid,
gdhr.fullName, gdhr.hasChildren, node, Plow.DEST_INTOLAST);
}
node.setNodeOpen(Plow.OPEN_CHILDREN);
node.setAnnotPixmap(0, axtt.iconOpenmap);
}
axtt.cmn.configure();
}
@Override
public void openAttributes(AXtt axtt) {
if ( (node.getNodeOpen() & Plow.OPEN_ATTRIBUTES) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_ATTRIBUTES);
}
else if ( (node.getNodeOpen() & Plow.OPEN_CHILDREN) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_CHILDREN);
node.setAnnotPixmap(0, axtt.iconMap);
}
else if ( (node.getNodeOpen() & Plow.OPEN_CROSSREFERENCES) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_CROSSREFERENCES);
}
else {
Vector<CdhrObjAttr> v = (Vector)axtt.gdh.getAllClassAttributes(classid, objid);
for ( int i = 0; i < v.size(); i++) {
CdhrObjAttr gdhr = v.get(i);
String fName = fullName + "." + gdhr.name;
if ( (gdhr.flags & Pwr.mAdef_pointer) != 0 &&
(gdhr.flags & Pwr.mAdef_private) != 0)
continue;
if ( (gdhr.flags & Pwr.mAdef_array) != 0) {
AXttItemAttrArray item = new AXttItemAttrArray(axtt, gdhr.objid, gdhr.name, fName,
gdhr.flags, gdhr.type, gdhr.elements, node, Plow.DEST_INTOLAST);
}
else if ( (gdhr.flags & Pwr.mAdef_class) != 0) {
AXttItemAttrObject item = new AXttItemAttrObject(axtt, gdhr.objid, gdhr.name, fName,
gdhr.flags, gdhr.type, node, Plow.DEST_INTOLAST);
}
else {
AXttItemAttr item = new AXttItemAttr(axtt, gdhr.objid, gdhr.name, fName,
gdhr.flags, gdhr.type, node, Plow.DEST_INTOLAST);
}
}
node.setNodeOpen(Plow.OPEN_ATTRIBUTES);
}
axtt.cmn.configure();
}
public void openCrossreferences(AXtt axtt) {
if ( (node.getNodeOpen() & Plow.OPEN_CROSSREFERENCES) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_CROSSREFERENCES);
}
else {
if ( (node.getNodeOpen() & Plow.OPEN_ATTRIBUTES) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_ATTRIBUTES);
}
else if ( (node.getNodeOpen() & Plow.OPEN_CHILDREN) != 0) {
axtt.cmn.closeNode(node);
node.resetNodeOpen(Plow.OPEN_CHILDREN);
node.setAnnotPixmap(0, axtt.iconMap);
}
CdhrClassId cret = axtt.gdh.getObjectClass( objid);
if ( cret.evenSts()) return;
CdhrString sret;
switch ( cret.classId) {
case Pwrb.cClass_Ai:
case Pwrb.cClass_Ao:
case Pwrb.cClass_Ii:
case Pwrb.cClass_Io:
case Pwrb.cClass_Di:
case Pwrb.cClass_Do:
case Pwrb.cClass_Po:
case Pwrb.cClass_Dv:
case Pwrb.cClass_Av:
case Pwrb.cClass_Iv:
case Pwrb.cClass_Sv:
sret = axtt.gdh.crrSignal( fullName);
break;
default:
sret = axtt.gdh.crrObject( fullName);
}
if ( sret.evenSts()) return;
String delim = new String( new char[] { '\n'});
StringTokenizer tokens = new StringTokenizer( sret.str, delim);
int tokensCnt = tokens.countTokens();
String text;
int type;
for ( int i = 0; i < tokensCnt; i++) {
String token = tokens.nextToken();
text = token.substring(1);
if ( token.startsWith("0"))
type = AXtt.CRR_READ;
else if ( token.startsWith("1"))
type = AXtt.CRR_WRITE;
else
type = AXtt.CRR_READWRITE;
AXttItemCrr item = new AXttItemCrr(axtt, text, type, node, Plow.DEST_INTOLAST);
}
node.setNodeOpen(Plow.OPEN_CROSSREFERENCES);
}
}
}
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowAnnot implements FlowArrayElem {
FlowPoint p;
int draw_type;
int text_size;
int display_level;
int annot_type;
int number;
FlowCmn cmn;
public FlowAnnot( FlowCmn cmn) {
this.cmn = cmn;
p = new FlowPoint(cmn);
}
@Override
public int type() {
return Flow.eObjectType_Annot;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Annot:
break;
case Flow.eSave_Annot_number:
number = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Annot_draw_type:
draw_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Annot_text_size:
text_size = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Annot_display_level:
display_level = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Annot_p:
p.open( reader);
break;
case Flow.eSave_Annot_annot_type:
annot_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowAnnot");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowAnnot");
}
}
public void draw( FlowPoint p0, String[] annotv, boolean highlight) {
if ( annotv == null || annotv[number] == null)
return;
if ( (display_level & FlowCmn.display_level) == 0)
return;
int tsize;
int idx = (int) (cmn.zoom_factor/cmn.base_zoom_factor * text_size * 5.8 + 1.0);
if ( cmn.zoom_factor/cmn.base_zoom_factor * text_size * 6.5 < 2) return;
int color = Flow.eDrawType_Line;
if ( highlight)
color = Flow.eDrawType_LineRed;
cmn.gdraw.drawText( annotv[number], color, idx, 0, (float)((p.x + p0.x) * cmn.zoom_factor - cmn.offset_x),
(float)((p.y + p0.y) * cmn.zoom_factor - cmn.offset_y));
// if ( idx > 8)
// idx = 8;
/*
switch( idx) {
case 0: tsize = 8; break;
case 1: tsize = 10; break;
case 2: tsize = 12; break;
case 3: tsize = 14; break;
case 4: tsize = 14; break;
case 5: tsize = 18; break;
case 6: tsize = 18; break;
case 7: tsize = 18; break;
default: tsize = idx * 3;
}
tsize -= tsize/5;
Font f;
switch ( draw_type) {
case Flow.eDrawType_TextHelveticaBold:
f = new Font("Helvetica", Font.BOLD, tsize);
break;
default:
f = new Font("Helvetica", Font.PLAIN, tsize);
}
char[] c = new char[] { 10 };
StringTokenizer token = new StringTokenizer( annotv[number], new String(c));
g.setColor( Color.black);
if ( highlight)
g.setColor( Color.red);
g.setFont( f);
float x = (float)((p.x + p0.x) * cmn.zoom_factor);
float y = (float)((p.y + p0.y) * cmn.zoom_factor - tsize/4);
while ( token.hasMoreTokens()) {
g.drawString( token.nextToken(), x, y);
y += f.getSize2D() * 1.4;
}
*/
}
@Override
public boolean getSelect() {
return false;
}
@Override
public void setSelect(boolean select) {
}
public boolean eventHandler(PlowEvent e) {
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowArc implements FlowArrayElem {
FlowPoint ll;
FlowPoint ur;
double angel1;
double angel2;
int draw_type;
int line_width;
FlowCmn cmn;
public FlowArc( FlowCmn cmn) {
this.cmn = cmn;
ll = new FlowPoint(cmn);
ur = new FlowPoint(cmn);
}
@Override
public int type() {
return Flow.eObjectType_Arc;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Arc:
break;
case Flow.eSave_Arc_draw_type:
draw_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Arc_line_width:
line_width = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Arc_angel1:
angel1 = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Arc_angel2:
angel2 = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Arc_ll:
ll.open( reader);
break;
case Flow.eSave_Arc_ur:
ur.open( reader);
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowArc");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowArc");
}
}
public void draw( FlowPoint p, String[] annotv, boolean highlight) {
int color;
switch ( draw_type) {
case Flow.eDrawType_LineGray:
color = Plow.COLOR_LIGHTGRAY;
break;
case Flow.eDrawType_LineRed:
case Flow.eDrawType_LineDashedRed:
color = Plow.COLOR_RED;
break;
default:
color = Plow.COLOR_BLACK;
}
if ( highlight)
color = Plow.COLOR_RED;
cmn.gdraw.arc( true, color, (float)((ll.x + p.x) * cmn.zoom_factor - cmn.offset_x),
(float)((ll.y + p.y) * cmn.zoom_factor - cmn.offset_y),
(float)((ur.x + p.x) * cmn.zoom_factor - cmn.offset_x),
(float)((ur.y + p.y) * cmn.zoom_factor - cmn.offset_y),
(float)angel1, (float)angel2);
/*
Arc2D.Double rect = new Arc2D.Double( (ll.x + p.x) * cmn.zoom_factor,
(ll.y + p.y) * cmn.zoom_factor,
(ur.x - ll.x) * cmn.zoom_factor,
(ur.y - ll.y) * cmn.zoom_factor,
angel1, angel2, Arc2D.OPEN);
g.setStroke( new BasicStroke( (float)(cmn.zoom_factor / cmn.base_zoom_factor * line_width)));
g.setColor( Color.black);
if ( highlight)
g.setColor( Color.red);
g.draw( rect);
*/
}
@Override
public boolean getSelect() {
return false;
}
@Override
public void setSelect(boolean select) {
}
public boolean eventHandler(PlowEvent e) {
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowArray {
Vector a = new Vector();
FlowCmn cmn;
public FlowArray( FlowCmn cmn) {
this.cmn = cmn;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Array:
break;
case Flow.eSave_Rect:
FlowRect rect = new FlowRect( cmn);
rect.open( reader);
a.add( rect);
break;
case Flow.eSave_Line:
FlowLine l = new FlowLine( cmn);
l.open( reader);
a.add( l);
break;
case Flow.eSave_Arc:
FlowArc arc = new FlowArc( cmn);
arc.open( reader);
a.add( arc);
break;
case Flow.eSave_Text:
FlowText text = new FlowText( cmn);
text.open( reader);
a.add( text);
break;
case Flow.eSave_ConPoint:
FlowConPoint cp = new FlowConPoint( cmn);
cp.open( reader);
a.add( cp);
break;
case Flow.eSave_Annot:
FlowAnnot annot = new FlowAnnot( cmn);
annot.open( reader);
a.add( annot);
break;
case Flow.eSave_Arrow:
FlowArrow arrow = new FlowArrow( cmn);
arrow.open( reader);
a.add( arrow);
break;
case Flow.eSave_Point:
FlowPoint point = new FlowPoint( cmn);
point.open( reader);
a.add( point);
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowArray");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowArray");
}
}
public void draw( FlowPoint p, String[] annotv, boolean highlight) {
for ( int i = 0; i < a.size(); i++) {
((FlowArrayElem)a.get(i)).draw( p, annotv, highlight);
}
}
public void draw( FlowPoint p, int size, boolean highlight) {
for ( int i = 0; i < size; i++) {
((FlowArrayElem)a.get(i)).draw( p, null, highlight);
}
}
public boolean eventHandler(PlowEvent e) {
for ( int i = 0; i < a.size(); i++) {
if ( ((FlowArrayElem)a.get(i)).eventHandler(e))
return true;
}
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
public interface FlowArrayElem {
public void draw( FlowPoint p, String[] annotv, boolean highlight);
public boolean getSelect();
public void setSelect(boolean select);
public boolean eventHandler(PlowEvent e);
public int type();
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
import android.graphics.Path;
public class FlowArrow implements FlowArrayElem {
FlowPoint p1;
FlowPoint p2;
FlowPoint p_dest;
double arrow_width;
double arrow_length;
int draw_type;
int line_width;
FlowCmn cmn;
public FlowArrow( FlowCmn cmn) {
this.cmn = cmn;
p1 = new FlowPoint(cmn);
p2 = new FlowPoint(cmn);
p_dest = new FlowPoint(cmn);
}
@Override
public int type() {
return Flow.eObjectType_Arrow;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Arrow:
break;
case Flow.eSave_Arrow_arrow_width:
arrow_width = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Arrow_arrow_length:
arrow_length = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Arrow_draw_type:
draw_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Arrow_line_width:
line_width = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Arrow_p_dest:
p_dest.open( reader);
break;
case Flow.eSave_Arrow_p1:
p1.open( reader);
break;
case Flow.eSave_Arrow_p2:
p2.open( reader);
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowArrow");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowArrow");
}
}
public void draw( FlowPoint p, String[] annotv, boolean highlight) {
int color;
Path path = new Path();
switch ( draw_type) {
case Flow.eDrawType_LineGray:
color = Plow.COLOR_LIGHTGRAY;
break;
case Flow.eDrawType_LineRed:
case Flow.eDrawType_LineDashedRed:
color = Plow.COLOR_RED;
break;
default:
color = Plow.COLOR_BLACK;
}
if ( highlight)
color = Plow.COLOR_RED;
cmn.gdraw.arrow(color, (float)((p1.x + p.x) * cmn.zoom_factor - cmn.offset_x), (float)((p1.y + p.y) * cmn.zoom_factor - cmn.offset_y),
(float)((p2.x + p.x) * cmn.zoom_factor - cmn.offset_x), (float)((p2.y + p.y) * cmn.zoom_factor - cmn.offset_y),
(float)((p_dest.x + p.x) * cmn.zoom_factor - cmn.offset_x), (float)((p_dest.y + p.y) * cmn.zoom_factor - cmn.offset_y));
}
@Override
public boolean getSelect() {
return false;
}
@Override
public void setSelect(boolean select) {
}
public boolean eventHandler(PlowEvent e) {
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import jpwr.rt.*;
import java.io.*;
import java.util.*;
import android.graphics.Canvas;
import android.view.MotionEvent;
public class FlowCmn implements PlowCmnIfc {
PwrtObjid objid;
static final int display_level = Flow.mDisplayLevel_1;
static final int scrollOffset = 200;
boolean debug;
boolean antiAliasing;
PlowAppl appl;
Gdh gdh;
double zoom_factor;
double base_zoom_factor;
int offset_x;
int offset_y;
double x_right;
double x_left;
double y_high;
double y_low;
PlowDrawIfc gdraw;
// Canvas canvas;
int canvasWidth;
int canvasHeight;
FlowNode currentNode;
FlowNode selectedNode;
boolean opened = false;
Object userData;
Vector<FlowArrayElem> a = new Vector<FlowArrayElem>();
Vector<FlowArrayElem> a_nc = new Vector<FlowArrayElem>();
Vector<FlowArrayElem> a_cc = new Vector<FlowArrayElem>();
public FlowCmn( PlowAppl appl, Gdh gdh, PwrtObjid objid) {
this.gdh = gdh;
this.objid = objid;
this.appl = appl;
this.debug = false;
this.antiAliasing = true;
currentNode = null;
selectedNode = null;
}
@Override
public int type() {
return PlowCmnIfc.TYPE_FLOW;
}
public PwrtObjid getObjid() {
return objid;
}
public void setGDraw(PlowDrawIfc gdraw) {
this.gdraw = gdraw;
canvasWidth = gdraw.getCanvasWidth();
canvasHeight = gdraw.getCanvasHeight();
}
public void draw() {
for ( int i = 0; i < a.size(); i++) {
a.get(i).draw(new FlowPoint(this), null, false);
}
}
@Override
public void zoom(double factor) {
zoom_factor *= factor;
draw();
}
@Override
public void scroll( int x, int y) {
offset_y += y;
offset_x += x;
if ( offset_x < x_left * zoom_factor - scrollOffset)
offset_x = (int)(x_left * zoom_factor) - scrollOffset;
if ( offset_x > x_right * zoom_factor - canvasWidth + scrollOffset)
offset_x = (int)(x_right * zoom_factor - canvasWidth) + scrollOffset;
if ( offset_y < y_low * zoom_factor - scrollOffset)
offset_y = (int)(y_low * zoom_factor) - scrollOffset;
if ( offset_y > y_high * zoom_factor - canvasHeight + 80 + scrollOffset)
offset_y = (int)(y_high * zoom_factor - canvasHeight + 80) + scrollOffset;
}
@Override
public void pageUp() {
offset_y -= canvasHeight * 0.8;
if ( offset_y < y_low * zoom_factor)
offset_y = (int)(y_low * zoom_factor);
}
@Override
public void pageDown() {
offset_y += canvasHeight * 0.8;
if ( offset_y > y_high * zoom_factor - canvasHeight + 80)
offset_y = (int)(y_high * zoom_factor - canvasHeight + 80);
}
@Override
public void eventHandler(int action, double fx, double fy) {
double x = (fx + offset_x) / zoom_factor;
double y = (fy + offset_y) / zoom_factor;
int type;
switch( action) {
case MotionEvent.ACTION_UP:
type = PlowEvent.TYPE_CLICK;
break;
default:
return;
}
System.out.println("Event: " + type + "(" + x + "," + y + ")");
PlowEvent e = new PlowEvent(type, x, y, null);
currentNode = null;
for ( int i = 0; i < a.size(); i++) {
if ( a.get(i).eventHandler(e))
break;
}
appl.eventHandler(e);
switch (e.type) {
case PlowEvent.TYPE_OBJECT_DELETED:
if ( currentNode == selectedNode)
selectedNode = null;
break;
}
}
@Override
public void select(Object node) {
selectedNode = (FlowNode)node;
}
@Override
public void selectClear() {
selectedNode = null;
}
@Override
public Object getSelect() {
return selectedNode;
}
public void centerObject(FlowArrayElem object) {
if ( object.type() == Flow.eObjectType_Node) {
FlowDimension d = ((FlowNode)object).measureNode();
int x = (int)((d.x1 + d.x2) / 2 * zoom_factor - canvasWidth / 2);
int y = (int)((d.y1 + d.y2) / 2 * zoom_factor - canvasHeight / 2);
scroll(x - offset_x, y - offset_y);
draw();
}
}
public void dynamicOpen() {
System.out.println("FlowCmn::dynamicOpen");
for ( int i = 0; i < a.size(); i++) {
if ( a.get(i).type() == Flow.eObjectType_Node)
((FlowNode)a.get(i)).dynamicOpen();
}
opened = true;
}
public void dynamicClose() {
for ( int i = 0; i < a.size(); i++) {
if ( a.get(i).type() == Flow.eObjectType_Node)
((FlowNode)a.get(i)).dynamicClose();
}
}
public void dynamicUpdate() {
if (!opened)
return;
System.out.println("FlowCmn::dynamicUpdate");
for ( int i = 0; i < a.size(); i++) {
if ( a.get(i).type() == Flow.eObjectType_Node)
((FlowNode)a.get(i)).dynamicUpdate(false);
}
}
public void configure() {}
public Object getUserData() {
return userData;
}
public void setUserData(Object userData) {
this.userData = userData;
}
public void setCanvas(Canvas canvas) {
gdraw.setCanvas(canvas);
}
public Object getFirst() {
return null;
}
public Object getLast() {
return null;
}
public Object getNext(Object elem) {
return null;
}
public Object getPrevious(Object elem) {
return null;
}
public int remove(Object e) {
return 0;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowCon implements FlowArrayElem {
double x_right;
double x_left;
double y_high;
double y_low;
FlowCmn cmn;
FlowConClass cc;
int p_num;
int l_num;
int a_num;
int arrow_num;
int ref_num;
double point_x[] = new double[8];
double point_y[] = new double[8];
FlowArray line_a;
FlowArray arc_a;
FlowArray arrow_a;
FlowArray ref_a;
String c_name;
String trace_object;
String trace_attribute;
int trace_attr_type;
int temporary_ref;
boolean highlight;
FlowCon( FlowCmn cmn) {
this.cmn = cmn;
line_a = new FlowArray(cmn);
arc_a = new FlowArray(cmn);
arrow_a = new FlowArray(cmn);
ref_a = new FlowArray(cmn);
}
@Override
public int type() {
return Flow.eObjectType_Con;
}
public String getName() {
return c_name;
}
public String getTraceObject() {
return trace_object;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
int i;
boolean found = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Con:
break;
case Flow.eSave_Con_cc:
String cc_name = token.nextToken();
found = false;
for ( i = 0; i < cmn.a_cc.size(); i++) {
if ( ((FlowConClass)cmn.a_cc.get(i)).cc_name.equals( cc_name)) {
cc = (FlowConClass) cmn.a_cc.get(i);
found = true;
break;
}
}
if ( !found)
System.out.println( "FlowCon: ConClass not found: " + cc_name);
break;
case Flow.eSave_Con_c_name:
if ( token.hasMoreTokens())
c_name = token.nextToken();
else
c_name = new String();
break;
case Flow.eSave_Con_x_right:
x_right = new Double( token.nextToken()).doubleValue();
break;
case Flow.eSave_Con_x_left:
x_left = new Double( token.nextToken()).doubleValue();
break;
case Flow.eSave_Con_y_high:
y_high = new Double( token.nextToken()).doubleValue();
break;
case Flow.eSave_Con_y_low:
y_low = new Double( token.nextToken()).doubleValue();
break;
case Flow.eSave_Con_dest_node:
reader.readLine();
break;
case Flow.eSave_Con_source_node:
reader.readLine();
break;
case Flow.eSave_Con_dest_conpoint:
case Flow.eSave_Con_source_conpoint:
case Flow.eSave_Con_dest_direction:
case Flow.eSave_Con_source_direction:
break;
case Flow.eSave_Con_line_a:
line_a.open( reader);
break;
case Flow.eSave_Con_arc_a:
arc_a.open( reader);
break;
case Flow.eSave_Con_arrow_a:
arrow_a.open( reader);
break;
case Flow.eSave_Con_ref_a:
ref_a.open( reader);
break;
case Flow.eSave_Con_p_num:
p_num = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_Con_l_num:
l_num = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_Con_a_num:
a_num = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_Con_arrow_num:
arrow_num = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_Con_ref_num:
ref_num = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_Con_point_x:
for ( i = 0; i < p_num; i++)
point_x[i] = new Double( reader.readLine()).doubleValue();
break;
case Flow.eSave_Con_point_y:
for ( i = 0; i < p_num; i++)
point_y[i] = new Double( reader.readLine()).doubleValue();
break;
case Flow.eSave_Con_source_ref_cnt:
case Flow.eSave_Con_dest_ref_cnt:
break;
case Flow.eSave_Con_trace_object:
if ( token.hasMoreTokens())
trace_object = token.nextToken();
break;
case Flow.eSave_Con_trace_attribute:
if ( token.hasMoreTokens())
trace_attribute = token.nextToken();
break;
case Flow.eSave_Con_trace_attr_type:
trace_attr_type = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_Con_temporary_ref:
temporary_ref = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowCon");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowCon");
}
}
public void setBounds() {
// Make extra space for arrows witch is not included in rectangel
int x = (int)((x_left - cmn.x_left) * cmn.zoom_factor) - 3 * Flow.DRAWOFFSET;
int y = (int)((y_low - cmn.y_low) * cmn.zoom_factor) - 3 * Flow.DRAWOFFSET;
int width = (int)((x_right - x_left) * cmn.zoom_factor) + 6 * Flow.DRAWOFFSET;
int height = (int)((y_high - y_low) * cmn.zoom_factor) + 6 * Flow.DRAWOFFSET;
// setBounds( x, y, width, height);
}
public boolean getSelect() {
return false;
}
public void setSelect( boolean select) {
}
public void draw( FlowPoint p0, String[] annotv, boolean highlight) {
// Adjust pos to javabean koordinates
FlowPoint p = new FlowPoint(cmn);
p.x = x_left / cmn.zoom_factor;
p.y = y_low / cmn.zoom_factor;
if ( temporary_ref != 0 || cc.con_type == Flow.eConType_Reference)
ref_a.draw( p, null, highlight);
else {
line_a.draw( p, l_num, highlight);
arc_a.draw( p, a_num, highlight);
arrow_a.draw( p, arrow_num, highlight);
}
}
public boolean eventHandler(PlowEvent e) {
return false;
}
/*
public void paintComponent( Graphics g1) {
Graphics2D g = (Graphics2D) g1;
if ( cmn.antiAliasing)
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
// Adjust pos to javabean koordinates
FlowPoint p = new FlowPoint(cmn);
p.x = - x_left + ((double) (3 * Flow.DRAWOFFSET)) / cmn.zoom_factor;
p.y = - y_low + ((double) ( 3 * Flow.DRAWOFFSET)) / cmn.zoom_factor;
if ( temporary_ref != 0 || cc.con_type == Flow.eConType_Reference)
ref_a.draw( g, p, null, highlight);
else {
line_a.draw( g, p, l_num, highlight);
arc_a.draw( g, p, a_num, highlight);
arrow_a.draw( g, p, arrow_num, highlight);
}
}
*/
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowConClass {
String cc_name;
int con_type;
int corner;
int draw_type;
int line_width;
double arrow_width;
double arrow_length;
double round_corner_amount;
int group;
FlowCmn cmn;
public FlowConClass( FlowCmn cmn) {
this.cmn = cmn;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_ConClass:
break;
case Flow.eSave_ConClass_cc_name:
cc_name = token.nextToken();
break;
case Flow.eSave_ConClass_con_type:
con_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_ConClass_corner:
corner = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_ConClass_draw_type:
draw_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_ConClass_line_width:
line_width = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_ConClass_arrow_width:
arrow_width = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_ConClass_arrow_length:
arrow_length = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_ConClass_round_corner_amount:
round_corner_amount = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_ConClass_group:
group = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowConClass");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowConClass");
}
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowConPoint implements FlowArrayElem {
FlowPoint p;
int number;
int direction;
String trace_attribute;
int trace_attr_type;
FlowCmn cmn;
public FlowConPoint( FlowCmn cmn) {
this.cmn = cmn;
p = new FlowPoint(cmn);
}
@Override
public int type() {
return Flow.eObjectType_ConPoint;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_ConPoint:
break;
case Flow.eSave_ConPoint_number:
number = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_ConPoint_direction:
direction = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_ConPoint_p:
p.open( reader);
break;
case Flow.eSave_ConPoint_trace_attribute:
trace_attribute = reader.readLine();
break;
case Flow.eSave_ConPoint_trace_attr_type:
trace_attr_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowConPoint");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowConPoint");
}
}
public void draw( FlowPoint p, String[] annotv, boolean highlight) {
}
@Override
public boolean getSelect() {
return false;
}
@Override
public void setSelect(boolean select) {
}
public boolean eventHandler(PlowEvent e) {
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
import jpwr.rt.*;
public class FlowCtx implements FlowCtxInterface {
FlowCmn cmn;
String name;
public FlowCtx( FlowCmn cmn) {
this.cmn = cmn;
}
public void unselect() {
/*
for ( int i = 0; i < cmn.a.size(); i++)
((FlowComponent)cmn.a.get(i)).setSelect( false);
*/
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Ctx:
break;
case Flow.eSave_Ctx_zoom_factor:
cmn.zoom_factor = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Ctx_base_zoom_factor:
cmn.base_zoom_factor = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Ctx_offset_x:
cmn.offset_x = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Ctx_offset_y:
cmn.offset_y = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Ctx_nav_zoom_factor:
case Flow.eSave_Ctx_print_zoom_factor:
case Flow.eSave_Ctx_nav_offset_x:
case Flow.eSave_Ctx_nav_offset_y:
break;
case Flow.eSave_Ctx_x_right:
cmn.x_right = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Ctx_x_left:
cmn.x_left = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Ctx_y_high:
cmn.y_high = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Ctx_y_low:
cmn.y_low = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Ctx_nav_rect_ll_x:
case Flow.eSave_Ctx_nav_rect_ll_y:
case Flow.eSave_Ctx_nav_rect_ur_x:
case Flow.eSave_Ctx_nav_rect_ur_y:
case Flow.eSave_Ctx_nav_rect_hot:
break;
case Flow.eSave_Ctx_name:
name = token.nextToken();
break;
case Flow.eSave_Ctx_user_highlight:
case Flow.eSave_Ctx_grid_size_x:
case Flow.eSave_Ctx_grid_size_y:
case Flow.eSave_Ctx_grid_on:
case Flow.eSave_Ctx_draw_delta:
case Flow.eSave_Ctx_refcon_width:
case Flow.eSave_Ctx_refcon_height:
case Flow.eSave_Ctx_refcon_textsize:
case Flow.eSave_Ctx_refcon_linewidth:
break;
case Flow.eSave_Ctx_a_nc:
FlowVector.open( reader, cmn, cmn.a_nc);
break;
case Flow.eSave_Ctx_a_cc:
FlowVector.open( reader, cmn, cmn.a_cc);
break;
case Flow.eSave_Ctx_a:
FlowVector.open( reader, cmn, cmn.a);
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowCtx");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowCtx");
}
//cmn.base_zoom_factor /= 5F;
cmn.zoom_factor = cmn.base_zoom_factor;
}
public Object getSelected() {
for ( int i = 0; i < cmn.a.size(); i++) {
if ( ((FlowArrayElem)cmn.a.get(i)).getSelect())
return cmn.a.get(i);
}
return null;
}
public Object getObject( String name) {
for ( int i = 0; i < cmn.a.size(); i++) {
if ( ((FlowArrayElem)cmn.a.get(i)).type() == Flow.eObjectType_Node) {
if ( ((FlowNode)cmn.a.get(i)).getName().equalsIgnoreCase( name))
return cmn.a.get(i);
}
}
return null;
}
public void centerObject(FlowArrayElem object) {
cmn.centerObject(object);
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
public interface FlowCtxInterface {
public void unselect();
}
package jpwr.app;
public class FlowDimension {
double x1, y1, x2, y2;
public FlowDimension(double x1, double y1, double x2, double y2) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
}
package jpwr.app;
public interface FlowDrawIfc {
public void rect(boolean border, int color, float x, float y, float width, float height);
public void pixmap(PlowPixmapData pixmapData, int idx, boolean invert, float x, float y);
public void drawText( String text, int textColor, int textSize, int font, float x, float y);
public float measureText( String text, int textSize, int font);
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowLine implements FlowArrayElem {
FlowPoint p1;
FlowPoint p2;
int draw_type;
int line_width;
FlowCmn cmn;
public FlowLine( FlowCmn cmn) {
this.cmn = cmn;
p1 = new FlowPoint(cmn);
p2 = new FlowPoint(cmn);
}
@Override
public int type() {
return Flow.eObjectType_Line;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Line:
break;
case Flow.eSave_Line_draw_type:
draw_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Line_line_width:
line_width = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Line_p1:
p1.open( reader);
break;
case Flow.eSave_Line_p2:
p2.open( reader);
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowLine");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowLine");
}
}
public void draw( FlowPoint p, String[] annotv, boolean highlight) {
int color;
switch ( draw_type) {
case Flow.eDrawType_LineGray:
color = Plow.COLOR_LIGHTGRAY;
break;
case Flow.eDrawType_LineRed:
case Flow.eDrawType_LineDashedRed:
color = Plow.COLOR_RED;
break;
default:
color = Plow.COLOR_BLACK;
}
if ( highlight)
color = Plow.COLOR_RED;
cmn.gdraw.line(true, color, (float)((p1.x + p.x) * cmn.zoom_factor - cmn.offset_x),
(float)((p1.y + p.y) * cmn.zoom_factor - cmn.offset_y),
(float)((p2.x + p.x) * cmn.zoom_factor - cmn.offset_x),
(float)((p2.y + p.y) * cmn.zoom_factor - cmn.offset_y));
/*
Line2D.Double line = new Line2D.Double( (p1.x + p.x) * cmn.zoom_factor,
(p1.y + p.y) * cmn.zoom_factor,
(p2.x + p.x) * cmn.zoom_factor,
(p2.y + p.y) * cmn.zoom_factor);
switch ( draw_type) {
case Flow.eDrawType_LineDashed:
case Flow.eDrawType_LineDashedRed:
g.setStroke( new BasicStroke( (float)(cmn.zoom_factor / cmn.base_zoom_factor * line_width),
BasicStroke.CAP_BUTT,
BasicStroke.JOIN_BEVEL, 0,
new float[] { 4F * line_width, 2F * line_width},
0));
break;
default:
g.setStroke( new BasicStroke( (float)(cmn.zoom_factor / cmn.base_zoom_factor * line_width)));
}
switch ( draw_type) {
case Flow.eDrawType_LineGray:
g.setColor( Color.lightGray);
break;
case Flow.eDrawType_LineRed:
case Flow.eDrawType_LineDashedRed:
g.setColor( Color.red);
break;
default:
g.setColor( Color.black);
}
if ( highlight)
g.setColor( Color.red);
g.draw( line);
*/
}
@Override
public boolean getSelect() {
return false;
}
@Override
public void setSelect(boolean select) {
}
public boolean eventHandler(PlowEvent e) {
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import jpwr.rt.*;
import java.io.*;
import java.util.*;
public class FlowNode implements FlowArrayElem {
static final int OFFSET = 2;
double x_right;
double x_left;
double y_high;
double y_low;
FlowCmn cmn;
FlowNodeClass nc;
FlowPoint pos;
String n_name;
String annotv[] = new String[10];
int annotsize[] = new int[10];
String trace_object;
String trace_attribute;
int trace_attr_type;
boolean highlight;
boolean select;
public FlowNode( FlowCmn cmn) {
this.cmn = cmn;
pos = new FlowPoint( cmn);
}
@Override
public int type() {
return Flow.eObjectType_Node;
}
public boolean getSelect() {
return select;
}
public void setSelect( boolean select) {
boolean redraw = (this.select != select);
this.select = select;
if ( redraw)
draw();
}
public String getName() {
return n_name;
}
public FlowCmn getCmn() {
return cmn;
}
public String getTraceObject() {
return trace_object;
}
public FlowDimension measureNode() {
return new FlowDimension(x_left, y_low, x_right, y_high);
}
public void setHighlight( boolean highlight) {
boolean redraw = (this.highlight != highlight);
this.highlight = highlight;
if ( redraw)
draw();
}
public void draw() {
// TODO
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
boolean found = false;
int i;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + line);
switch ( key) {
case Flow.eSave_Node_nc:
String nc_name = token.nextToken();
found = false;
for ( i = 0; i < cmn.a_nc.size(); i++) {
if ( ((FlowNodeClass)cmn.a_nc.get(i)).nc_name.equals( nc_name)) {
nc = (FlowNodeClass) cmn.a_nc.get(i);
found = true;
break;
}
}
if ( !found)
System.out.println( "FlowNode: NodeClass not found: " + nc_name);
break;
case Flow.eSave_Node_n_name:
if ( token.hasMoreTokens())
n_name = token.nextToken();
else
n_name = new String();
break;
case Flow.eSave_Node_refcon_cnt:
for ( i = 0; i < 32; i++)
reader.readLine();
break;
case Flow.eSave_Node_x_right:
x_right = new Double( token.nextToken()).doubleValue();
break;
case Flow.eSave_Node_x_left:
x_left = new Double( token.nextToken()).doubleValue();
break;
case Flow.eSave_Node_y_high:
y_high = new Double( token.nextToken()).doubleValue();
break;
case Flow.eSave_Node_y_low:
y_low = new Double( token.nextToken()).doubleValue();
break;
case Flow.eSave_Node_annotsize:
for ( i = 0; i < 10; i++) {
line = reader.readLine();
token = new StringTokenizer(line);
annotsize[i] = new Integer( token.nextToken()).intValue();
}
break;
case Flow.eSave_Node_annotv:
// Annotation are surrouded by quotes. A quote inside a
// annotation is preceded by a backslash. The size is calculated
// without backslashes
for ( i = 0; i < 10; i++) {
if ( annotsize[i] > 0) {
StringBuffer buf = new StringBuffer();
char c_old = 0;
char c;
reader.read();
for ( int j = 0; j < annotsize[i]; j++) {
c = (char) reader.read();
if ( c == '"') {
if ( c_old == '\\') {
buf.setLength( buf.length() - 1);
j--;
}
else
break;
}
buf.append(c); // TODO convert to UTF-8
c_old = c;
}
annotv[i] = new String( buf);
reader.readLine(); // Read linefeed
}
}
break;
case Flow.eSave_Node_pos:
pos.open( reader);
break;
case Flow.eSave_Node_trace_object:
if ( token.hasMoreTokens())
trace_object = token.nextToken();
break;
case Flow.eSave_Node_trace_attribute:
if ( token.hasMoreTokens())
trace_attribute = token.nextToken();
break;
case Flow.eSave_Node_trace_attr_type:
trace_attr_type = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_Node_obst_x_right:
case Flow.eSave_Node_obst_x_left:
case Flow.eSave_Node_obst_y_high:
case Flow.eSave_Node_obst_y_low:
case Flow.eSave_Node_trace_inverted:
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowNode");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOException FlowNode");
}
/*
if ( nc.group == Flow.eNodeGroup_Common) {
this.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent e) {
if ( e.isPopupTrigger()) {
new JopMethodsMenu( cmn.session, trace_object, JopUtility.TRACE,
component, e.getX(), e.getY());
return;
}
}
public void mousePressed(MouseEvent e) {
System.out.println( "Mouse event" + n_name);
if ( e.isPopupTrigger()) {
new JopMethodsMenu( cmn.session, trace_object, JopUtility.TRACE,
component, e.getX(), e.getY());
return;
}
if ( select) {
setSelect( false);
}
else {
cmn.unselect();
setSelect( true);
}
}
public void mouseClicked(MouseEvent e) {
// Detect double click
if ( e.getClickCount() == 2) {
if ( trace_object == null || trace_object.equals(""))
return;
cmn.session.openCrrFrame( trace_object);
}
}
});
}
*/
}
public void draw( FlowPoint p0, String[] annotv0, boolean hl) {
if ( select) {
// Draw blue background
cmn.gdraw.rect(false, Plow.COLOR_LIGHTBLUE, (float)(x_left * cmn.zoom_factor - cmn.offset_x),
(float)(y_low * cmn.zoom_factor - cmn.offset_y),
(float)(x_right * cmn.zoom_factor - cmn.offset_x),
(float)(y_high * cmn.zoom_factor - cmn.offset_y));
}
nc.draw( pos, annotv, highlight);
}
public boolean eventHandler(PlowEvent e) {
System.out.println( "x(" + x_left + "," + x_right + ") (" + y_low + "," + y_high + ")");
switch ( e.type) {
case PlowEvent.TYPE_CLICK:
if (nc.group == Flow.eNodeGroup_Document)
return false;
if ( x_left <= e.x && e.x <= x_right &&
y_low <= e.y && e.y <= y_high) {
cmn.currentNode = this;
e.object = this;
System.out.println("Hit !!");
return true;
}
break;
}
return false;
}
boolean attrFound;
PwrtRefId subid;
int refid;
boolean oldValue;
boolean firstScan;
public Object dynamicGetRoot() {
return null;
}
public void dynamicOpen() {
if ( trace_object == null || trace_attribute == null ||
trace_object.equals(""))
return;
if ( trace_attr_type != Flow.eTraceType_Boolean)
return;
String attrName = trace_object + "." + trace_attribute;
GdhrRefObjectInfo ret = cmn.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "ObjectInfoError " + attrName);
else {
attrFound = true;
refid = ret.id;
subid = ret.refid;
if (trace_object.equals("H1-Dv1"))
System.out.println("FlowNode sts: " + ret.sts + " refid:" + refid + " " + trace_object + "." + trace_attribute);
}
}
public void dynamicClose() {
if ( attrFound)
cmn.gdh.unrefObjectInfo( subid);
}
public void dynamicUpdate( boolean animationOnly) {
if ( attrFound) {
boolean value = cmn.gdh.getObjectRefInfoBoolean( refid);
if (trace_object.equals("H1-Dv1"))
System.out.println("FlowNode value: " + value + " refid:" + refid + " " + trace_object + "." + trace_attribute);
if ( value != oldValue || firstScan) {
highlight = value;
oldValue = value;
}
}
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowNodeClass implements FlowArrayElem {
FlowArray a;
String nc_name;
public int group;
FlowCmn cmn;
public FlowNodeClass( FlowCmn cmn) {
this.cmn = cmn;
a = new FlowArray( cmn);
}
@Override
public int type() {
return Flow.eObjectType_NodeClass;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_NodeClass_nc_name:
nc_name = token.nextToken();
break;
case Flow.eSave_NodeClass_a:
a.open( reader);
break;
case Flow.eSave_NodeClass_group:
group = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_NodeClass_no_con_obstacle:
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowNodeClass");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowNodeClass");
}
}
public void draw( FlowPoint p, String[] annotv, boolean highlight) {
a.draw( p, annotv, highlight);
}
@Override
public boolean getSelect() {
return false;
}
@Override
public void setSelect(boolean select) {
}
public boolean eventHandler(PlowEvent e) {
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowPoint {
double x;
double y;
FlowCmn cmn;
public FlowPoint( FlowCmn cmn) {
this.cmn = cmn;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Point:
break;
case Flow.eSave_Point_x:
x = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_Point_y:
y = new Double(token.nextToken()).doubleValue();
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println("Syntax error in FlowPoint");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowRect");
}
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowRect implements FlowArrayElem {
FlowPoint ll;
FlowPoint ur;
int draw_type;
int line_width;
int display_level;
FlowCmn cmn;
public FlowRect( FlowCmn cmn) {
this.cmn = cmn;
ll = new FlowPoint(cmn);
ur = new FlowPoint(cmn);
}
@Override
public int type() {
return Flow.eObjectType_Rect;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Rect_draw_type:
draw_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Rect_line_width:
line_width = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Rect_display_level:
display_level = new Integer( token.nextToken()).intValue();
break;
case Flow.eSave_Rect_ll:
ll.open( reader);
break;
case Flow.eSave_Rect_ur:
ur.open( reader);
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowRect");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowRect");
}
}
public void draw( FlowPoint p, String[] annotv, boolean highlight) {
if ( (display_level & FlowCmn.display_level) == 0)
return;
int color;
if ( highlight)
color = Plow.COLOR_RED;
else
color = Plow.COLOR_BLACK;
cmn.gdraw.rect(true, color, (float)((ll.x + p.x) * cmn.zoom_factor - cmn.offset_x),
(float)((ll.y + p.y) * cmn.zoom_factor - cmn.offset_y),
(float)((ur.x + p.x) * cmn.zoom_factor - cmn.offset_x),
(float)((ur.y + p.y) * cmn.zoom_factor - cmn.offset_y));
}
@Override
public boolean getSelect() {
return false;
}
@Override
public void setSelect(boolean select) {
}
public boolean eventHandler(PlowEvent e) {
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowText implements FlowArrayElem {
FlowPoint p;
int draw_type;
int text_size;
String text;
FlowCmn cmn;
public FlowText( FlowCmn cmn) {
this.cmn = cmn;
p = new FlowPoint(cmn);
}
@Override
public int type() {
return Flow.eObjectType_Text;
}
public void open( BufferedReader reader) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Text:
break;
case Flow.eSave_Text_text_size:
text_size = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Text_draw_type:
draw_type = new Integer(token.nextToken()).intValue();
break;
case Flow.eSave_Text_text:
text = token.nextToken();
break;
case Flow.eSave_Text_p:
p.open( reader);
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowText");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowText");
}
}
public void draw( FlowPoint p0, String[] annotv, boolean highlight) {
int tsize;
int idx = (int) (cmn.zoom_factor/cmn.base_zoom_factor * text_size * 5.8 + 1.0);
if ( cmn.zoom_factor/cmn.base_zoom_factor * text_size * 6.5 < 2) return;
int color = Flow.eDrawType_Line;
if ( highlight)
color = Flow.eDrawType_LineRed;
cmn.gdraw.drawText( text, color, idx, 0, (float)((p.x + p0.x) * cmn.zoom_factor - cmn.offset_x),
(float)((p.y + p0.y) * cmn.zoom_factor - cmn.offset_y));
}
@Override
public boolean getSelect() {
return false;
}
@Override
public void setSelect(boolean select) {
}
public boolean eventHandler(PlowEvent e) {
return false;
}
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.app;
import java.io.*;
import java.util.*;
public class FlowVector {
public FlowVector() {
}
//public static void open( BufferedReader reader, FlowCmn cmn, Vector<Object> a) {
public static void open( BufferedReader reader, FlowCmn cmn, Vector a) {
String line;
StringTokenizer token;
boolean end = false;
try {
while( (line = reader.readLine()) != null) {
token = new StringTokenizer(line);
int key = new Integer(token.nextToken()).intValue();
if ( cmn.debug) System.out.println( "line : " + key);
switch ( key) {
case Flow.eSave_Array:
break;
case Flow.eSave_NodeClass:
FlowNodeClass nc = new FlowNodeClass( cmn);
nc.open( reader);
a.add( (Object) nc);
break;
case Flow.eSave_ConClass:
FlowConClass cc = new FlowConClass( cmn);
cc.open( reader);
a.add( (Object) cc);
break;
case Flow.eSave_Node:
FlowNode n = new FlowNode( cmn);
n.open( reader);
a.add( n);
break;
case Flow.eSave_Con:
FlowCon c = new FlowCon( cmn);
c.open( reader);
a.add( c);
break;
case Flow.eSave_End:
end = true;
break;
default:
System.out.println( "Syntax error in FlowVector");
break;
}
if ( end)
break;
}
} catch ( Exception e) {
System.out.println( "IOExeption FlowVector");
}
}
}
package jpwr.app;
import android.graphics.Canvas;
import android.view.MotionEvent;
import jpwr.jopg.*;
public class GraphCmn implements PlowCmnIfc {
public static final int ACTION_CLICK = 1;
public static final int ACTION_UP = 2;
public static final int ACTION_DOWN = 3;
public static final int ACTION_MOVE = 4;
public Graph graph;
int scanCount = 0;
double buttonDownX;
double buttonDownY;
public GraphCmn(Graph graph) {
this.graph = graph;
}
public int type() {
return PlowCmnIfc.TYPE_GRAPH;
}
public Object getUserData() {
return null;
}
public void setUserData(Object userData) {
}
public void draw() {
graph.ctx.draw();
}
public void zoom(double factor) {
graph.ctx.zoom(factor);
}
public void scroll( int x, int y) {}
public void pageUp() {}
public void pageDown() {}
public synchronized void eventHandler(int action, double fx, double fy) {
switch ( action) {
case ACTION_UP: {
GlowEvent event = new GlowEvent();
event.x = (fx + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (fy + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_MB1Up;
graph.cmn.setNodraw();
graph.ctx.eventHandler( event);
graph.cmn.resetNodraw();
break;
}
case ACTION_CLICK: {
GlowEvent event = new GlowEvent();
event.x = (fx + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (fy + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_MB1Up;
graph.cmn.setNodraw();
graph.ctx.eventHandler( event);
graph.cmn.resetNodraw();
System.out.println("GraphCmn event click");
GlowEvent event2 = new GlowEvent();
event2.x = (fx + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event2.y = (fy + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event2.event = Glow.eEvent_MB1Click;
graph.cmn.setNodraw();
graph.ctx.eventHandler( event2);
graph.cmn.resetNodraw();
break;
}
case ACTION_DOWN: {
GlowEvent event = new GlowEvent();
event.x = (fx + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (fy + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_MB1Down;
graph.cmn.setNodraw();
graph.ctx.eventHandler( event);
graph.cmn.resetNodraw();
buttonDownX = event.x;
buttonDownY = event.y;
break;
}
case ACTION_MOVE: {
GlowEvent event = new GlowEvent();
event.x = (fx + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (fy + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_ButtonMotion;
graph.cmn.setNodraw();
graph.ctx.eventHandler( event);
graph.cmn.resetNodraw();
break;
}
}
}
public void select(Object node) {}
public void selectClear() {}
public Object getSelect() {return null;}
public void configure() {}
public void dynamicOpen() {}
public void dynamicClose() {
graph.ctx.traceDisconnect();
}
public synchronized void dynamicUpdate() {
/*
scanCount++;
if ( scanCount == 1)
graph.gdh.getObjectRefInfoAll();
*/
graph.cmn.setNodraw();
graph.ctx.traceScan();
graph.cmn.resetNodraw();
}
public void setCanvas(Canvas canvas) {
graph.cmn.gdraw.setCanvas(canvas);
}
public Object getFirst() {
return null;
}
public Object getLast() {
return null;
}
public Object getNext(Object elem) {
return null;
}
public Object getPrevious(Object elem) {
return null;
}
public int remove(Object e) {
return 0;
}
}
package jpwr.app;
public class Plow {
public static final int DRAWOFFSET = 2;
public static final int DEST_INTOLAST = 0;
public static final int DEST_INTOFIRST = 1;
public static final int DEST_AFTER = 2;
public static final int DEST_BEFORE = 3;
public static final double TREE_INDENTATION = 1D;
public static final int OPEN_ATTRIBUTES = 1;
public static final int OPEN_CHILDREN = 2;
public static final int OPEN_CROSSREFERENCES = 4;
public static final int OPEN_ALL = OPEN_ATTRIBUTES | OPEN_CHILDREN | OPEN_CROSSREFERENCES;
public static final int COLOR_BLACK = 1;
public static final int COLOR_RED = 2;
public static final int COLOR_GRAY = 3;
public static final int COLOR_DARKGRAY = 4;
public static final int COLOR_LIGHTGRAY = 5;
public static final int COLOR_WHITE = 6;
public static final int COLOR_YELLOW = 7;
public static final int COLOR_GREEN = 8;
public static final int COLOR_LIGHTBLUE = 9;
public static final int COLOR_BLUE = 10;
public static final int COLOR_VIOLET = 11;
}
package jpwr.app;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
public class PlowAnnot implements PlowArrayElem {
public static final int RELATIVE_POSITION = 1;
public static final int NEXT_RELATIVE_POSITION = 2;
public static final double RELATIVE_OFFSET = 1D;
double x;
double y;
int textSize;
int textColor;
int annotType;
int font;
int number;
PlowCmn cmn;
public PlowAnnot(PlowCmn cmn, double x, double y, int textSize, int textColor, int font,
int annotType, int number) {
this.cmn = cmn;
this.x = x;
this.y = y;
this.textSize = textSize;
this.textColor = textColor;
this.font = font;
this.annotType = annotType;
this.number = number;
}
public void draw(PlowPoint p, PlowNodeIfc node) {
if ( node == null || node.getAnnot(number) == null)
return;
int size = (int) (cmn.zoom_factor/cmn.base_zoom_factor * textSize);
double xPos;
int color;
if ( node.getInvert())
color = Plow.COLOR_WHITE;
else
color = textColor;
if ( (annotType & RELATIVE_POSITION) != 0) {
xPos = p.x + node.getAnnotPosition() + RELATIVE_OFFSET;
if ( xPos < p.x + x)
xPos = p.x + x;
}
else
xPos = p.x + x;
cmn.gdraw.drawText(node.getAnnot(number), color, size, font, (float)((xPos) * cmn.zoom_factor - cmn.offset_x),
(float)((y + p.y) * cmn.zoom_factor - cmn.offset_y));
if ( (annotType & NEXT_RELATIVE_POSITION) != 0)
node.setAnnotPosition(xPos - p.x + cmn.gdraw.measureText(node.getAnnot(number), size, font)/cmn.zoom_factor);
}
public void setBorders(PlowBorders borders) {
double width = 0;
double height = 0;
if ( x < borders.x_left)
borders.x_left = x;
if ( x + width > borders.x_right)
borders.x_right = x + width;
if ( y < borders.y_low)
borders.y_low = y;
if ( y + height > borders.y_high)
borders.y_high = y + height;
}
public boolean eventHandler(PlowEvent e) {
return false;
}
public void setInvert(boolean invert) {
}
public void draw(double x_left, double y_low, double x_right, double y_high) {
}
}
package jpwr.app;
import android.graphics.Color;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
public class PlowAnnotPixmap implements PlowArrayElem {
double x;
double y;
int number;
PlowCmn cmn;
static float[] inv = { -1f, 0f, 0f, 1f, 1f,
0f,-1f, 0f, 1f, 1f,
0f, 0f,-1f, 1f, 1f,
0f, 0f, 0f, 1f, 0f};
public PlowAnnotPixmap(PlowCmn cmn, double x, double y, int number) {
this.cmn = cmn;
this.x = x;
this.y = y;
this.number = number;
}
public void draw(PlowPoint p, PlowNodeIfc node) {
if ( node == null || node.getPixmap(number) == null)
return;
boolean invert = ( node != null && node.getInvert());
int idx = (int)(cmn.zoom_factor/cmn.base_zoom_factor * 6 - 3);
if ( idx < 0)
idx = 0;
if ( idx > 7)
idx = 7;
cmn.gdraw.pixmap(node.getPixmap(number), idx, invert, (float)((x + p.x) * cmn.zoom_factor - cmn.offset_x),
(float)((y + p.y) * cmn.zoom_factor - cmn.offset_y));
}
public void setBorders(PlowBorders borders) {
double width = 0;
double height = 0;
if ( x < borders.x_left)
borders.x_left = x;
if ( x + width > borders.x_right)
borders.x_right = x + width;
if ( y < borders.y_low)
borders.y_low = y;
if ( y + height > borders.y_high)
borders.y_high = y + height;
}
public boolean eventHandler(PlowEvent e) {
return false;
}
public void setInvert(boolean invert) {
}
public void draw(double x_left, double y_low, double x_right, double y_high) {
}
}
package jpwr.app;
import android.content.res.Resources;
public interface PlowAppl {
public void eventHandler(PlowEvent e);
public Resources getApplResources();
}
package jpwr.app;
import java.util.Vector;
public class PlowArray {
//Vector<Object> a = new Vector<Object>();
Vector<PlowArrayElem> a = new Vector<PlowArrayElem>();
PlowCmn cmn;
public PlowArray( PlowCmn cmn) {
this.cmn = cmn;
}
public void draw( PlowPoint p, PlowNodeIfc node) {
for ( int i = 0; i < a.size(); i++) {
((PlowArrayElem)a.get(i)).draw(p, node);
}
}
public void draw() {
PlowPoint p = new PlowPoint();
for ( int i = 0; i < a.size(); i++) {
((PlowArrayElem)a.get(i)).draw( p, null);
}
}
public void draw(double x_left, double y_low, double x_right, double y_high) {
for ( int i = 0; i < a.size(); i++) {
((PlowArrayElem)a.get(i)).draw(x_left, y_low, x_right, y_high);
}
}
public void setBorders(PlowBorders borders) {
for ( int i = 0; i < a.size(); i++) {
((PlowArrayElem)a.get(i)).setBorders(borders);
}
}
public void insert( PlowArrayElem e) {
a.add(e);
}
public boolean insertNode(PlowArrayElem e, PlowArrayElem destination, int code) {
if ( find(e))
return false;
int idx;
int destination_level = 0;
if ( destination == null) {
switch ( code) {
case Plow.DEST_INTOLAST:
idx = a.size();
break;
default:
idx = 0;
}
destination_level = 0;
}
else {
boolean found = false;
for ( idx = 0; idx < a.size(); idx++) {
if ( a.get(idx) == destination) {
found = true;
destination_level = ((PlowNode)a.get(idx)).getLevel();
idx++;
break;
}
}
if ( !found)
return false;
}
switch ( code) {
case Plow.DEST_INTOFIRST:
a.insertElementAt(e, idx);
if ( destination != null)
((PlowNode)e).setLevel(destination_level + 1);
else
((PlowNode)e).setLevel(destination_level);
break;
case Plow.DEST_INTOLAST: {
int i;
for ( i = idx; i < a.size(); i++) {
if ( ((PlowNode)a.get(i)).getLevel() <= destination_level)
break;
}
idx = i;
a.insertElementAt(e, idx);
if ( destination != null)
((PlowNode)e).setLevel(destination_level + 1);
else
((PlowNode)e).setLevel(destination_level);
break;
}
case Plow.DEST_AFTER: {
int i;
for ( i = idx; i < a.size(); i++) {
if ( ((PlowNode)a.get(i)).getLevel() < destination_level)
break;
}
idx = i;
a.insertElementAt(e, idx);
((PlowNode)e).setLevel(destination_level);
break;
}
case Plow.DEST_BEFORE:
if ( idx > 0)
idx--;
a.insertElementAt(e, idx);
((PlowNode)e).setLevel(destination_level);
break;
}
return true;
}
public void closeNode(PlowArrayElem element) {
boolean found = false;
int idx = 0;
int next_idx;
int i;
for ( i = 0; i < a.size(); i++) {
if ( a.get(i) == element) {
idx = i;
found = true;
break;
}
}
if ( !found)
return;
int level = ((PlowNode)a.get(idx)).getLevel();
for ( i = idx + 1; i < a.size(); i++) {
if ( ((PlowNode)a.get(i)).getLevel() <= level)
break;
}
next_idx = i;
if ( next_idx == idx + 1)
return;
for ( i = idx + 1; i < next_idx; i++) {
PlowEvent e = new PlowEvent(PlowEvent.TYPE_OBJECT_DELETED, 0D, 0D, (PlowNode)a.get(i));
cmn.appl.eventHandler(e);
if ( cmn.getSelect() == a.get(i))
cmn.selectClear();
a.remove(i);
i--;
next_idx--;
}
}
public boolean eventHandler(PlowEvent e) {
for ( int i = 0; i < a.size(); i++) {
if ( ((PlowArrayElem)a.get(i)).eventHandler(e))
return true;
}
return false;
}
public void setInvert(boolean invert) {
for ( int i = 0; i < a.size(); i++) {
((PlowArrayElem)a.get(i)).setInvert(invert);
}
}
public void configure() {
for ( int i = 0; i < a.size(); i++) {
if ( i == 0)
((PlowNode)a.get(i)).configure(null);
else
((PlowNode)a.get(i)).configure((PlowNode)a.get(i-1));
}
}
public boolean find(PlowArrayElem e) {
for ( int i = 0; i < a.size(); i++) {
if ( a.get(i) == e)
return true;
}
return false;
}
public PlowArrayElem get_next( PlowArrayElem element) {
int i;
for ( i = 0; i < a.size(); i++) {
if ( a.get(i) == element) {
if ( i == a.size() - 1)
return null;
return a.get(i+1);
}
}
return null;
}
public PlowArrayElem get_previous( PlowArrayElem element) {
int i;
for ( i = 0; i < a.size(); i++) {
if ( a.get(i) == element) {
if ( i == 0)
return null;
return a.get(i-1);
}
}
return null;
}
public PlowArrayElem get_first() {
if ( a.size() == 0)
return null;
return a.get(0);
}
public PlowArrayElem get_last() {
if ( a.size() == 0)
return null;
return a.get(a.size() - 1);
}
public int remove(PlowArrayElem e) {
if ( a.remove(e))
return 1;
return 0;
}
}
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.
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.
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.
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.
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