Skip to content

Commit 08b35cf

Browse files
committed
Modify precision value for cpx and clue
1 parent a03d3d8 commit 08b35cf

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

src/view/components/toolbar/InputSlider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class InputSlider extends React.Component<ISliderProps, any, any> {
2121

2222
render() {
2323
const isInputDisabled = this.context === VIEW_STATE.PAUSE;
24-
const nbDecimals = this.props.step.toString().split(".")[1].length || 0;
24+
25+
const nbDecimals =
26+
this.props.step.toString().split(".")[1]?.length || 0;
2527
return (
2628
<div className="input-slider">
2729
<span>{this.props.axisLabel}</span>

src/view/components/toolbar/clue/ClueSensorProperties.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ISensorProps, ISliderProps } from "../../../viewUtils";
44
const CLUE_SLIDER_R: ISliderProps = {
55
axisLabel: "R",
66
maxLabel: "Max",
7-
maxValue: 255,
7+
maxValue: 65535,
88
minLabel: "Min",
99
minValue: 0,
1010
type: SENSOR_LIST.LIGHT_R,
@@ -14,7 +14,7 @@ const CLUE_SLIDER_R: ISliderProps = {
1414
const CLUE_SLIDER_G: ISliderProps = {
1515
axisLabel: "G",
1616
maxLabel: "Max",
17-
maxValue: 255,
17+
maxValue: 65535,
1818
minLabel: "Min",
1919
minValue: 0,
2020
type: SENSOR_LIST.LIGHT_G,
@@ -24,7 +24,7 @@ const CLUE_SLIDER_G: ISliderProps = {
2424
const CLUE_SLIDER_B: ISliderProps = {
2525
axisLabel: "B",
2626
maxLabel: "Max",
27-
maxValue: 255,
27+
maxValue: 65535,
2828
minLabel: "Min",
2929
minValue: 0,
3030
type: SENSOR_LIST.LIGHT_B,
@@ -54,7 +54,7 @@ const CLUE_MAGNET_X: ISliderProps = {
5454
maxValue: 1000,
5555
minValue: -1000,
5656
type: SENSOR_LIST.MAGNET_X,
57-
step: 1,
57+
step: 0.1,
5858
};
5959
const CLUE_MAGNET_Y: ISliderProps = {
6060
axisLabel: "Y",
@@ -63,7 +63,7 @@ const CLUE_MAGNET_Y: ISliderProps = {
6363
maxValue: 1000,
6464
minValue: -1000,
6565
type: SENSOR_LIST.MAGNET_Y,
66-
step: 1,
66+
step: 0.1,
6767
};
6868
const CLUE_MAGNET_Z: ISliderProps = {
6969
axisLabel: "Z",
@@ -72,7 +72,7 @@ const CLUE_MAGNET_Z: ISliderProps = {
7272
maxValue: 1000,
7373
minValue: -1000,
7474
type: SENSOR_LIST.MAGNET_Z,
75-
step: 1,
75+
step: 0.1,
7676
};
7777

7878
export const CLUE_MAGNET_PROPERTIES: ISensorProps = {
@@ -87,7 +87,7 @@ const CLUE_GYRO_X: ISliderProps = {
8787
maxValue: 1000,
8888
minValue: -1000,
8989
type: SENSOR_LIST.GYRO_X,
90-
step: 1,
90+
step: 0.1,
9191
};
9292
const CLUE_GYRO_Y: ISliderProps = {
9393
axisLabel: "Y",
@@ -96,7 +96,7 @@ const CLUE_GYRO_Y: ISliderProps = {
9696
maxValue: 1000,
9797
minValue: -1000,
9898
type: SENSOR_LIST.GYRO_Y,
99-
step: 1,
99+
step: 0.1,
100100
};
101101
const CLUE_GYRO_Z: ISliderProps = {
102102
axisLabel: "Z",
@@ -105,7 +105,7 @@ const CLUE_GYRO_Z: ISliderProps = {
105105
maxValue: 1000,
106106
minValue: -1000,
107107
type: SENSOR_LIST.GYRO_Z,
108-
step: 1,
108+
step: 0.1,
109109
};
110110

111111
export const CLUE_GYRO_PROPERTIES: ISensorProps = {
@@ -124,7 +124,7 @@ export const CLUE_HUMIDITY_PROPERTIES: ISensorProps = {
124124
minLabel: "Min",
125125
minValue: 0,
126126
type: SENSOR_LIST.HUMIDITY,
127-
step: 1,
127+
step: 0.1,
128128
},
129129
],
130130
unitLabel: "%",
@@ -154,7 +154,7 @@ export const CLUE_PRESSURE_PROPERTIES: ISensorProps = {
154154
minLabel: "Min",
155155
minValue: 800,
156156
type: SENSOR_LIST.PRESSURE,
157-
step: 1,
157+
step: 0.1,
158158
},
159159
],
160160
unitLabel: "hPa",
@@ -166,7 +166,7 @@ const MOTION_SLIDER_PROPS_X: ISliderProps = {
166166
minLabel: "Left",
167167
minValue: -1023,
168168
type: SENSOR_LIST.MOTION_X,
169-
step: 1,
169+
step: 0.1,
170170
};
171171

172172
const MOTION_SLIDER_PROPS_Y: ISliderProps = {
@@ -176,7 +176,7 @@ const MOTION_SLIDER_PROPS_Y: ISliderProps = {
176176
minLabel: "Back",
177177
minValue: -1023,
178178
type: SENSOR_LIST.MOTION_Y,
179-
step: 1,
179+
step: 0.1,
180180
};
181181

182182
const MOTION_SLIDER_PROPS_Z: ISliderProps = {
@@ -186,7 +186,7 @@ const MOTION_SLIDER_PROPS_Z: ISliderProps = {
186186
minLabel: "Up",
187187
minValue: -1023,
188188
type: SENSOR_LIST.MOTION_Z,
189-
step: 1,
189+
step: 0.1,
190190
};
191191

192192
export const MOTION_SENSOR_PROPERTIES: ISensorProps = {
@@ -206,7 +206,7 @@ const TEMPERATURE_SLIDER_PROPS: ISliderProps = {
206206
minLabel: "Cold",
207207
minValue: -55,
208208
type: SENSOR_LIST.TEMPERATURE,
209-
step: 1,
209+
step: 0.1,
210210
};
211211

212212
export const TEMPERATURE_SENSOR_PROPERTIES: ISensorProps = {

0 commit comments

Comments
 (0)