40 bool aShowObjectSelector ) :
44 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] ctor START" ) );
54 wxArrayString objectChoices;
55 objectChoices.Add(
_(
"Object A" ) );
56 objectChoices.Add(
_(
"Object B" ) );
58 m_objectChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, objectChoices );
62 if( !aShowObjectSelector )
66 wxArrayString conditionChoices;
67 conditionChoices.Add(
_(
"Any" ) );
68 conditionChoices.Add(
_(
"Net" ) );
69 conditionChoices.Add(
_(
"Netclass" ) );
70 conditionChoices.Add(
_(
"Within Area" ) );
71 conditionChoices.Add(
_(
"Custom Query" ) );
73 m_conditionChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, conditionChoices );
98 m_customQueryCtrl =
new wxStyledTextCtrl(
this, wxID_ANY, wxDefaultPosition, wxSize( -1, 60 ) );
113 []( wxKeyEvent& aEvent )
117 []( wxStyledTextEvent& aEvent )
128 m_deleteBtn->SetToolTip(
_(
"Remove this condition" ) );
131 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] setting sizer" ) );
143 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] ctor END" ) );
222 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] expr='%s'" ), aExpr );
224 if( aExpr.IsEmpty() )
226 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] empty -> ANY" ) );
231 wxString expr = aExpr;
234 if( expr.StartsWith(
"A." ) )
237 expr = expr.Mid( 2 );
239 else if( expr.StartsWith(
"B." ) )
242 expr = expr.Mid( 2 );
246 static wxRegEx netRe( wxT(
"^NetName\\s*==\\s*'([^']*)'" ) );
247 static wxRegEx netclassRe1( wxT(
"^hasNetclass\\('([^']*)'\\)" ) );
248 static wxRegEx netclassRe2( wxT(
"^NetClass\\s*==\\s*'([^']*)'" ) );
249 static wxRegEx areaRe( wxT(
"^(?:enclosedByArea|intersectsArea)\\('([^']*)'\\)" ) );
251 if( netRe.Matches( expr ) )
253 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NET pattern" ) );
258 else if( netclassRe1.Matches( expr ) )
260 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NETCLASS (hasNetclass) pattern" ) );
265 else if( netclassRe2.Matches( expr ) )
267 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NETCLASS (NetClass==) pattern" ) );
272 else if( areaRe.Matches( expr ) )
274 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched WITHIN_AREA pattern" ) );
281 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] no match -> CUSTOM" ) );