FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ORNLSlicer/src/main.cpp at develop · ORNLSlicer/ORNLSlicer · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ORNLSlicer
/
ORNLSlicer
Public
Notifications
You must be signed in to change notification settings
Fork
20
Star
90
Code
Issues
18
Pull requests
5
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ORNLSlicer
/
src
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
122 lines (105 loc) · 4.64 KB
Breadcrumbs
ORNLSlicer
/
src
/
main.cpp
Copy path
File metadata and controls
122 lines (105 loc) · 4.64 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
include
<
QApplication
>
#
include
<
QCommandLineParser
>
#
include
<
QStyleFactory
>
#
include
<
nlohmann/json_fwd.hpp
>
#
include
<
qcontainerfwd.h
>
#
include
<
qcoreapplication.h
>
#
include
<
qdeadlinetimer.h
>
#
include
<
qhash.h
>
#
include
<
qlist.h
>
#
include
<
qnamespace.h
>
#
include
<
qobject.h
>
#
include
<
qsharedpointer.h
>
#
include
<
qtextformat.h
>
#
include
<
qtresource.h
>
#
include
<
qtypes.h
>
#
include
"
configs/settings_base.h
"
#
include
"
console/command_line_processor.h
"
#
include
"
console/main_control.h
"
#
include
"
gcode/gcode_command.h
"
#
include
"
gcode/gcode_meta.h
"
#
include
"
geometry/mesh/closed_mesh.h
"
#
include
"
geometry/mesh/mesh_base.h
"
#
include
"
geometry/mesh/open_mesh.h
"
#
include
"
geometry/segment_base.h
"
#
include
"
ornlslicer/build_info.h
"
#
include
"
part/part.h
"
#
include
"
threading/mesh_loader.h
"
#
include
"
units/unit.h
"
#
include
"
utilities/constants.h
"
#
include
"
utilities/enums.h
"
#
include
"
utilities/qt_json_conversion.h
"
#
include
"
utilities/runtime_diagnostics.h
"
#
include
"
windows/main_window.h
"
int
main
(
int
argc,
char
* argv[]) {
QCoreApplication::setAttribute
(Qt::AA_UseDesktopOpenGL);
//
Register the meta type so we can use queued signals/slots.
qRegisterMetaType<QSharedPointer<
ORNL
::Part>>(
"
QSharedPointer<Part>
"
);
qRegisterMetaType<QSharedPointer<
ORNL
::ClosedMesh>>(
"
QSharedPointer<ClosedMesh>
"
);
qRegisterMetaType<QSharedPointer<
ORNL
::OpenMesh>>(
"
QSharedPointer<OpenMesh>
"
);
qRegisterMetaType<QSharedPointer<
ORNL
::MeshBase>>(
"
QSharedPointer<MeshBase>
"
);
qRegisterMetaType<QVector<QVector<QSharedPointer<
ORNL
::SegmentBase>>>>(
"
QVector<QVector<QSharedPointer<SegmentBase>>>
"
);
qRegisterMetaType<
ORNL
::Distance>(
"
Distance
"
);
qRegisterMetaType<
ORNL
::Velocity>(
"
Velocity
"
);
qRegisterMetaType<
ORNL
::Acceleration>(
"
Acceleration
"
);
qRegisterMetaType<
ORNL
::Angle>(
"
Angle
"
);
qRegisterMetaType<
ORNL
::Time>(
"
Time
"
);
qRegisterMetaType<
ORNL
::Temperature>(
"
Temperature
"
);
qRegisterMetaType<
ORNL
::Voltage>(
"
Voltage
"
);
qRegisterMetaType<
ORNL
::Mass>(
"
Mass
"
);
qRegisterMetaType<QHash<QString, QTextCharFormat>>(
"
QHash<QString,QTextCharFormat>
"
);
qRegisterMetaType<QList<
ORNL
::Time>>(
"
QList<Time>
"
);
qRegisterMetaType<QList<
int
>>(
"
QList<int>
"
);
qRegisterMetaType<QList<
double
>>(
"
QList<double>
"
);
qRegisterMetaType<
ORNL
::StatusUpdateStepType>(
"
StatusUpdateStepType
"
);
qRegisterMetaType<
ORNL
::GcodeCommand>(
"
GcodeCommand
"
);
qRegisterMetaType<
ORNL
::GcodeMeta>(
"
GcodeMeta
"
);
qRegisterMetaType<fifojson>(
"
fifojson
"
);
qRegisterMetaType<nlohmann::json>(
"
nlohmann::json
"
);
qRegisterMetaType<quintptr>(
"
quintptr
"
);
qRegisterMetaType<
ORNL
::MeshLoader::MeshData>(
"
MeshData
"
);
qRegisterMetaType<qintptr>(
"
qintptr
"
);
//
Register the message handler so all output is printed in the main window as well.
QCommandLineParser parser;
if
(argc >
1
) {
QCoreApplication
ca
(argc, argv);
QCoreApplication::setApplicationName
(
"
ornlslicer
"
);
QCoreApplication::setOrganizationName
(
"
ornl
"
);
QCoreApplication::setApplicationVersion
(
QString::fromUtf8
(
ORNL
::BuildInfo::Version));
QSharedPointer<
ORNL
::SettingsBase> options = QSharedPointer<
ORNL
::SettingsBase>::
create
();
ORNL
::CommandLineConverter clc;
clc.
setupCommandLineParser
(parser);
parser.
process
(ca);
bool
setupResult = clc.
convertOptions
(parser, options);
if
(setupResult) {
ORNL::Diagnostics::logRuntimeSummary
(
QStringLiteral
(
"
cli
"
));
ORNL
::MainControl* control =
new
ORNL::MainControl
(options);
QObject::connect
(control, &
ORNL
::MainControl::finished, &ca, &QCoreApplication::quit, Qt::QueuedConnection);
control->
run
();
int
ret = ca.
exec
();
delete
control;
return
ret;
}
return
parser.
isSet
(
ORNL
::Constants::ConsoleOptionStrings::
kVersion
) ?
0
:
1
;
}
else
{
QApplication
a
(argc, argv);
QApplication::setStyle
(
QStyleFactory::create
(
"
fusion
"
));
QApplication::setApplicationName
(
"
ornlslicer
"
);
QApplication::setOrganizationName
(
"
ornl
"
);
QApplication::setApplicationVersion
(
QString::fromUtf8
(
ORNL
::BuildInfo::Version));
QApplication::setApplicationDisplayName
(
QString
(
"
ORNLSlicer-
"
) +
QString::fromUtf8
(
ORNL
::BuildInfo::Version));
ORNL::Diagnostics::logRuntimeSummary
(
QStringLiteral
(
"
gui
"
));
Q_INIT_RESOURCE
(icons);
Q_INIT_RESOURCE
(shaders);
Q_INIT_RESOURCE
(styles);
Q_INIT_RESOURCE
(configs);
//
Get the instance of the main window and show it.
ORNL
::MainWindow* w =
ORNL::MainWindow::getInstance
();
w->
show
();
int
ret = a.
exec
();
delete
w;
return
ret;
}
}
Back
|
FazBrowse Home
|
New Git URL