44 bool aShowObjectSelector ) :
48 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] ctor START" ) );
58 wxArrayString objectChoices;
59 objectChoices.Add(
_(
"Object A" ) );
60 objectChoices.Add(
_(
"Object B" ) );
62 m_objectChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, objectChoices );
66 if( !aShowObjectSelector )
70 wxArrayString conditionChoices;
71 conditionChoices.Add(
_(
"Any" ) );
72 conditionChoices.Add(
_(
"Net" ) );
73 conditionChoices.Add(
_(
"Netclass" ) );
74 conditionChoices.Add(
_(
"Within Area" ) );
75 conditionChoices.Add(
_(
"Custom Query" ) );
77 m_conditionChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, conditionChoices );
102 m_customQueryCtrl =
new wxStyledTextCtrl(
this, wxID_ANY, wxDefaultPosition, wxSize( -1, 60 ) );
117 []( wxKeyEvent& aEvent )
121 []( wxStyledTextEvent& aEvent )
132 m_deleteBtn->SetToolTip(
_(
"Remove this condition" ) );
135 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] setting sizer" ) );
147 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] ctor END" ) );
226 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] expr='%s'" ), aExpr );
228 if( aExpr.IsEmpty() )
230 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] empty -> ANY" ) );
235 wxString expr = aExpr;
238 if( expr.StartsWith(
"A." ) )
241 expr = expr.Mid( 2 );
243 else if( expr.StartsWith(
"B." ) )
246 expr = expr.Mid( 2 );
250 wxRegEx netRe( wxT(
"^NetName\\s*==\\s*'([^']*)'" ) );
251 wxRegEx netclassRe1( wxT(
"^hasNetclass\\('([^']*)'\\)" ) );
252 wxRegEx netclassRe2( wxT(
"^NetClass\\s*==\\s*'([^']*)'" ) );
253 wxRegEx areaRe( wxT(
"^(?:enclosedByArea|intersectsArea)\\('([^']*)'\\)" ) );
255 if( netRe.Matches( expr ) )
257 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NET pattern" ) );
262 else if( netclassRe1.Matches( expr ) )
264 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NETCLASS (hasNetclass) pattern" ) );
269 else if( netclassRe2.Matches( expr ) )
271 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NETCLASS (NetClass==) pattern" ) );
276 else if( areaRe.Matches( expr ) )
278 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched WITHIN_AREA pattern" ) );
285 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] no match -> CUSTOM" ) );