Compare commits

...

4 Commits

Author SHA1 Message Date
Morgan Allen 7d1e0a7385 typo 2018-03-23 11:52:22 -07:00
Morgan 'ARR\!' Allen b8ef93344f bump 1.4.0 2017-04-11 21:00:52 -07:00
Morgan 'ARR\!' Allen 7e39a90a9e notes on origin placement 2017-04-11 21:00:43 -07:00
Morgan 'ARR\!' Allen 93ef93dacd fixed encoding, rotation, other stuff 2017-04-11 20:57:37 -07:00
3 changed files with 16 additions and 9 deletions

View File

@ -2,7 +2,7 @@
Converts KiCAD .pos placement file to Charmhigh Pick and Place CSV
## usage
## Usage
```
pos2csv -i test/top.pos -f test/feeds.csv -o pnp.csv
```
@ -19,6 +19,11 @@ pos2csv -i test/top.pos -f test/feeds.csv -o pnp.csv
--feed Feed file from PnP
```
## Layout
Board Origin must be below and to the left of your circuit.
The Charmhigh cannot use negative numbers from the Origin.
Place a Fiducial footprint to mark the location on the F-Cu layer.
Use this mark to visually align the origin.
## Feed file
The feed file is generated by the Pick and Place. Go through the normal

View File

@ -11,11 +11,11 @@ module.exports = function(input, output, feedFile, opts) {
var section = -1;
var sections = [[], [], [], []];
fs.createReadStream(feedFile)
fs.createReadStream(feedFile, { encoding: "latin1" })
.on("data", function(data) {
buf += data.toString();
var lines = buf.split("\n");
var lines = buf.split("\r\n");
buf = lines.pop();
for(var i = 0; i < lines.length; i++) {
@ -72,7 +72,9 @@ module.exports = function(input, output, feedFile, opts) {
var p = match[1];
var x = match[3];
var y = match[4];
var r = match[5];
var r = Math.round(match[5] - 90);
if(r < 0) r += 360;
if(!feeds[p]) {
if(!opts.quite)
@ -83,7 +85,7 @@ module.exports = function(input, output, feedFile, opts) {
var feed = feeds[p];
this.push([ 0, seq++, feed.slot, x, y, r, 0.50, 0, 100, null, null, null ].join(",") + "\n");
this.push([ ++seq, 1, feed.slot, Math.abs(x), Math.abs(y), r, 0.50, 0, 100, null, null, null ].join(",") + "\r\n");
};
done();
@ -91,13 +93,13 @@ module.exports = function(input, output, feedFile, opts) {
next(null, tr, sections);
}], function(err, tr, sections) {
var rs = fs.createReadStream(input);
var ws = fs.createWriteStream(output);
var rs = fs.createReadStream(input, { encoding: "latin1" });
var ws = fs.createWriteStream(output, { encoding: "latin1" });
var i = 0;
async.forEachSeries(sections, function(section, next) {
ws.write(section.join("\n") + (++i < 4 ? "\n\n" : "\n"), next);
ws.write(section.join("\r\n") + (++i < 4 ? "\r\n\r\n" : "\r\n"), next);
}, function() {
rs.pipe(tr);
tr.pipe(ws).on("close", function() {

View File

@ -1,6 +1,6 @@
{
"name": "pos2charmhigh",
"version": "1.2.0",
"version": "1.4.0",
"description": "Translates KiCAD .pos files to Charmhigh CSV",
"main": "index.js",
"scripts": {