last ...
This commit is contained in:
@@ -1076,6 +1076,8 @@ bool DetectXCAEAConditions(
|
||||
|
||||
//
|
||||
// Parsing Pivots ...
|
||||
XBoxZone upperPivot;
|
||||
XBoxZone lowerPivot;
|
||||
double providedSL = 0;
|
||||
XBoxZone rejectedPivot;
|
||||
XBoxZone insidePivots[];
|
||||
@@ -1135,6 +1137,7 @@ bool DetectXCAEAConditions(
|
||||
allowedFakeBreakedPivots,
|
||||
fakeBreakedPivot,
|
||||
pivots,
|
||||
helper,
|
||||
zBar,
|
||||
cBar,
|
||||
pBar,
|
||||
@@ -1146,6 +1149,30 @@ bool DetectXCAEAConditions(
|
||||
//
|
||||
Print("Faked Breaked Box Detected ...");
|
||||
}
|
||||
|
||||
//
|
||||
// Select Boundary Boxes ...
|
||||
ENUM_XCA_PIVOTS allowedBoundarydPivots[] = {
|
||||
XCA_PEAK,
|
||||
XCA_VALE,
|
||||
};
|
||||
has = SelectBoundaryBoxes(
|
||||
allowedBoundarydPivots,
|
||||
upperPivot,
|
||||
lowerPivot,
|
||||
pivots,
|
||||
helper,
|
||||
zBar,
|
||||
cBar,
|
||||
pBar,
|
||||
p2Bar //
|
||||
);
|
||||
Clean(allowedBoundarydPivots);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Print("Boundary Pivots Detected ...");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1431,6 +1458,8 @@ bool DetectXCAEAConditions(
|
||||
p2Bar.Clean();
|
||||
p3Bar.Clean();
|
||||
p4Bar.Clean();
|
||||
upperPivot.Clean();
|
||||
lowerPivot.Clean();
|
||||
Clean(cTrendValues);
|
||||
Clean(pTrendValues);
|
||||
Clean(insidePivots);
|
||||
@@ -1702,6 +1731,7 @@ bool SelectFakeBreakedBox(
|
||||
ENUM_XCA_PIVOTS &allowedTypes[],
|
||||
XBoxZone &box,
|
||||
XBoxZone &boxes[],
|
||||
XCXCAEAHelper *helper,
|
||||
XOHCL &zBar,
|
||||
XOHCL &cBar,
|
||||
XOHCL &pBar,
|
||||
@@ -1776,6 +1806,7 @@ bool SelectFakeBreakedBox(
|
||||
// Check Box Fake Breakeout ...
|
||||
result = IsFakeBreakeout(
|
||||
iBox,
|
||||
helper,
|
||||
cBar.Index() //
|
||||
);
|
||||
if (result)
|
||||
@@ -1800,6 +1831,124 @@ bool SelectFakeBreakedBox(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool SelectBoundaryBoxes(
|
||||
ENUM_XCA_PIVOTS &allowedTypes[],
|
||||
XBoxZone &upperBox,
|
||||
XBoxZone &lowerBox,
|
||||
XBoxZone &boxes[],
|
||||
XCXCAEAHelper *helper,
|
||||
XOHCL &zBar,
|
||||
XOHCL &cBar,
|
||||
XOHCL &pBar,
|
||||
XOHCL &p2Bar //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
upperBox.Clean();
|
||||
lowerBox.Clean();
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
result =
|
||||
zBar.IsValid() &&
|
||||
cBar.IsValid() &&
|
||||
pBar.IsValid() &&
|
||||
p2Bar.IsValid() &&
|
||||
HasChild(boxes);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XBoxZone tmp[];
|
||||
Copy(
|
||||
boxes,
|
||||
tmp //
|
||||
);
|
||||
|
||||
//
|
||||
int idx = -1;
|
||||
XBoxZone iBox;
|
||||
while (HasChild(tmp))
|
||||
{
|
||||
//
|
||||
idx = GetYoungest(tmp);
|
||||
result = IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
iBox = tmp[idx];
|
||||
ArrayRemove(
|
||||
tmp,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
// Checking Box Type Allowed ...
|
||||
ENUM_XCA_PIVOTS iType = GetPivotType(iBox);
|
||||
result = IsValid(iType) &&
|
||||
(!HasChild(allowedTypes)
|
||||
? true
|
||||
: Contains(
|
||||
iType,
|
||||
allowedTypes //
|
||||
));
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Upper ...
|
||||
bool canSetUpper =
|
||||
iType == XCA_PEAK &&
|
||||
(!upperBox.IsValid()
|
||||
? true
|
||||
: upperBox.lower > iBox.lower);
|
||||
if (canSetUpper)
|
||||
{
|
||||
upperBox = iBox;
|
||||
}
|
||||
|
||||
//
|
||||
// Lower ...
|
||||
bool canSetLower =
|
||||
iType == XCA_VALE &&
|
||||
(!lowerBox.IsValid()
|
||||
? true
|
||||
: lowerBox.upper < iBox.upper);
|
||||
if (canSetLower)
|
||||
{
|
||||
lowerBox = iBox;
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
Clean(tmp);
|
||||
iBox.Clean();
|
||||
|
||||
//
|
||||
result = upperBox.IsValid() &&
|
||||
lowerBox.IsValid();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int ExtractValues(
|
||||
double &values[],
|
||||
|
||||
Reference in New Issue
Block a user