<commit_before>// Copyright 2014-2018 Sound Metrics Corp. All Rights Reserved.

namespace SoundMetrics.Aris.Config

open Microsoft.FSharp.Data.UnitSystems.SI.UnitSymbols

[<Measure>] type Us // Microseconds

type PingMode = PingMode1 | PingMode3 | PingMode6 | PingMode9 | InvalidPingMode of uint32
with
    member pm.IsSupported =
        match pm with
        | PingMode1 | PingMode3 | PingMode6 | PingMode9 -> true
        | InvalidPingMode _ -> false

    member pm.ToUInt32 () =
        match pm with
        | PingMode1 -> 1u
        | PingMode3 -> 3u
        | PingMode6 -> 6u
        | PingMode9 -> 9u
        | InvalidPingMode pingMode -> failwithf "Unexpected use of InvalidPingMode: %u" pingMode

    static member From (pingMode : uint32) =
        match pingMode with
        | 1u -> PingMode1
        | 3u -> PingMode3
        | 6u -> PingMode6
        | 9u -> PingMode9
        | _ -> invalidArg "pingMode" "Unsupported ping mode"

type Frequency = Low = 0 | High = 1

module SonarConfig =

    //type Range<'t> = { Name: string; Min: 't; Max: 't }
    //with
    //    override rng.ToString() = sprintf "%s %A-%A" rng.Name rng.Min rng.Max

    //[<CompiledName("RangeContains")>]
    //let contains value range =
    //    assert (range.Min <= range.Max)
    //    range.Min <= value && value <= range.Max

    //module internal RangeImpl =

    //    let inline range<'T when 'T : comparison> name (min: 'T) (max: 'T) = { Name = name; Min = min; Max = max }


    //    let inline isSubrangeOf<'T when 'T : comparison> (original : Range<'T>) subrange =

    //        original |> contains subrange.Min && original |> contains subrange.Max


    //    let inline subrangeOf<'T when 'T : comparison> range (min : 'T) (max : 'T) =

    //        let subrange = { Name = range.Name; Min = min; Max = max }
    //        if not (subrange |> isSubrangeOf range) then
    //            invalidArg "min" "subrange falls outside original range"

    //        subrange


    //    let inline constrainRangeMax<'T when 'T : comparison> range (max : 'T) = subrangeOf range range.Min max

    open SoundMetrics.Data
    open SoundMetrics.Data.Range
    open SoundMetrics.Common

    // Min/max values per ARIS Engineering Test Command List

    let SampleCountRange =      range "SampleCount"          128u         4096u
    let FocusPositionRange =    range "FocusPosition"          0u         1000u
    let ReceiverGainRange =     range "ReceiverGain"           0u           24u
    let FrameRateRange =        range "FrameRate"           1.0f</s>     15.0f</s>

    let SampleStartDelayRange = range "SampleStartDelay"     930<Us>     60000<Us><commit_msg>Remove old code<commit_after>// Copyright 2014-2018 Sound Metrics Corp. All Rights Reserved.

namespace SoundMetrics.Aris.Config

open Microsoft.FSharp.Data.UnitSystems.SI.UnitSymbols

[<Measure>] type Us // Microseconds

type PingMode = PingMode1 | PingMode3 | PingMode6 | PingMode9 | InvalidPingMode of uint32
with
    member pm.IsSupported =
        match pm with
        | PingMode1 | PingMode3 | PingMode6 | PingMode9 -> true
        | InvalidPingMode _ -> false

    member pm.ToUInt32 () =
        match pm with
        | PingMode1 -> 1u
        | PingMode3 -> 3u
        | PingMode6 -> 6u
        | PingMode9 -> 9u
        | InvalidPingMode pingMode -> failwithf "Unexpected use of InvalidPingMode: %u" pingMode

    static member From (pingMode : uint32) =
        match pingMode with
        | 1u -> PingMode1
        | 3u -> PingMode3
        | 6u -> PingMode6
        | 9u -> PingMode9
        | _ -> invalidArg "pingMode" "Unsupported ping mode"

type Frequency = Low = 0 | High = 1

module SonarConfig =

    open SoundMetrics.Data
    open SoundMetrics.Data.Range
    open SoundMetrics.Common

    // Min/max values per ARIS Engineering Test Command List

    let SampleCountRange =      range "SampleCount"          128u         4096u
    let FocusPositionRange =    range "FocusPosition"          0u         1000u
    let ReceiverGainRange =     range "ReceiverGain"           0u           24u
    let FrameRateRange =        range "FrameRate"           1.0f</s>     15.0f</s>

    let SampleStartDelayRange = range "SampleStartDelay"     930<Us>     60000<Us>
{'fraction_non_alphanumeric': 0.09693396226415095, 'fraction_numerical': 0.03207547169811321, 'mean_word_length': 2.150817236255572, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2141675', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1294, 'n_words': 379}