source: experimental/osgVisual-GUI/Sichtsystem-GUI/visualGUI_externalLinkVCL.cpp @ 261

Last change on this file since 261 was 236, checked in by Torben Dannhauer, 14 years ago
File size: 2.4 KB
Line 
1#include "visualGUI_externalLinkVCL.h"
2
3visualGUI_externalLinkVCL::visualGUI_externalLinkVCL(QObject *parent, visualGUI_externalDataContainer* externalDataContainer_ )
4        : visualGUI_externalLink(parent)
5{
6        initialized = false;
7        externalDataContainer = externalDataContainer_;
8}
9
10visualGUI_externalLinkVCL::~visualGUI_externalLinkVCL()
11{
12
13}
14
15bool visualGUI_externalLinkVCL::InitExternalLink()
16{
17        std::cout << "Initializing ExternalLink" << std::endl;
18
19        CVCLIO::GetInstance().LoadProject("osgVisual_out.xml");
20
21        if( !CAMERA_POSITION_LATITUDE.Attach("OSGVISCONTROL_OUT", "SAENGER2_POS_LAT") )
22                return false;
23    if( !CAMERA_POSITION_LONGITUDE.Attach("OSGVISCONTROL_OUT", "SAENGER2_POS_LON") )
24                return false;
25    if( !CAMERA_POSITION_ALTITUDE.Attach("OSGVISCONTROL_OUT", "SAENGER2_POS_ALT") )
26                return false;
27        if( !OBJECT_BANK_PHI.Attach("OSGVISCONTROL_OUT", "SAENGER2_ROT_X") )
28                return false;
29    if( !OBJECT_PITCH_THETA.Attach("OSGVISCONTROL_OUT", "SAENGER2_ROT_Y") )
30                return false;
31    if( !OBJECT_AZIMUTH_PSI.Attach("OSGVISCONTROL_OUT", "SAENGER2_ROT_Z") )
32                return false;
33        if( !TRACKING_ID.Attach("OSGVISCONTROL_OUT", "TRACKING_ID") )
34                return false;
35
36        //if( !IS_VALID.Attach("VISENGINE_CAMERA_CHANNEL_SEND", "IS_VALID") )
37        //      return false;
38       
39        initialized = true;
40
41        return true;
42}
43
44void visualGUI_externalLinkVCL::processExternalLink()
45{
46        if (!initialized)
47                return;
48
49        // Send Data
50        //std::cout << "processing ExternalLink.." << std::endl;
51
52        //qDebug()<<"Lat: " << externalDataContainer->lat;
53        //qDebug()<<"Lon: " << externalDataContainer->lon;
54        //qDebug()<<"Alt: " << externalDataContainer->alt;
55        //qDebug()<<"bank_phi: " << externalDataContainer->bank_phi;
56        //qDebug()<<"pitch_theta: " << externalDataContainer->pitch_theta;
57        //qDebug()<<"azimuth_psi: " << externalDataContainer->azimuth_psi;
58        CAMERA_POSITION_LATITUDE.SetValue( externalDataContainer->lat );
59        CAMERA_POSITION_LONGITUDE.SetValue( externalDataContainer->lon );
60        CAMERA_POSITION_ALTITUDE.SetValue( externalDataContainer->alt );
61        OBJECT_BANK_PHI.SetValue( externalDataContainer->bank_phi );
62        OBJECT_PITCH_THETA.SetValue( externalDataContainer->pitch_theta );
63        OBJECT_AZIMUTH_PSI.SetValue( externalDataContainer->azimuth_psi );
64        TRACKING_ID.SetValue( externalDataContainer->idToTrack );
65
66        IS_VALID.SetValue( 1.23 );      // Transmit anything != Zero
67
68        CVCLIO::GetInstance().DoDataExchange();
69}
Note: See TracBrowser for help on using the repository browser.