Jump to content
The simFlight Network Forums

Search the Community

Showing results for tags 'qt'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Product Support Forums
    • FSUIPC Support Pete Dowson Modules
    • MyTraffic Support Forum
    • FeelThere Support Forums
    • FS Commander Support Forum
    • Flying W Simulation
    • AConstable Traffic Sounds Support Forum
    • Fabio Merlo Products Support Forum
    • Elite-Air Studio Support Forum
    • Nikola Jovanovic Support Forum
    • Intrasystems Support Forum
    • FScene Support Forum
    • Taburet & DanVFR Support Forum
    • Environ Scenery
  • simFlight DE
  • FS MAGAZIN (DE)
  • simRussia
  • FSUIPC Client DLL for .NET

Calendars

  • Community Calendar

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 3 results

  1. I am getting some problems in my Main.cpp file, I have attached my whole fime, if someone could help me out, it would be really appreciated. Here's mu main.cpp file : #include "mainwindow.h" #include <QApplication> #include <QDebug> #include <windows.h> #include <conio.h> #include <stdio.h> #include <string.h> #include <math.h> // Universal data #include "universal.h" // FS interface #include "FSinterface.h" #include "FSUIPC_User.h" // for setting the timer #include "timer.h" // for Serial RS232 #include "tserial.h" #include"universal.h" #include "types.h" const char *pszErrors[] = { "Okay", "Attempt to Open when already Open", "Cannot link to FSUIPC or WideClient", "Failed to Register common message with Windows", "Failed to create Atom for mapping filename", "Failed to create a file mapping object", "Failed to open a view to the file map", "Incorrect version of FSUIPC, or not FSUIPC", "Sim is not version requested", "Call cannot execute, link not Open", "Call cannot execute: no requests accumulated", "IPC timed out all retries", "IPC sendmessage failed all retries", "IPC request contains bad data", "Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC", "Read or Write request cannot be added, memory for Process is full", }; char buffer_fsupc[25000]; char buffer_reception[12]; char bufftx[40]; int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; double Attitude[NROT]; FSAttitudeType FSAtt; DWORD dwResult;// a pointer to receive an error number if the operation fails. Tserial *com; // Serial declaration int SampleTime; // Sample Time in ms Timer timer; int capsam=0; int pousseeL, pousseeR; int pousseeOldL = 0, pousseeOldR = 0; char car; int vret,index=0; int oktrame=0; int pousseeTmp; char x[]=" \\\\.\\com3"; if(FSUIPC_Open(SIM_ANY,&dwResult)){ // Declaration des variables locales const char *pFS[] = { "FS98", "FS2000", "CFS2", "CFS1", "Fly!", "FS2002", "FS2004" }; // Change made 060603 // Okay, we're linked, and already the FSUIPC_Open has had an initial // exchange with FSUIPC to get its version number and to differentiate // between FS's. printf ("CapSim: Link established to FSUIPC\n") ; // printf ("Sim is %s,FSUIPC Version = %c.%c%c%c%c\r%s\n",(FSUIPC_FS_Version && (FSUIPC_FS_Version <= 7)) ? pFS[FSUIPC_FS_Version - 1] : "Unknown FS",'0' + (0x0f & (FSUIPC_Version >> 28)),'0' + (0x0f & (FSUIPC_Version >> 24)),'0' + (0x0f & (FSUIPC_Version >> 20)),'0' + (0x0f & (FSUIPC_Version >> 16)),(FSUIPC_Version & 0xffff) ? 'a' + (FSUIPC_Version & 0xff) - 1 : ' '); /* ///////////////////////////// une autre maniere de faire ///////////////////////////// */ // Timer //printf("\nEnter the Sample Time in miliseconde\n"); //scanf("%d",&SampleTime); SampleTime=100; // RS232 com=new Tserial(); if( com!=0 ) com->connect (x,9600,spNONE); // com Initialisation else printf("Error Setting COM"); }else{ //Openninig FSUIPC failed printf ("CapSim: Failed to open link to FSUIPC:%s\n", pszErrors[dwResult]) ; FSUIPC_Close(); // Closing when it wasn't open is okay, so this is safe here // com->disconnect(); // Closing the port return 0; } while(true) { Sleep(40); //if(timer.elasped((clock_t)SampleTime)) if(1){ /* -------------------------------------- Sending Data -------------------------------------- */ // Read from FS data structure FSUIPC_Read(0x000,25000,buffer_fsupc,&dwResult); FSUIPC_Process(&dwResult); // Process all the request(s) // sprintf(bufftx,"%4u %3u %6u %3u",*((unsigned int*)(buffer_fsupc+0x2BC))/128,(unsigned int)(*((double*)(buffer_fsupc+0x2CC))), // (unsigned int)floor((double)(((unsigned int)*((__int64 *)(buffer_fsupc+0x570))*(double)3.2808)/((double)65536.)+0.5)),0); /*(unsigned int)floor(((unsigned int)*((unsigned short int*)(buffer_fsupc+0xcc))*360.)/65536.+0.5),(unsigned int)*((unsigned short int*)(buffer_fsupc+0xe2)), (unsigned int)floor((double)(((unsigned int)*((unsigned int*)(buffer_fsupc+0xd4))*3.2808)/65536.+0.5)));*/ /* sprintf(bufftx,"%6u %01u %01u\n", *((unsigned short*)(buffer_fsupc+0x5682))&0xffff, *((unsigned char*)(buffer_fsupc+ 0x568A))&0xff, *((unsigned char*)(buffer_fsupc+ 0x568E))&0xff); printf("%s\n",bufftx);*/ if(_kbhit()){ car=_getch(); switch(car) { case ui->Alt : printf("To change Altitude turn the Dial"); capsam= (capsam*(65536./3.2808)); *((unsigned int*)buffer_fsupc)= capsam; FSUIPC_Write(0x7D4,4,buffer_fsupc,&dwResult); FSUIPC_Process(&dwResult); break; case ui-> Spd: printf("To change Speed turn the Dial:"); scanf("%u",&capsam); capsam = (capsam*16384)/100; *((unsigned int*)buffer_fsupc)= (unsigned short int) capsam; FSUIPC_Write(0x88C,2,buffer_fsupc,&dwResult); FSUIPC_Process(&dwResult); break; case ui-> Hdg : printf("To Change Heading , turn the Dial"); scanf("%u",&capsam); capsam= (capsam*65536)/36; capsam += ((capsam%10)>=5 ? 10 : 0); capsam= capsam/10; *((unsigned short int*)buffer_fsupc)= (unsigned short int )capsam; FSUIPC_Write(0x7CC,2,buffer_fsupc,&dwResult); FSUIPC_Process(&dwResult); // Process all th break; }} w.show(); return a.exec(); } } } The errors I am getting are these: Tserial: undeclared variable. line 59 com : undeclared variable. line 91,93, syntax error; identifier ' Tserial'. Ui undeclared variable., Alt undeclared variable. mainwindow.cpp main.cpp fsinterface.cpp
  2. Hello, I'm new with QT and i can't connect to fs 2004 using QT 5.0.1 and MinGW/ VC++ 2015. It works fine with Visual Studio 2017 and code Blocks (MinGW 32) !! There is the errors that i have : https://ibb.co/dMQSmS. Thank you !
  3. Good morning! Since some days I am tryingto read out some values from the FS2004 via FSUIPC. I am using the QT Creator to show my result in a small and simple form. I think my problem is an easy one. Here is my code: (It's a SLOT function connected with a pushButton) void MainWindow::connectFSUIPC(){ DWORD dwResult; if(FSUIPC_Open(SIM_ANY, &dwResult)){ char *chTime; if(FSUIPC_Read(0x0238, 1, &chTime, &dwResult)){ !FSUIPC_Process(&dwResult); QString str; str = *chTime; ui->labelFSUIPC->setText(str); } } } [/CODE] The connection and read out from the FS is successfully. I've tested it. But the variable str is empty. My label shows nothing. Maybe I made a conversion mistake? Thank you for your help! Michael
×

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.