<?xml version="1.0" encoding="UTF-8"?>

<!-- Copyright (c) 2020 Josh Davidson (Octal450) -->

<PropertyList>

	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>0.1</value>
		</time>
		<S>
			<property>/controls/electrical/switches/gen-1</property>
		</S>
		<output>/systems/electrical/some-electric-thingie/generator-1-pb</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>0.1</value>
		</time>
		<S>
			<property>/controls/electrical/switches/gen-2</property>
		</S>
		<output>/systems/electrical/some-electric-thingie/generator-2-pb</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/systems/electrical/some-electric-thingie/emer-elec-config-generator-1-bustie</property>
		</S>
		<R>
			<not>
				<property>/systems/electrical/some-electric-thingie/emer-elec-config</property>
			</not>
		</R>
		<output>/systems/electrical/some-electric-thingie/generator-1-reset-bustie</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/systems/electrical/some-electric-thingie/emer-elec-config-generator-2-bustie</property>
		</S>
		<R>
			<not>
				<property>/systems/electrical/some-electric-thingie/emer-elec-config</property>
			</not>
		</R>
		<output>/systems/electrical/some-electric-thingie/generator-2-reset-bustie</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/systems/electrical/some-electric-thingie/emer-elec-config-generator-1</property>
		</S>
		<R>
			<not>
				<property>/systems/electrical/some-electric-thingie/emer-elec-config</property>
			</not>
		</R>
		<output>/systems/electrical/some-electric-thingie/generator-1-reset</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/systems/electrical/some-electric-thingie/emer-elec-config-generator-2</property>
		</S>
		<R>
			<not>
				<property>/systems/electrical/some-electric-thingie/emer-elec-config</property>
			</not>
		</R>
		<output>/systems/electrical/some-electric-thingie/generator-2-reset</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>ECAM/to-config-set</property>
		</S>
		<R>
			<property>ECAM/to-config-reset</property>
		</R>
		<output>ECAM/to-config-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>ECAM/to-memo-set</property>
		</S>
		<R>
			<property>ECAM/to-memo-reset</property>
		</R>
		<output>ECAM/to-memo-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>SR</type>
		<S>
			<property>ECAM/ldg-memo-set</property>
		</S>
		<R>
			<property>ECAM/ldg-memo-reset</property>
		</R>
		<output>ECAM/ldg-memo-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>ECAM/ldg-memo-2200-set</property>
		</S>
		<R>
			<property>ECAM/ldg-memo-2200-reset</property>
		</R>
		<output>ECAM/ldg-memo-2200-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>SR</type>
		<S>
			<property>ECAM/flipflop/radar-altimeter-5-set</property>
		</S>
		<R>
			<property>ECAM/flipflop/radar-altimeter-5-reset</property>
		</R>
		<output>ECAM/flipflop/radar-altimeter-5-output</output>
	</flipflop>
	
	<flipflop>
		<type>SR</type>
		<S>
			<property>ECAM/phases/flipflop/phase-2-set</property>
		</S>
		<R>
			<property>ECAM/phases/flipflop/phase-2-reset</property>
		</R>
		<output>ECAM/phases/flipflop/phase-2-output</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>ECAM/phases/flipflop/phase-10-set</property>
		</S>
		<R>
			<property>ECAM/phases/flipflop/phase-10-reset</property>
		</R>
		<output>ECAM/phases/flipflop/phase-10-output</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>ECAM/flipflop/recall-set</property>
		</S>
		<R>
			<property>ECAM/flipflop/recall-reset</property>
		</R>
		<output>ECAM/flipflop/recall-output</output>
	</flipflop>
	
	<flipflop>
		<type>SR</type>
		<S>
			<property>ECAM/flipflop/speed-gt-80-set</property>
		</S>
		<R>
			<property>ECAM/flipflop/speed-gt-80-reset</property>
		</R>
		<output>ECAM/phases/speed-gt-80</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<time>
			<value>2.0</value>
		</time>
		<S>
			<not>
				<property>ECAM/phases/speed-gt-80</property>
			</not>
		</S>
		<output>ECAM/phases/monostable-80kt</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<time>
			<value>2.0</value>
		</time>
		<S>
			<property>/ECAM/ground-calc-immediate</property>
		</S>
		<output>ECAM/phases/monostable/gnd-output</output>
	</flipflop>
	
	
	<flipflop>
		<type>monostable</type>
		<time>
			<value>300.0</value>
		</time>
		<S>
			<property>ECAM/phases/monostable/phase-1-300</property>
		</S>
		<output>ECAM/phases/monostable/phase-1-output</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<time>
			<value>120.0</value>
		</time>
		<S>
			<property>ECAM/phases/monostable/phase-5</property>
		</S>
		<output>ECAM/phases/monostable/phase-5-output</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<time>
			<value>180.0</value>
		</time>
		<S>
			<property>ECAM/phases/monostable/phase-7</property>
		</S>
		<output>ECAM/phases/monostable/phase-7-output</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<time>
			<value>5.0</value>
		</time>
		<S>
			<property>ECAM/buttons/recall-status-normal</property>
		</S>
		<R>
			<property>ECAM/buttons/clear-btn</property>
		</R>
		<output>ECAM/buttons/recall-status-normal-output</output>
	</flipflop>
	
	<flipflop>
		<type>SR</type>
		<S>
			<property>ECAM/altitude-alert-monostable-set</property>
		</S>
		<R>
			<property>ECAM/altitude-alert-monostable-intermediate-output</property>
		</R>
		<output>ECAM/altitude-alert-monostable-flipflop-intermediate</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>1.5</value>
		</time>
		<S>
			<not><property>ECAM/altitude-alert-monostable-flipflop-intermediate</property></not>
		</S>
		<output>ECAM/altitude-alert-monostable-intermediate-output</output>
	</flipflop>
	
	<filter>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<property>ECAM/altitude-alert-monostable-flipflop-intermediate</property>
					<not><property>ECAM/altitude-alert-monostable-intermediate-output</property></not>
				</and>
			</condition>
			<value>1</value>
		</input>
		<output>ECAM/altitude-alert-monostable-output</output>
	</filter>	
	
	<filter>
		<type>derivative</type>
		<input>it-autoflight/input/alt</input>
		<output>it-autoflight/input/alt-is-changing</output>
		<filter-time>1.0</filter-time>
	</filter>
	
	<flipflop>
		<type>monostable</type>
		<time>
			<value>1</value>
		</time>
		<S>
			<property>it-autoflight/input/alt-is-changing</property>
		</S>
		<output>ECAM/alt-is-changing</output>
	</flipflop>
	
	<filter>
		<input>
			<condition>
				<equals>
					<property>gear/gear[0]/position-norm</property>
					<value>1</value>
				</equals>
			</condition>
			<value>1</value>
		</input>
		<input>
			<condition>
				<not-equals>
					<property>gear/gear[0]/position-norm</property>
					<value>1</value>
				</not-equals>
			</condition>
			<value>0</value>
		</input>
		<output>ECAM/gear-downlocked-set</output>
	</filter>
	
	<flipflop>
		<type>monostable</type>
		<time>
			<value>1</value>
		</time>
		<S>
			<property>ECAM/gear-downlocked-set</property>
		</S>
		<output>ECAM/gear-downlocked-output</output>
	</flipflop>
	
	
	<filter>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<or>
					<equals><property>ECAM/gear-downlocked-output</property><value>1</value></equals>
					<equals><property>ECAM/alt-is-changing</property><value>1</value></equals>
				</or>
			</condition>
			<value>1</value>
		</input>
		<input>
			<condition>
				<and>
					<equals><property>ECAM/gear-downlocked-output</property><value>0</value></equals>
					<equals><property>ECAM/alt-is-changing</property><value>0</value></equals>
				</and>
			</condition>
			<value>0</value>
		</input>
		<output>ECAM/flipflop/alt-alert-rs-reset</output>
	</filter>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>ECAM/flipflop/altitude-alert-rs-set</property>
		</S>
		<R>
			<property>ECAM/flipflop/alt-alert-rs-reset</property>
		</R>
		<output>ECAM/flipflop/alt-alert-rs-output</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>ECAM/flipflop/alt-alert-2-rs-set</property>
		</S>
		<R>
			<property>ECAM/flipflop/alt-alert-2-rs-reset</property>
		</R>
		<output>ECAM/flipflop/alt-alert-2-rs-output</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>ECAM/flipflop/alt-alert-3-rs-set</property>
		</S>
		<R>
			<property>ECAM/flipflop/alt-alert-rs-reset</property>
		</R>
		<output>ECAM/flipflop/alt-alert-3-rs-output</output>
	</flipflop>
	
	<!-- falling edge detector - take inverse of following -->
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>3.0</value>
		</time>
		<S>
			<property>ECAM/phases/monostable/phase-9</property>
		</S>
		<output>ECAM/phases/monostable/phase-9-output</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>1.0</value>
		</time>
		<S>
			<property>ECAM/phases/to-power-set</property>
		</S>
		<output>ECAM/phases/monostable/to-power-set-output</output>
	</flipflop>
	
	<!-- when -pulse is true and switch is true -->
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
            <not><property>/controls/ice-protection/wing</property></not>
        </S>
        <output>/ECAM/phases/wing-anti-ice-pulse</output>
    </flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>180.0</value>
        </time>
        <S>
            <not><property>/ECAM/phases/monostable/phase-6-180</property></not>
        </S>
        <output>/ECAM/phases/monostable/phase-6-180-pulse</output>
    </flipflop>
	
	<!-- falling edge detectors -->
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>10.0</value>
		</time>
		<S>
			<property>/ECAM/warnings/timer/xbleed-fault-output</property>
		</S>
		<output>/ECAM/warnings/timer/xbleed-fault-output-10</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>15.0</value>
		</time>
		<S>
			<property>/controls/engines/engine[0]/fire-btn</property>
		</S>
		<output>/ECAM/warnings/timer/xbleed-fault-output-15</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<equals>
				<property>/ECAM/warnings/timer/prv-1-not-shut-apu-output</property>
				<value>1</value>
			</equals>
		</S>
		<R>
			<property>/ECAM/warnings/logic/prv-1-not-shut-apu-reset</property>
		</R>
		<output>/ECAM/warnings/logic/prv-1-not-shut-apu-flipflop-output</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<equals>
				<property>/ECAM/warnings/timer/prv-2-not-shut-apu-output</property>
				<value>1</value>
			</equals>
		</S>
		<R>
			<property>/ECAM/warnings/logic/prv-2-not-shut-apu-reset</property>
		</R>
		<output>/ECAM/warnings/logic/prv-2-not-shut-apu-flipflop-output</output>
	</flipflop>
	
	<!-- falling edge detector, take inverse -->
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>1.0</value>
		</time>
		<S>
			<property>/systems/pneumatics/valves/engine-1-prv-valve-disag</property>
		</S>
		<output>/ECAM/warnings/logic/engine-1-prv-valve-falling-pulse</output>
	</flipflop>
	
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>1.0</value>
		</time>
		<S>
			<property>/systems/pneumatics/valves/engine-2-prv-valve-disag</property>
		</S>
		<output>/ECAM/warnings/logic/engine-2-prv-valve-falling-pulse</output>
	</flipflop>
	
	<!-- rising detector: when -pulse is true and switch is true -->
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/controls/pneumatics/switches/bleed-1</property></not>
        </S>
        <output>/ECAM/warnings/logic/bleed-sw1-pulse</output>
    </flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/controls/pneumatics/switches/bleed-2</property></not>
        </S>
        <output>/ECAM/warnings/logic/bleed-sw2-pulse</output>
    </flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/controls/pneumatics/switches/apu</property></not>
        </S>
        <output>/ECAM/warnings/logic/apu-bleed-sw-pulse</output>
    </flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/ECAM/warnings/logic/wai-ground-pulse-set</property></not>
        </S>
        <output>/ECAM/warnings/logic/wai-ground-pulse</output>
    </flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/ECAM/warnings/timer/phase-1-input</property></not>
        </S>
        <output>/ECAM/warnings/timer/phase-1-pulse</output>
	</flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/ECAM/warnings/logic/wai-phase-9-pulse-input</property></not>
        </S>
        <output>/ECAM/warnings/logic/wai-phase-9-pulse</output>
	</flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/ECAM/warnings/logic/phase-10-pulse-input</property></not>
        </S>
        <output>/ECAM/warnings/logic/phase-10-pulse</output>
	</flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/controls/pneumatics/switches/pack-1</property></not>
        </S>
        <output>/ECAM/warnings/logic/pack-1-pulse</output>
	</flipflop>
	
	<flipflop>
        <type>monostable</type>
        <time>
            <value>1.0</value>
        </time>
        <S>
			<not><property>/controls/pneumatics/switches/pack-2</property></not>
        </S>
        <output>/ECAM/warnings/logic/pack-2-pulse</output>
	</flipflop>
	
	<!-- Bleed Low Temp -->
	<flipflop>
		<type>RS</type>
		<S>
			<equals>
				<property>/ECAM/warnings/timer/bleed-1-low-temp-output</property>
				<value>1</value>
			</equals>
		</S>
		<R>
			<property>/ECAM/warnings/logic/bleed-low-temp-reset</property>
		</R>
		<output>/ECAM/warnings/logic/bleed-1-low-temp-flipflop-output</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<equals>
				<property>/ECAM/warnings/timer/bleed-2-low-temp-output</property>
				<value>1</value>
			</equals>
		</S>
		<R>
			<property>/ECAM/warnings/logic/bleed-low-temp-reset</property>
		</R>
		<output>/ECAM/warnings/logic/bleed-2-low-temp-flipflop-output</output>
	</flipflop>
	
	<!-- falling detector, when this is false, and switch is false -->
	<flipflop>
		<type>monostable</type>
		<inverted type="bool">true</inverted>
		<time>
			<value>1.0</value>
		</time>
		<S>
			<property>/controls/ice-protection/wing</property>
		</S>
		<output>/ECAM/warnings/logic/wai-falling-pulse</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/ECAM/warnings/logic/bleed-1-off-flipflop-set</property>
		</S>
		<R>
			<property>/ECAM/warnings/logic/bleed-1-off-flipflop-reset</property>
		</R>
		<output>/ECAM/warnings/logic/bleed-1-off-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/ECAM/warnings/logic/bleed-2-off-flipflop-set</property>
		</S>
		<R>
			<property>/ECAM/warnings/logic/bleed-2-off-flipflop-reset</property>
		</R>
		<output>/ECAM/warnings/logic/bleed-2-off-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<equals>
				<property>/ECAM/warnings/logic/wing-anti-ice-flipflop-set</property>
				<value>1</value>
			</equals>
		</S>
		<R>
			<property>/ECAM/warnings/logic/wing-anti-ice-flipflop-reset</property>
		</R>
		<output>/ECAM/warnings/logic/wing-anti-ice-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>SR</type>
		<S>
			<equals>
				<property>/ECAM/warnings/logic/wing-anti-ice-left-closed-set</property>
				<value>1</value>
			</equals>
		</S>
		<R>
			<property>/ECAM/warnings/logic/wing-anti-ice-left-closed-reset</property>
		</R>
		<output>/ECAM/warnings/flipflop/wing-anti-ice-left-closed</output>
	</flipflop>
	
	<flipflop>
		<type>SR</type>
		<S>
			<equals>
				<property>/ECAM/warnings/logic/wing-anti-ice-right-closed-set</property>
				<value>1</value>
			</equals>
		</S>
		<R>
			<property>/ECAM/warnings/logic/wing-anti-ice-right-closed-reset</property>
		</R>
		<output>/ECAM/warnings/flipflop/wing-anti-ice-right-closed</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/ECAM/warnings/logic/proc-wai-shutdown-set</property>
		</S>
		<R>
			<property>/ECAM/warnings/logic/proc-wai-shutdown-reset</property>
		</R>
		<output>/ECAM/warnings/logic/proc-wai-shutdown-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/ECAM/warnings/logic/wing-anti-ice-gnd-fault-set</property>
		</S>
		<R>
			<property>/ECAM/warnings/logic/wing-anti-ice-flipflop-reset</property>
		</R>
		<output>/ECAM/warnings/logic/wing-anti-ice-gnd-fault-flipflop</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/systems/air-conditioning/warnings/pack-1-ovht-fault</property>
		</S>
		<R>
			<property>/ECAM/warnings/logic/pack-1-ovht-reset</property>
		</R>
		<output>/ECAM/warnings/flipflop/pack-1-ovht</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/systems/air-conditioning/warnings/pack-2-ovht-fault</property>
		</S>
		<R>
			<property>/ECAM/warnings/logic/pack-2-ovht-reset</property>
		</R>
		<output>/ECAM/warnings/flipflop/pack-2-ovht</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/ECAM/warnings/timer/pack-1-fault-5</property>
		</S>
		<R>
			<property>/ECAM/warnings/logic/pack-1-off-reset</property>
		</R>
		<output>/ECAM/warnings/flipflop/pack-1-off</output>
	</flipflop>
	
	<flipflop>
		<type>RS</type>
		<S>
			<property>/ECAM/warnings/timer/pack-2-fault-5</property>
		</S>
		<R>
			<property>/ECAM/warnings/logic/pack-2-off-reset</property>
		</R>
		<output>/ECAM/warnings/flipflop/pack-2-off</output>
	</flipflop>
	
</PropertyList>