mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3541 HoloLens: Create session object
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include "RicImportInputEclipseCaseFeature.h"
|
#include "RicImportInputEclipseCaseFeature.h"
|
||||||
#include "RicImportSummaryCasesFeature.h"
|
#include "RicImportSummaryCasesFeature.h"
|
||||||
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
|
#include "ExportCommands/RicSnapshotAllViewsToFileFeature.h"
|
||||||
|
#include "HoloLensCommands/RicHoloLensSession.h"
|
||||||
|
|
||||||
#include "Rim2dIntersectionViewCollection.h"
|
#include "Rim2dIntersectionViewCollection.h"
|
||||||
#include "RimCellRangeFilterCollection.h"
|
#include "RimCellRangeFilterCollection.h"
|
||||||
@@ -995,6 +996,8 @@ bool RiaApplication::saveProjectAs(const QString& fileName)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiaApplication::closeProject()
|
void RiaApplication::closeProject()
|
||||||
{
|
{
|
||||||
|
RicHoloLensSession::instance()->terminateSession();
|
||||||
|
|
||||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||||
|
|
||||||
RiaViewRedrawScheduler::instance()->clearViewsScheduledForUpdate();
|
RiaViewRedrawScheduler::instance()->clearViewsScheduledForUpdate();
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionFeature.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensTerminateSessionFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensTerminateSessionFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.h
|
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.h
|
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSession.h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.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}/RicHoloLensTerminateSessionFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSession.cpp
|
||||||
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.cpp
|
${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.cpp
|
${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.cpp
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user