Skip to content

Insert/PowerOnly.tl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
aggregate PowerOnly {
  """
  Enable easy toggling of PowerOnly devices. PowerOnly devices configured
  as PowerAlways (sampleTime = 0 sec) will override these settings! The
  PowerOnly component must be loaded and appropriate config must exist in
  vehicle.cfg and Sensor.cfg.
  """

  arguments {
    SampleAll = false
      """
      Turn on all PowerOnly devices configured in vehicle.cfg
      """

    SampleLoad1 = false
      """
      Turn on the loadControl1 PowerOnly device configured in vehicle.cfg
      """

    SampleLoad2 = false
      """
      Turn on the loadControl2 PowerOnly device configured in vehicle.cfg
      """

    SampleLoad3 = false
      """
      Turn on the loadControl3 PowerOnly device configured in vehicle.cfg
      """

    EnabledPowerOnly = Sensor:PowerOnly.loadAtStartup
      """
      Defaults true when PowerOnly component loaded, false otherwise. Set
      to false to disable regardless of Sample* flags.
      """
  }

  run in parallel

  readData strategy="MinError" {
    while (
      SampleAll
      and EnabledPowerOnly
    )

    Sensor:PowerOnly.samplePowerOnly
  }

  readData strategy="MinError" {
    while (
      SampleLoad1
      and EnabledPowerOnly
    )

    Sensor:PowerOnly.sampleLoad1
  }

  readData strategy="MinError" {
    while (
      SampleLoad2
      and EnabledPowerOnly
    )

    Sensor:PowerOnly.sampleLoad2
  }

  readData strategy="MinError" {
    while (
      SampleLoad3
      and EnabledPowerOnly
    )

    Sensor:PowerOnly.sampleLoad3
  }

  # Keep the readDatas on the stack until the toplevel mission ends
  behavior Guidance:Wait {
    run in sequence

    set duration = 999999 hour
  }
}