last ...
This commit is contained in:
@@ -312,6 +312,9 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
|
||||
//
|
||||
// Setup Conditions ...
|
||||
XOBFVG selectedZone;
|
||||
bool hasSelectedZone = false;
|
||||
bool isSelectedZoneReversal = false;
|
||||
|
||||
//
|
||||
// First We Have to Has Working Zone ...
|
||||
@@ -358,7 +361,44 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
workingZone.HasInsideZones();
|
||||
if (hasInsideZones)
|
||||
{
|
||||
Print("Has Inside Zones");
|
||||
//
|
||||
int selectedIDX = -1;
|
||||
int count = workingZone.CountInsideZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
bool has = CheckOBFVGXWZConditions(
|
||||
isSelectedZoneReversal,
|
||||
workingZone.insideZones[i],
|
||||
decisionState,
|
||||
decisionXConditions //
|
||||
);
|
||||
|
||||
//
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
selectedIDX = i;
|
||||
selectedZone = workingZone.insideZones[i];
|
||||
|
||||
//
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (IsValidIndex(selectedIDX))
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
workingZone.insideZones,
|
||||
selectedIDX,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
hasSelectedZone = selectedZone.IsValid();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -366,7 +406,55 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
workingZone.HasBreakedZones();
|
||||
if (hasBreakedZones)
|
||||
{
|
||||
Print("Has Breaked Zones");
|
||||
//
|
||||
if (!hasSelectedZone)
|
||||
{
|
||||
//
|
||||
int selectedIDX = -1;
|
||||
int count = workingZone.CountBreakedZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
bool has = CheckOBFVGXWZConditions(
|
||||
isSelectedZoneReversal,
|
||||
workingZone.breakedZones[i],
|
||||
decisionState,
|
||||
decisionXConditions //
|
||||
);
|
||||
|
||||
//
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
selectedIDX = i;
|
||||
selectedZone = workingZone.breakedZones[i];
|
||||
|
||||
//
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (IsValidIndex(selectedIDX))
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
workingZone.breakedZones,
|
||||
selectedIDX,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
hasSelectedZone = selectedZone.IsValid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (hasSelectedZone)
|
||||
{
|
||||
//
|
||||
Print("Has Selected Zone ...");
|
||||
}
|
||||
|
||||
//
|
||||
@@ -378,14 +466,15 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
//
|
||||
workingZone.Draw(
|
||||
drawer,
|
||||
true, // Force Clean ...
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true //
|
||||
true, // Draw Waiting Zones ..
|
||||
true, // Draw Inside Zones ..
|
||||
true, // Draw Breaked Zones ..
|
||||
false, // Draw Supply Zone ..
|
||||
false, // Draw Demand Zone ..
|
||||
false, // Draw Supply Zones ..
|
||||
false, // Draw Demand Zones ..
|
||||
false, // Draw Support Zones ..
|
||||
false // Draw Resistance Zones ..
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user