Unverified Commit 13101861 authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Fixed spiceserver debugging and addressed duplicate NaifKeywords PvlObjects...

Fixed spiceserver debugging and addressed duplicate NaifKeywords PvlObjects when spiceiniting over the web (#4594)
parent 0168a08b
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include "IString.h"
#include "Pvl.h"
#include "Table.h"
#include "TextFile.h"

using namespace std;
using namespace Isis;
@@ -84,6 +85,25 @@ namespace Isis {

    *p_xml = QString(QByteArray(raw.toLatin1()).toHex().constData());

    /*
     * For Debugging, you may want to run spiceserver locally (without spiceinit).
     *
     * Uncomment the following code and run the spiceinit with web=true. An error will be thrown
     * with the file name of the stored input hex file. You can rsync that file to your work area
     * and run spiceserver locally.
     */

    // const char *inmode = "overwrite";
    // const char *ext  = "dat";
    // TextFile newInput;
    // QString serverInputFile("/tmp/input");
    // newInput.Open(serverInputFile, inmode, ext);
    // newInput.Rewind();//start at begining
    // newInput.PutLine(hexCode);
    // newInput.Close();
    // QString msg = "Exporting expected server input to: " + serverInputFile;
    // throw IException(IException::Programmer, msg, _FILEINFO_);

    int contentLength = p_xml->length();
    QString contentLengthStr = toString((BigInt)contentLength);

+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ namespace Isis {
   * @author ????-??-?? Steven Lambright
   *
   * @internal
   *   @history 2021-08-10 Adam Paquette - Moved debugging code for spiceserver
   *                           into SpiceClient to maintain current debugging
   *                           practices.
   */
  class SpiceClient : public QThread {
      Q_OBJECT
+6 −1
Original line number Diff line number Diff line
@@ -684,7 +684,12 @@ namespace Isis {
      log->addGroup(kernelsGroup);
    }

    icube->label()->addObject(naifKeywords);
    Pvl *icubeLabel = icube->label();

    if (icubeLabel->hasObject(naifKeywords.name())) {
      icubeLabel->deleteObject(naifKeywords.name());
    }
    icubeLabel->addObject(naifKeywords);

    icube->write(*pointingTable);
    icube->write(*positionTable);
+4 −0
Original line number Diff line number Diff line
@@ -306,6 +306,10 @@
      Moved writeHistory() call to main function because a history entry was only being written
      to the cube when using a data area for kernels (not using the web service). Fixes #4040.
    </change>
    <change name="Adam Paquette" date="2021-08-10">
      Fixed the NaifKeywords PvlObject not being updated/replaced when spiceinit with web=true was
      run on a cube that was already spiceinit'd.
    </change>
  </history>

  <oldName>
+0 −19
Original line number Diff line number Diff line
@@ -79,25 +79,6 @@ namespace Isis {
      // GetLine returns false if it was the last line... so we can't check for problems really
      inFile.GetLine(hexCode);

      /*
       * For Debugging, you may want to run spiceserver locally (without spiceinit).
       *
       * Uncomment the following code and run the spiceinit with web=true. An error will be thrown
       * with the file name of the stored input hex file. You can rsync that file to your work area
       * and run spice server locally.
       */
      /*
       * const char *inmode = "overwrite";
       * const char *ext  = "dat";
       * TextFile newInput;
       * newInput.Open(QString("/tmp/spice_web_service/input"), inmode, ext);
       * newInput.Rewind();//start at begining
       * newInput.PutLine(hexCode);
       * newInput.Close();
       * QString msg = "In: " + ui.GetFileName("FROM") + "   " + ui.GetFileName("TO");
       * throw IException(IException::Programmer, msg, _FILEINFO_);
       */

      Pvl label;
      label.clear();
      QString otherVersion;
Loading