Skip to content

Commit

Permalink
chore: rename sensor status
Browse files Browse the repository at this point in the history
  • Loading branch information
mmadfox committed Aug 20, 2023
1 parent 143682c commit b2aa432
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,21 @@ tracker.AddRoute(route...)
A sensor provides a flexible and expandable way to represent and work with sensors. It enables the generation of different values for various tasks, making it suitable for diverse applications and use cases, including sensor data collection, modeling, or analysis.

```go
// types.WithStart: Generation starts from the minimum value of 1 to 10
// types.WithEnd: Generation ends at the minimum value from 10 to 1
// types.WithRandom: Data generation follows a Bezier curve from 1 to 10
// types.WithSensorStartMode: Generation starts from the minimum value of 1 to 10
// types.WithSensorEndMode: Generation ends at the minimum value from 10 to 1
// types.WithSensorRandomMode: Data generation follows a Bezier curve from 1 to 10

minValue := 1
maxValue := 10
amplitude := 16 // 4 - 512

s1, err := gpsgen.NewSensor("s1", minValue, maxValue, amplitude, types.WithStart|types.WithRandom|types.WithEnd)
s1, err := gpsgen.NewSensor("s1", minValue, maxValue, amplitude, types.WithSensorStartMode|types.WithSensorRandomMode|types.WithSensorEndMode)
if err != nil {
panic(err)
}

droneTracker.AddSensor(s1)
s2, err := gpsgen.NewSensor("s2", 10, 20, 16, types.WithRandom|types.WithEnd)
s2, err := gpsgen.NewSensor("s2", 10, 20, 16, types.WithSensorRandomMode|types.WithSensorEndMode)
if err != nil {
panic(err)
}
Expand Down
10 changes: 5 additions & 5 deletions README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,21 @@ tracker.AddRoute(route...)
для различных приложений и вариантов использования, включающих сбор данных датчиков, моделирование или анализ.

```go
// types.WithStart: Генерация начинается с минимального значения от 1 до 10
// types.WithEnd: Генерация заканчивается минимальным значением от 10 до 1
// types.WithRandom: Генерация данных по кривой безье 1 - 10
// types.WithSensorStartMode: Генерация начинается с минимального значения от 1 до 10
// types.WithSensorEndMode: Генерация заканчивается минимальным значением от 10 до 1
// types.WithSensorRandomMode: Генерация данных по кривой безье 1 - 10

minValue := 1
maxValue := 10
amplitude := 16 // 4 - 512

s1, err := gpsgen.NewSensor("s1", minValue, maxValue, amplitude, types.WithStart|types.WithRandom|types.WithEnd)
s1, err := gpsgen.NewSensor("s1", minValue, maxValue, amplitude, types.WithSensorStartMode|types.WithSensorRandomMode|types.WithSensorEndMode)
if err != nil {
panic(err)
}

droneTracker.AddSensor(s1)
s2, err := gpsgen.NewSensor("s2", 10, 20, 16, types.WithRandom|types.WithEnd)
s2, err := gpsgen.NewSensor("s2", 10, 20, 16, types.WithSensorRandomMode|types.WithSensorEndMode)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions examples/addsensor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ func main() {

droneTracker := gpsgen.NewDroneTracker()

s1, err := gpsgen.NewSensor("s1", 1, 10, 16, types.WithStart|types.WithRandom|types.WithEnd)
s1, err := gpsgen.NewSensor("s1", 1, 10, 16, types.WithSensorStartMode|types.WithSensorRandomMode|types.WithSensorEndMode)
if err != nil {
panic(err)
}
droneTracker.AddSensor(s1)
s2, err := gpsgen.NewSensor("s2", 10, 20, 16, types.WithRandom|types.WithEnd)
s2, err := gpsgen.NewSensor("s2", 10, 20, 16, types.WithSensorRandomMode|types.WithSensorEndMode)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion io_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestEncodeDecodeSensors(t *testing.T) {
sensors := make([]*types.Sensor, 0)
for i := 0; i < 10; i++ {
sensorName := fmt.Sprintf("s-%d", i)
sensor, err := types.NewSensor(sensorName, 0, float64(i), 8, types.WithRandom)
sensor, err := types.NewSensor(sensorName, 0, float64(i), 8, types.WithSensorRandomMode)
require.NoError(t, err)
sensors = append(sensors, sensor)
}
Expand Down
6 changes: 3 additions & 3 deletions types/sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ type (
)

const (
WithRandom = curve.ModeDefault
WithStart = curve.ModeMinStart
WithEnd = curve.ModeMinEnd
WithSensorRandomMode = curve.ModeDefault
WithSensorStartMode = curve.ModeMinStart
WithSensorEndMode = curve.ModeMinEnd
)

// NewSensor creates a new Sensor instance with the given name,
Expand Down

0 comments on commit b2aa432

Please sign in to comment.