#include <QApplication>
#include <QX11EmbedWidget>
#include <QWidget>
#include <QX11Info>
#include <QPaintDevice>
#include <QGraphicsView>
#include <QMainWindow>
/* Standard headers. */
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
/* X headers. */
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>
#include <X11/Core.h>
#include <X11/Xaw/Box.h>
#include <X11/Xaw/Command.h>
#include <X11/Xaw/Form.h>
#include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/Toggle.h>
#include <X11/Shell.h>
/* SPx headers. */
#include "SPx.h"
/*Class header */
#include "Radar.h" // Class for creating QMainWindow
static int UpdateTimerMsecs = 50;
#define START_VIEW_X 0
#define START_VIEW_Y 0
#define START_VIEW_W 200000
#define START_VIEW_H 200000
static void sigIntHandler(int sig)
{
printf("SIGINT received - exiting application.\n");
exit(EXIT_SUCCESS);
}
int main(int argc, char *argv[])
{
Display *XDisplay = 0;
int c;
Radar *TopLevel= new Radar;
Window win= TopLevel->winId();
qDebug("Window ID of win is %x",win);
//QGraphicsView *TopLevel;
//QWidget *TopLevel= new QWidget;
//QPaintDevice *TopLevel;
Display *display=TopLevel->x11Info().display();
//Display *display=QX11Info::display();
SPxScDestDisplayX11 *scDestX11;
SPxScSourceLocal *ScanConverter = NULL;
double Vx = START_VIEW_X;
double Vy = START_VIEW_Y;
double Vw = START_VIEW_W;
double Vh = START_VIEW_H;
signal(SIGINT, sigIntHandler);
if( SPxInit() != SPX_NO_ERROR )
{
printf("Failed to initialise SPx.\n");
exit(-1);
}
XDisplay = display; //x11Info().
qDebug("X Display %x",XDisplay);
scDestX11 = new SPxScDestDisplayX11();
scDestX11->UseDisplay(TopLevel->x11Info().display());
scDestX11->Create(0, 1600, 1200, 0, 0, 0);
scDestX11->SetUpdateInterval(UpdateTimerMsecs);
SPxRIB *rib = new SPxRIB(1024 * 1024, NULL);
SPxPIM *pim = new SPxPIM(rib, 2048, 2048, SPX_PIM_RAN_PEAK, SPX_PIM_AZI_PEAK, SPX_PIM_OUTPUT(1));
ScanConverter = new SPxScSourceLocal(scDestX11);
ScanConverter->SetWinGeom(10,10,500,500);
ScanConverter->ShowRadar(0,1);
ScanConverter->SetFade(SPX_RADAR_FADE_REAL_TIME,200);
new SPxRunProcess(SPxProScanConv, NULL, pim, ScanConverter);
SPxScFollowX11 *WinFollow = new SPxScFollowX11(ScanConverter,TopLevel->x11Info().display(),win,0); //Having doubts over this
WinFollow->AddSC(ScanConverter);
WinFollow->CheckUnderTimer(250);
SPxTestGenerator *testGen = new SPxTestGenerator(rib, 2048, 2.0,1000,33, 0);
testGen->Enable(TRUE);
TopLevel->show();
return app.exec();
}
#include <QApplication>
#include <QX11EmbedWidget>
#include <QWidget>
#include <QX11Info>
#include <QPaintDevice>
#include <QGraphicsView>
#include <QMainWindow>
/* Standard headers. */
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
/* X headers. */
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>
#include <X11/Core.h>
#include <X11/Xaw/Box.h>
#include <X11/Xaw/Command.h>
#include <X11/Xaw/Form.h>
#include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/Toggle.h>
#include <X11/Shell.h>
/* SPx headers. */
#include "SPx.h"
/*Class header */
#include "Radar.h" // Class for creating QMainWindow
static int UpdateTimerMsecs = 50;
#define START_VIEW_X 0
#define START_VIEW_Y 0
#define START_VIEW_W 200000
#define START_VIEW_H 200000
static void sigIntHandler(int sig)
{
printf("SIGINT received - exiting application.\n");
exit(EXIT_SUCCESS);
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Display *XDisplay = 0;
int c;
Radar *TopLevel= new Radar;
Window win= TopLevel->winId();
qDebug("Window ID of win is %x",win);
//QGraphicsView *TopLevel;
//QWidget *TopLevel= new QWidget;
//QPaintDevice *TopLevel;
Display *display=TopLevel->x11Info().display();
//Display *display=QX11Info::display();
SPxScDestDisplayX11 *scDestX11;
SPxScSourceLocal *ScanConverter = NULL;
double Vx = START_VIEW_X;
double Vy = START_VIEW_Y;
double Vw = START_VIEW_W;
double Vh = START_VIEW_H;
signal(SIGINT, sigIntHandler);
if( SPxInit() != SPX_NO_ERROR )
{
printf("Failed to initialise SPx.\n");
exit(-1);
}
XDisplay = display; //x11Info().
qDebug("X Display %x",XDisplay);
scDestX11 = new SPxScDestDisplayX11();
scDestX11->UseDisplay(TopLevel->x11Info().display());
scDestX11->Create(0, 1600, 1200, 0, 0, 0);
scDestX11->SetUpdateInterval(UpdateTimerMsecs);
SPxRIB *rib = new SPxRIB(1024 * 1024, NULL);
SPxPIM *pim = new SPxPIM(rib, 2048, 2048, SPX_PIM_RAN_PEAK, SPX_PIM_AZI_PEAK, SPX_PIM_OUTPUT(1));
ScanConverter = new SPxScSourceLocal(scDestX11);
ScanConverter->SetWinGeom(10,10,500,500);
ScanConverter->ShowRadar(0,1);
ScanConverter->SetFade(SPX_RADAR_FADE_REAL_TIME,200);
new SPxRunProcess(SPxProScanConv, NULL, pim, ScanConverter);
SPxScFollowX11 *WinFollow = new SPxScFollowX11(ScanConverter,TopLevel->x11Info().display(),win,0); //Having doubts over this
WinFollow->AddSC(ScanConverter);
WinFollow->CheckUnderTimer(250);
SPxTestGenerator *testGen = new SPxTestGenerator(rib, 2048, 2.0,1000,33, 0);
testGen->Enable(TRUE);
TopLevel->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks