OptionsPanelWidget::OptionsPanelWidget() { setObjectName("OP_MAIN_WIDGET"); setStyleSheet("QWidget#OP_MAIN_WIDGET { " "border-style: solid;" "border-color: palette(shadow);" "border-top-width: 1px;" "border-bottom-width: 1px;" " }"); initOptionsLayout(); QWidget *groupsWidget = initGroupsLayout(); initMainLayout(groupsWidget); // Init the state opMainWidgetState = OPMainWidgetState_Closed; }
DockPanel::DockPanel(QWidget *parent) : QLabel(parent) { setObjectName("Panel"); initGlobalPreview(); initShowHideAnimation(); initHideStateManager(); initPluginLayout(); initAppLayout(); initMainLayout(); setMinimumHeight(m_dockModeData->getDockHeight()); //set height for border-image calculate reloadStyleSheet(); connect(m_dockModeData, &DockModeData::dockModeChanged, this, &DockPanel::onDockModeChanged); connect(PanelMenu::instance(), &PanelMenu::menuItemInvoked, [=] { //To ensure that dock will not hide at changing the hide-mode to keepshowing m_menuItemInvoked = true; }); }
int main(void){ // Init buffer for (int i=0; i<BUFFER_SIZE; i++){ Buffer[i] = 0; } //uIP unsigned int i; uip_ipaddr_t ipaddr; struct timer periodic_timer, arp_timer; clock_init(2); timer_set(&periodic_timer, CLOCK_SECOND / 2); timer_set(&arp_timer, CLOCK_SECOND * 10); init(); // Touch init ToushRes_t XY_Touch; Boolean Touch = FALSE; TouchScrInit(); // Init font GLCD_SetFont(&Terminal_9_12_6,0xFFFFFF,0x000000); // Init UART UART_init(UART_0,4,NORM); // Init Real Time Clock RTC_init(); // Init animations Animation_init(); // Init navigationBar navigationBar = initNavigationBar(); // Init pages mainLayout = initMainLayout(); learningLayout = initLearningLayout(); graphLayout = initGraphLayout(); devicesLayout = initDevicesLayout(); swapToLayout(0); // Initialize the ethernet device driver do{ GLCD_TextSetPos(0,0); } while(!tapdev_init()); GLCD_TextSetPos(0,0); // uIP web server // Initialize the uIP TCP/IP stack. uip_init(); uip_ipaddr(ipaddr, 192,168,0,100); uip_sethostaddr(ipaddr); uip_ipaddr(ipaddr, 192,168,0,1); uip_setdraddr(ipaddr); uip_ipaddr(ipaddr, 255,255,255,0); uip_setnetmask(ipaddr); // Initialize the HTTP server. httpd_init(); while(1){ if(TouchGet(&XY_Touch)) { // Check if the current Layout accepts the touch if (!Layout_dispatchTouch(currentLayout, XY_Touch.X, XY_Touch.Y)){ // Touch not accepted, pass it on to the navigationBar Layout_dispatchTouch(navigationBar, XY_Touch.X, XY_Touch.Y); } if (Touch == FALSE){ Touch = TRUE; } } else if(Touch) { USB_H_LINK_LED_FSET = USB_H_LINK_LED_MASK; Touch = FALSE; } // Data from UART0 UART_Check(Buffer); if (Buffer[0] != 'E'){ Parsing_parse(Buffer, &measurement); // Notify the graph updateGraphLayout(&measurement, currentLayout == graphLayout); checkDevices(&measurement, currentLayout); double vRMS = measurement.voltage; double iRMS = measurement.current; double pACT = measurement.P_power; double pREAC = measurement.Q_power; double pHAR = measurement.H_power; if (currentLayout == mainLayout){ GLCD_SetWindow(0, 0, 150, 70); GLCD_TextSetPos(0,0); GLCD_SetFont(&Terminal_9_12_6,0xFFFFFF,0x000000); GLCD_print(" Voltage: %f\r\n Current: %f\r\n Power: \t%f\r\n Reac: \t%f\r\n Har: \t%f", vRMS, iRMS, pACT, pREAC, pHAR); } } // HANDLE uIP uip_len = tapdev_read(uip_buf); if(uip_len > 0) { if(BUF->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); tapdev_send(uip_buf,uip_len); } } else if(BUF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { tapdev_send(uip_buf,uip_len); } } } else if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); tapdev_send(uip_buf,uip_len); } } #if UIP_UDP for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); tapdev_send(); } } #endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } } } }