6 |
#include "FlisServerDlg.h" |
#include "FlisServerDlg.h" |
7 |
#include <vector> |
#include <vector> |
8 |
#include ".\flisserverdlg.h" |
#include ".\flisserverdlg.h" |
9 |
|
#include <atlrx.h> |
10 |
|
|
11 |
#ifdef _DEBUG |
#ifdef _DEBUG |
12 |
#define new DEBUG_NEW |
#define new DEBUG_NEW |
374 |
HandleAcknowledge(TlfNr); |
HandleAcknowledge(TlfNr); |
375 |
return; |
return; |
376 |
} |
} |
377 |
|
CAtlRegExp<> regex; |
378 |
|
if (regex.Parse("^{[0-9]+}:{[0-9]+}:[0-1]:[0-1]:[0-1]:[0-1]:$") == REPARSE_ERROR_OK) |
379 |
|
{ |
380 |
|
|
381 |
|
CAtlREMatchContext<> pContext; |
382 |
|
|
383 |
|
if (!regex.Match(FyrData, &pContext)) |
384 |
|
{ |
385 |
|
AppendText("Invalid SMS recieved"); |
386 |
|
return; |
387 |
|
} |
388 |
|
} |
389 |
|
else |
390 |
|
{ |
391 |
|
AppendText("Regex PARSE error!!!"); //Burde aldrig kunne ske ! |
392 |
|
} |
393 |
|
|
394 |
SmsCount = Splitter(FyrData); |
SmsCount = Splitter(FyrData); |
395 |
Temper = Splitter(FyrData); |
Temper = Splitter(FyrData); |
396 |
Flamme = Splitter(FyrData); |
Flamme = Splitter(FyrData); |
438 |
{ |
{ |
439 |
// TODO: Add your control notification handler code here |
// TODO: Add your control notification handler code here |
440 |
continueThread = 0; |
continueThread = 0; |
441 |
|
Sleep(250); |
442 |
DeleteSms(); |
DeleteSms(); |
443 |
|
|
444 |
Sleep(500); |
Sleep(500); |
533 |
{ |
{ |
534 |
while (continueThread != 0) |
while (continueThread != 0) |
535 |
{ |
{ |
536 |
Reader(); |
MyMainThread(); |
537 |
} |
} |
538 |
} |
} |
539 |
void CFlisServerDlg::Reader() |
void CFlisServerDlg::MyMainThread() |
540 |
{ |
{ |
541 |
if(Serial.getComstat().cbInQue > 0) |
if(Serial.getComstat().cbInQue > 0) |
542 |
{ |
{ |
544 |
std::vector<unsigned char> answer = readFrame(); |
std::vector<unsigned char> answer = readFrame(); |
545 |
Sleep(500); |
Sleep(500); |
546 |
CString tekst, oldtekst; |
CString tekst, oldtekst; |
|
int lol; |
|
547 |
|
|
548 |
for (int i=0; i<answer.size(); i++) |
for (int i=0; i<answer.size(); i++) |
549 |
{ |
{ |
758 |
CString SQL, Textwindow; |
CString SQL, Textwindow; |
759 |
SQL.Format("update command set executed=now() where id=%s",IDnr); |
SQL.Format("update command set executed=now() where id=%s",IDnr); |
760 |
db.ExecuteSQL(SQL); |
db.ExecuteSQL(SQL); |
761 |
|
Sleep(100); |
762 |
AppendText("Command executed"); |
AppendText("Command executed"); |
763 |
} |
} |
764 |
Sleep(150); |
Sleep(150); |
836 |
Tekst.Append("\r\n"); |
Tekst.Append("\r\n"); |
837 |
Tekst.Append(s); |
Tekst.Append(s); |
838 |
m_Textwindow.SetWindowText(Tekst); |
m_Textwindow.SetWindowText(Tekst); |
839 |
|
int g = m_Textwindow.GetScrollLimit(SB_VERT); |
840 |
|
if (g > 0) |
841 |
|
{ |
842 |
|
m_Textwindow.SetScrollPos(g,1,false); |
843 |
|
} |
844 |
|
|
845 |
} |
} |
846 |
void ConfigFile::ReadSettings() |
void ConfigFile::ReadSettings() |
985 |
DBConnect(); |
DBConnect(); |
986 |
AppendText("DB connection started again"); |
AppendText("DB connection started again"); |
987 |
} |
} |
988 |
|
return buffer; |
989 |
} |
} |
990 |
|
|
991 |
|
|