Skip to content

Commit

Permalink
Merge pull request #22 from xianglic/merge_ver
Browse files Browse the repository at this point in the history
revise the logic of outputing the list of int for hsv bound
  • Loading branch information
teiszler authored Mar 15, 2024
2 parents 2d6fbe0 + 7f84be7 commit 8342c6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public String toJson() {
return String.format("{'lng': %s, 'lat': %s, 'alt': %s}", x, y, z);
}
}
public record HSV(double h, double s, double v) {
public record HSV(int h, int s, int v) {
public String toString() {
return String.format("[%s, %s, %s]", int(h), int(s), int(v));
return String.format("[%s, %s, %s]", h, s, v);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ static Tuple2<String, Task> createTask(GenericNode<? extends GenericNode<?>> tas
}

// HSV
var nums = attrMap.get("hsv_upper_bound").child(BotPsiElementTypes.PAREN).child(BotPsiElementTypes.TUPLE).childrenOfType(BotPsiElementTypes.NUMBER).map(t -> t.tokenText().toFloat()).toImmutableSeq();
var nums = attrMap.get("hsv_upper_bound").child(BotPsiElementTypes.PAREN).child(BotPsiElementTypes.TUPLE).childrenOfType(BotPsiElementTypes.NUMBER).map(t -> t.tokenText().toInt()).toImmutableSeq();
var hsv_upper_bound = new DetectTask.HSV(nums.get(0), nums.get(1), nums.get(2));
nums = attrMap.get("hsv_lower_bound").child(BotPsiElementTypes.PAREN).child(BotPsiElementTypes.TUPLE).childrenOfType(BotPsiElementTypes.NUMBER).map(t -> t.tokenText().toFloat()).toImmutableSeq();
nums = attrMap.get("hsv_lower_bound").child(BotPsiElementTypes.PAREN).child(BotPsiElementTypes.TUPLE).childrenOfType(BotPsiElementTypes.NUMBER).map(t -> t.tokenText().toInt()).toImmutableSeq();
var hsv_lower_bound = new DetectTask.HSV(nums.get(0), nums.get(1), nums.get(2));

// construct new task
Expand Down

0 comments on commit 8342c6a

Please sign in to comment.