Ajout des derniers changements dans le changelog
Cette révision appartient à :
@@ -15,6 +15,14 @@ Licence GPL v2 (see )
|
|||||||
|
|
||||||
LAST CHANGES
|
LAST CHANGES
|
||||||
|
|
||||||
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
2026/02/01 ericb
|
||||||
|
|
||||||
|
Correction de la modulation M-ASK : maintenant, les amplitudes respectent la règle Ak = 2k-M-1
|
||||||
|
Suppression de la double initiaisation de la SDL.
|
||||||
|
Ajout de la fenêtre modale qui servira de modèle pour la documentation du cours (consultable en runtime)
|
||||||
|
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
2026/01/25 ericb
|
2026/01/25 ericb
|
||||||
|
|
||||||
|
|||||||
1
Makefile
1
Makefile
@@ -50,6 +50,7 @@ SOURCES = \
|
|||||||
${SOURCES_DIR}/modulations.cxx \
|
${SOURCES_DIR}/modulations.cxx \
|
||||||
${SOURCES_DIR}/imgui_utils.cxx \
|
${SOURCES_DIR}/imgui_utils.cxx \
|
||||||
${SOURCES_DIR}/application.cxx \
|
${SOURCES_DIR}/application.cxx \
|
||||||
|
${SOURCES_DIR}/cours_popup.cxx \
|
||||||
${SOURCES_DIR}/engine.cxx \
|
${SOURCES_DIR}/engine.cxx \
|
||||||
${SOURCES_DIR}/main.cxx
|
${SOURCES_DIR}/main.cxx
|
||||||
|
|
||||||
|
|||||||
7
inc/cours_popup.h
Fichier normal
7
inc/cours_popup.h
Fichier normal
@@ -0,0 +1,7 @@
|
|||||||
|
#ifndef COURS_POPUP_H
|
||||||
|
#define COURS_POPUP_H
|
||||||
|
#include "modulations.h"
|
||||||
|
|
||||||
|
void afficher_cours_modal_popup(DigitalModulationType);
|
||||||
|
|
||||||
|
#endif
|
||||||
70
src/cours_popup.cxx
Fichier normal
70
src/cours_popup.cxx
Fichier normal
@@ -0,0 +1,70 @@
|
|||||||
|
#include <imgui.h>
|
||||||
|
#include "cours_popup.h"
|
||||||
|
|
||||||
|
#define CLOSE_WINDOW_WIDTH 180
|
||||||
|
#define CLOSE_WINDOW_HEIGHT 50
|
||||||
|
|
||||||
|
void afficher_cours_modal_popup(DigitalModulationType dType)
|
||||||
|
{
|
||||||
|
/// Dessin du bouton "Rappels de cours "
|
||||||
|
|
||||||
|
// Centrage de la fenêtre modale
|
||||||
|
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
||||||
|
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
|
||||||
|
ImVec2 displaySize = ImGui::GetIO().DisplaySize;
|
||||||
|
ImGui::SetNextWindowSize(ImVec2(displaySize.x * 0.8f,displaySize.y * 0.8f), ImGuiCond_Always);
|
||||||
|
|
||||||
|
ImGui::SetNextItemWidth(CLOSE_WINDOW_WIDTH);
|
||||||
|
float largeur_fenetre = ImGui::GetContentRegionAvail().x;
|
||||||
|
|
||||||
|
ImGui::NewLine();
|
||||||
|
ImGui::Dummy(ImVec2((largeur_fenetre - CLOSE_WINDOW_WIDTH) * 0.5f, 0.0));
|
||||||
|
ImGui::SameLine();
|
||||||
|
|
||||||
|
if (ImGui::Button("Rappels de cours"))
|
||||||
|
ImGui::OpenPopup("Rappels de cours");
|
||||||
|
|
||||||
|
if (ImGui::BeginPopupModal("Rappels de cours", NULL, ImGuiWindowFlags_AlwaysAutoResize))
|
||||||
|
{
|
||||||
|
ImGui::BeginChild("Scroll",ImVec2(displaySize.x * 0.8, displaySize.y * 0.65),true, ImGuiWindowFlags_AlwaysVerticalScrollbar);
|
||||||
|
|
||||||
|
switch (dType)
|
||||||
|
{
|
||||||
|
case MOD_OOK_TYPE:
|
||||||
|
// ImGui::TextWraped(OOK_COURSE_DOC);
|
||||||
|
// break;
|
||||||
|
case MOD_ASK_TYPE:
|
||||||
|
case MOD_MASK_TYPE:
|
||||||
|
case MOD_FSK_TYPE:
|
||||||
|
case MOD_MFSK_TYPE:
|
||||||
|
case MOD_BPSK_TYPE:
|
||||||
|
case MOD_DPSK_TYPE:
|
||||||
|
case MOD_4_QAM_TYPE:
|
||||||
|
case MOD_16_QAM_TYPE:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::TextWrapped("Je rajoute plein de mot afin que le texte soit tres long genre vraiment tres long BLABLLALBLALBALBLABLBLALABLBALALBLABLLBALBALBALBALBLAABLLALABLBAL ");
|
||||||
|
ImGui::Separator();
|
||||||
|
|
||||||
|
for (int i = 0; i < 50; i++)
|
||||||
|
{
|
||||||
|
ImGui::Text("Y'a vraiment plein d'information dans cette phrase dis donc (c'est faux) Ligne %d", i + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::EndChild();
|
||||||
|
|
||||||
|
largeur_fenetre = ImGui::GetContentRegionAvail().x;
|
||||||
|
ImGui::NewLine();
|
||||||
|
|
||||||
|
ImGui::Dummy(ImVec2((largeur_fenetre - CLOSE_WINDOW_WIDTH) * 0.5f, 0.0));
|
||||||
|
ImGui::SameLine();
|
||||||
|
|
||||||
|
if (ImGui::Button("Fermer la fenêtre", ImVec2(CLOSE_WINDOW_WIDTH, 0)))
|
||||||
|
ImGui::CloseCurrentPopup();
|
||||||
|
ImGui::EndPopup();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "modulations.h"
|
#include "modulations.h"
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
|
|
||||||
|
|
||||||
static void showApplicationQuitMenu()
|
static void showApplicationQuitMenu()
|
||||||
{
|
{
|
||||||
if (ImGui::BeginMenu(APPLICATION_MENU_HEAD))
|
if (ImGui::BeginMenu(APPLICATION_MENU_HEAD))
|
||||||
@@ -37,13 +36,6 @@ int main(void)
|
|||||||
Application app;
|
Application app;
|
||||||
Application * p_app = &app;
|
Application * p_app = &app;
|
||||||
|
|
||||||
// --------------------- SDL INIT ---------------------
|
|
||||||
if (!SDL_Init(SDL_INIT_VIDEO))
|
|
||||||
{
|
|
||||||
fprintf(stdout, "SDL init error: %s\n", SDL_GetError());
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Engine engine;
|
Engine engine;
|
||||||
|
|
||||||
// -----------------IMGUI INIT---------------------------
|
// -----------------IMGUI INIT---------------------------
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "imgui_utils.h"
|
#include "imgui_utils.h"
|
||||||
#include "vtoggle_button.h"
|
#include "vtoggle_button.h"
|
||||||
#include "gl_helpers.h"
|
#include "gl_helpers.h"
|
||||||
|
#include "cours_popup.h"
|
||||||
|
|
||||||
#ifdef M_PI
|
#ifdef M_PI
|
||||||
#undef M_PI
|
#undef M_PI
|
||||||
@@ -111,6 +112,7 @@ short int DigitalModulation::AmplitudeDigitalModulation(float * carrier_freq,
|
|||||||
);
|
);
|
||||||
|
|
||||||
float amplitude = 0.0f;
|
float amplitude = 0.0f;
|
||||||
|
int somme = 0;
|
||||||
|
|
||||||
switch (amplitude_modulation_t)
|
switch (amplitude_modulation_t)
|
||||||
{
|
{
|
||||||
@@ -123,10 +125,33 @@ short int DigitalModulation::AmplitudeDigitalModulation(float * carrier_freq,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MOD_MASK_TYPE:
|
case MOD_MASK_TYPE:
|
||||||
|
|
||||||
if ((bit_traite % 2) == 0) // bit pair => bits 0, 2, 4 ou 6
|
if ((bit_traite % 2) == 0) // bit pair => bits 0, 2, 4 ou 6
|
||||||
amplitude = base_amp * (0.25 + 0.5 * am_bits[bit_traite] + 0.25 * am_bits[bit_traite+1]);
|
somme = 2*am_bits[bit_traite]+am_bits[bit_traite+1];
|
||||||
else // bit impair => bits 1, 3, 5 ou 7
|
else
|
||||||
amplitude = base_amp * (0.25 + 0.5 * am_bits[bit_traite-1] + 0.25 * am_bits[bit_traite]);
|
somme = 2*am_bits[bit_traite-1]+am_bits[bit_traite];
|
||||||
|
|
||||||
|
switch(somme)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
amplitude = -base_amp * 0.33f;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
amplitude = - base_amp;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
amplitude = base_amp * 0.33f;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
amplitude = base_amp;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -216,18 +241,21 @@ short int DigitalModulation::AmplitudeDigitalModulation(float * carrier_freq,
|
|||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
DrawIndicator("Le symbole vaut 11 : ", &c_freq, &litude_modulation_t, &samples_per_bit, 1.0f, 0.0f, col, ind_size);
|
DrawIndicator("Le symbole vaut 11 : ", &c_freq, &litude_modulation_t, &samples_per_bit, 1.0f, 0.0f, col, ind_size);
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
DrawIndicator("Le symbole vaut 10 : ", &c_freq, &litude_modulation_t, &samples_per_bit, 0.75f, 0.0f, col, ind_size);
|
DrawIndicator("Le symbole vaut 10 : ", &c_freq, &litude_modulation_t, &samples_per_bit, 0.33f, 0.0f, col, ind_size);
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
DrawIndicator("Le symbole vaut 01 : ", &c_freq, &litude_modulation_t, &samples_per_bit, 0.4f, 0.0f, col, ind_size);
|
DrawIndicator("Le symbole vaut 01 : ", &c_freq, &litude_modulation_t, &samples_per_bit, -1.0f, 0.0f, col, ind_size);
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
DrawIndicator("Le symbole vaut 00 : ", &c_freq, &litude_modulation_t, &samples_per_bit, 0.15f, 0.0f, col, ind_size);
|
DrawIndicator("Le symbole vaut 00 : ", &c_freq, &litude_modulation_t, &samples_per_bit, -0.33f, 0.0f, col, ind_size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------- FIN AJOUT TEMOIN -------------
|
// ------- FIN AJOUT TEMOIN -------------
|
||||||
|
|
||||||
|
/// Dessin du bouton "Rappels de cours "
|
||||||
|
afficher_cours_modal_popup(amplitude_modulation_t);
|
||||||
|
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
|
|
||||||
|
|||||||
Référencer dans un nouveau ticket
Bloquer un utilisateur