Skip to content

Commit 1b2ba06

Browse files
committed
eh
1 parent 18db8a8 commit 1b2ba06

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
*.obj
99
*.lastbuildstate
1010

11+
build.bat
12+
13+
.gitignore
14+
1115
#################
1216
## Eclipse
1317
#################

main.hpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@
7272
#include "include/SettingsManager.hpp"
7373
#include "include/Buttons.hpp"
7474
#include "include/Wavelength.hpp"
75+
#include "include/GraphMemoryMan.hpp"
76+
#include "include/Percentage.hpp"
7577

7678
#include <String>
7779
#include <math.h>
7880

7981

80-
//Definice vzhledu a textu:
81-
#define APP_STYLE_MAINBG wxColor(230,230,246)
82-
#define APP_LOGO_PADDING 10
82+
#include "include/design.hpp"
8383

8484
//Definice samplovani:
8585
#define DEFAULT_SAMPLE_LENGTH 1024
@@ -153,10 +153,12 @@ enum
153153
BUTTON_Screenshot,
154154
BUTTON_PrevCam,
155155
BUTTON_NextCam,
156-
STHREAD_EVENT
156+
STHREAD_EVENT,
157+
BUTTON_Pause
157158
};
158159

159160
class WavelengthPanel;
161+
class PercentagePanel;
160162
class AppMain;
161163
class FrameMain : public wxFrame
162164
{
@@ -180,13 +182,13 @@ class FrameMain : public wxFrame
180182
void SpectrumBoundsChanged();
181183

182184
private:
183-
185+
GraphMemoryMan* graphMem;
184186
wxGLCanvasSubClass* GLcanvas;
185187
UVStatusPanel *uvbut;
186188
SettingsManager *SetMan;
187189
bool drawing;
188190

189-
191+
PauseButton *pauseBut;
190192
QuitButton *quitBut;
191193
MaxDemaxButton *maxBut;
192194
ScreenshotButton *scrBut;
@@ -195,6 +197,7 @@ class FrameMain : public wxFrame
195197
NextButton *nextBut;
196198

197199
WavelengthPanel *wavlen;
200+
PercentagePanel *percpan;
198201
/**Window status**/
199202
bool dragged;
200203
wxPoint dragPoint;
@@ -244,5 +247,12 @@ std::string toString(const T& value)
244247
oss << value;
245248
return oss.str();
246249
}
250+
251+
//Signum
252+
//http://stackoverflow.com/a/4609795/607407
253+
//Returns sign of the input value
254+
template <typename T> int sgn(T val) {
255+
return (T(0) < val) - (val < T(0));
256+
}
247257
//Konverze barev do RGB
248258

minimal.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ BEGIN_EVENT_TABLE(WavelengthPanel, wxPanel)
2929
EVT_PAINT(WavelengthPanel::paintEvent)
3030
END_EVENT_TABLE()
3131

32+
BEGIN_EVENT_TABLE(PercentagePanel, wxPanel)
33+
EVT_PAINT(PercentagePanel::paintEvent)
34+
END_EVENT_TABLE()
35+
36+
/*BEGIN_EVENT_TABLE(GraphMemory, wxPanel)
37+
EVT_PAINT(GraphMemory::paintEvent)
38+
END_EVENT_TABLE()*/
39+
3240
IMPLEMENT_APP(AppMain)
3341

3442

@@ -41,6 +49,7 @@ FrameMain::FrameMain(const wxString& title, SettingsManager *n_SetMan)
4149
SetFont(wxFont(11, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
4250
SetFocus();
4351

52+
4453
//Zarovnat okno pri maximalizaci
4554
Connect(wxEVT_MAXIMIZE, wxCommandEventHandler(FrameMain::Align), NULL, this);
4655
//Eventy pro posouvani
@@ -64,20 +73,27 @@ FrameMain::FrameMain(const wxString& title, SettingsManager *n_SetMan)
6473
/**Vlnove lenghty*/
6574
wavlen = new WavelengthPanel(this,SetMan ,666, kam);
6675
wavlen->Align();
76+
/**Procenta nalevo**/
77+
percpan = new PercentagePanel(this);
78+
percpan->Align();
6779
/**Graf**/
6880

6981
GLcanvas = new wxGLCanvasSubClass(this, kam, SetMan);
7082
GLcanvas->Centre();
83+
84+
/**Graf pauza**/
85+
graphMem = new GraphMemoryMan(this, GLcanvas);
86+
GLcanvas->setMemory(graphMem);
7187

72-
88+
pauseBut = new PauseButton(this, BUTTON_Pause, graphMem);
7389
quitBut = new QuitButton(this, BUTTON_Quit);
7490
maxBut = new MaxDemaxButton(this, BUTTON_Max, ST_MAXED);
7591

7692
prevBut = new PreviousButton(this, BUTTON_PrevCam, SetMan);
7793
nextBut = new NextButton(this, BUTTON_NextCam, prevBut, SetMan);
7894
prevBut->SetNextBut(nextBut);
7995

80-
scrBut = new ScreenshotButton(this, BUTTON_Screenshot);
96+
scrBut = new ScreenshotButton(this, BUTTON_Screenshot, GLcanvas);
8197
grBut = new GraphButton(this, wxID_ANY, SetMan);
8298
if (SetMan->GetSetting(SETT_GEN_CFG) == 0)
8399
{
@@ -92,6 +108,7 @@ FrameMain::FrameMain(const wxString& title, SettingsManager *n_SetMan)
92108
}
93109

94110

111+
95112
/*drawPane = new BasicDrawPane(this, SetMan);
96113
timer = new RenderTimer(drawPane);
97114
timer->start();
@@ -225,8 +242,10 @@ void FrameMain::Align(wxCommandEvent& WXUNUSED(event)) {
225242
GLcanvas->SetFocus();
226243
timer->Start();
227244

228-
wavlen->Align();
245+
pauseBut->Align();
229246

247+
wavlen->Align();
248+
percpan->Align();
230249
}
231250
void FrameMain::setUVStatus(const bool status) {
232251
uvbut->State(status);

src/Wavelength.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ void WavelengthPanel::render(wxDC &dc) {
9797

9898
int sirka = abs(uv-ir);
9999

100-
100+
if(sirka<2)
101+
return;
102+
101103

102104
sirka-= tsirka+mezera;
103105

0 commit comments

Comments
 (0)