Commit 7c261950 authored by Scott Sun's avatar Scott Sun

scott

parent cf08b85d
...@@ -318,9 +318,7 @@ try { ...@@ -318,9 +318,7 @@ try {
var analysis_obj = analysis({job:job,jobId:JobId,pcs_step:pcs_step,array_step:array_step,matrix:matrix}) var analysis_obj = analysis({job:job,jobId:JobId,pcs_step:pcs_step,array_step:array_step,matrix:matrix})
// 创建profile // 创建profile
var tmp_matrix = GEN.getMatrix({job:job}) var tmp_matrix = GEN.getMatrix({job:job})
var board_layer = Object.keys(tmp_matrix).filter(function(v){
return tmp_matrix[v].context == "board"
})
GEN.openStep({job:job, name:pcs_step}) GEN.openStep({job:job, name:pcs_step})
var now_profile = GEN.getProfile({job:job, step:pcs_step}) var now_profile = GEN.getProfile({job:job, step:pcs_step})
console.log("profile:===============>"+now_profile); console.log("profile:===============>"+now_profile);
...@@ -330,15 +328,21 @@ try { ...@@ -330,15 +328,21 @@ try {
var hasProfile = GEN.getProfile({job:job, step:pcs_step}) var hasProfile = GEN.getProfile({job:job, step:pcs_step})
if(hasProfile.match(/\n/ig).length == 1){ if(hasProfile.match(/\n/ig).length == 1){
throw "创建profile失败" throw "创建profile失败"
} else {
GEN.affectedLayer({affected:'yes',mode:'all'})
GEN.selectByFilter({profile:"out"})
if(GEN.getSelectCount() > 0){
GEN.selDelete()
}
} }
} else { } else {
GEN.affectedLayer({affected:'yes',layer: board_layer, clear_before:"yes"}) GEN.affectedLayer({affected:'yes',mode:'all'})
GEN.selectByFilter({profile:"out"}) GEN.selectByFilter({profile:"out"})
if(GEN.getSelectCount() > 0){ if(GEN.getSelectCount() > 0){
GEN.selDelete() GEN.selDelete()
} }
} }
GEN.closeStep()
// * profile 和 拼版 // * profile 和 拼版
var pandle_step = step_list.map(function(v){ var pandle_step = step_list.map(function(v){
var type = "unknow"; var type = "unknow";
...@@ -745,16 +749,16 @@ try { ...@@ -745,16 +749,16 @@ try {
jobid: JobId, jobid: JobId,
jobinfohash: {ATS_surface_area_base_on:"Card"} jobinfohash: {ATS_surface_area_base_on:"Card"}
}) })
var jobpath var jobpath = GEN.getJobPath({job:job})
if(GEN.GEN_TYPE == "genesis"){ // if(GEN.GEN_TYPE == "genesis"){
jobpath = GEN.getJobPath({job:job}) // jobpath = GEN.getJobPath({job:job})
} else { // } else {
jobpath = "/home/local_db/server_db/jobs/"+job // jobpath = "/home/local_db/server_db/jobs/"+job
} // }
mkPath(jobpath,["user","opcam","steps"]) mkPath(jobpath,["user","opcam","steps"])
stepList.forEach(function(step){ stepList.forEach(function(step){
GEN.openStep({ job: job, name: step }) GEN.openStep({ job: job, name: step })
// GEN.units({type:'mm'}) GEN.units({type:'mm'})
// 曝光 // 曝光
analysis_obj.matrixInfo.mOuters.forEach(function(item){ analysis_obj.matrixInfo.mOuters.forEach(function(item){
if(ALL.gold_fingers.length>0){ if(ALL.gold_fingers.length>0){
...@@ -764,7 +768,7 @@ try { ...@@ -764,7 +768,7 @@ try {
}) })
var layer_gold_type = /top/ig.test(item.signalL) ? "top" : "bot" var layer_gold_type = /top/ig.test(item.signalL) ? "top" : "bot"
if(tmp_gold_info[layer_gold_type]){ if(tmp_gold_info[layer_gold_type]){
var tmp_info = GEN.copperArea({layer1:tmp_gold_info[layer_gold_type],resolution_value:1}) var tmp_info = GEN.copperArea({layer1:tmp_gold_info[layer_gold_type],resolution_value:25.4})
// var tmp_info = GEN.exposedArea({layer1:item.signalL,mask1:tmp_gold_info[layer_gold_type]}) // var tmp_info = GEN.exposedArea({layer1:item.signalL,mask1:tmp_gold_info[layer_gold_type]})
var tmp_data = {} var tmp_data = {}
if(layer_gold_type == "top") { if(layer_gold_type == "top") {
...@@ -790,7 +794,8 @@ try { ...@@ -790,7 +794,8 @@ try {
} }
} }
if(item.solderL){ if(item.solderL){
var tmp_info = GEN.exposedArea({layer1:item.signalL,mask1:item.solderL}) var tmp_info = GEN.copperArea({layer1:item.solderL,resolution_value:25.4})
// var tmp_info = GEN.exposedArea({layer1:item.signalL,mask1:item.solderL})
// {"area":"0.73817","percent":"8.986"} // {"area":"0.73817","percent":"8.986"}
var tmp_area = tmp_info.area var tmp_area = tmp_info.area
var tmp_percent = tmp_info.percent; var tmp_percent = tmp_info.percent;
...@@ -811,7 +816,7 @@ try { ...@@ -811,7 +816,7 @@ try {
}) })
GEN.clearLayers() GEN.clearLayers()
GEN.affectedLayer({ affected: 'no', mode: 'all' }) GEN.affectedLayer({ affected: 'no', mode: 'all' })
// GEN.units({type:'inch'}) GEN.units({type:'inch'})
console.log("==================================> Drill analysis") console.log("==================================> Drill analysis")
// 钻孔 // 钻孔
......
...@@ -579,8 +579,8 @@ ...@@ -579,8 +579,8 @@
{"orig_name" : "fab.art", "tl_name" : "fab.art" }, {"orig_name" : "fab.art", "tl_name" : "fab.art" },
{"orig_name" : ["multipack.art","^array$"], "tl_name" : "array" }, {"orig_name" : ["multipack.art","^array$"], "tl_name" : "array" },
{"orig_name" : ["^outline"], "tl_name" : "outline" }, {"orig_name" : ["^outline"], "tl_name" : "outline" },
{"orig_name" : ["top-enig","enig_top"], "tl_name" : "enig_top" }, {"orig_name" : ["^pst\\.art$","top-enig","enig_top"], "tl_name" : "enig_top" },
{"orig_name" : ["bot-enig","enig_bot"], "tl_name" : "enig_bot" }, {"orig_name" : ["^sst\\.art$","bot-enig","enig_bot"], "tl_name" : "enig_bot" },
] ]
}, },
"New_data": { "New_data": {
......
...@@ -134,6 +134,14 @@ declare class TopCamIkm6 { ...@@ -134,6 +134,14 @@ declare class TopCamIkm6 {
     * @returns 返回IKM的DB连接参数      * @returns 返回IKM的DB连接参数
     */      */
    getIkmConnectParameter():JSON     getIkmConnectParameter():JSON
/**
     * 获取料号info
     * 
     * @param 
     * @returns 返回料号info
     */
    get_jobinfo(p:{jobid:number, jobinfo:string}):any;
} }
export = TopCamIkm6; export = TopCamIkm6;
......
/* /*
NAME: NAME:
DESCRIPTION: ; DESCRIPTION: ;
PARAMETER: PARAMETER:
[ [
{
name : 'auto_save',
title : '自动保存',
type : 'RadioBox',
property : {
item_list:[
{name:'yes',text:'YES'},
{name:'no',text:'NO'},
],
tool_tip:'是否自动保存料号开关'
}
}
] ]
VERSION_HISTORY: VERSION_HISTORY:
V1.00 2020-04-17 Scott Sun V1.00 2020-04-20 Scott Sun
1.新版本 1.新版本
HELP: HELP:
<html><body bgcolor="#DDECFE"> <html><body bgcolor="#DDECFE">
<font size="3" color="#003DB2"><p>功能简介</p></font> <font size="3" color="#003DB2"><p>功能简介</p></font>
<p> 数据标准化 </p> <p> scott test </p>
<br> <br>
<font size="3" color="#003DB2"><p>参数配置</p></font> <font size="3" color="#003DB2"><p>参数配置</p></font>
<p> 客户配置 </p> <p> 外形层 </p>
<br> <br>
<font size="3" color="#003DB2"><p>注意事项</p></font> <font size="3" color="#003DB2"><p>注意事项</p></font>
<p> 无 </p> <p> 无 </p>
<br> <br>
</body></html> </body></html>
*/ */
//////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////// console.log("---------------scott----------------");
// 引入模块 包 // 引入模块 包
console.log("==============================================>scott test")
var $ = require('topcam.scriptfunc').argv(); var $ = require('topcam.scriptfunc').argv();
var fs = require('fs'); var fs = require('fs');
var _ = require('lodash'); var _ = require('lodash');
var database = require("topsin.database"); var mode = $.ikm ? "topcam" : "aimdfm";
database.addConnection($.conf.database_conf, "DFM"); var IKM = $.ikm;
var QDfm = database.query("DFM"); if (IKM==undefined ) { IKM = require('topcam.ikm6')($) }
if ($.conf.product_type == "aimdfm") {
QDfm.updateRow({
table: "pdm_aimdfm_task",
data: {
current_process_title: $.process_title
},
where: { id: $.task_id }
});
}
var GEN = $.gen; var GEN = $.gen;
var Job = $.job_name; var GUI = $.gui || {};
var db = $.db; var Job = $.job || $.job_name;
var JobId = $.job_id; var JobId = $.job_id;
var process = require('process'); var db = $.db || {}
var Status = 'ok'; var PAR = {}
var resultData = []; if ($.par) {
var PAR = {}; PAR = $.par
if ($.hasOwnProperty('script_parameter')){ } else if ($.hasOwnProperty('script_parameter')){
PAR = JSON.parse($.script_parameter); PAR = JSON.parse($.script_parameter);
} }
if (mode === "aimdfm") {
var database = require("topsin.database");
database.addConnection($.conf.database_conf, "DFM");
var QDfm = database.query("DFM");
$.QDfm = QDfm;
if ($.conf.product_type == "aimdfm") {
QDfm.updateRow({
table: "pdm_aimdfm_task",
data: {
current_process_title: $.process_title
},
where: { id: $.task_id }
});
}
}
var Status = 'ok';
var resultData = [];
try { try {
var job = Job.toLowerCase()
var matrix = GEN.getMatrix({job:job}) var path = GEN.getJobPath({job:Job})
var sm = Object.keys(matrix).filter(function(v){
var item = matrix[v] console.log("----------------path---------------");
return item.context=="board" && item.layer_type=="solder_mask" console.log(path);
})
GEN.openStep({job:job,name:"cad"})
sm.forEach(function(layer){
GEN.PAUSE(layer)
var info = GEN.copperArea({layer:layer})
GEN.PAUSE(_.toString(info))
})
QDfm.updateRow({
table: "pdm_aimdfm_task",
data: { if (mode === "aimdfm") {
progress: 33.33 $.QDfm.updateRow({
}, table: "pdm_aimdfm_task",
where: { id: $.task_id } data: {
}); progress: 33.33
if (GEN.hasError()) { },
Status = 'error'; where: { id: $.task_id }
resultData.push({ type: "error", title: "GEN错误!", detail: [{ desc: _.join(GEN.STATUS, "\n") }] }); });
return { if (GEN.hasError()) {
status: Status, Status = 'error';
result_data: resultData resultData.push({ type: "error", title: "GEN错误!", detail: [{ desc: _.join(GEN.STATUS, "\n") }] });
}; return {
} else { status: Status,
resultData.push({ type: "info", title: "操作完成, 请注意检查!" }); result_data: resultData
return { };
status: Status, } else {
result_data: resultData resultData.push({ type: "info", title: "操作完成, 请注意检查!" });
}; return {
status: Status,
result_data: resultData
};
}
}else {
return "Done"
} }
} } catch (e) {
catch (e) {
Status = 'error'; Status = 'error';
resultData.push({type: "error", title: "脚本执行出错!", detail: [{desc: _.toString(e)}]}); resultData.push({type: "error", title: "脚本执行出错!", detail: [{desc: _.toString(e)}]});
return {status: Status, result_data: resultData}; return (mode === "aimdfm") ? {status: Status, result_data: resultData} : "Error";
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment