Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
main.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7#include <QFileInfo>
8#include <QApplication>
9#include <QtNetwork/QHostInfo>
10
11#include <QHyoda.h>
12#include <QOpenGLFunctions>
13
14// ****************************************************************************
15// * main: on informe en premier la partie Hyoda d'Arcane
16// * afin qu'elle se connecte dès le début
17// * Ceci se fait en settant les variables ARCANE_HYODA,
18// * ARCANE_HYODA_ADRS & ARCANE_HYODA_PORT
19// ****************************************************************************
20int main(int argc, char *argv[]){
21 QApplication qt(argc,argv);
22 QString localHostName=QHostInfo::localHostName();
23 qputenv("ARCANE_HYODA", QByteArray());
24 qputenv("ARCANE_HYODA_HOST",localHostName.toLocal8Bit());
25 QHostInfo info=QHostInfo::fromName(localHostName);
26 if (!info.addresses().isEmpty()){
27 QString adrs=QString("%1").arg(info.addresses().first().toIPv4Address());
28 //qDebug() << "[main] ARCANE_HYODA_ADRS:"<<adrs;
29 qputenv("ARCANE_HYODA_ADRS", adrs.toLocal8Bit());
30 }else qFatal("Empty list of IP addresses associated with hostName()");
31 //qDebug() << "[main] ARCANE_HYODA_PORT:"<<3889;
32 qputenv("ARCANE_HYODA_PORT", QString("%1").arg(3889).toLocal8Bit());
33
34 QHyoda hyoda(argc,argv);
35 return qt.exec();
36
37}