Commit 165f09a5 authored by Tyler Wilson's avatar Tyler Wilson
Browse files

New BundleObservationView class for handling the display of BundleObservation...

New BundleObservationView class for handling the display of BundleObservation data in a QTable object.  Fixes #4839#

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce_FY17-Sprint1@7638 41f8697f-d340-4b68-9986-7bafba869bb8
parent ce362dc5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
Image,rms,rms,rms,X,X,X,X,X,Y,Y,Y,Y,Y,Z,Z,Z,Z,Z,RA,RA,RA,RA,RA,DEC,DEC,DEC,DEC,DEC,TWIST,TWIST,TWIST,TWIST,TWIST,
Filename,sample res,line res,total res,Initial,Correction,Final,Apriori Sigma,Adj Sigma,Initial,Correction,Final,Apriori Sigma,Adj Sigma,Initial,Correction,Final,Apriori Sigma,Adj Sigma,Initial,Correction,Final,Apriori Sigma,Adj Sigma,Initial,Correction,Final,Apriori Sigma,Adj Sigma,Initial,Correction,Final,Apriori Sigma,Adj Sigma,
/work/projects/ApolloMetric/METRIC/Calibrated/AS15/SUB4_MSK_InstrumentStartTime/Sub4-AS15-M-1757_msk.cub,0.51845694436147,0.97524424269876,0.78099261714619,-1676.1866244276,0.3170026774516,-1675.8696217502,500.0,0.1690797492717,776.01842700262,0.18308214004334,776.20150914267,500.0,0.17709880748748,190.83692567603,0.67934738703117,191.51627306306,500.0,0.16934724936719,-114.81847479623,0.14786430851052,-114.67061048772,0.5,0.097887257746279,84.286744189607,0.14301001677591,84.429754206383,0.5,0.085518977881851,135.10580640169,-0.073755435116957,135.03205096657,0.5,0.10209077775713
/work/projects/ApolloMetric/METRIC/Calibrated/AS15/SUB4_MSK_InstrumentStartTime/Sub4-AS15-M-1758_msk.cub,0.48914157340128,0.96409831563102,0.76444262081337,-1661.0556247296,0.24305052799097,-1660.8125742016,500.0,0.17883341616719,800.60462193458,0.26766384701447,800.87228578159,500.0,0.17894270116668,219.62524418461,0.81713498430798,220.44237916892,500.0,0.17548613324839,-115.68927691479,0.15112876410579,-115.53814815068,0.5,0.097663328471951,83.287864615961,0.14571379590631,83.433578411867,0.5,0.085317156538059,135.24236174012,-0.081063071500818,135.16129866862,0.5,0.10243445718908
/work/projects/ApolloMetric/METRIC/Calibrated/AS15/SUB4_MSK_InstrumentStartTime/Sub4-AS15-M-1759_msk.cub,0.3234786200299,1.0445725353158,0.77323030177063,-1645.118297281,0.18547301310201,-1644.9328242679,500.0,0.20684835804294,824.80203432912,0.37787280348465,825.17990713261,500.0,0.20520137756462,248.30682152756,0.97427898916589,249.28110051673,500.0,0.20458947672359,-116.55201321842,0.1414520464547,-116.41056117197,0.5,0.097506040940435,82.310079123292,0.14270993562181,82.452789058913,0.5,0.085163168400858,135.38610126297,-0.069324655588454,135.31677660738,0.5,0.10281378780214
/work/projects/ApolloMetric/METRIC/Calibrated/AS16/SUB4_MSK_NewStartTime/Sub4-AS16-M-0392_msk.cub,0.49188485000562,1.1397636203373,0.8777846592159,1747.0424536016,-0.25503937331921,1746.7874142282,500.0,0.18429641470036,633.3492820035,0.49395906374671,633.84324106725,500.0,0.1830184566499,81.070798243394,-0.49125912498146,80.579539118413,500.0,0.19512758266095,110.34149860419,0.3735945369789,110.71509314116,0.5,0.088850090823099,87.09334362033,-0.10691005392567,86.986433566404,0.5,0.094783462079425,-149.90233460871,-0.036238357509029,-149.93857296621,0.5,0.10327678221121
/work/projects/ApolloMetric/METRIC/Calibrated/AS16/SUB4_MSK_NewStartTime/Sub4-AS16-M-0393_msk.cub,0.745496019873,1.1426404871033,0.96472576373138,1760.2742054268,-0.034511936246684,1760.2396934906,500.0,0.17301063061067,597.66419620361,0.45091683878255,598.11511304239,500.0,0.1749682885975,58.98892575481,-0.51847411988065,58.47045163493,500.0,0.17712241769798,109.18883286426,0.37607709864275,109.56490996291,0.5,0.088840587895256,87.796840611543,-0.09134753252743,87.705493079016,0.5,0.094319465492397,-149.84701529934,-0.033154227141492,-149.88016952649,0.5,0.10364410342365
/work/projects/ApolloMetric/METRIC/Calibrated/AS16/SUB4_MSK_NewStartTime/Sub4-AS16-M-0394_msk.cub,0.57994567220543,1.0445737373178,0.84482876235478,1772.5152690217,0.19274695792245,1772.7080159796,500.0,0.18900862793942,561.64149498279,0.39235269508021,562.03384767787,500.0,0.19507829017625,36.873141324453,-0.50650471222111,36.366636612232,500.0,0.18962962942032,108.01512683489,0.38747308139741,108.40259991629,0.5,0.088957785858698,88.534523650897,-0.1083766713918,88.426146979505,0.5,0.093815486035816,-149.80439189401,-0.018129130140166,-149.82252102415,0.5,0.10404865355201
+122 −0
Original line number Diff line number Diff line
#include "AbstractProjectItemView.h"
#include "BundleObservationView.h"
#include "BundleObservation.h"
#include <QAction>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QEvent>
#include <QFile>
#include <QHBoxLayout>
#include <QMap>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QMenu>
#include <QModelIndex>
#include <QSize>
#include <QSizePolicy>
#include <QStandardItemModel>
#include <QStandardItem>
#include <QStatusBar>

#include <QHeaderView>
#include <QStringList>
#include <QTableView>
#include <QTextStream>
#include <QToolBar>
#include <QVBoxLayout>
#include <QWidgetAction>
#include <QXmlStreamWriter>


#include "ControlPoint.h"
#include "Directory.h"
#include "Cube.h"
#include "Image.h"
#include "MosaicGraphicsView.h"
#include "MosaicSceneWidget.h"
#include "ProjectItem.h"
#include "ProjectItemModel.h"
#include "Shape.h"
#include "ToolPad.h"


  namespace Isis {



  BundleObservationView::BundleObservationView(BundleObservation * bundleObservation,QWidget *parent):
                         AbstractProjectItemView(parent) {

    QStandardItemModel *model = new QStandardItemModel;

    QFile file("AS15_16_test_bundleout_images.csv");
    if (file.open(QIODevice::ReadOnly)) {

      int lineindex = 0;                     // file line counter
      QTextStream in(&file);                 // read to text stream

      while (!in.atEnd()) {

        // read one line from textstream(separated by "\n")
        QString fileLine = in.readLine();

        // parse the read line into separate pieces(tokens) with "," as the delimiter
        QStringList lineToken = fileLine.split(",", QString::SkipEmptyParts);

        // load parsed data to model accordingly
        for (int j = 0; j < lineToken.size(); j++) {
          QString value = lineToken.at(j);

          //  First 2 lines are header, load into model header data
          if (lineindex < 2) {
            //qDebug()<<"header = "<<value;
            //model->setHeaderData(j, Qt::Horizontal, value);
            //qDebug()<<"header = "<<value;
            QStandardItem *v1 = new QStandardItem(value);

            model->setHorizontalHeaderItem(j,v1);
            //model->setHeaderData(j, Qt::Horizontal, value);
          }
          else {
            QStandardItem *item = new QStandardItem(value);
            model->setItem(lineindex, j, item);
          }
        }

        lineindex++;
      }

      file.close();
    }

    QTableView *qtable=new QTableView();
    qtable->setModel(model);
    qtable->setSortingEnabled(true);
    
    QHeaderView *headerView = qtable->horizontalHeader();
    headerView->setStretchLastSection(true);

    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);
    layout->addWidget(qtable);

    QSizePolicy policy = sizePolicy();
    policy.setHorizontalPolicy(QSizePolicy::Expanding);
    policy.setVerticalPolicy(QSizePolicy::Expanding);
    setSizePolicy(policy);
    }


  /**
   * Destructor
   */
  BundleObservationView::~BundleObservationView() {

  }


}


+83 −0
Original line number Diff line number Diff line
#ifndef BundleObservationView_h
#define BundleObservationView_h
/**
 * @file
 * $Date$
 * $Revision$
 *
 *   Unless noted otherwise, the portions of Isis written by the USGS are
 *   public domain. See individual third-party library and package descriptions
 *   for intellectual property information, user agreements, and related
 *   information.
 *
 *   Although Isis has been used by the USGS, no warranty, expressed or
 *   implied, is made by the USGS as to the accuracy and functioning of such
 *   software and related material nor shall the fact of distribution
 *   constitute any such warranty, and no responsibility is assumed by the
 *   USGS in connection therewith.
 *
 *   For additional information, launch
 *   $ISISROOT/doc//documents/Disclaimers/Disclaimers.html
 *   in a browser or see the Privacy &amp; Disclaimers page on the Isis website,
 *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
 *   http://www.usgs.gov/privacy.html.
 */

#include <QWidgetAction>
#include <QList>
#include <QMap>
#include <QSize>

#include "AbstractProjectItemView.h"


class QAction;
class QEvent;
class QToolBar;
class QWidgetAction;



namespace Isis{

class BundleObservation;
class Directory;
class Project;



/**
 * View for displaying BundleOutput results
 *
 * @author 2017-05-01 Tyler Wilson
 *
 * @internal
 *   @history 2017-05-01 Tyler Wilson - Original version.
 */

  class BundleObservationView : public AbstractProjectItemView
  {
    Q_OBJECT
    public:
    BundleObservationView(BundleObservation * BundleObservation, QWidget *parent=0);
    //BundleObservationView(const BundleObservationView &other);
    ~BundleObservationView();



  private:


  protected:

  private slots:






  };

}
#endif
+7 −0
Original line number Diff line number Diff line
ifeq ($(ISISROOT), $(BLANK))
.SILENT:
error:
	echo "Please set ISISROOT";
else
	include $(ISISROOT)/make/isismake.objs
endif
 No newline at end of file