43 bool aShowObjectSelector ) :
47 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] ctor START" ) );
57 wxArrayString objectChoices;
58 objectChoices.Add(
_(
"Object A" ) );
59 objectChoices.Add(
_(
"Object B" ) );
61 m_objectChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, objectChoices );
65 if( !aShowObjectSelector )
69 wxArrayString conditionChoices;
70 conditionChoices.Add(
_(
"Any" ) );
71 conditionChoices.Add(
_(
"Net" ) );
72 conditionChoices.Add(
_(
"Netclass" ) );
73 conditionChoices.Add(
_(
"Within Area" ) );
74 conditionChoices.Add(
_(
"Custom Query" ) );
76 m_conditionChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, conditionChoices );
101 m_customQueryCtrl =
new wxStyledTextCtrl(
this, wxID_ANY, wxDefaultPosition, wxSize( -1, 60 ) );
120 m_deleteBtn->SetToolTip(
_(
"Remove this condition" ) );
123 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] setting sizer" ) );
130 wxLogTrace(
TRACE_COND, wxS(
"[DRC_RE_CONDITION_ROW_PANEL] ctor END" ) );
209 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] expr='%s'" ), aExpr );
211 if( aExpr.IsEmpty() )
213 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] empty -> ANY" ) );
218 wxString expr = aExpr;
221 if( expr.StartsWith(
"A." ) )
224 expr = expr.Mid( 2 );
226 else if( expr.StartsWith(
"B." ) )
229 expr = expr.Mid( 2 );
233 wxRegEx netRe( wxT(
"^NetName\\s*==\\s*'([^']*)'" ) );
234 wxRegEx netclassRe1( wxT(
"^hasNetclass\\('([^']*)'\\)" ) );
235 wxRegEx netclassRe2( wxT(
"^NetClass\\s*==\\s*'([^']*)'" ) );
236 wxRegEx areaRe( wxT(
"^(?:enclosedByArea|intersectsArea)\\('([^']*)'\\)" ) );
238 if( netRe.Matches( expr ) )
240 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NET pattern" ) );
245 else if( netclassRe1.Matches( expr ) )
247 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NETCLASS (hasNetclass) pattern" ) );
252 else if( netclassRe2.Matches( expr ) )
254 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched NETCLASS (NetClass==) pattern" ) );
259 else if( areaRe.Matches( expr ) )
261 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] matched WITHIN_AREA pattern" ) );
268 wxLogTrace(
TRACE_COND, wxS(
"[ParseExpression] no match -> CUSTOM" ) );