sub getStripSideRailCopUsage {
my $type = shift;
# 【12003365】cam-残铜率检查程序优化 按最新文件要求,所有type diff均为10
my $diff = 10;
my (@usageStrip,@usageUnit,$fullCopperValue,$unitFullCopperValue);
ICO::OpenStep($f,$JOB,$subStep[0]);
ICO::DelLayer($f,$JOB,'side_rail_fill_cop','unit_fill_cop','unit_fill_cop+++');
ICO::CreateLay($f, $JOB, "misc", "document", 'side_rail_fill_cop','unit_fill_cop','unit_fill_cop+++');
$f->COM('sr_fill', type => 'solid',
solid_type => 'surface',
min_brush => '2.54',
use_arcs => 'yes',
cut_prims => 'no',
outline_draw => 'no',
outline_width => 0,
outline_invert => 'no',
polarity => 'positive',
step_margin_x => 0,
step_margin_y => 0,
step_max_dist_x => 2540,
step_max_dist_y => 2540,
sr_margin_x => '0.3',
sr_margin_y => '0.3',
sr_max_dist_x => 0,
sr_max_dist_y => 0,
nest_sr => 'no',
consider_feat => 'no',
feat_margin => 0,
consider_drill => 'no',
drill_margin => 0,
consider_rout => 'no',
dest => 'layer_name',
layer => 'side_rail_fill_cop',
stop_at_steps => '');
$fullCopperValue = ICO::GetCopperArea($f,'side_rail_fill_cop','all',0);
$f->COM('profile_to_rout', layer => 'unit_fill_cop', width => 10);
ICO::ClearAll($f,$JOB);
$f->COM('affected_layer', name => 'unit_fill_cop', mode => 'single', affected => 'yes');
$f->COM('sel_cut_data', det_tol => '25.4', con_tol => '25.4', rad_tol => '2.54', ignore_width => 'yes',
filter_overlaps => 'no', delete_doubles => 'no', use_order => 'yes', ignore_holes => 'none',
start_positive => 'yes', polarity_of_touching => 'same', contourize => 'yes', simplify => 'yes',
resize_thick_lines => 'no' );
ICO::ClearLayer($f);
$f->COM('affected_layer', name => 'side_rail_fill_cop', mode => 'single', affected => 'yes');
$f->COM('sel_copy_other', dest => 'layer_name',target_layer => 'unit_fill_cop', invert => 'yes',dx => 0,dy => 0,size => 0,x_anchor => '0',y_anchor => '0');
ICO::ClearLayer($f);
$f->COM('affected_layer', name => 'unit_fill_cop', mode => 'single', affected => 'yes');
$f->COM('sel_cont_resize', accuracy => 25.4, break_to_islands => 'yes', island_size => 0, hole_size => 0, drill_filter => 'no', corner_ctl => 'no');
ICO::ClearLayer($f);
$unitFullCopperValue = ICO::GetCopperArea($f,'unit_fill_cop','all', 0);
$f->COM('reset_filter_criteria', filter_name => '', criteria => 'all');
$f->COM('adv_filter_reset');
foreach my $sig (@sigLayers) {
ICO::ClearAll($f,$JOB);
my $tmp = ICO::GetExposeArea($f,$sig,'side_rail_fill_cop','all',0);
push @usageStrip, sprintf '%.3f', $tmp/$fullCopperValue*100;
$tmp = ICO::GetExposeArea($f,$sig,'unit_fill_cop','all',0);
push @usageUnit, sprintf '%.3f', $tmp/$unitFullCopperValue*100;
}
ICO::DelLayer($f,$JOB,'side_rail_fill_cop','unit_fill_cop','unit_fill_cop+++');
ICO::ClearAll($f,$JOB);
my $str = '';
my $str2 = '';
my @side = (1..99);
my $layCount = @sigLayers;
for (my $u = 0; $u < $layCount; $u++) {
$hashCopInfo{$u}{side} = 'L'.$side[$u];
$hashCopInfo{$u}{ucop} = $usageUnit[$u];
$hashCopInfo{$u}{scop} = $usageStrip[$u];
$hashCopInfo{$u}{diff} = abs($usageStrip[$u]-$usageUnit[$u]);
$hashCopInfo{$u}{status} = 'PASS';
if ($type == 1){ # RF+MSAP+压平
if ($usageUnit[$u]-$usageStrip[$u] > 0){
$diff = 4; # u>strip时,差值需要<=4%,
}elsif ($usageUnit[$u]-$usageStrip[$u] <= 0){
$diff = 9; # u<strip时,差值需要<=9%
}
}
elsif ($type == 4){ # PMIC+Tenting
if ($cuThick[$u] <= 30){
$diff = 20;
}
elsif ($cuThick[$u] <= 40){
$diff = 15;
}else {
$diff = 10;
}
}
if (abs($usageStrip[$u]-$usageUnit[$u]) > $diff) {
$str .= 'L'.$side[$u].'、 strip和unit残铜相差超'.$diff.'%, strip='. $usageStrip[$u] .'%, unit= '.$usageUnit[$u] ."%\n";
$hashCopInfo{$u}{status} = 'NG';
}
$str2 .= 'L'.$side[$u].'、 strip='. $usageStrip[$u] .'%, unit= '.$usageUnit[$u] ."%\n";
}
$hashCopInfo{count} = $layCount;
if ($str ne '') {
LogResult($str);
}
$hashCopInfo{striptopcop} = ICO::GetCopperArea($f,$sigLayers[0],'all', 1);
$hashCopInfo{stripbotcop} = ICO::GetCopperArea($f,$sigLayers[-1],'all', 1);
$hashCopInfo{striptopsm} = 100-ICO::GetCopperArea($f,$topSM[0],'all', 1);
$hashCopInfo{stripbotsm} = 100-ICO::GetCopperArea($f,$botSM[0],'all', 1);
uiShowResTable();
}
sub uiShowResTable {
my ($err1,$err2);
my $mw3 = $mw->Toplevel(-title => "结果查看");
$mw3->geometry( '+400+300' );
$mw3->maxsize( 1000, 1200 );
my $part2 = $mw3->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
my $frameMainB = $part2->Scrolled('Frame', -scrollbars => 'e', -borderwidth => 2, -relief => 'groove', -height => 600) ->pack(-expand => 'yes', -fill => 'both');
my $frameB = $frameMainB->Frame()->pack(-side=>"top",-expand=>"yes",-fill=>"both",-anchor=>"n",-padx=>5,-pady=>10);
my $frameUnitCop = $frameB->LabFrame(-label=>"unit区域和strip外围残铜数据(%)",-font=>"normal 12")->pack(-side=>"top",-fill=>"x");
my $frameUCTop = $frameUnitCop->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameUCTop->Label( -text=>"STEP",-font=>"normal 12", -width=>18, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
for (my $i = 1; $i <= $hashCopInfo{count}; $i++) {
$frameUCTop->Label( -text=>"L".$i,-font=>"normal 12", -width=>10, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
}
my $frameUCRow = $frameUnitCop->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameUCRow->Label( -text=>"unit",-font=>"normal 12", -width=>18, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
for (my $i = 0; $i < $hashCopInfo{count}; $i++) {
$frameUCRow ->Entry(-textvariable=>\$hashCopInfo{$i}{ucop}, -width=>10, -font=>"normal 12", -background=>"white") ->pack(-side=>"left",-padx=>5,-pady=>2);
}
my $frameUCRow2 = $frameUnitCop->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameUCRow2->Label( -text=>"strip",-font=>"normal 12", -width=>18, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
for (my $i = 0; $i < $hashCopInfo{count}; $i++) {
$frameUCRow2 ->Entry(-textvariable=>\$hashCopInfo{$i}{scop}, -width=>10, -font=>"normal 12", -background=>"white") ->pack(-side=>"left",-padx=>5,-pady=>2);
}
my $frameUCRow3 = $frameUnitCop->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameUCRow3->Label( -text=>"差异",-font=>"normal 12", -width=>18, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
for (my $i = 0; $i < $hashCopInfo{count}; $i++) {
$frameUCRow3 ->Entry(-textvariable=>\$hashCopInfo{$i}{diff}, -width=>10, -font=>"normal 12", -background=>"white") ->pack(-side=>"left",-padx=>5,-pady=>2);
}
my $frameUCRow4 = $frameUnitCop->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameUCRow4->Label( -text=>"状态",-font=>"normal 12", -width=>18, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
for (my $i = 0; $i < $hashCopInfo{count}; $i++) {
my $color = 'red';
if ($hashCopInfo{$i}{status} eq 'PASS') {
$color = 'green';
} else {
$err1 = 'unit和strip残铜相差超过10%(G2产品u>strip时,差值需要<=4%,u<strip时,差值需要<=9%)';
}
$frameUCRow4 ->Entry(-textvariable=>\$hashCopInfo{$i}{status}, -width=>10, -font=>"normal 12", -background=>"$color") ->pack(-side=>"left",-padx=>5,-pady=>2);
}
if ($err1) {
$needCtype = 1;
$frameUnitCop->Label( -text=>"$err1",-font=>"normal 12", -width=>100, -fg=>'blue') ->pack(-side=>"top",-padx=>5,-pady=>2);
}
# $ed_dummy_rule ="需增加回蚀dummy流程,审单铺铜需满足以下规则:当U小于80%:S(板边)大于等于U+14%\n当U大于等于80%:S(板边)大于等于U+9%\n并提难点确认板边设计(板边残铜过高接近实铜)";
if ($ed_dummy_rule) {
$frameUnitCop->Label( -text=>"$ed_dummy_rule ",-font=>"normal 12", -width=>100, -fg=>'blue') ->pack(-side=>"top",-padx=>5,-pady=>2);
}
my $frameFullCop = $frameB->LabFrame(-label=>"strip整板数据(%)",-font=>"normal 12")->pack(-side=>"top",-fill=>"x");
my $frameSData = $frameFullCop->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameSData->Label( -text=>"类型",-font=>"normal 12", -width=>18, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSData->Label( -text=>"TOP",-font=>"normal 12", -width=>12, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSData->Label( -text=>"BOTTOM",-font=>"normal 12", -width=>12, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSData->Label( -text=>"差值",-font=>"normal 12", -width=>12, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSData->Label( -text=>"状态",-font=>"normal 12", -width=>12, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
my $frameSCop = $frameFullCop->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameSCop->Label( -text=>"strip残铜",-font=>"normal 12", -width=>18, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSCop ->Entry(-textvariable=>\$hashCopInfo{striptopcop}, -width=>12, -font=>"normal 12", -background=>"white") ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSCop ->Entry(-textvariable=>\$hashCopInfo{stripbotcop}, -width=>12, -font=>"normal 12", -background=>"white") ->pack(-side=>"left",-padx=>5,-pady=>2);
my $cccc = sprintf('%.3f',abs($hashCopInfo{striptopcop}-$hashCopInfo{stripbotcop}));
$frameSCop->Label( -text=>$cccc,-font=>"normal 12", -width=>12, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
if (abs($hashCopInfo{striptopcop}-$hashCopInfo{stripbotcop}) > 3) {
$frameSCop->Label( -text=>"NG",-font=>"normal 12", -width=>12, -fg=>'red') ->pack(-side=>"left",-padx=>5,-pady=>2);
$err2 = 'strip正背面差异超3%';
} else {
$frameSCop->Label( -text=>"PASS",-font=>"normal 12", -width=>12, -fg=>'green') ->pack(-side=>"left",-padx=>5,-pady=>2);
}
my $frameSSM = $frameFullCop->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameSSM->Label( -text=>"strip残墨",-font=>"normal 12", -width=>18, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSSM ->Entry(-textvariable=>\$hashCopInfo{striptopsm}, -width=>12, -font=>"normal 12", -background=>"white") ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSSM ->Entry(-textvariable=>\$hashCopInfo{stripbotsm}, -width=>12, -font=>"normal 12", -background=>"white") ->pack(-side=>"left",-padx=>5,-pady=>2);
$frameSSM->Label( -text=>abs($hashCopInfo{striptopsm}-$hashCopInfo{stripbotsm}),-font=>"normal 12", -width=>12, -fg=>'blue') ->pack(-side=>"left",-padx=>5,-pady=>2);
if (abs($hashCopInfo{striptopsm}-$hashCopInfo{stripbotsm}) > 3) {
$frameSSM->Label( -text=>"NG X",-font=>"normal 12", -width=>12, -fg=>'red') ->pack(-side=>"left",-padx=>5,-pady=>2);
$err2 = 'strip正背面差异超3%';
} else {
$frameSSM->Label( -text=>"PASS",-font=>"normal 12", -width=>12, -fg=>'green') ->pack(-side=>"left",-padx=>5,-pady=>2);
}
if ($err2) {
$frameFullCop->Label( -text=>"$err2",-font=>"normal 12", -width=>50, -fg=>'blue') ->pack(-side=>"top",-padx=>5,-pady=>2);
$needCtype = 1;
}
my $frameRun = $frameB->Frame(-borderwidth => 2, -relief => 'groove')->pack(-side=>"top",-fill=>"x");
$frameRun->Button(-text=>"继续跑翘曲程序", -command=> sub{callControlWarpage();}, -width=>39,-font=>"normal 18") ->pack(-side=>"left",-padx=>2,-pady=>2);
$f->COM('get_user_group');
if ($f->{COMANS} eq 'MKT') {
$frameRun->Button(-text=>"直接退出", -command=> sub{exit;}, -width=>39,-font=>"normal 18") ->pack(-side=>"left",-padx=>2,-pady=>2);
}
}
在这段代码基础上修改、添加。并且最终要在tk界面新增zkcoupon与unit差值的对比,仿照 “unit区域和strip外围残铜数据”部分的界面排布,按zkcoupon的数量增加对比栏位。如果有zkcoupon的step才执行新增操作,否则按原程序进行,也不必增加tk界面。
最新发布