This repository has been archived by the owner on Jun 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GUI elements are now a separate class to reduce code reuse GUI now has clickable buttons for frequency on FC3 aircraft
- Loading branch information
Ciaran Fisher
committed
Sep 3, 2015
1 parent
bf4d432
commit 1b6716f
Showing
14 changed files
with
359 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "RadioUpdateCommand.h" | ||
#include "json/json.h" | ||
|
||
namespace SimpleRadio | ||
{ | ||
|
||
RadioUpdateCommand::RadioUpdateCommand() | ||
{ | ||
} | ||
|
||
|
||
RadioUpdateCommand::~RadioUpdateCommand() | ||
{ | ||
} | ||
|
||
const RadioUpdateCommand RadioUpdateCommand::deserialize(const std::string& document) | ||
{ | ||
RadioUpdateCommand data; | ||
Json::Reader reader; | ||
Json::Value root; | ||
|
||
bool success = reader.parse(document, root, false); | ||
if (success == true) | ||
{ | ||
data.freq = root["freq"].asDouble(); | ||
data.radio = root["radio"].asInt(); | ||
} | ||
else | ||
{ | ||
throw std::string("Failed to parse Update Command"); | ||
} | ||
|
||
return data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
#include <string> | ||
namespace SimpleRadio | ||
{ | ||
class RadioUpdateCommand | ||
{ | ||
public: | ||
|
||
double freq; | ||
int radio; | ||
|
||
RadioUpdateCommand(); | ||
~RadioUpdateCommand(); | ||
|
||
static const RadioUpdateCommand deserialize(const std::string& document); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.