Skip to content

Commit

Permalink
revise the logic of outputing the list of int for hsv bound in Detect…
Browse files Browse the repository at this point in the history
…Task.java
  • Loading branch information
xianglic committed Mar 15, 2024
1 parent 2d6fbe0 commit 7f84be7
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 7f84be7

Please sign in to comment.