Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
visimpl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SimVisSuite
visimpl
Commits
01510deb
Commit
01510deb
authored
3 years ago
by
Felix de las Pozas
Browse files
Options
Downloads
Plain Diff
Merge branch 'load-groups-stackviz' into 'master'
Load groups stackviz See merge request nsviz/visimpl!83
parents
564bdca1
d6978ed7
No related branches found
Branches containing commit
Tags
1.7.4
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
stackviz/MainWindow.cpp
+117
-0
117 additions, 0 deletions
stackviz/MainWindow.cpp
stackviz/MainWindow.h
+2
-0
2 additions, 0 deletions
stackviz/MainWindow.h
stackviz/stackviz.ui
+18
-1
18 additions, 1 deletion
stackviz/stackviz.ui
with
138 additions
and
2 deletions
CMakeLists.txt
+
1
−
1
View file @
01510deb
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
cmake_minimum_required
(
VERSION 3.1 FATAL_ERROR
)
cmake_minimum_required
(
VERSION 3.1 FATAL_ERROR
)
# visimpl project and version
# visimpl project and version
project
(
visimpl VERSION 1.7.
3
)
project
(
visimpl VERSION 1.7.
4
)
set
(
visimpl_VERSION_ABI 6
)
set
(
visimpl_VERSION_ABI 6
)
SET
(
VISIMPL_LICENSE
"GPL"
)
SET
(
VISIMPL_LICENSE
"GPL"
)
...
...
This diff is collapsed.
Click to expand it.
stackviz/MainWindow.cpp
+
117
−
0
View file @
01510deb
...
@@ -50,6 +50,9 @@
...
@@ -50,6 +50,9 @@
#include
<QShortcut>
#include
<QShortcut>
#include
<QDateTime>
#include
<QDateTime>
#include
<QtGlobal>
#include
<QtGlobal>
#include
<QJsonArray>
#include
<QJsonDocument>
#include
<QJsonObject>
#include
<boost/bind.hpp>
#include
<boost/bind.hpp>
...
@@ -162,11 +165,15 @@ void MainWindow::init( const std::string &session )
...
@@ -162,11 +165,15 @@ void MainWindow::init( const std::string &session )
connect
(
_ui
->
actionOpenSubsetEventsFile
,
SIGNAL
(
triggered
(
void
)),
connect
(
_ui
->
actionOpenSubsetEventsFile
,
SIGNAL
(
triggered
(
void
)),
this
,
SLOT
(
openSubsetEventsFileThroughDialog
(
void
)));
this
,
SLOT
(
openSubsetEventsFileThroughDialog
(
void
)));
connect
(
_ui
->
actionOpenGroupsFile
,
SIGNAL
(
triggered
(
void
)),
this
,
SLOT
(
openGroupsThroughDialog
(
void
)));
connect
(
_ui
->
actionCloseData
,
SIGNAL
(
triggered
(
bool
)),
connect
(
_ui
->
actionCloseData
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
closeData
()));
this
,
SLOT
(
closeData
()));
_ui
->
actionOpenSubsetEventsFile
->
setEnabled
(
false
);
_ui
->
actionOpenSubsetEventsFile
->
setEnabled
(
false
);
_ui
->
actionOpenGroupsFile
->
setEnabled
(
false
);
initPlaybackDock
(
);
initPlaybackDock
(
);
...
@@ -1049,6 +1056,7 @@ void MainWindow::updateUIonOpen(const std::string &eventsFile)
...
@@ -1049,6 +1056,7 @@ void MainWindow::updateUIonOpen(const std::string &eventsFile)
_ui
->
actionShowDataManager
->
setEnabled
(
true
);
_ui
->
actionShowDataManager
->
setEnabled
(
true
);
_ui
->
actionOpenSubsetEventsFile
->
setEnabled
(
true
);
_ui
->
actionOpenSubsetEventsFile
->
setEnabled
(
true
);
_ui
->
actionOpenGroupsFile
->
setEnabled
(
true
);
_ui
->
actionCloseData
->
setEnabled
(
true
);
_ui
->
actionCloseData
->
setEnabled
(
true
);
_dockSimulation
->
setEnabled
(
true
);
_dockSimulation
->
setEnabled
(
true
);
...
@@ -1459,3 +1467,112 @@ void stackviz::MainWindow::loadRESTData(const simil::LoaderRestData::Configurati
...
@@ -1459,3 +1467,112 @@ void stackviz::MainWindow::loadRESTData(const simil::LoaderRestData::Configurati
m_loader
->
start
(
);
m_loader
->
start
(
);
}
}
#endif
#endif
void
MainWindow
::
openGroupsThroughDialog
()
{
const
auto
title
=
tr
(
"Load Groups"
);
const
QString
groupsFilename
=
QFileDialog
::
getOpenFileName
(
this
,
title
,
_lastOpenedGroupsFileName
,
tr
(
"Json files (*.json)"
),
nullptr
,
QFileDialog
::
ReadOnly
|
QFileDialog
::
DontUseNativeDialog
);
if
(
groupsFilename
.
isEmpty
())
return
;
QFile
file
{
groupsFilename
};
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
))
{
const
auto
message
=
tr
(
"Couldn't open file %1"
).
arg
(
groupsFilename
);
QMessageBox
msgbox
(
this
);
msgbox
.
setWindowTitle
(
title
);
msgbox
.
setIcon
(
QMessageBox
::
Icon
::
Critical
);
msgbox
.
setText
(
message
);
msgbox
.
setWindowIcon
(
QIcon
(
":/visimpl.png"
));
msgbox
.
setStandardButtons
(
QMessageBox
::
Ok
);
msgbox
.
exec
();
return
;
}
const
auto
contents
=
file
.
readAll
();
QJsonParseError
jsonError
;
const
auto
jsonDoc
=
QJsonDocument
::
fromJson
(
contents
,
&
jsonError
);
if
(
jsonDoc
.
isNull
()
||
!
jsonDoc
.
isObject
())
{
const
auto
message
=
tr
(
"Couldn't read the contents of %1 or parsing error."
).
arg
(
groupsFilename
);
QMessageBox
msgbox
{
this
};
msgbox
.
setWindowTitle
(
title
);
msgbox
.
setIcon
(
QMessageBox
::
Icon
::
Critical
);
msgbox
.
setText
(
message
);
msgbox
.
setWindowIcon
(
QIcon
(
":/visimpl.png"
));
msgbox
.
setStandardButtons
(
QMessageBox
::
Ok
);
msgbox
.
setDetailedText
(
jsonError
.
errorString
());
msgbox
.
exec
();
return
;
}
const
auto
jsonObj
=
jsonDoc
.
object
();
if
(
jsonObj
.
isEmpty
())
{
const
auto
message
=
tr
(
"Error parsing the contents of %1."
).
arg
(
groupsFilename
);
QMessageBox
msgbox
{
this
};
msgbox
.
setWindowTitle
(
title
);
msgbox
.
setIcon
(
QMessageBox
::
Icon
::
Critical
);
msgbox
.
setText
(
message
);
msgbox
.
setWindowIcon
(
QIcon
(
":/visimpl.png"
));
msgbox
.
setStandardButtons
(
QMessageBox
::
Ok
);
msgbox
.
exec
();
return
;
}
QApplication
::
setOverrideCursor
(
Qt
::
WaitCursor
);
const
auto
jsonGroups
=
jsonObj
.
value
(
"groups"
).
toArray
();
for
(
const
auto
group
:
jsonGroups
)
{
const
auto
o
=
group
.
toObject
();
const
auto
name
=
o
.
value
(
"name"
).
toString
();
const
auto
gidsStrings
=
o
.
value
(
"gids"
).
toString
().
split
(
","
);
visimpl
::
GIDUSet
gids
;
auto
addGids
=
[
&
gids
](
const
QString
s
)
{
if
(
s
.
contains
(
":"
))
{
auto
limits
=
s
.
split
(
":"
);
for
(
unsigned
int
id
=
limits
.
first
().
toUInt
();
id
<=
limits
.
last
().
toUInt
();
++
id
)
gids
.
insert
(
id
);
}
else
{
gids
.
insert
(
s
.
toUInt
());
}
};
std
::
for_each
(
gidsStrings
.
cbegin
(),
gidsStrings
.
cend
(),
addGids
);
visimpl
::
Selection
selection
;
selection
.
gids
=
gids
;
selection
.
name
=
name
.
toStdString
();
#ifdef VISIMPL_USE_ZEROEQ
_summary
->
AddNewHistogram
(
selection
,
false
);
#else
_summary
->
AddNewHistogram
(
selection
);
#endif
}
_summary
->
UpdateHistograms
();
if
(
_displayManager
)
{
_displayManager
->
dirtyHistograms
();
_displayManager
->
refresh
();
}
QApplication
::
restoreOverrideCursor
();
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
stackviz/MainWindow.h
+
2
−
0
View file @
01510deb
...
@@ -94,6 +94,7 @@ namespace stackviz
...
@@ -94,6 +94,7 @@ namespace stackviz
void
openH5FilesThroughDialog
(
void
);
void
openH5FilesThroughDialog
(
void
);
void
openSubsetEventsFileThroughDialog
(
void
);
void
openSubsetEventsFileThroughDialog
(
void
);
void
openRESTThroughDialog
();
void
openRESTThroughDialog
();
void
openGroupsThroughDialog
();
void
aboutDialog
(
void
);
void
aboutDialog
(
void
);
void
togglePlaybackDock
(
void
);
void
togglePlaybackDock
(
void
);
...
@@ -167,6 +168,7 @@ namespace stackviz
...
@@ -167,6 +168,7 @@ namespace stackviz
QString
_lastOpenedFileNamePath
;
QString
_lastOpenedFileNamePath
;
QString
_lastOpenedSubsetsFileName
;
QString
_lastOpenedSubsetsFileName
;
QString
_lastOpenedGroupsFileName
;
simil
::
TSimulationType
_simulationType
;
simil
::
TSimulationType
_simulationType
;
...
...
This diff is collapsed.
Click to expand it.
stackviz/stackviz.ui
+
18
−
1
View file @
01510deb
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
1280
</width>
<width>
1280
</width>
<height>
2
2
</height>
<height>
2
4
</height>
</rect>
</rect>
</property>
</property>
<widget
class=
"QMenu"
name=
"menuFile"
>
<widget
class=
"QMenu"
name=
"menuFile"
>
...
@@ -38,6 +38,8 @@
...
@@ -38,6 +38,8 @@
<addaction
name=
"separator"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionOpenSubsetEventsFile"
/>
<addaction
name=
"actionOpenSubsetEventsFile"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionOpenGroupsFile"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionCloseData"
/>
<addaction
name=
"actionCloseData"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionQuit"
/>
<addaction
name=
"actionQuit"
/>
...
@@ -340,6 +342,21 @@
...
@@ -340,6 +342,21 @@
<string>
Ctrl+Q
</string>
<string>
Ctrl+Q
</string>
</property>
</property>
</action>
</action>
<action
name=
"actionOpenGroupsFile"
>
<property
name=
"icon"
>
<iconset
resource=
"resources.qrc"
>
<normaloff>
:/icons/folder-doc.svg
</normaloff>
:/icons/folder-doc.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Open Groups file...
</string>
</property>
<property
name=
"toolTip"
>
<string>
Open groups as histograms
</string>
</property>
<property
name=
"shortcut"
>
<string>
Ctrl+G
</string>
</property>
</action>
</widget>
</widget>
<resources>
<resources>
<include
location=
"resources.qrc"
/>
<include
location=
"resources.qrc"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment