Aug. 26, 2015, 9 p.m.

AVR

Attiny24, USI

USI - Universal Serial Interface (Universal Serial Interface) is actually a workpiece for hardware serial transmit and receive data. This interface is not a ready-made solution for some specific data transmission protocol, but provides a more convenient way to transfer data than in the case of full software solution.

The essence of this interface is that it offers a level of hardware to transmit and receive serial data and protocol operation logic is the responsibility of the software implementation.

Aug. 26, 2015, 9:15 a.m.

Qt

QPallete, QSplitter, QSplitter color, QSplitter example, Qt

Qualitative layout always increases application usability, and this is true for all kinds of applications, from desktop to mobile. One such interface elements, which can improve usability is QSplitter class, which is an object-type layout with a movable divider that separates the two areas in the application interface.

Project Structure for QSplitter

Project Structure for QSplitter

Project structure completely unremarkable and a little interesting, since the main actions will be carried out in the designer, and QSplitter in mainwindow.cpp setting will produce a minimum.

Aug. 24, 2015, 9 p.m.

AVR

Attiny, MUL

MUL - multiplication instruction in microcontrollers, is present, for example, microcontrollers Atmega. But not all AVR microcontrollers there is hardware support multiplication of functions. For example, in microcontrollers Attiny MUL team simply does not exist, so the solution to this problem lies with the program code.

The main point to be taken into account in the implementation of the multiplication function is that to save the multiplication result will need two registers. In one of the registers will be kept low byte of the result, and in the second case bude saved significant byte result.

Aug. 22, 2015, 9 p.m.

AVR

BCD, Atmega

Decimal numbers machine language may be represented in the form of eight-bit sequences of ones and zeros, that is bytes. However, there are two types of presentation formats decimal numbers. It is packed format (BCD), and unpacked.

Uncompressed format

In this format, one digit of a decimal number is placed in one byte. Namely LSnibble bytes, whereas the most significant nibble (referred to as a zone) is filled units. For example, the number 157 would be as follows.

Aug. 21, 2015, 9:30 p.m.

AVR

TWI, Atmega

I remembered a little hardcore in Hardwar with TWI interface, which takes a few years ago. Who would not say, and Assembler perfectly cleanses the brain and develops an understanding of the algorithms. The most important thing I learned while working with AVR microcontrollers on Assembler, is the fact that all the operations, all directives, all functions must be written in a clear sequence. After all, if the write data in the register is not in the sequence, then your controller firmware does not work. And when writing code in high-level languages, sometimes you can see a complete indifference to the sequence of calling functions and methods, though often in the instructions to the libraries can be read, in what order you need to initialize a particular functionality, to get everything working. But who would read them carefully? Well, if you dear reader to read this paragraph instead skopipastit immediately imagine a software library of code that is shown below.

Aug. 21, 2015, 12:26 p.m.

Data Transmission Technologies

DELL, PBR, Route-Map

Corporate networks, which are typically used for multiple departments in an organization is often divided into VLANs for increased performance. Administrators can combine multiple physical switches into a single virtual network to create a more efficient use of bandwidth for interagency traffic. Members of each department, who often work remotely feel the performance increase despite the great geographical distance. By using routing policies other levels may be included resolution of the administrators of the rules of the incoming and outgoing traffic. These rules and settings can alter the way the network package.

Configuring PBR includes construction of route-map with the installation instructions, which include the appropriate route-map interface. IP routing must be enabled on the interfaces to control PBR. PBR can only be allowed for incoming traffic through these interfaces.

Aug. 20, 2015, 8:45 a.m.

Qt

Qt, Qt урок, QTimer, QTimer example, QTimer таймер

Few talk about the use of class QTimer in Qt. This is a small lightweight theme after a series of articles about QSqlTabelModel volume and the resulting consequences of it.

Timers we may need to create a poll LAN devices via TCP / IP stack with certain intervals or hourly data validation or active connections to the server. Yes to anything !? And here we come to the aid QTimer, which we consider the example of output every second time QLabel.

Project structure

We use a minimum of files in our project:

  • QDataMapperWidget.pro
  • mainwindow.h - header file of the main application window;
  • mainwindow.cpp -source window;
  • main.cpp - the main source file from which the application starts;
  • mainwindow.ui - form of the main application window;

A draw form in the Designer Qt Creator. But there is nothing to draw. QLabel thrown into the middle and ready.

Aug. 19, 2015, 3:59 a.m.

Qt

mapper, QDataWidgetMapper, QDataWidgetMapper example, QSqlTableModel, qt, sql

To display the data in a widget with an arbitrary use QDataMapperWidget class. To work with this widget is still required model for presentation.

For example, QSqlTableModel or QSqlRelationalTableModel , but the data is not already substituted QTableView , and various arbitrary objects. For example QLineEdit or QComboBox . Or in the dialog box to add records with which to work in this article.

Thus, the problem is as follows. Write a program that displays a list of computers in the table, and each computer has three data fields: Имя Хоста, IP-адрес и MAC-адрес. There should also be a button to display the dialog box, through which we can add a new device to the table. Also, we should be able to edit the records through the same dialog box.

Project structure of QDataWidgetMapper

The project is created as an application Qt Widgets, where the following files are created:

  • QDataMapperWidget.pro ;
  • mainwindow.h - header file of the main application window;
  • mainwindow.cpp - source code of window;
  • main.cpp - the main source file from which the application starts;
  • mainwindow.ui - form of the main application window;
  • database.h - header file of helper class to be used for information that is placed in a database;
  • database.cpp - source code of helper class file to be used for information that is placed in a database;
  • dialogadddevice.h - header file dialog to add or edit entries;
  • dialogadddevice.cpp - source file dialog box to add and edit entries;
  • dialogadddevice.ui

Note. Most of the interface is created in the designer, so as not to clutter up the main logic code superfluous information. In fact it is only a matter of taste and habit.

Aug. 18, 2015, 12:20 p.m.

Data Transmission Technologies

MSTP, RSTP, STP

Configuring STP for DELL switches (depending on the version of the OS switch syntax may vary slightly.)

Before making STP setting on the switch port, you must set a global preference protocol:

console(config)# spanning-tree 
console(config)# spanning-tree mode rstp 
console(config)# spanning-tree priority 12288 
console(config)# spanning-tree hello-time 5 
console(config)# spanning-tree max-age 12 
console(config)# spanning-tree forward-time 25 
console(config)# exit

In this case, the adjusted version of the protocol, switch priority in the construction of the tree, while promoting the package, the duration of sending hello packet. Once made global protocol setting, make the setting Protocol on the switch ports that will participate in the construction of the tree topology.

Aug. 17, 2015, 2:55 a.m.

Qt

QSqlQueryModel, qsqlquerymodel example, qt, qt таблицы, query

Using QSqlQueryModel to form tables in Qt is the most hardcore version with the lowest level of abstraction than the use QSqlTableModel or QSqlRelationalTableModel . But with all this, and the most flexible option, which requires a deeper knowledge of the language of SQL-queries. In a previous article , two tables were constructed:

  • The main, which were columns Дата, Время, Имя Хоста, IP-адрес.
  • Table devices , which were columns Имя Хоста and IP-адрес.

In the main table in the columns of the host name and IP-address points ID-devices, which carried out a substitution of data from the device tables. In this paper, the structure of the first table and therefore the table will look different:

  • The main, which were columns Дата, Время, ID устройства.
  • Table devices , which were columns Имя Хоста and IP-адрес.

The Generating of the main table in the Application will be SQL-query and the table will be a column respectively Дата, Время, Имя Хоста and IP-адрес.

Donate

Hello, Dear Users of EVILEG!!!

If the site helped you, then support the development of the site financially, please.

You can do it by following ways:

Thank you, Evgenii Legotckoi

AT
Dec. 10, 2019, 8:06 a.m.
Anastasija Troschenkova

C++ - Test 001. The first program and data types

  • Result:60points,
  • Rating points-1
AT
Dec. 10, 2019, 8:02 a.m.
Anastasija Troschenkova

Qt - Test 001. Signals and slots

  • Result:73points,
  • Rating points1
g
Dec. 10, 2019, 4:51 a.m.
gisLu

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:40points,
  • Rating points-8
Last comments
Dec. 9, 2019, 3:41 a.m.
Evgenij Legotskoj

Эта ошибка invalid use of incomplete type ‘class Ui::AnotherWindow’ обычно говорит о том, что не найдено определение класса или структуры. Типичная проблема - не подключён заголовочны…
NB
Dec. 9, 2019, 3:36 a.m.
Nikolaj Batmanov

Ну, не настолько со мной всё полхо...))) Вроде бы. Я ж кнопки отрисовываю.
Dec. 9, 2019, 3:14 a.m.
Evgenij Legotskoj

Добрый день. У вас ui файлов по ходу нет. UI файлы используются для вёрстки в графическом дизайнере.
NB
Dec. 9, 2019, 3:05 a.m.
Nikolaj Batmanov

Здравствуйте! Полностью скопировал ваш пример к себе, чтобы разобраться. А он не хочет запускаться, дает ошибку: invalid use of incomplete type ‘class Ui::AnotherWindow’ ui(new Ui…
Dec. 8, 2019, 7:23 a.m.
Evgenij Legotskoj

У меня здесь есть одна старая статья с примером векторного редактора. Там есть ответы на ваши вопросы. Поизучайте Qt/C++ - Урок 072. Пример векторного редактора на Qt QGraphicsItem, QG…
Now discuss on the forum
MU
Dec. 11, 2019, 8:27 a.m.
Maciej Urmański

Thank you! Now works, and this is solution. num_embed = Embed.objects.filter(added_by=recipe.added_by).count()
Dec. 11, 2019, 8:12 a.m.
Mihailll

Так работает. Взял этот пример https://api-2d3d-cad.com/face_recognition_with_opencv/ void MainWindow::on_pushButton_4_clicked() //фото определение лица{ // Load Face cascade (.xml…
TD
Dec. 10, 2019, 4:14 a.m.
Timur Dosov

Спасибо, работает. А ещё вопрос: как загрузить страницу с динамической подгрузкой контента по скроллингу? Например - [https://ntvplus.ru/tv/]. Пока делаю через костыль - QApplication::s…
Dec. 9, 2019, 7:16 a.m.
qml_puthon_user

Я сделал простой вывод текста по испусканию сигнала... Чего не хватает программе?) Python: # системные библиотекиimport cv2import numpy as npimport sysimport threading# PyQt б…
SK
Dec. 8, 2019, 4:11 p.m.
Semen Kosandjak

інтерфейс qt, приклад того додаю на малюнку, я натискаю на кнопку і у мене з'являється 2 текст лайну в які я вводжу значення, тобто в 1 цифри,у другому випадку це літери, тобто c++, без графічно…
EVILEG
About
Services
© EVILEG 2015-2019
Recommend hosting TIMEWEB