* Validates timing mark setting value. * Makes sure they can be differentiated from each other. * @protected * @param {mixed} rawValue * @param {Setting} setting * @return {boolean} Returns true, if value is valid.
(rawValue, setting)
| 290 | * @return {boolean} Returns true, if value is valid. |
| 291 | */ |
| 292 | validateTimingMarkSettingValue (rawValue, setting) { |
| 293 | const mark = setting.filterValue(rawValue) |
| 294 | const equalSettingName = |
| 295 | ['signalOnMark', 'signalOffMark'] |
| 296 | .filter(name => name !== setting.getName()) |
| 297 | .find(name => mark.indexOf(this.getSettingValue(name)) === 0) |
| 298 | |
| 299 | if (equalSettingName !== undefined) { |
| 300 | return { |
| 301 | key: 'morseCodeMarkNotUnique', |
| 302 | message: 'Timing marks need to be different from each other' |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | return true |
| 307 | } |
| 308 | |
| 309 | /** |
| 310 | * Triggered when a setting field has changed. |
nothing calls this directly
no test coverage detected