Advertisement
Guest User

Untitled

a guest
Mar 16th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 4.43 KB | None | 0 0
  1. private RigStatus analisysCXDX(TallySondeo tally, StatusWell currentStatus, ConfigWell configWell, Rig rig, Well well) {
  2.         logger.debug("analisysCXDX");
  3.         this.referencePointA = this.validateReferencePoint(this.referencePointA, rig, well);
  4.         this.referencePointB = this.validateReferencePoint(this.referencePointB, rig, well);
  5.         if (!this.referencePointA.equals(NULL_VALUE_REFERENCE) &&
  6.             !this.referencePointB.equals(NULL_VALUE_REFERENCE)) {
  7.  
  8.             Double delta = (this.referencePointB - this.referencePointA) / 100;
  9.             this.referencePointA = NULL_VALUE_REFERENCE;
  10.             this.referencePointB = NULL_VALUE_REFERENCE;
  11.  
  12.             CXDXEvent event = new CXDXEvent(this.source);
  13.  
  14.          
  15.             currentStatus.setDrillStringLength(currentStatus.getDrillStringLength() + this.delta);
  16.            
  17.             event.addLogLine("set setDrillStringLength, delta = " + this.delta);
  18.             LOGGER.debug("set setDrillStringLength, delta = " + this.delta);
  19.  
  20.             AtomicBoolean tallyFitted = new AtomicBoolean(Boolean.FALSE);
  21.  
  22.             this.commandsHandler.getFitDrillStringTally(null, tallyFitted).execute(); // SE ACOMODA EL TALLY
  23.  
  24.             this.commandsHandler.getReloadDrillStringTally().execute(); // RECARGA DEL TALLY (Se calculan lengths y esas cosas por los cambios que se pudieran haber producido en el fit)
  25.  
  26.             this.commandsHandler.getSettingActiveElementWell(clientID, tally, currentStatus).execute(); // VE DE SETEAR LA BARRA ACTIVA
  27.  
  28.             event.addLogLine("tallyFitted " + tallyFitted.get());
  29.             if (!tally.empty() && !tallyFitted.get()) { // Si aun habiendo realizado el fitTally aun no se ha llegado a completar el drillString (system)
  30.                 //this.addNewPipe(tally, delta, rig, configWell);
  31.                 commandsHandler.getAddNewPipe(null, delta, tally, rig, configWell).execute(); // AGREGA UNA NUEVA BARRA
  32.  
  33.                 commandsHandler.getReloadDrillStringTally().execute(); // RECARGA DEL TALLY (Se calculan length y esas cosas por los cambios que se pudieran haber producido en el agregado)
  34.             }
  35.  
  36.             if (delta > 0) { // ES UN CONEXION
  37.                 event.addLogLine("CONNECTION");
  38.                 currentStatus.setLastDeltaCx(delta);
  39.                 modelData.getQueueRigStatus().setAll(RigStatus.CONNECTION);
  40.                 currentStatus.setRigStatus(RigStatus.CONNECTION);
  41.             } else {  // ES UN DESCONEXION
  42.                 event.addLogLine("DISCONNECTION");
  43.                 currentStatus.setLastDeltaDx(delta);
  44.                 modelData.getQueueRigStatus().setAll(RigStatus.DISCONNECTION);
  45.                 currentStatus.setRigStatus(RigStatus.DISCONNECTION);
  46.             }
  47.  
  48.          
  49.             event.addLogLine("getAutomaticFixDepth = " + configWell.getAutomaticFixDepth());
  50.             if (configWell.getAutomaticFixDepth()) {
  51.                 /*
  52.                  * AUTO FIX, luego de haber realizado el acomodar Tally, si la diferencia entre el drillStringLenght del tally
  53.                  * ya acomodado y el SistemDrillStringLenght están en valor absoluto dentro de una tolerancia preestablecida
  54.                  *  (valores similar al enfoque inicial) si la marca AutoFix esta habilitada, procedemos a corregir el
  55.                  *  SystemDrillString para que se ajuste al tally.
  56.                  */
  57.  
  58.                 event.addLogLine("currentStatus.getDrillStringLength() = " + currentStatus.getDrillStringLength());
  59.                 event.addLogLine("modelData.getWell().tallySondeo().getTotal().getTotalLenghtDrillString() = " + modelData.getWell().tallySondeo().getTotal().getTotalLenghtDrillString());
  60.                 event.addLogLine("hookHeigthErrorTolerance = " + hookHeigthErrorTolerance);
  61.  
  62.                 if (Math.abs(currentStatus.getDrillStringLength() - modelData.getWell().tallySondeo().getTotal().getTotalLenghtDrillString()) < hookHeigthErrorTolerance) {
  63.                     event.addLogLine("Setting currentStatus.drillStringLength = " + modelData.getWell().tallySondeo().getTotal().getTotalLenghtDrillString());
  64.                     currentStatus.setDrillStringLength(modelData.getWell().tallySondeo().getTotal().getTotalLenghtDrillString());
  65.                 }
  66.             }
  67.             this.sendEvent(event);
  68.             commandsHandler.getRecalculateSectionsWell().execute();
  69.             clientsHandler.sendBroadcast(CommonConstants.MANDATORY_UPDATE);
  70.         }
  71. return currentStatus.getRigStatus();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement