Closed timurufa86 closed 4 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
` void drawHeaderOverlay(OLEDDisplay display, OLEDDisplayUiState state ) {
display->setColor(WHITE); showProcesses(); display->drawHorizontalLine(0, 14, 128); //горизонтальная линия }
//____ icon disp____
void printpr(byte processNumber, byte poz) { switch (processNumber) { case 1: display.drawXbm(13, poz, Xbm1_width, Xbm1_height, Xbm1_bits); break; case 2: // display->drawXbm(13, y + poz, Xbm2_width, Xbm2_height, Xbm2_bits); break; case 3: // display->drawXbm(13, y + poz, Xbm3_width, Xbm3_height, Xbm3_bits); break; } } bool addProcess(byte processNumber) // добавление отображения процесса на экран { // есть ли у нас ещё свободные места? if (emptySlot >= MAX_PROCESSES) return false;
// проверяем - не существует ли такой процесс уже? for (byte i = 0; i < emptySlot; i++) { if (processes[i] == processNumber) return false; }
// добавляем processes[emptySlot] = processNumber;
emptySlot++;
return true; }
void removeProcess(byte processNumber) // удаление процесса с экрана { for (byte i = 0; i < emptySlot; i++) { if (processes[i] == processNumber) { for (byte k = i + 1; k < MAX_PROCESSES; k++) { processes[k - 1] = processes[k]; } emptySlot--;
} }
void showProcesses() { if (!emptySlot) return;
for (byte i = 0; i < emptySlot; i++) { printpr(processes[i], 112 - (i * 16)); // обратный порядок processes[emptySlot-i-1] } } void stmaster(bool st, byte num) //обработчик входящих статусов { if (st == 1) { addProcess(num); } else if (st == 0) { removeProcess(num); } showProcesses(); } ` The idea the following. there is an area at the top of the screen where I want to display the status icons of different processes in both cell phone... I need depending on the running processes display. Am I thinking right????