0 Members and 1 Guest are viewing this topic.
Je termine en remettant des photos qui se sont enlevées des posts précédents (merci Hosting Pics ).
D'autres nouvelles très bientôt les gars. Déjà de très très nombreuses heures de travail que l'on ne compte pas. Enivrant !A+
int numButton, newState; if (NASSPC_getButtonState(&numButton, &newState)) { if (numButton == 0) { EMSFunctionSwitch.SetState(newState); } if (numButton == 1) { EMSModeSwitch.SetState(newState); } if (numButton == 2) { GTASwitch.Unguard(); GTASwitch.SetState(newState); } if (numButton == 3) { int event; int clicked_x = 10; int clicked_y; switch (newState) { case 0: event = PANEL_MOUSE_RBUP; break; case 1: event = PANEL_MOUSE_LBPRESSED; clicked_y = 25; case 2: event = PANEL_MOUSE_RBPRESSED; clicked_y = 25; case 3: event = PANEL_MOUSE_LBPRESSED; clicked_y = 50; case 4: event = PANEL_MOUSE_RBPRESSED; clicked_y = 50; } EMSDvSetSwitch.CheckMouseClick(event, clicked_x, clicked_y); } } //écriture des données en sortie dans un fichier texte std::ofstream out_fHandle; out_fHandle.open("NASSPC_OUT.txt", std::ios::app); // DeltaV out_fHandle << "EMS Dv Display : " << EMSDvDisplay.GetState() << endl; // à diviser par 10 // Scroller. Et le bug ??? out_fHandle << "EMS Scroll Display : " << ems.GetScrollOffset()+EMSScrollDisplay.GetState()-65 << endl; // en pixels out_fHandle << "SPS Thrust light : " << ems.SPSThrustLight() << endl; // led droite out_fHandle << ".05G light : " << ems.pt05GLight() << endl; // led gauche //Truc en bas à gauche out_fHandle << "EMS RSI Rotation : " << ems.GetRSIRotation() << endl; // radians out_fHandle << "EMS Lift Vect Light : " << ems.LiftVectLight() << endl; // -1, 0, 1 // -1 est la led du bas, 1 celle du haut out_fHandle.close();
bool NASSPC_getButtonState(int *numButton, int *newState){ CSerial serial; if (serial.Open(6, 9600)) { char* lpBuffer = new char[5]; int nBytesRead = serial.ReadData(lpBuffer, 5); serial.Close(); if ((nBytesRead > 0) && (lpBuffer[0] == '<')) { *numButton = (int)lpBuffer[1]; *newState = (int)lpBuffer[3];#ifdef MAX_DEBUG_MODE out.open("NASSPC_log.txt", std::ios::app); out << "serial received : " << *numButton << ";" << *newState << endl; out.close();#endif delete[]lpBuffer; return true; } } return false;}