Skip to content

Commit

Permalink
Bag with write operations
Browse files Browse the repository at this point in the history
  • Loading branch information
maisvendoo committed Nov 27, 2017
1 parent cf40209 commit 7bc07bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 4 additions & 5 deletions forms/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
<rect>
<x>320</x>
<y>0</y>
<width>51</width>
<width>61</width>
<height>17</height>
</rect>
</property>
Expand All @@ -228,7 +228,7 @@
<rect>
<x>400</x>
<y>0</y>
<width>51</width>
<width>61</width>
<height>17</height>
</rect>
</property>
Expand Down Expand Up @@ -461,7 +461,7 @@
<rect>
<x>580</x>
<y>210</y>
<width>101</width>
<width>131</width>
<height>17</height>
</rect>
</property>
Expand Down Expand Up @@ -550,7 +550,7 @@
<x>0</x>
<y>0</y>
<width>1041</width>
<height>21</height>
<height>22</height>
</rect>
</property>
</widget>
Expand All @@ -568,4 +568,3 @@
<resources/>
<connections/>
</ui>

7 changes: 4 additions & 3 deletions include/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ struct abstract_request_t
quint16 address;
/// Data count
quint16 count;
/// Data
quint16 data[MAX_DATA_SIZE / 2];

abstract_request_t()
{
id = 1;
func = 0x00;
count = 0;
memset(data, 0, sizeof(quint16) * MAX_DATA_SIZE / 2);
}
};

Expand Down Expand Up @@ -110,11 +113,9 @@ Q_DECLARE_METATYPE(read_request_t)

struct write_request_t : public abstract_request_t
{
quint16 data[MAX_DATA_SIZE / 2];

write_request_t() : abstract_request_t()
{
memset(data, 0, sizeof(quint16) * MAX_DATA_SIZE / 2);

}
};

Expand Down

0 comments on commit 7bc07bc

Please sign in to comment.