Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MoMo Type System and PCB Build System #26

Merged
merged 1 commit into from
Mar 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pymomo/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.10"
__version__ = "1.1.1"
1 change: 0 additions & 1 deletion pymomo/commander/commands/rpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from command import Command
from pymomo.commander.exceptions import *
import base64
Expand Down
75 changes: 75 additions & 0 deletions pymomo/config/pcb/eagle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"templates":
{
"two_layer":
{
"layers":
{
"Top Solderpaste Layer":
{
"extension": "crm",
"program_layers": ["tCream"],
"type": "gerber",
"remove": "gpi"
},

"Top Silkscreen Layer":
{
"extension": "plc",
"program_layers": ["Dimension", "tPlace", "tNames"],
"type": "gerber",
"remove": "gpi"
},

"Top Copper Layer":
{
"extension": "cmp",
"program_layers": ["Top", "Pads", "Vias"],
"type": "gerber",
"remove": "gpi"
},

"Bottom Copper Layer":
{
"extension": "sol",
"program_layers": ["Bottom", "Pads", "Vias"],
"type": "gerber",
"remove": "gpi"
},

"Top Soldermask Layer":
{
"extension": "stc",
"program_layers": ["tStop"],
"type": "gerber",
"remove": "gpi"
},

"Bottom Soldermask Layer":
{
"extension": "sts",
"program_layers": ["bStop"],
"type": "gerber",
"remove": "gpi"
},

"Drill Information":
{
"extension": "drd",
"program_layers": ["Drills", "Holes"],
"type": "excellon",
"remove": "dri"
}
},

"assembly":
{
"program_layers": ["tPlace", "tNames", "tDocu", "Document", "Reference","Dimension"],
"type": "drawing",
"extension": "ps"
},

"description": "Two layer board, Top silkscreen only, Soldermask on both sides"
}
}
}
File renamed without changes.
35 changes: 34 additions & 1 deletion pymomo/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def format_msg(self):

return msg

def __str__(self):
msg = self.format()
return msg

class ValidationError(MoMoException):
"""
API routines can impose validation criteria on their arguments in
Expand Down Expand Up @@ -78,11 +82,22 @@ class ArgumentError(MoMoException):

pass

class DataError(MoMoException):
"""
The method relied on data pass in by the user and the data was invalid.

This could be because a file was the wrong type or because a data provider
returned an unexpected result. The parameters passed with this exception
provide more detail on what occurred and where.
"""

pass

class InternalError(MoMoException):
"""
The method could not be completed with the user input passed for
an unexpected reason. This does not signify a bug in the API
method code. More details should be passed in the arguments
method code. More details should be passed in the arguments.
"""

pass
Expand All @@ -109,4 +124,22 @@ class BuildError(MoMoException):
that something is misconfigured.
"""

pass

class TypeSystemError(MoMoException):
"""
There was an error with the MoMo type system. This can be due to improperly
specifying an unknown type or because the required type was not properly loaded
from an external module before a function that used that type was needed.
"""

pass

class EnvironmentError(MoMoException):
"""
The environment is not properly configured for the MoMo API command that was called.
This can be because a required program was not installed or accessible or because
a required environment variable was not defined.
"""

pass
22 changes: 22 additions & 0 deletions pymomo/pcb/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
A package for managing bills of materials and pcb fabrication

Methods and objects for creating and pricing bills of materials
as well as automatically generating gerber files for pcb fabrication.

- The CircuitBoard object provides a way to generate BOMs and production
files for pcb fabrication from ECAD files
- various BOM pricing and matching engines like OctopartMatcher allow you
to see how much your BOM would cost in different quantities.
"""

_name_ = "pcb"


#Add in required types that we need
import types
import pymomo.utilities.typedargs
pymomo.utilities.typedargs.type_system.load_type_module(types)

from match_engines import *
from board import CircuitBoard
Loading