# "channel-test-d-08.prsimrc"
# @haco@ channel-test-d.haco-a
# @deps@ channel-test-a-values-X.txt
# manually controlling source

# echo-commands on
source channel-test-d-01.prsimrc

channel-show X
# channel-source X channel-test-a-values-X.txt
channel-sink X
channel-watch X
channel-log X channel-test-d-08-X.txt
channel-reset X
cycle
getall X
channel-show X

watchall
echo releasing channel X (source)
channel-release X
cycle

set X.d[0] 0
set X.d[1] 0
cycle
getall X
set X.n 1
cycle
assert X.e 1

echo a channel value is logged when X.n-
echo if data rails are invalid, 'X' will be logged

set X.n 0
cycle
assert X.e 0
set X.n 1
cycle
assert X.e 1

set X.n 0
cycle
set X.n 1
cycle

set X.d[0] 1
cycle
echo should not produce a value until X.n-
set X.d[0] 0
cycle
set X.d[1] 1
cycle
set X.n 0
cycle
assert X.e 0
set X.n 1
cycle
assert X.e 1
set X.n 0
cycle
assert X.e 0
set X.d[1] 0
cycle
assert X.e 0
set X.n 1
cycle

set X.d[0] 1
cycle
set X.n 0
cycle
set X.n 1
cycle
set X.n 0
cycle
set X.n 1
cycle
set X.d[0] 0
cycle

echo produce an X
set X.d[0] X
cycle
set X.n 0
cycle
set X.n 1
cycle

set X.d[0] 1
cycle
set X.n 0
cycle
set X.n 1
set X.d[0] 0
cycle

set X.d[1] 1
cycle
set X.n 0
cycle
set X.n 1
cycle

channel-close X
!cat channel-test-d-08-X.txt
!rm channel-test-d-08-X.txt

