-
Notifications
You must be signed in to change notification settings - Fork 0
/
SurfaceView.cpp
642 lines (553 loc) · 17 KB
/
SurfaceView.cpp
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
// SurfaceView.cpp : implementation of the CSurfaceView class
//
#include "stdafx.h"
#include "Surface.h"
#include "General.h"
#include "Receptor.h"
#include "SigMol.h"
#include "Cell.h"
#include "Grid.h"
#include "SurfaceDoc.h"
#include "SurfaceView.h"
#include "Option.h"
#include "BaseDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSurfaceView
clock_t start, start1, fin;
int stepGl = 0, stepGlS = -2;
int isTimer = true;
//static int flag1 = false;
static int num = 0;
bool IsMemDc = true;
bool isMemDc = true;
IMPLEMENT_DYNCREATE(CSurfaceView, CFormView)
BEGIN_MESSAGE_MAP(CSurfaceView, CFormView)
//{{AFX_MSG_MAP(CSurfaceView)
ON_WM_TIMER()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
ON_MESSAGE(GEN_ONE, OnMyMessage) //gg1
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSurfaceView construction/destruction
CSurfaceView::CSurfaceView()
: CFormView(CSurfaceView::IDD)
{
//{{AFX_DATA_INIT(CSurfaceView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// TODO: add construction code here
m_OptionDlg = 0;
m_stopDraw = false; //false;
m_PartGrid = 1;
m_StepBy = false;
m_PartGridNum = 1;
m_Next = false;
minZoom = 1;
}
CSurfaceView::~CSurfaceView()
{
}
void CSurfaceView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSurfaceView)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BOOL CSurfaceView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CFormView::PreCreateWindow(cs);
}
void CSurfaceView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
SetTimer(1, CGeneral::TimerInitialisator, NULL);
m_pdlg = new CBaseDlg();
m_pdlg->Create(this);
}
/////////////////////////////////////////////////////////////////////////////
// CSurfaceView printing
BOOL CSurfaceView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CSurfaceView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CSurfaceView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
void CSurfaceView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
// TODO: add customized printing code here
}
/////////////////////////////////////////////////////////////////////////////
// CSurfaceView diagnostics
#ifdef _DEBUG
void CSurfaceView::AssertValid() const
{
CFormView::AssertValid();
}
void CSurfaceView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
CSurfaceDoc* CSurfaceView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSurfaceDoc)));
return (CSurfaceDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSurfaceView message handlers
void CSurfaceView::OnDraw(CDC* pDC)
{
// return;
// TODO: Add your specialized code here and/or call the base class
// if(!CGeneral::RaftArray.size()) return;
if(CGeneral::step == 0) return;
CGeneral::is_draw_finished = false;
clock_t startd, find;
double duration = 0;
startd = clock();
//yellow, cremovi
static COLORREF colors[255*255*255];
for(int r=0; r<255 ; r++) {
for(int g=0; g<255 ; g++) {
for(int b=0; b<255 ; b++) {
colors[r+g+b]= RGB( 255-r, 255-g, 255-b);
}
}
}
static COLORREF col[16] = { RGB( 255, 0, 0 ), RGB( 0, 255, 0 ), //krasnii-0, zelyonii-1
RGB( 0, 0, 255), RGB( 0, 255, 255 ), //sinii-2, goluboiCian-3
RGB( 255, 0, 255), RGB( 255, 255, 0 ), //malinovii-4, jyoltii-5
RGB( 192, 192, 192), RGB( 80, 0, 80 ), //serii-6, t-malinovii-7
RGB( 255, 255, 255), RGB( 80, 80, 0 ), //serii-8, t-jyoltii-9,
RGB( 80, 80, 0 ), RGB( 0, 0, 80 ), //4yornii-10, tyomn. golub - 11
RGB( 250, 166, 70 ), RGB( 207, 10, 243 ), //orange-12, tyomn. fioletovii - 13
RGB( 128, 128, 0 ), RGB( 0, 0, 0 )}; // seri 15
GetClientRect(m_ClientRect );
int oldBkMode = pDC->SetBkMode(TRANSPARENT);
static int key = 1;
DrawSize = (m_ClientRect.Width( ) < m_ClientRect.Height( ) )
? m_ClientRect.Width( ) : m_ClientRect.Height( ) ;
if(DrawSize > GRID_SIZE) DrawSize = GRID_SIZE;
else
{
minZoom = (GRID_SIZE-1)/DrawSize + 1 ;
if(m_PartGrid < minZoom)
{
m_PartGrid = minZoom;
}
}
DrawSize = GRID_SIZE/m_PartGrid;
m_OptionDlg->SetZoom(m_PartGrid, GRID_SIZE/m_PartGrid,num);
int xp = (m_PartGridNum - 1)%m_PartGrid ;
int yp = (m_PartGridNum - 1) / m_PartGrid ;
X = 0 + DrawSize * xp;
Y = 0 + DrawSize * yp;
X1 = X + DrawSize;
Y1 = Y + DrawSize;
//-----------------------------------------------------------------
CDC * myDc;
CDC memdc;
CBitmap bmp, *poldbmp;
isMemDc = IsMemDc && !( CGeneral::DrawRaftIndexes
|| CGeneral::DrawRecIndexes
|| CGeneral::DrawSigMolInd || CGeneral::DrawSigMolNames
|| CGeneral::DrawRecNames);
if(isMemDc)
{
// Create a compatible memory DC
memdc.CreateCompatibleDC( pDC);
bmp.CreateCompatibleBitmap (pDC, m_ClientRect.Height(), m_ClientRect.Height());
//bmp.CreateCompatibleBitmap (pDC, DrawSize, DrawSize);
// Select the new bitmap object into the memory device context.
poldbmp = memdc.SelectObject( &bmp );
memdc.BitBlt( 0,0,m_ClientRect.Height(), m_ClientRect.Height(),&memdc, 0, 0, WHITENESS );
myDc = &memdc;
}
else myDc = pDC;
myDc->SetMapMode(MM_ISOTROPIC);
SetWindowExtEx(*myDc,DrawSize,DrawSize,NULL);
SetViewportExtEx(*myDc,m_ClientRect.right, -m_ClientRect.bottom,NULL);
SetViewportOrgEx(*myDc,0,m_ClientRect.bottom,NULL);
//-----------------------------------------------------------------
double sd = sqrt(DrawSize /27.) ;
if( CGeneral::DrawSigMol ){
double sd_sm = sd-1;
if(sd_sm < 1) sd_sm = 1; // ?????????????????
CBrush br;
br.CreateSolidBrush(col[1]);
for(int in=0; in<GRID_SIZE ; in++)
{
for(int in1=0; in1<GRID_SIZE ; in1++)
{
CBrush br1;
double IFN_prot_conc = CGeneral::grid.m_Grid[in1][in].array[SM];
if(IFN_prot_conc == 0){
continue;
}
int normalized_IFN_prot_conc = floor(IFN_prot_conc);
br1.CreateSolidBrush(colors[normalized_IFN_prot_conc]);
CBrush* pSMBr = myDc->SelectObject( &br1 );
// myDc->Rectangle(in - X, in1 -Y, in + sd_sm -X, in1 + sd_sm - Y);
CRect rect(in - X, in1 -Y, in + sd_sm -X, in1 + sd_sm - Y);
myDc->FillRect(&rect ,&br1);
if(CGeneral::DrawSigMolNames)
{
char buf[30] = "IFNprot: ";
char buf5[10];
itoa(IFN_prot_conc,buf5,10);
strncat(buf, buf5, 10);//add coma
myDc->TextOut(in - X, in1 -Y, buf, strlen(buf));
}
}
}
}
/////////////////// begin drawing rafts //////////////////////////////////
if( CGeneral::DrawRafts )
{
CBrush gray_hatch_br, red_br, grey_br;
gray_hatch_br.CreateHatchBrush(HS_BDIAGONAL, col[15]);
grey_br.CreateSolidBrush(col[15]);
red_br.CreateSolidBrush(col[1]);
CBrush* pOldBr = myDc->SelectObject( &gray_hatch_br );
std::vector<CCell>::iterator raft_iter;
raft_iter = CGeneral::CellArray.begin();
CCell * p_Raft = raft_iter;
for(; raft_iter != CGeneral::CellArray.end(); raft_iter++)
{
p_Raft = raft_iter;
double rigI_rna_conc = p_Raft->GetRIGI_rna_conc();
// double normalized_rigI_rna_conc = rigI_rna_conc/CGeneral::RIGI_rna_maxLevel;
double IFN_prot_conc = p_Raft->GetIFN_prot_conc();
// double normalized_IFN_prot_conc = IFN_prot_conc/CGeneral::IFN_prot_maxLevel;
if( p_Raft->IsActivated() )
{
CBrush br;
double RIGI_rna_conc = p_Raft->GetRIGI_rna_conc();
int val=0;
if(CGeneral::DrawAgs)
double rigI_rna_conc = p_Raft->GetRIGI_rna_conc();
else
double rigI_rna_conc = p_Raft->GetRIGI_rna_conc();
if( !p_Raft->IsInfected() )//not infected
{
br.CreateHatchBrush(HS_BDIAGONAL, RGB( 128, 128, 128 ));
CBrush* pSMBr = myDc->SelectObject( &br );
myDc->Ellipse(p_Raft->Location.x - X, p_Raft->Location.y -Y,
p_Raft->Location.x -X, p_Raft->Location.y - Y);
}
else// infected
{
if( CGeneral::step != 1)
{
CBrush* pSMBr = myDc->SelectObject( &red_br );
myDc->Ellipse(p_Raft->Location.x - X, p_Raft->Location.y -Y,
p_Raft->Location.x -X, p_Raft->Location.y - Y);
}
if(p_Raft->m_blinking_counter == p_Raft->m_blinking_const)
{
p_Raft->m_blinking_counter = 0;
p_Raft->m_justChangedStatus = !p_Raft->m_justChangedStatus;
}
else{p_Raft->m_blinking_counter++;}
br.CreateSolidBrush(RGB( 128, 128, 128 ));
CBrush* pSMBr = myDc->SelectObject( &br );
myDc->Ellipse(p_Raft->Location.x - X, p_Raft->Location.y -Y,
p_Raft->Location.x -X, p_Raft->Location.y - Y);
if(p_Raft->m_blinking_counter == p_Raft->m_blinking_const)
{
p_Raft->m_blinking_counter = 0;
p_Raft->m_justChangedStatus = !p_Raft->m_justChangedStatus;
}
else{p_Raft->m_blinking_counter++;}
}
} // if
else // not activated
{
CBrush brt,brt1;
int val_msg;
int val_prot;
if(!CGeneral::DrawAgs) {//DDX58
// if(CGeneral::DrawAgIndexes)//msg
val_msg = p_Raft->GetRIGI_rna_conc();
// else //prot
val_prot = p_Raft->GetRIGI_prot_conc();
}
else {//IFNB1
// if(CGeneral::DrawAgIndexes)//IFNB1
val_msg = p_Raft->GetIFN_rna_conc();
// else //prot
val_prot = p_Raft->GetIFN_prot_conc();
}
if( p_Raft->IsInfected() )//NOT UNFECTED
{
brt.CreateSolidBrush(colors[val_prot]);
CBrush* pSMBr = myDc->SelectObject( &brt );
myDc->Ellipse(p_Raft->Location.x - X-1, p_Raft->Location.y -Y-1,
p_Raft->Location.x -X+sd+1, p_Raft->Location.y - Y+sd+1);
brt1.CreateSolidBrush(colors[val_msg]);
pSMBr = myDc->SelectObject( &brt1 );
myDc->Ellipse(p_Raft->Location.x - X, p_Raft->Location.y -Y,
p_Raft->Location.x -X+sd, p_Raft->Location.y - Y+sd);
/* myDc->SetTextColor(col[0]);
char buf[30] = "*";
myDc->TextOut(p_Raft->Location.x - X+1, p_Raft->Location.y -Y+1,
buf, strlen(buf));
*/
} // if
else//not infected
{
// brt.CreateSolidBrush(colors[col[2]]);
brt.CreateHatchBrush(HS_BDIAGONAL, colors[val_prot]);
CBrush* pSMBr = myDc->SelectObject( &brt );
myDc->Ellipse(p_Raft->Location.x - X-1, p_Raft->Location.y -Y-1,
p_Raft->Location.x -X+sd+1, p_Raft->Location.y - Y+sd+1);
brt1.CreateHatchBrush(HS_FDIAGONAL, colors[val_prot]);
pSMBr = myDc->SelectObject( &brt1 );
myDc->Ellipse(p_Raft->Location.x - X, p_Raft->Location.y -Y,
p_Raft->Location.x -X+sd, p_Raft->Location.y - Y+sd);
}
}
myDc->SetTextColor(col[0]);
int boundTypeIR = p_Raft->Get_boundTypeIR();
if(boundTypeIR) {
char buf1[3] = "|";
char buf2[3] = "--";
char buf3[3]="";
char buf[30] = "";
char buf5[10];
if((boundTypeIR%2)){
strncat(buf3, buf1, 3);//add coma
}else{
strncat(buf3, buf2, 3);//add coma
}
myDc->TextOut(p_Raft->Location.x - X+1, p_Raft->Location.y -Y+1,
buf3, strlen(buf3));
}
myDc->SetTextColor(RGB(0,0,0));
if( !p_Raft->IsInfected() ) {//not infected
}
else {// infected
}
/*
double rigI_rna_conc = p_Raft->GetRIGI_rna_conc();
double normalized_rigI_rna_conc = rigI_rna_conc/CGeneral::RIGI_rna_maxLevel;
double IFN_rna_conc = p_Raft->GetIFN_rna_conc();
double normalized_IFN_rna_conc = IFN_rna_conc/CGeneral::IFN_rna_maxLevel;
int sd_rna = sd+3;
int val;
if(CGeneral::DrawAgs)
val = 255 - normalized_rigI_rna_conc * 255;
else
val = 255 - normalized_IFN_rna_conc * 255;
CBrush br_rna;
br_rna.CreateSolidBrush(RGB( val, val, val ));
CBrush* pSMBr = myDc->SelectObject( &br_rna );
// myDc->Ellipse(p_Raft->m_shape.Centroid().x - X, p_Raft->m_shape.Centroid().y -Y,
// p_Raft->m_shape.Centroid().x + sd_rna -X, p_Raft->m_shape.Centroid().y + sd_rna - Y);
*/
if(CGeneral::DrawRaftIndexes)
{
char buf[30]="";
char buf5[10]="";
if(!CGeneral::DrawAgs){
// if(CGeneral::DrawAgIndexes) {
strncat(buf, "DDX58: ", 10);//add coma
itoa(p_Raft->GetRIGI_rna_conc(),buf5,10);
strncat(buf, buf5, 10);//add coma
myDc->TextOut(p_Raft->Location.x - X, p_Raft->Location.y -Y,
buf, strlen(buf));
// }
// else{
strncat(buf, ", RIGI: ", 10);//add coma
itoa(p_Raft->GetRIGI_prot_conc(),buf5,10);
strncat(buf, buf5, 10);//add coma
myDc->TextOut(p_Raft->Location.x - X, p_Raft->Location.y -Y,
buf, strlen(buf));
// }
}
else{
// if(CGeneral::DrawAgIndexes) {
strncat(buf, "IFNB:", 10);//add coma
// buf = "IFNB: ";
itoa(p_Raft->GetIFN_rna_conc(),buf5,10);
strncat(buf, buf5, 10);//add coma
myDc->TextOut(p_Raft->Location.x - X, p_Raft->Location.y -Y,
buf, strlen(buf));
// }
// else{
/* strncat(buf, ", IFNb:", 10);//add coma
itoa(p_Raft->GetIFN_prot_conc(),buf5,10);
strncat(buf, buf5, 10);//add coma
myDc->TextOut(p_Raft->Location.x - X, p_Raft->Location.y -Y,
buf, strlen(buf));*/
// }
}
}
}
myDc->SelectObject( pOldBr);
num++;
myDc->SetBkMode(oldBkMode);
}
//------------------------ end drawing rafts ---------------------------//
if(isMemDc)
{
pDC->StretchBlt( 0,0,m_ClientRect.Height( ) ,m_ClientRect.Height( ),&memdc, 0, 0,
DrawSize, DrawSize, SRCCOPY);
//pDC->BitBlt( 0,0,DrawSize, DrawSize,&memdc, 0, 0, SRCCOPY );
bmp.DeleteObject();
memdc.DeleteDC();
}
pDC->SetBkMode(oldBkMode);
CGeneral::is_draw_finished = true;
if(stepGl == 10 || stepGl == 1000 || stepGl == 10000
|| stepGl == 100000 || stepGl == 300000 || stepGl == 2000000)
{
find = clock();
duration = (double)(find - startd) / CLOCKS_PER_SEC;
// CGeneral::out << "\n Draw duration " << duration << " step " << stepGl << endl;
}
}
void CSurfaceView::OnTimer(UINT nIDEvent)
{
begin:
// TODO: Add your message handler code here and/or call default
if(!m_OptionDlg || !CGeneral::is_draw_finished || !CGeneral::is_simul_finished)
{
if(isTimer) CFormView::OnTimer(nIDEvent);
return;
}
CGeneral::is_simul_finished = true;
static int flag2 = false;
int step = 0;
if(CGeneral::START_SIM && ((m_StepBy && m_Next) || !m_StepBy))
{
if(!flag2)
{
CWaitCursor curs;
CGeneral::InitProcess();
}
flag2 = true;
try
{
start = clock();
step = CGeneral::BeginSimulation();
stepGl = step;
CGeneral::Simulation_Duration = step*CGeneral::TIME_STEP_LENGHT/60;
double duration = 0;
if(stepGl == 10 || stepGl == 1000 || stepGl == 10000
|| stepGl == 100000 || stepGl == 300000 || stepGl == 2000000)
{
fin = clock();
stepGlS = stepGl;
duration = (double)(fin - start) / CLOCKS_PER_SEC;
CGeneral::out << "\n Sim duration " << duration << " step " << stepGl << endl;
start1 = start;
}
else if(stepGlS == stepGl - 1)
{
duration = (double)(start - start1) / CLOCKS_PER_SEC;
CGeneral::out << "\n Time duration " << duration << " step " << stepGl << endl;
}
else if(step > 1000 && stepGlS == step - 100)
{
duration = (double)(start - start1) / CLOCKS_PER_SEC;
CGeneral::out << "\n Time of 100 steps " << duration << " step " << stepGl << endl;
}
}
catch(int exep)
{
CGeneral::START_SIM = false;
switch(exep)
{
case -1:
AfxMessageBox("Simulation problem: Too many attempts to create new Antigen!");
AfxGetMainWnd()->PostMessage(WM_CLOSE);
return;
case -2:
AfxMessageBox("Simulation problem: There is no free receptor for Ag binding!");
AfxGetMainWnd()->PostMessage(WM_CLOSE);
return;
case -3:
AfxMessageBox("Simulation problem: There is no raft to initialise SMs!");
AfxGetMainWnd()->PostMessage(WM_CLOSE);
return;
}
}
if(!step)
{
CGeneral::Record_Results_to_files();
CGeneral::Record_Results_to_files1();
CGeneral::START_SIM = false;
AfxMessageBox("Simulation complete");
m_OptionDlg->OnFinishSim();
// AfxGetMainWnd()->PostMessage(WM_CLOSE);
}
if(step && !(step % CGeneral::UpdateWindowVariable) && !m_stopDraw)
{
SetRedraw(TRUE);
Invalidate( !isMemDc);
//Invalidate(!CGeneral::is_draw_rec_path);
UpdateWindow();
}
m_OptionDlg->UpdateData();
m_Next = false;
}
if(!CGeneral::START_SIM)
{
SetRedraw(FALSE);
CGeneral::step = 0;
flag2 = false;
CGeneral::RecInRaft = 0;
num = 0;
m_PartGrid = minZoom;
}
if(!m_stopDraw)
{
if(!isTimer)
{
SetTimer(1, CGeneral::TimerInitialisator, NULL);
isTimer = true;
}
else
CFormView::OnTimer(nIDEvent);
}
else
{
// if(!isTimer && !(step % 1))
if(!isTimer && !(step % 100))
{
SetTimer(1, 2, NULL);
isTimer = true;
}
else
{
if(isTimer) { KillTimer(nIDEvent); isTimer = false;}
goto begin;
}
}
}
////gg1
LRESULT CSurfaceView::OnMyMessage(WPARAM WParam, LPARAM LParam)
{
Sleep(600);
return (LRESULT)0;
}