Skip to content

Commit

Permalink
Merge pull request #12 from icarpis/new_ds5_controls_order
Browse files Browse the repository at this point in the history
Determine the order of controls appearance in rs-config app
  • Loading branch information
dorodnic authored and GitHub Enterprise committed Jul 19, 2017
2 parents 39e72cf + 5ebf85d commit 80d394a
Show file tree
Hide file tree
Showing 16 changed files with 718 additions and 201 deletions.
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
bin/
lib/

ubuntu-xenial/

# CMake
build/

Expand Down Expand Up @@ -33,10 +35,8 @@ local_ignore/
# QTCreator Project
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.user
*.user.*
*.moc
moc_*.cpp
qrc_*.cpp
Expand All @@ -45,7 +45,6 @@ Makefile*
*-build-*
librealsense-log.txt

*.vcxproj.user
*.pyproj
*.orig
*.psess
Expand Down
37 changes: 37 additions & 0 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,43 @@ namespace rs2
}
}

void subdevice_model::draw_options(const std::vector<rs2_option>& drawing_order,
bool update_read_only_options, std::string& error_message)
{
for (auto& opt : drawing_order)
{
draw_option(opt, update_read_only_options, error_message);
}

for (auto i = 0; i < RS2_OPTION_COUNT; i++)
{
auto opt = static_cast<rs2_option>(i);
if(std::find(drawing_order.begin(), drawing_order.end(), opt) == drawing_order.end())
{
draw_option(opt, update_read_only_options, error_message);
}
}
}

void subdevice_model::draw_option(rs2_option opt, bool update_read_only_options,
std::string& error_message)
{
auto&& metadata = options_metadata[opt];
if (update_read_only_options)
{
metadata.update_supported(error_message);
if (metadata.supported && streaming)
{
metadata.update_read_only(error_message);
if (metadata.read_only)
{
metadata.update_all(error_message);
}
}
}
metadata.draw(error_message);
}

stream_model::stream_model()
: texture ( std::unique_ptr<texture_buffer>(new texture_buffer()))
{}
Expand Down
4 changes: 4 additions & 0 deletions common/model-views.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ namespace rs2
void stop();
void play(const std::vector<stream_profile>& profiles);
void update(std::string& error_message);
void draw_options(const std::vector<rs2_option>& drawing_order,
bool update_read_only_options, std::string& error_message);
void draw_option(rs2_option opt, bool update_read_only_options,
std::string& error_message);

bool is_paused() const;
void pause();
Expand Down
110 changes: 110 additions & 0 deletions include/librealsense/rs2_advanced_mode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,116 @@

inline std::ostream & operator << (std::ostream & o, rs2_rs400_visual_preset preset) { return o << rs2_advanced_mode_preset_to_string(preset); }

bool operator==(const STDepthControlGroup& a, const STDepthControlGroup& b)
{
return (a.plusIncrement == b.plusIncrement &&
a.minusDecrement == b.minusDecrement &&
a.deepSeaMedianThreshold == b.deepSeaMedianThreshold &&
a.scoreThreshA == b.scoreThreshA &&
a.scoreThreshB == b.scoreThreshB &&
a.textureDifferenceThreshold == b.textureDifferenceThreshold &&
a.textureCountThreshold == b.textureCountThreshold &&
a.deepSeaSecondPeakThreshold == b.deepSeaSecondPeakThreshold &&
a.deepSeaNeighborThreshold == b.deepSeaNeighborThreshold &&
a.lrAgreeThreshold == b.lrAgreeThreshold);
}

bool operator==(const STRsm& a, const STRsm& b)
{
return (a.rsmBypass == b.rsmBypass &&
a.diffThresh == b.diffThresh &&
a.sloRauDiffThresh == b.sloRauDiffThresh &&
a.removeThresh == b.removeThresh);
}

bool operator==(const STRauSupportVectorControl& a, const STRauSupportVectorControl& b)
{
return (a.minWest == b.minWest &&
a.minEast == b.minEast &&
a.minWEsum == b.minWEsum &&
a.minNorth == b.minNorth &&
a.minSouth == b.minSouth &&
a.minNSsum == b.minNSsum &&
a.uShrink == b.uShrink &&
a.vShrink == b.vShrink);
}

bool operator==(const STColorControl& a, const STColorControl& b)
{
return (a.disableSADColor == b.disableSADColor &&
a.disableRAUColor == b.disableRAUColor &&
a.disableSLORightColor == b.disableSLORightColor &&
a.disableSLOLeftColor == b.disableSLOLeftColor &&
a.disableSADNormalize == b.disableSADNormalize);
}

bool operator==(const STRauColorThresholdsControl& a, const STRauColorThresholdsControl& b)
{
return (a.rauDiffThresholdRed == b.rauDiffThresholdRed &&
a.rauDiffThresholdGreen == b.rauDiffThresholdGreen &&
a.rauDiffThresholdBlue == b.rauDiffThresholdBlue);
}

bool operator==(const STSloColorThresholdsControl& a, const STSloColorThresholdsControl& b)
{
return (a.diffThresholdRed == b.diffThresholdRed &&
a.diffThresholdGreen == b.diffThresholdGreen &&
a.diffThresholdBlue == b.diffThresholdBlue);
}

bool operator==(const STSloPenaltyControl& a, const STSloPenaltyControl& b)
{
return (a.sloK1Penalty == b.sloK1Penalty &&
a.sloK2Penalty == b.sloK2Penalty &&
a.sloK1PenaltyMod1 == b.sloK1PenaltyMod1 &&
a.sloK2PenaltyMod1 == b.sloK2PenaltyMod1 &&
a.sloK1PenaltyMod2 == b.sloK1PenaltyMod2 &&
a.sloK2PenaltyMod2 == b.sloK2PenaltyMod2);
}

bool operator==(const STHdad& a, const STHdad& b)
{
return (a.lambdaCensus == b.lambdaCensus &&
a.lambdaAD == b.lambdaAD &&
a.ignoreSAD == b.ignoreSAD);
}

bool operator==(const STColorCorrection& a, const STColorCorrection& b)
{
return (a.colorCorrection1 == b.colorCorrection1 &&
a.colorCorrection2 == b.colorCorrection2 &&
a.colorCorrection3 == b.colorCorrection3 &&
a.colorCorrection4 == b.colorCorrection4 &&
a.colorCorrection5 == b.colorCorrection5 &&
a.colorCorrection6 == b.colorCorrection6 &&
a.colorCorrection7 == b.colorCorrection7 &&
a.colorCorrection8 == b.colorCorrection8 &&
a.colorCorrection9 == b.colorCorrection9 &&
a.colorCorrection10 == b.colorCorrection10 &&
a.colorCorrection11 == b.colorCorrection11 &&
a.colorCorrection12 == b.colorCorrection12);
}

bool operator==(const STAEControl& a, const STAEControl& b)
{
return (a.meanIntensitySetPoint == b.meanIntensitySetPoint);
}

bool operator==(const STDepthTableControl& a, const STDepthTableControl& b)
{
return (a.depthUnits == b.depthUnits &&
a.depthClampMin == b.depthClampMin &&
a.depthClampMax == b.depthClampMax &&
a.disparityMode == b.disparityMode &&
a.disparityShift == b.disparityShift);
}

bool operator==(const STCensusRadius& a, const STCensusRadius& b)
{
return (a.uDiameter == b.uDiameter &&
a.vDiameter == b.vDiameter);
}

namespace rs400
{
class advanced_mode : public rs2::device
Expand Down
3 changes: 1 addition & 2 deletions include/librealsense/rs2_advanced_mode_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef enum rs2_rs400_visual_preset
RS2_RS400_VISUAL_PRESET_COUNT
} rs2_rs400_visual_preset;

const char* rs2_advanced_mode_preset_to_string (rs2_rs400_visual_preset preset);
const char* rs2_advanced_mode_preset_to_string(rs2_rs400_visual_preset preset);

typedef struct
{
Expand Down Expand Up @@ -144,7 +144,6 @@ typedef struct
uint32_t vDiameter;
}STCensusRadius;


#ifdef __cplusplus
extern "C"{
#endif
Expand Down
Loading

0 comments on commit 80d394a

Please sign in to comment.