YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3
* SPDX-License-Identifier: LGPL-2.1-or-later
4
*/
5
6
#include "
include/mainwindow.h
"
7
#include <QApplication>
8
9
#include <yarp/dataplayer/YarpDataplayer.h>
10
11
#if defined(_WIN32)
12
#pragma warning (disable : 4099)
13
#pragma warning (disable : 4250)
14
#pragma warning (disable : 4520)
15
#endif
16
17
#include <iostream>
18
#include <
yarp/os/ResourceFinder.h
>
19
#include <
yarp/os/Network.h
>
20
#include <QtGlobal>
21
22
#include <
yarp/os/Os.h
>
23
24
#if defined(_WIN32)
25
#include <windows.h>
26
#else
27
#include <cerrno>
28
#include <sys/types.h>
29
#include <csignal>
30
#endif
31
32
using namespace
yarp::os
;
33
34
int
main
(
int
argc,
char
*argv[])
35
{
36
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
37
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
38
#else
39
qputenv
(
"QT_DEVICE_PIXEL_RATIO"
,
QByteArray
(
"auto"
));
40
#endif
41
setEnergySavingModeState
(
false
);
42
QApplication
a(argc, argv);
43
44
Network
yarp
;
45
if
(!
yarp
.checkNetwork()){
46
fprintf
(
stderr
,
"Sorry YARP network does not seem to be available, is the yarp server available?\n"
);
47
return
1;
48
}
49
50
yarp::os::ResourceFinder
rf;
51
rf.
setDefaultConfigFile
(
"config.ini"
);
//overridden by --from parameter
52
rf.
setDefaultContext
(
"yarpdataplayer"
);
//overridden by --context parameter
53
rf.
configure
( argc, argv );
54
55
MainWindow
w(rf);
56
57
if
(rf.
check
(
"hidden"
)){
58
w.hide();
59
}
else
{
60
w.show();
61
}
62
63
int
returnFlag
= (a.exec()!=0?1:0);
64
setEnergySavingModeState
(
true
);
65
return
returnFlag
;
66
}
Network.h
Os.h
ResourceFinder.h
MainWindow
MainWindow class.
Definition
display.h:22
yarp::os::BufferedPort
A mini-server for performing network communication in the background.
Definition
BufferedPort.h:60
yarp::os::Network
Utilities for manipulating the YARP network, including initialization and shutdown.
Definition
Network.h:706
yarp::os::ResourceFinder
Helper class for finding config files and other external resources.
Definition
ResourceFinder.h:29
yarp::os::ResourceFinder::check
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Definition
ResourceFinder.cpp:903
yarp::os::ResourceFinder::setDefaultContext
bool setDefaultContext(const std::string &contextName)
Sets the context for the current ResourceFinder object.
Definition
ResourceFinder.h:60
yarp::os::ResourceFinder::configure
bool configure(int argc, char *argv[], bool skipFirstArgument=true)
Sets up the ResourceFinder.
Definition
ResourceFinder.cpp:786
yarp::os::ResourceFinder::setDefaultConfigFile
bool setDefaultConfigFile(const std::string &fname)
Provide a default value for the configuration file (can be overridden from command line with the –fro...
Definition
ResourceFinder.h:103
main
int main(int argc, char *argv[])
Definition
main.cpp:34
yarp::os
An interface to the operating system, including Port based communication.
Definition
AbstractCarrier.h:13
yarp::os::setEnergySavingModeState
void setEnergySavingModeState(bool enabled)
Toggle the OS energy saving feature.
Definition
Os.cpp:110
yarp
The main, catch-all namespace for YARP.
Definition
dirs.h:16
mainwindow.h
YARP
3.11.100+20250603.4+gitaa77f8b5c
src
guis
yarpdataplayer
src
main.cpp
Generated on Wed Jun 4 2025 02:40:10 for YARP by
1.9.8