| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0fdca55 commit 1c5ba93
15 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,9 +24,6 @@ public class PVCopyFactory { | |||
| 24 | 24 | public static PVCopy create(PVStructure pvMaster,PVStructure pvRequest,String structureName) { | |
| 25 | 25 | if(firstTime) { | |
| 26 | 26 | 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(); | ||
| 30 | 27 | } | |
| 31 | 28 | return PVCopyImpl.create(pvMaster, pvRequest,structureName); | |
| 32 | 29 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,6 @@ static PVCopy create( | |||
| 41 | 41 | PVCopyImpl impl = new PVCopyImpl(pvMaster); | |
| 42 | 42 | boolean result = impl.init(pvStruct); | |
| 43 | 43 | if(!result) return null; | |
| 44 | - impl.traverseMasterInitPlugin(); | ||
| 45 | 44 | //System.out.println("\npvCopy" + impl.dump()); | |
| 46 | 45 | return impl; | |
| 47 | 46 | } | |
@@ -56,7 +55,6 @@ static class Node { | |||
| 56 | 55 | int structureOffset = 0; // In the copy | |
| 57 | 56 | int nfields = 0; | |
| 58 | 57 | PVStructure options = null; | |
| 59 | - PVFilter[] pvFilters = null; | ||
| 60 | 58 | } | |
| 61 | 59 | ||
| 62 | 60 | ||
@@ -68,7 +66,6 @@ static class StructureNode extends Node { | |||
| 68 | 66 | private Structure structure = null; | |
| 69 | 67 | private Node headNode = null; | |
| 70 | 68 | private PVStructure cacheInitStructure = null; | |
| 71 | - private BitSet ignorechangeBitSet = null; | ||
| 72 | 69 | ||
| 73 | 70 | private PVCopyImpl(PVStructure pvMaster) { | |
| 74 | 71 | this.pvMaster = pvMaster; | |
@@ -176,15 +173,13 @@ public void initCopy(PVStructure copyPVStructure, BitSet bitSet) { | |||
| 176 | 173 | public void updateCopySetBitSet(PVStructure copyPVStructure,BitSet bitSet) | |
| 177 | 174 | { | |
| 178 | 175 | updateCopySetBitSet(copyPVStructure,headNode,bitSet); | |
| 179 | - checkIgnore(copyPVStructure,bitSet); | ||
| 180 | 176 | } | |
| 181 | 177 | /* (non-Javadoc) | |
| 182 | 178 | * @see org.epics.pvdata.pvCopy.PVCopy#updateCopyFromBitSet(org.epics.pvdata.pv.PVStructure, org.epics.pvdata.misc.BitSet) | |
| 183 | 179 | */ | |
| 184 | 180 | public void updateCopyFromBitSet(PVStructure copyPVStructure,BitSet bitSet) { | |
| 185 | 181 | if(bitSet.get(0)) bitSet.set(0,copyPVStructure.getNumberFields(),true); | |
| 186 | 182 | updateCopyFromBitSet(copyPVStructure,headNode,bitSet); | |
| 187 | - checkIgnore(copyPVStructure,bitSet); | ||
| 188 | 183 | } | |
| 189 | 184 | /* (non-Javadoc) | |
| 190 | 185 | * @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) | |||
| 267 | 262 | ||
| 268 | 263 | private void updateCopySetBitSet(PVField pvCopy,Node node,BitSet bitSet) { | |
| 269 | 264 | 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 | - } | ||
| 276 | 265 | if(!node.isStructure) { | |
| 277 | 266 | if(result) return; | |
| 278 | 267 | updateCopySetBitSet(pvCopy,node.masterPVField,bitSet); | |
@@ -289,15 +278,6 @@ private void updateCopySetBitSet(PVField pvCopy,Node node,BitSet bitSet) { | |||
| 289 | 278 | ||
| 290 | 279 | private void updateCopyFromBitSet(PVField pvCopy,Node node,BitSet bitSet) { | |
| 291 | 280 | 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 | - } | ||
| 301 | 281 | if(!node.isStructure) { | |
| 302 | 282 | if(result) return; | |
| 303 | 283 | PVField pvMaster = node.masterPVField; | |
@@ -319,15 +299,6 @@ private void updateCopyFromBitSet(PVField pvCopy,Node node,BitSet bitSet) { | |||
| 319 | 299 | ||
| 320 | 300 | private void updateMaster(PVField pvCopy,Node node,BitSet bitSet) { | |
| 321 | 301 | 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 | - } | ||
| 331 | 302 | if(!node.isStructure) { | |
| 332 | 303 | if(result) return; | |
| 333 | 304 | PVField pvMaster = node.masterPVField; | |
@@ -371,7 +342,6 @@ private boolean init(PVStructure pvRequest) { | |||
| 371 | 342 | structure = createStructure(pvMasterStructure,pvRequest); | |
| 372 | 343 | if(structure==null) return false; | |
| 373 | 344 | cacheInitStructure = createPVStructure(); | |
| 374 | - ignorechangeBitSet = new BitSet(cacheInitStructure.getNumberFields()); | ||
| 375 | 345 | headNode = createStructureNodes(pvMaster,pvRequest,cacheInitStructure); | |
| 376 | 346 | return true; | |
| 377 | 347 | } | |
@@ -469,49 +439,6 @@ private static Node createStructureNodes( | |||
| 469 | 439 | ||
| 470 | 440 | } | |
| 471 | 441 | ||
| 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 | - | ||
| 515 | 442 | private Node getCopyOffset(StructureNode structureNode,PVField masterPVField) | |
| 516 | 443 | { | |
| 517 | 444 | int offset = masterPVField.getFieldOffset(); | |
@@ -531,38 +458,6 @@ private Node getCopyOffset(StructureNode structureNode,PVField masterPVField) | |||
| 531 | 458 | return null; | |
| 532 | 459 | } | |
| 533 | 460 | ||
| 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 | - } | ||
| 566 | 461 | private Node getMasterNode(StructureNode structureNode,int structureOffset) { | |
| 567 | 462 | for(Node node : structureNode.nodes) { | |
| 568 | 463 | if(structureOffset>=(node.structureOffset + node.nfields)) continue; | |
@@ -599,12 +494,6 @@ private void dump(StringBuilder builder,Node node,int indentLevel) { | |||
| 599 | 494 | String name = node.masterPVField.getFullName(); | |
| 600 | 495 | convert.newLine(builder, indentLevel+1); | |
| 601 | 496 | 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 | - } | ||
| 608 | 497 | if(!node.isStructure) return; | |
| 609 | 498 | StructureNode structureNode = (StructureNode)node; | |
| 610 | 499 | Node[] nodes =structureNode.nodes; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments