Evgenij LegotskojAug. 22, 2015, 9 p.m.

AVRBCD format in Assembler in AVR Atmega

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.

Evgenij LegotskojAug. 21, 2015, 9:30 p.m.

AVRTWI interface in microcontrollers AVR Atmega

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.

Evgenij LegotskojAug. 21, 2015, 12:26 p.m.

Data Transmission TechnologiesDELL Networking. Basics Routing Policy (Part 1)

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.

Evgenij LegotskojAug. 20, 2015, 8:45 a.m.

QtQt/C++ - Lesson 009. QTimer – How to work with timer?

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.

Evgenij LegotskojAug. 19, 2015, 3:59 a.m.

QtQt/C++ - Lesson 008. QDataWidgetMapper - Working with the database via a widget

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.

Evgenij LegotskojAug. 18, 2015, 12:20 p.m.

Data Transmission TechnologiesDELL Networking. STP Configuring

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.

Evgenij LegotskojAug. 17, 2015, 2:55 a.m.

QtQt/C++ - Lesson 006. QSqlQueryModel – Tables in Qt with SQL-query

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-адрес.

Evgenij LegotskojAug. 16, 2015, 11:32 a.m.

QtQt WinAPI - Lesson 002. How to make win installer for Qt apllication?

WinAPI, DLL, InnoSetup, Windows, Qt, Инсталлятор

In the previous article we learned how to quickly collect all used in the project DLL-libraries. And now it is time to talk about how to build an installer for OS Windows. For a long time I use quite comfortable opensource tool called InnoSetup, which allows just a few clicks to collect a multilingual installer.

The installer utility is going from a script, you can write to blows, or use a script to create the script. The second embodiment is sufficiently effective and easier.

Build installer

Step one. Running the build script

To run the script, go to the menu and choose to create a new one: File > New or combination of keys Ctrl + N.

Then click on the button Next.

Evgenij LegotskojAug. 16, 2015, 10:43 a.m.

QtQt WinAPI - Lesson 001. How to collect all DLL, which used in Qt project?

WinAPI, DLL, DLL Collector, DLLCollector, Qt

Sooner or later before any Qt-developer gets the necessary migration of your application on other computers, and then there is the problem of the availability of libraries on the target computer that are needed to start and run the application. This is especially noticeable when the application can transfer that must be executed under of Windows. If the Linux OS the necessary Qt libraries are present by default, such as with of Ubuntu, is a Windows and they can not be.

But finding and assembling all the necessary libraries can be difficult for a newcomer, and quite tedious task for an experienced programmer. But here, thanks to the good people there is a solution. This utility DLL Collector . This utility allows you to program depending on which was written in the framework, Qt library and automatically copy data to the specified folder.

As the author writes, the utility searches for dependencies in runtime process. Therefore your program must run through this utility. DLL Collector collects information about all loadable plug-ins used by your program, but it should not be forgotten that the plugins are loaded when you first use them in your program functions. Thus, you need to run your program on its functionality to DLL Collector Found all libraries.

Evgenij LegotskojAug. 15, 2015, 12:31 p.m.

QtQt/C++ - Lesson 005. QSqlRelationalTableModel - The work with relational tables

QSqlRelationalTableModel, QSqlRelationalTableModel example, qt, qt таблицы, sql, sqlite

In Qt to represent table fields, which involve foreign keys to other tables database, QSqlRelationalTableModel can be used, which is a more advanced version QSqlTableModel class, which was considered in the previous article .

This class allows you to set relationships between tables and substitute values in the representation of the table formed by the values of the connected tables.

This article discusses the option of two tables. One table contains information about the devices (host name and IP address), and the second table ID of the device, which in the second table to be substituted host name and IP address of the device, respectively.

Project Structure for QSqlRelationalTableModel

Структура проекта

The project for this tutorial is a modified version of the preceding Article and remains unchanged.

Timeweb

Let me recommend you the excellent hosting on which EVILEG is located.

For many years, Timeweb has been proving his stability.

For projects on Django I recommend VDS hosting

View Hosting
SN

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

  • Result:10points,
  • Rating points-10
k
  • knobu
  • Sept. 23, 2020, 2:34 a.m.

C++ - Test 006. Enumerations

  • Result:60points,
  • Rating points-1
k
  • knobu
  • Sept. 23, 2020, 2:21 a.m.

C++ - Test 005. Structures and Classes

  • Result:91points,
  • Rating points8
Last comments
DI

Qt/C++ - Lesson 015. QTableWidget – How to create a table with checkboxes?

Кто-нибудь знает, как сделать так, чтобы в QTableWidget состоящей из чекбоксов в строке таблицы можно было выбрать только один checkbox ?

Qt/C++ - Lesson 006. QSqlQueryModel – Tables in Qt with SQL-query

QSqlTableModel выполняет ряд стандартных операций для одной таблицы из базы данных. Поэтому там и реализован функционал по удалению и редактированию. QSqlQueryModel позволяет выполнить запр…
VB

Qt/C++ - Lesson 006. QSqlQueryModel – Tables in Qt with SQL-query

Добрый день. Хотел спросить вот что. Создал проект на основе QAbstractTableModel. В MainWindow cоответственно создал модель и связал с представлением. Поиск веду по списку элементов модели,…

QCheckBox в качестве делегата QTableView

До тех пор, пока у вас проект содержит только одну таблицу, или несколько то может быть. Когда их будет 1000 и чекбоксы в разных колонках, то без делегатов и переопределения возвращаемых ре…
D
  • Damir
  • Sept. 20, 2020, 3:34 p.m.

QCheckBox в качестве делегата QTableView

bool Node::setData(const QModelIndex& index, const QVariant& value, int role){ switch (index.column()) { case 0: switch (role) { case Qt::CheckStateRole:// <- т…
Now discuss on the forum
DI

Как в QTableWidget, состоящей из чекбоксов, в строке таблицы можно было выбрать только один checkbox ?

Сделал таблицу состоящую из чекбоксов по уроку https://evileg.com/ru/post/78/ Кто-нибудь знает, как сделать так, чтобы в QTableWidget состоящей из чекбоксов в строке таблицы можно …
U

как скрыть елемент с копии виджета

Удалить пост нельзя... Поэтому удачки, Катту)
H

Тесты падают при сборке под MinGW.

Всем привет! При сборке под MinGW некоторые тесты при старте выдают FATAL "не удалось запустить тест проекта" и подвешивают Qt Creator - приходится его перезапускать. При сборке под MSVC та…

Как в qml работать с динамически созданными потомками?

Спасибо) В Qt/С++ есть функция deleteLater, которую обычно используют, чтобы удалить объекты, которые наследованы от QObject . Она добавлена для того, чтобы не удалять такие…

Как в Qt в qmenu добавить scrollarea

Вот это наследованный класс меню. Но посути это обычное меню. #pragma once#include <QtWidgets>class TransMenu : public QMenu { Q_OBJECTpublic: TransMenu(QWidget* parent = …
About
Services
© EVILEG 2015-2020
Recommend hosting TIMEWEB