forked from OSGP/sng-crest-device-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OSGP#93 from OSGP/feature/FDP-2929-alarm-command
FDP-2929 ~ Fixes result handling for alarm thresholds
- Loading branch information
Showing
4 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
.../main/kotlin/org/gxf/crestdeviceservice/command/mapper/AnalogAlarmsThresholdTranslator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-FileCopyrightText: Copyright Contributors to the GXF project | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.gxf.crestdeviceservice.command.mapper | ||
|
||
import org.gxf.crestdeviceservice.command.exception.CommandValidationException | ||
|
||
object AnalogAlarmsThresholdTranslator { | ||
fun translatePortToChannel(port: String) = | ||
when (port) { | ||
"3" -> "AL6" | ||
"4" -> "AL7" | ||
else -> throw CommandValidationException("Device port unknown: $port") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters