#3541 HoloLens: Create session object

This commit is contained in:
Magne Sjaastad 2018-10-22 11:09:52 +02:00
parent 75174a47e8
commit 24a075499e
4 changed files with 142 additions and 0 deletions

View File

@ -34,6 +34,7 @@
#include "RicImportInputEclipseCaseFeature.h"
#include "RicImportSummaryCasesFeature.h"
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
#include "HoloLensCommands/RicHoloLensSession.h"
#include "Rim2dIntersectionViewCollection.h"
#include "RimCellRangeFilterCollection.h"
@ -995,6 +996,8 @@ bool RiaApplication::saveProjectAs(const QString& fileName)
//--------------------------------------------------------------------------------------------------
void RiaApplication::closeProject()
{
RicHoloLensSession::instance()->terminateSession();
RiuMainWindow* mainWnd = RiuMainWindow::instance();
RiaViewRedrawScheduler::instance()->clearViewsScheduledForUpdate();

View File

@ -8,6 +8,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensTerminateSessionFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.h
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.h
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSession.h
${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.h
@ -24,6 +26,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensTerminateSessionFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.cpp
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.cpp
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSession.cpp
${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.cpp
${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.cpp

View File

@ -0,0 +1,90 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicHoloLensSession.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicHoloLensSession::RicHoloLensSession()
: m_isSessionValid(false)
, m_isDummySession(false)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicHoloLensSession* RicHoloLensSession::instance()
{
static RicHoloLensSession theInstance;
return &theInstance;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicHoloLensSession::createSession(const QString& serverUrl, const QString& sessionName, const QString& sessionPinCode)
{
if (isSessionValid())
{
return false;
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicHoloLensSession::createDummyFileBackedSession()
{
if (isSessionValid())
{
return false;
}
m_isDummySession = true;
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicHoloLensSession::isSessionValid() const
{
if (m_isDummySession) return true;
return m_isSessionValid;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHoloLensSession::updateSessionDataFromView(RimGridView* activeView) {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHoloLensSession::terminateSession()
{
m_isDummySession = false;
m_isSessionValid = false;
}

View File

@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QString>
class RimGridView;
//==================================================================================================
///
//==================================================================================================
class RicHoloLensSession
{
public:
RicHoloLensSession();
static RicHoloLensSession* instance();
bool createSession(const QString& serverUrl, const QString& sessionName, const QString& sessionPinCode);
bool createDummyFileBackedSession();
bool isSessionValid() const;
void updateSessionDataFromView(RimGridView* activeView);
void terminateSession();
private:
bool m_isSessionValid;
bool m_isDummySession;
};