-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainDlg.h
executable file
·128 lines (102 loc) · 4.01 KB
/
MainDlg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// MainDlg.h : header file
//
#pragma once
#include "afxwin.h"
#include "afxcmn.h"
#include "GlView.h"
#include "CWorld.h"
// The order here must match the order of the corresponding radio buttons
// on the dialog box
enum eMissileControlRadioButtonValue
{
eRADIO_MISSILE_CONTROL_ADAPTIVE_PID = 0,
eRADIO_MISSILE_CONTROL_PID,
eRADIO_MISSILE_CONTROL_KEYBOARD,
NUM_RADIO_MISSILE_CONTROL_MODES,
};
// The order here must match the order of the corresponding radio buttons
// on the dialog box
enum eTargetControlRadioButtonValue
{
eRADIO_TARGET_CONTROL_AUTOMATIC = 0,
eRADIO_TARGET_CONTROL_KEYBOARD,
NUM_TARGET_CONTROL_MODES,
};
class CSliderCtrlWithCEdit : public CSliderCtrl
{
public:
void Init(CEdit *edit, float min_value, float max_value, float increment, float large_change, float tick_frequency, int number_format);
void SetValue(float new_value);
float GetValue();
void UpdateTextBox();
private:
CEdit* m_pCEdit;
float m_MinValue;
float m_MaxValue;
float m_Increment;
float m_LargeChange;
float m_TickFrequency;
int m_NumberFormat;
};
// CMainDlg dialog
class CMainDlg : public CDialog
{
// Construction
public:
CMainDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
enum { IDD = IDD_INTELLIGENTSTEERINGUSINGADAPTIVEPIDCONTROLLERS_DIALOG };
protected:
virtual BOOL DestroyWindow();
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
virtual LONG WindowProc(UINT msg, UINT wParam, LONG lParam);
public:
afx_msg void OnBnClickedButtonResetSliders();
private:
void DisplayHelpMessageBox(UINT help_message_id_part_1, UINT help_message_id_part_2);
void ReadKeyboardState();
void HandleUIControls();
void ResizeGLScene();
CGlView* m_pclGlView;
CWorld m_World;
UINT_PTR m_Timer;
DWORD m_PreviousTime;
bool m_KeyState[NUM_KEYS];
public:
afx_msg void OnBnClickedButtonHelpPCoefficient();
afx_msg void OnBnClickedButtonHelpICoefficient();
afx_msg void OnBnClickedButtonHelpDCoefficient();
private:
int m_RadioTargetControlMode;
int m_RadioMissileControlMode;
int m_PauseWorld;
CEdit m_TextBoxMissileSteeringPControl;
CEdit m_TextBoxMissileSteeringIControl;
CEdit m_TextBoxMissileSteeringDControl;
CEdit m_TextBoxMissileAccelerationControl;
CEdit m_TextBoxTargetSpeedControl;
CEdit m_TextBoxMissileRotationalDrag;
CEdit m_TextBoxMissileAngularAcceleration;
CEdit m_TextBoxMissilePIDOutputScale;
CSliderCtrlWithCEdit m_SliderMissileSteeringP;
CSliderCtrlWithCEdit m_SliderMissileSteeringI;
CSliderCtrlWithCEdit m_SliderMissileSteeringD;
CSliderCtrlWithCEdit m_SliderMissileAcceleration;
CSliderCtrlWithCEdit m_SliderMissileRotationalDrag;
CSliderCtrlWithCEdit m_SliderMissileAngularAcceleration;
CSliderCtrlWithCEdit m_SliderMissilePIDOutputScale;
CSliderCtrlWithCEdit m_SliderTargetSpeed;
public:
afx_msg void OnBnClickedRadioMissileControlAdaptivePid();
};