Skip to content

Commit

Permalink
Footprint functionality
Browse files Browse the repository at this point in the history
Script version 248
Tool version: 5.0.604
  • Loading branch information
HendriXML committed Oct 6, 2019
1 parent e966532 commit 9dded5f
Show file tree
Hide file tree
Showing 15 changed files with 315 additions and 162 deletions.
Binary file modified Interpreter/XMLScriptInterpreter.NLD
Binary file not shown.
Binary file modified Interpreter/XMLScriptInterpreter.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions Resources.Project.ComponentMappings/Generic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@
<Part Part="2N7000" Component="NMOSFET"/>
<Part Part="IRLZ44N" Component="NMOSFET"/>
</Library>
<Library Name="LM335">
<Part Part="LM335" Component="IntegratedCircuit"/>
</Library>
</Devices>
20 changes: 12 additions & 8 deletions Script.Common.Electronics/BOM CapacitorClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -452,19 +452,23 @@

<Execute Statement="Result:= Result shl 1"/>
<Case Expression="FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Case Expression="ComponentSpec.FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<Exit Condition="Footprint &lt;&gt; ComponentSpec.Footprint" Result="0"/>
<Execute Statement="Result:= Result + 1"/>
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Execute Statement="Result:= Result + 1" Condition="Footprint = ComponentSpec.Footprint"/>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<Exit Result="0"/>
<On Select="TFootPrintValueType.MaskSpecifiedByTemplate, TFootPrintValueType.MaskSpecified">
<Execute Statement="Result:= Result + 1" Condition="ComponentSpec.FootprintMask.Matches(Footprint)"/>
</On>
<On Select="TFootPrintValueType.Unspecified, TFootPrintValueType.Cleared, TFootPrintValueType.ClearedByTemplate">
</On>
<Otherwise>
<Exit/>
</Otherwise>
</Case>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<Exit Result="0"/>
<On Select="TFootPrintValueType.Error, TFootPrintValueType.ErrorByTemplate">
<Exit/>
</On>
</Case>

Expand Down
13 changes: 9 additions & 4 deletions Script.Common.Electronics/BOM ConnectorClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -569,17 +569,22 @@
</Case>
<Execute Statement="Result:= Result shl 1"/>
<Case Expression="FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Case Expression="ComponentSpec.FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Execute Statement="Result:= Result + 1" Condition="Footprint = ComponentSpec.Footprint"/>
</On>
<On Select="TFootPrintValueType.MaskSpecifiedByTemplate, TFootPrintValueType.MaskSpecified">
<Execute Statement="Result:= Result + 1" Condition="ComponentSpec.FootprintMask.Matches(Footprint)"/>
</On>
<On Select="TFootPrintValueType.Unspecified, TFootPrintValueType.Cleared, TFootPrintValueType.ClearedByTemplate">
</On>
<Otherwise>
<Exit/>
</Otherwise>
</Case>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<On Select="TFootPrintValueType.Error, TFootPrintValueType.ErrorByTemplate">
<Exit/>
</On>
</Case>
Expand Down Expand Up @@ -784,7 +789,7 @@
<Execute Statement="Result:= ''"/>
</When>
<Otherwise>
<Execute Statement="Result:= Format('%-*s%*s%*s%-*s%-*s',
<Execute Statement="Result:= Format('%-*s%*s%-*s%-*s%-*s',
ColumnManager.GetColumnWidth(ColumnOffset + TConnectorSpecColumns.Value, 4), Value,
ColumnManager.GetColumnWidth(ColumnOffset + TConnectorSpecColumns.AmpRating, 2), AmpRating,
ColumnManager.GetColumnWidth(ColumnOffset + TConnectorSpecColumns.FootPrint, 1), FootPrint,
Expand Down
20 changes: 12 additions & 8 deletions Script.Common.Electronics/BOM DiodeClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,19 +332,23 @@

<Execute Statement="Result:= Result shl 1"/>
<Case Expression="FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Case Expression="ComponentSpec.FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<Exit Condition="Footprint &lt;&gt; ComponentSpec.Footprint" Result="0"/>
<Execute Statement="Result:= Result + 1"/>
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Execute Statement="Result:= Result + 1" Condition="Footprint = ComponentSpec.Footprint"/>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<Exit Result="0"/>
<On Select="TFootPrintValueType.MaskSpecifiedByTemplate, TFootPrintValueType.MaskSpecified">
<Execute Statement="Result:= Result + 1" Condition="ComponentSpec.FootprintMask.Matches(Footprint)"/>
</On>
<On Select="TFootPrintValueType.Unspecified, TFootPrintValueType.Cleared, TFootPrintValueType.ClearedByTemplate">
</On>
<Otherwise>
<Exit/>
</Otherwise>
</Case>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<Exit Result="0"/>
<On Select="TFootPrintValueType.Error, TFootPrintValueType.ErrorByTemplate">
<Exit/>
</On>
</Case>

Expand Down
20 changes: 12 additions & 8 deletions Script.Common.Electronics/BOM FuseClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,19 +377,23 @@

<Execute Statement="Result:= Result shl 1"/>
<Case Expression="FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Case Expression="ComponentSpec.FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<Exit Condition="Footprint &lt;&gt; ComponentSpec.Footprint" Result="0"/>
<Execute Statement="Result:= Result + 1"/>
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Execute Statement="Result:= Result + 1" Condition="Footprint = ComponentSpec.Footprint"/>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<Exit Result="0"/>
<On Select="TFootPrintValueType.MaskSpecifiedByTemplate, TFootPrintValueType.MaskSpecified">
<Execute Statement="Result:= Result + 1" Condition="ComponentSpec.FootprintMask.Matches(Footprint)"/>
</On>
<On Select="TFootPrintValueType.Unspecified, TFootPrintValueType.Cleared, TFootPrintValueType.ClearedByTemplate">
</On>
<Otherwise>
<Exit/>
</Otherwise>
</Case>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<Exit Result="0"/>
<On Select="TFootPrintValueType.Error, TFootPrintValueType.ErrorByTemplate">
<Exit/>
</On>
</Case>

Expand Down
20 changes: 12 additions & 8 deletions Script.Common.Electronics/BOM InductorClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -336,19 +336,23 @@

<Execute Statement="Result:= Result shl 1"/>
<Case Expression="FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Case Expression="ComponentSpec.FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<Exit Condition="Footprint &lt;&gt; ComponentSpec.Footprint" Result="0"/>
<Execute Statement="Result:= Result + 1"/>
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Execute Statement="Result:= Result + 1" Condition="Footprint = ComponentSpec.Footprint"/>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<Exit Result="0"/>
<On Select="TFootPrintValueType.MaskSpecifiedByTemplate, TFootPrintValueType.MaskSpecified">
<Execute Statement="Result:= Result + 1" Condition="ComponentSpec.FootprintMask.Matches(Footprint)"/>
</On>
<On Select="TFootPrintValueType.Unspecified, TFootPrintValueType.Cleared, TFootPrintValueType.ClearedByTemplate">
</On>
<Otherwise>
<Exit/>
</Otherwise>
</Case>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<Exit Result="0"/>
<On Select="TFootPrintValueType.Error, TFootPrintValueType.ErrorByTemplate">
<Exit/>
</On>
</Case>

Expand Down
13 changes: 9 additions & 4 deletions Script.Common.Electronics/BOM IntegratedCircuitClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,22 @@
</Case>
<Execute Statement="Result:= Result shl 1"/>
<Case Expression="FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Case Expression="ComponentSpec.FootprintVT">
<On Select="TValueType.SpecifiedByTemplate, TValueType.Specified">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Execute Statement="Result:= Result + 1" Condition="Footprint = ComponentSpec.Footprint"/>
</On>
<On Select="TFootPrintValueType.MaskSpecifiedByTemplate, TFootPrintValueType.MaskSpecified">
<Execute Statement="Result:= Result + 1" Condition="ComponentSpec.FootprintMask.Matches(Footprint)"/>
</On>
<On Select="TFootPrintValueType.Unspecified, TFootPrintValueType.Cleared, TFootPrintValueType.ClearedByTemplate">
</On>
<Otherwise>
<Exit/>
</Otherwise>
</Case>
</On>
<On Select="TValueType.Error, TValueType.ErrorByTemplate">
<On Select="TFootPrintValueType.Error, TFootPrintValueType.ErrorByTemplate">
<Exit/>
</On>
</Case>
Expand Down Expand Up @@ -228,7 +233,7 @@
<Execute Statement="Result:= ''"/>
</When>
<Otherwise>
<Execute Statement="Result:= Format('%-*s%*s%*s%-*s%-*s',
<Execute Statement="Result:= Format('%-*s%*s%-*s%-*s%-*s',
ColumnManager.GetColumnWidth(ColumnOffset + TIntegratedCircuitSpecColumns.Value, 2), Name,
ColumnManager.GetColumnWidth(ColumnOffset + TIntegratedCircuitSpecColumns.Functions, 4), Functions,
ColumnManager.GetColumnWidth(ColumnOffset + TIntegratedCircuitSpecColumns.FootPrint, 1), FootPrint,
Expand Down
38 changes: 32 additions & 6 deletions Script.Common.Electronics/BOM PartKeeprProjectExport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!--Initialized in task-->
<Field Identifier="Name" Type="string"/>
<Field Identifier="StockCategory" Type="TStockCategory"/>
<Field Identifier="FootPrintInfo" Type="TFootprintInfo"/>
<!--<Field Identifier="FootPrintInfo" Type="TFootprintInfo"/>-->
<Field Identifier="InternalPartNumber" Type="string"/>
<Field Identifier="Error" Type="Boolean"/>
<!--Initialized in create task-->
Expand Down Expand Up @@ -857,7 +857,7 @@
<Variable Identifier="Footprint" Type="string" Init="''"/>
</Variables>
<Init>
<Execute Statement="Footprint:= PartKeeprPart.FootprintInfo.Name" Condition="Assigned(PartKeeprPart.FootprintInfo)"/>
<!--<Execute Statement="Footprint:= PartKeeprPart.FootprintInfo.Name" Condition="Assigned(PartKeeprPart.FootprintInfo)"/>-->
<Task.Description Expression="Format(sCreatePart, ConcatExt(' - ', True, PartKeeprPart.Name, Footprint, PartKeeprPart.InternalPartNumber))"/>
<Task.MarkFailed Condition="PartKeeprPart.Error"/>
</Init>
Expand All @@ -866,7 +866,7 @@
<ado:Recordset.AddNew/>
<ado:Field.SetValue Name="category_id" Value="PartKeeprPart.StockCategory.ID"/>
<ado:Field.SetValue Name="name" Value="PartKeeprPart.Name"/>
<ado:Field.SetValue Name="footprint_id" Value="PartKeeprPart.FootprintInfo.ID" Condition="Assigned(PartKeeprPart.FootprintInfo)"/>
<!--<ado:Field.SetValue Name="footprint_id" Value="PartKeeprPart.FootprintInfo.ID" Condition="Assigned(PartKeeprPart.FootprintInfo)"/>-->
<ado:Field.SetValue Name="storageLocation_id" Value="UnmatchedComponentsStorageID"/>
<Choose>
<When Expression="IsNonEmptyString(PartKeeprPart.InternalPartNumber)" >
Expand Down Expand Up @@ -955,7 +955,7 @@
<Variable Identifier="StockSpec" Type="TComponentSpec"/>
<Variable Identifier="NumericPartParameter" Type="TNumericPartParameter"/>
<Variable Identifier="StringPartParameter" Type="TStringPartParameter"/>
<Variable Identifier="FootprintInfo" Type="TFootprintInfo"/>
<!--<Variable Identifier="FootprintInfo" Type="TFootprintInfo"/>-->
<Variable Identifier="Found" Type="Boolean"/>
</Variables>
<Init>
Expand All @@ -971,10 +971,36 @@
<Execute Statement="Part.InternalPartNumber:= SchemaSpec.InternalPartNumber"/>
</On>
</Case>
<Block Condition="NumericParameterNeeded(SchemaSpec.FootPrint, SchemaSpec.FootPrintVT, StockSpec.FootPrint, StockSpec.FootPrintVT)">
<!--<Block Condition="NumericParameterNeeded(SchemaSpec.FootPrint, SchemaSpec.FootPrintVT, StockSpec.FootPrint, StockSpec.FootPrintVT)">
<inx:Index.FindValue Index="FootPrintToFootPrintInfoMapping" Key="SchemaSpec.Footprint" Value="FootprintInfo" Found="Found" Flags="NoErrorOnNotFound"/>
<Execute Statement="Part.FootprintInfo:= FootprintInfo" Condition="Found"/>
</Block>
</Block>-->
<Case Expression="SchemaSpec.FootprintVT">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Case Expression="StockSpec.FootprintVT">
<On Select="TFootPrintValueType.SpecifiedByTemplate, TFootPrintValueType.Specified">
<Block Condition="StockSpec.Footprint = SchemaSpec.Footprint">
<Execute Statement="StringPartParameter:= TStringPartParameter.Create(Part, TCustomField.Footprint, SchemaSpec.Footprint)"/>
<Task.AddDependency Task="CreateStringParameterTask" InstanceObject="StringPartParameter"/>
</Block>
</On>
<On Select="TFootPrintValueType.MaskSpecifiedByTemplate, TFootPrintValueType.MaskSpecified">
<Block Condition="StockSpec.FootprintMask.Matches(SchemaSpec.Footprint)">
<Execute Statement="StringPartParameter:= TStringPartParameter.Create(Part, TCustomField.Footprint, SchemaSpec.Footprint)"/>
<Task.AddDependency Task="CreateStringParameterTask" InstanceObject="StringPartParameter"/>
</Block>
</On>
<On Select="TFootPrintValueType.Unspecified, TFootPrintValueType.Cleared, TFootPrintValueType.ClearedByTemplate">
</On>
<Otherwise>
<Exit/>
</Otherwise>
</Case>
</On>
<On Select="TFootPrintValueType.Error, TFootPrintValueType.ErrorByTemplate">
<Exit/>
</On>
</Case>
<Block Condition="StringParameterNeeded(SchemaSpec.PartNumber, SchemaSpec.PartNumberVT, StockSpec.PartNumber, StockSpec.PartNumberVT)">
<Execute Statement="StringPartParameter:= TStringPartParameter.Create(Part, TCustomField.PartNumber, SchemaSpec.PartNumber)"/>
<Task.AddDependency Task="CreateStringParameterTask" InstanceObject="StringPartParameter"/>
Expand Down
Loading

0 comments on commit 9dded5f

Please sign in to comment.