Skip to content

Commit 1c5ba93

Browse files
committed
Backout plugin support.
PVAlarmFactory and PVDisplayFactory: in set method fix bug for string fields PVTimeStampFactory: In set methods fix bug for nanaSeconds. ConvertFactory: make some changes for unsigned field types. This removes warning message from compiler.
1 parent 0fdca55 commit 1c5ba93

15 files changed

Lines changed: 53 additions & 654 deletions

pvDataJava/src/org/epics/pvdata/copy/PVCopyFactory.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ public class PVCopyFactory {
2424
public static PVCopy create(PVStructure pvMaster,PVStructure pvRequest,String structureName) {
2525
if(firstTime) {
2626
firstTime = false;
27-
new org.epics.pvdata.copy.arrayPlugin.ArrayPlugin();
28-
new org.epics.pvdata.copy.timestampPlugin.TimestampPlugin();
29-
new org.epics.pvdata.copy.deadbandPlugin.DeadbandPlugin();
3027
}
3128
return PVCopyImpl.create(pvMaster, pvRequest,structureName);
3229
}

pvDataJava/src/org/epics/pvdata/copy/PVCopyImpl.java

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ static PVCopy create(
4141
PVCopyImpl impl = new PVCopyImpl(pvMaster);
4242
boolean result = impl.init(pvStruct);
4343
if(!result) return null;
44-
impl.traverseMasterInitPlugin();
4544
//System.out.println("\npvCopy" + impl.dump());
4645
return impl;
4746
}
@@ -56,7 +55,6 @@ static class Node {
5655
int structureOffset = 0; // In the copy
5756
int nfields = 0;
5857
PVStructure options = null;
59-
PVFilter[] pvFilters = null;
6058
}
6159

6260

@@ -68,7 +66,6 @@ static class StructureNode extends Node {
6866
private Structure structure = null;
6967
private Node headNode = null;
7068
private PVStructure cacheInitStructure = null;
71-
private BitSet ignorechangeBitSet = null;
7269

7370
private PVCopyImpl(PVStructure pvMaster) {
7471
this.pvMaster = pvMaster;
@@ -176,15 +173,13 @@ public void initCopy(PVStructure copyPVStructure, BitSet bitSet) {
176173
public void updateCopySetBitSet(PVStructure copyPVStructure,BitSet bitSet)
177174
{
178175
updateCopySetBitSet(copyPVStructure,headNode,bitSet);
179-
checkIgnore(copyPVStructure,bitSet);
180176
}
181177
/* (non-Javadoc)
182178
* @see org.epics.pvdata.pvCopy.PVCopy#updateCopyFromBitSet(org.epics.pvdata.pv.PVStructure, org.epics.pvdata.misc.BitSet)
183179
*/
184180
public void updateCopyFromBitSet(PVStructure copyPVStructure,BitSet bitSet) {
185181
if(bitSet.get(0)) bitSet.set(0,copyPVStructure.getNumberFields(),true);
186182
updateCopyFromBitSet(copyPVStructure,headNode,bitSet);
187-
checkIgnore(copyPVStructure,bitSet);
188183
}
189184
/* (non-Javadoc)
190185
* @see org.epics.pvdata.pvCopy.PVCopy#updateRecord(org.epics.pvdata.pv.PVStructure, org.epics.pvdata.misc.BitSet)
@@ -267,12 +262,6 @@ private void updateCopySetBitSet(PVField pvCopy,PVField pvMaster,BitSet bitSet)
267262

268263
private void updateCopySetBitSet(PVField pvCopy,Node node,BitSet bitSet) {
269264
boolean result = false;
270-
if(node.pvFilters!=null) {
271-
for(int i=0; i< node.pvFilters.length; ++i) {
272-
PVFilter pvFilter = node.pvFilters[i];
273-
if(pvFilter.filter(pvCopy,bitSet,true)) result = true;
274-
}
275-
}
276265
if(!node.isStructure) {
277266
if(result) return;
278267
updateCopySetBitSet(pvCopy,node.masterPVField,bitSet);
@@ -289,15 +278,6 @@ private void updateCopySetBitSet(PVField pvCopy,Node node,BitSet bitSet) {
289278

290279
private void updateCopyFromBitSet(PVField pvCopy,Node node,BitSet bitSet) {
291280
boolean result = false;
292-
boolean update = bitSet.get(pvCopy.getFieldOffset());
293-
if(update) {
294-
if(node.pvFilters!=null) {
295-
for(int i=0; i< node.pvFilters.length; ++i) {
296-
PVFilter pvFilter = node.pvFilters[i];
297-
if(pvFilter.filter(pvCopy,bitSet,true)) result = true;
298-
}
299-
}
300-
}
301281
if(!node.isStructure) {
302282
if(result) return;
303283
PVField pvMaster = node.masterPVField;
@@ -319,15 +299,6 @@ private void updateCopyFromBitSet(PVField pvCopy,Node node,BitSet bitSet) {
319299

320300
private void updateMaster(PVField pvCopy,Node node,BitSet bitSet) {
321301
boolean result = false;
322-
boolean update = bitSet.get(pvCopy.getFieldOffset());
323-
if(update) {
324-
if(node.pvFilters!=null) {
325-
for(int i=0; i< node.pvFilters.length; ++i) {
326-
PVFilter pvFilter = node.pvFilters[i];
327-
if(pvFilter.filter(pvCopy,bitSet,false)) result = true;
328-
}
329-
}
330-
}
331302
if(!node.isStructure) {
332303
if(result) return;
333304
PVField pvMaster = node.masterPVField;
@@ -371,7 +342,6 @@ private boolean init(PVStructure pvRequest) {
371342
structure = createStructure(pvMasterStructure,pvRequest);
372343
if(structure==null) return false;
373344
cacheInitStructure = createPVStructure();
374-
ignorechangeBitSet = new BitSet(cacheInitStructure.getNumberFields());
375345
headNode = createStructureNodes(pvMaster,pvRequest,cacheInitStructure);
376346
return true;
377347
}
@@ -469,49 +439,6 @@ private static Node createStructureNodes(
469439

470440
}
471441

472-
private void initPlugin(Node node,PVStructure pvOptions,PVField pvMasterField)
473-
{
474-
PVField[] pvFields = pvOptions.getPVFields();
475-
int num = pvFields.length;
476-
PVFilter[] pvFilters = new PVFilter[num];
477-
int numfilter = 0;
478-
for(int i=0; i<num; ++i) {
479-
PVString pvOption = (PVString)(pvFields[i]);
480-
481-
String name = pvOption.getFieldName();
482-
String value = pvOption.get();
483-
PVPlugin pvPlugin = PVPluginRegistry.find(name);
484-
if(pvPlugin==null) {
485-
if(name.equals("ignore")) setIgnore(node);
486-
continue;
487-
}
488-
pvFilters[numfilter] = pvPlugin.create(value,this,pvMasterField);
489-
if(pvFilters[numfilter]!=null) ++numfilter;
490-
}
491-
if(numfilter==0) return;
492-
node.pvFilters = new PVFilter[numfilter];
493-
for(int i=0; i<numfilter; ++i) node.pvFilters[i] = pvFilters[i];
494-
}
495-
496-
private void traverseMasterInitPlugin()
497-
{
498-
traverseMasterInitPlugin(headNode);
499-
}
500-
501-
private void traverseMasterInitPlugin(Node node)
502-
{
503-
PVField pvField = node.masterPVField;
504-
PVStructure pvOptions = node.options;
505-
if(pvOptions!=null) initPlugin(node,pvOptions,pvField);
506-
if(!node.isStructure) return;
507-
StructureNode structNode = (StructureNode)node;
508-
Node[] nodes = structNode.nodes;
509-
for(int i=0; i< nodes.length; ++i) {
510-
node = nodes[i];
511-
traverseMasterInitPlugin(node);
512-
}
513-
}
514-
515442
private Node getCopyOffset(StructureNode structureNode,PVField masterPVField)
516443
{
517444
int offset = masterPVField.getFieldOffset();
@@ -531,38 +458,6 @@ private Node getCopyOffset(StructureNode structureNode,PVField masterPVField)
531458
return null;
532459
}
533460

534-
private void checkIgnore(PVStructure copyPVStructure,BitSet bitSet) {
535-
if(ignorechangeBitSet==null) return;
536-
int numFields = copyPVStructure.getNumberFields();
537-
BitSet temp = new BitSet(numFields);
538-
temp.set(bitSet);
539-
int ind = 0;
540-
while(true) {
541-
ind = ignorechangeBitSet.nextSetBit(ind);
542-
if(ind<0) break;
543-
temp.clear(ind);
544-
ind++;
545-
if(ind>=numFields) break;
546-
}
547-
if(temp.nextSetBit(0)<0) bitSet.clear();
548-
}
549-
550-
private void setIgnore(Node node) {
551-
ignorechangeBitSet.set(node.structureOffset);
552-
if(node.isStructure) {
553-
StructureNode snode = (StructureNode)node;
554-
for(int i=0; i<snode.nodes.length; ++i) {
555-
setIgnore(snode.nodes[i]);
556-
}
557-
} else {
558-
int num = node.masterPVField.getNumberFields();
559-
if(num>1) {
560-
for(int i=1; i<num; ++i) {
561-
ignorechangeBitSet.set(node.structureOffset+i);
562-
}
563-
}
564-
}
565-
}
566461
private Node getMasterNode(StructureNode structureNode,int structureOffset) {
567462
for(Node node : structureNode.nodes) {
568463
if(structureOffset>=(node.structureOffset + node.nfields)) continue;
@@ -599,12 +494,6 @@ private void dump(StringBuilder builder,Node node,int indentLevel) {
599494
String name = node.masterPVField.getFullName();
600495
convert.newLine(builder, indentLevel+1);
601496
builder.append("masterField name " + name);
602-
PVFilter[] pvFilters = node.pvFilters;
603-
if(pvFilters!=null) {
604-
convert.newLine(builder, indentLevel+2);
605-
builder.append("filters:");
606-
for(int i=0; i< pvFilters.length; ++i) builder.append(" " +pvFilters[i].getName());
607-
}
608497
if(!node.isStructure) return;
609498
StructureNode structureNode = (StructureNode)node;
610499
Node[] nodes =structureNode.nodes;

pvDataJava/src/org/epics/pvdata/copy/PVFilter.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

pvDataJava/src/org/epics/pvdata/copy/PVPlugin.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

pvDataJava/src/org/epics/pvdata/copy/PVPluginRegistry.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)