Skip to content
Snippets Groups Projects
Commit 15eafcca authored by bodzsoaa's avatar bodzsoaa
Browse files

Group settings

parent a8cdbeb2
No related branches found
No related tags found
No related merge requests found
...@@ -95,14 +95,18 @@ bool Configuration::debug_mode() const { return debug_mode_; } ...@@ -95,14 +95,18 @@ bool Configuration::debug_mode() const { return debug_mode_; }
void Configuration::LoadSettings() { void Configuration::LoadSettings() {
// Building specific constants // Building specific constants
settings_.beginGroup("building");
floors_ = settings_.value("floors", 13).toUInt(); floors_ = settings_.value("floors", 13).toUInt();
rooms_per_floor_ = settings_.value("rooms_per_floor", 8).toUInt(); rooms_per_floor_ = settings_.value("rooms_per_floor", 8).toUInt();
windows_per_room_ = settings_.value("windows_per_room", 2).toUInt(); windows_per_room_ = settings_.value("windows_per_room", 2).toUInt();
settings_.endGroup();
// Hardware specific constants // Hardware specific constants
settings_.beginGroup("hardware");
vertical_pixel_unit_ = settings_.value("vertical_pixel_unit", 2).toUInt(); vertical_pixel_unit_ = settings_.value("vertical_pixel_unit", 2).toUInt();
horizontal_pixel_unit_ = settings_.value("horizontal_pixel_unit", 2).toUInt(); horizontal_pixel_unit_ = settings_.value("horizontal_pixel_unit", 2).toUInt();
color_depth_ = settings_.value("color_depth", 3).toUInt(); color_depth_ = settings_.value("color_depth", 3).toUInt();
settings_.endGroup();
// Software specific constants // Software specific constants
pixels_per_window_ = vertical_pixel_unit_ * horizontal_pixel_unit_; pixels_per_window_ = vertical_pixel_unit_ * horizontal_pixel_unit_;
...@@ -117,6 +121,7 @@ void Configuration::LoadSettings() { ...@@ -117,6 +121,7 @@ void Configuration::LoadSettings() {
frame_.fill(Qt::black); frame_.fill(Qt::black);
// Network protocol specific constants // Network protocol specific constants
settings_.beginGroup("network");
protocol_type_ = 2; protocol_type_ = 2;
unicast_animation_port_ = unicast_animation_port_ =
settings_.value("unicast_animation_port", 3000).toUInt(); settings_.value("unicast_animation_port", 3000).toUInt();
...@@ -144,6 +149,7 @@ void Configuration::LoadSettings() { ...@@ -144,6 +149,7 @@ void Configuration::LoadSettings() {
frame_fragment_size_ = max_windows_per_datagram_ * pixels_per_window_ * 3; frame_fragment_size_ = max_windows_per_datagram_ * pixels_per_window_ * 3;
max_packet_number_ = static_cast<std::uint32_t>( max_packet_number_ = static_cast<std::uint32_t>(
std::ceil(static_cast<float>(windows_) / max_windows_per_datagram_)); std::ceil(static_cast<float>(windows_) / max_windows_per_datagram_));
settings_.endGroup();
// TODO Configuration check // TODO Configuration check
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment