blob: 921edfed817ca783d7e003f5840227e6fe4ae3b8 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<modules:Monitor xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:modules="comps.modules.*" width="400" height="300">
<fx:Script>
<![CDATA[
import mx.events.EffectEvent;
protected var threshold:Number;
[Bindable]
public var fractionDiff:Number = 0.09;
private var initialEnd:Number;
private var returnEnd:Number;
private var initialVF:Number;
private var returnVF:Number;
override public function check():void {
if(isNaN(threshold)){
threshold = initialEnd*fractionDiff;
}
if(Math.abs(initialEnd - returnEnd) > threshold){
passed = false;
error = "AddRemoveChecker: Add time is not symmetric with remove time! " + initialEnd + " vs. " + returnEnd;
trace(error);
}else if(initialVF != 6 && returnVF != 3){
passed = false;
error = "AddRemoveChecker: Add flags indicate items were not added/removed correctly! " + initialVF + " vs. " + returnVF;
trace(error);
}
}
private function getChange(num:int, vec:Vector.<Number>):int{
var initialChange:int = -1;
for(var i:int = 0; i < initialValues.length; i++){
if(initialValues[i] == num) return i;
}
return initialChange;
}
override public function effectEnd(event:EffectEvent):void {
super.effectEnd(event);
if(isReturn){
returnEnd = end;
returnVF = valueFunction.call(target) as Number;
}else{
initialEnd = end;
initialVF = valueFunction.call(target) as Number;
}
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</modules:Monitor>