Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // PRZYGOTOWANIE DANYCH DO WYSYŁKI
- bufor[0] = 0x01; // deviceType - dla 7SEG zawsze 0x01
- bufor[1] = 0x01; // dataType - dla czasu zawsze 0x01
- if(zegarStatus.kierunek == GORA || zegarStatus.przekroczony){
- bufor[2] = (quint8)(zegarStatus.czas_up / 60); // minuty
- bufor[3] = (quint8)(zegarStatus.czas_up % 60); // sekundy
- } else {
- bufor[2] = (quint8)(zegarStatus.czas_down / 60); // minuty
- bufor[3] = (quint8)(zegarStatus.czas_down % 60); // sekundy
- }
- if(bufor.at(2) > 99)
- bufor[2] = 99;
- if(zegarStatus.wygaszaj_wiodace)
- bufor[4] = 1;
- if(zegarStatus.stan_zegara == STAN_ZEGARA_STOPPED)
- bufor[5] = 1; // reset wyświetlacza
- if(zegarStatus.warning)
- bufor[6] = 1;
- if(zegarStatus.przekroczony)
- bufor[7] = 1;
- if(zegarStatus.buzzer){
- if(zegarStatus.przekroczony){
- if(zegarStatus.czas_up == 1)
- bufor[8] = 1;
- if(zegarStatus.czas_up == 10)
- bufor[8] = 2;
- if(zegarStatus.czas_up == 20)
- bufor[8] = 20;
- bufor[7] = 1;
- }
- }
- for(quint8 i = 0; i < this->list_disp7SegNode.count(); i++){
- if(this->list_disp7SegNode.at(i)->isConnected()){
- if(this->m_webUserLogged && (!this->m_emptyList_B)){
- // ściśle pilnujemy lokalizacji jeśli webUser jest zalogowany i lista nie jest pusta
- if(this->list_disp7SegNode.at(i)->getLocation().toLower() == location.toLower()){
- // display obsługuje bieżącą lokalizację
- this->list_disp7SegNode.at(i)->sendData(bufor);
- }
- } else {
- // wszystkie displeje dostają czas z sali A
- if((location.toUpper() == "A") && (this->list_disp7SegNode.at(i)->getLocation().toUpper() == "B")){
- // jeśli idzie czas sali A do displeja z sali B
- // wyłącz sygnalizację dźwiękową
- QByteArray tmpBuf = bufor;
- tmpBuf[8] = 0;
- this->list_disp7SegNode.at(i)->sendData(tmpBuf);
- } else {
- // czas sali A do displeja z sali A - normalnie, bez zmian
- this->list_disp7SegNode.at(i)->sendData(bufor);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment