@ -28,7 +28,10 @@ namespace PaintingPC
private Dictionary < string , string > _l astJustDict = new Dictionary < string , string > ( ) ;
private string _f oreighColor = string . Empty ;
private string _l ineCode = string . Empty ;
private string _l ineCodeSys = string . Empty ;
private List < string > _ stations = new List < string > ( ) ;
private string _ stationType = string . Empty ;
private StationBLL _ stationBLL = new StationBLL ( ) ;
/// <summary>
/// 从tb_ForeignColorMap表得到的零件号
/// </summary>
@ -45,6 +48,27 @@ namespace PaintingPC
this . Size = new Size ( 1 2 8 0 , 1 0 2 0 ) ;
this . _ isWmsQuality = isWmsQuality ;
_l ineCode = ConfigurationManager . AppSettings [ "LineCode" ] . ToString ( ) ;
if ( _l ineCode = = "1" )
{
_l ineCodeSys = "1207" ;
}
else if ( _l ineCode = = "2" )
{
_l ineCodeSys = "1210" ;
}
DataTable stationTable = _ stationBLL . GetStationInfo ( _l ineCodeSys ) ;
if ( stationTable = = null | | stationTable . Rows . Count = = 0 )
{
ShowHint ( "查询产线[" + _l ineCodeSys + "]关联工位时异常,请进行确认产线是否存在关联工位." , false ) ;
}
if ( stationTable . Rows . Count > 0 )
{
_ stations = stationTable . AsEnumerable ( ) . Select ( p = > p . Field < string > ( "StationNo" ) ) . ToList ( ) ;
if ( _ stations . Count = = 0 )
ShowHint ( "产线[" + _l ineCodeSys + "]不存在关联工位,请先进行配置." , false ) ;
}
_ stationType = ConfigurationManager . AppSettings [ "Position" ] . ToString ( ) ;
string disableButtons = ConfigurationManager . AppSettings [ "DisableButtons" ] . ToString ( ) ;
string single = ConfigurationManager . AppSettings [ "SingleStation" ] . ToString ( ) ;
@ -87,7 +111,10 @@ namespace PaintingPC
{
btnAllowChangeColor . Visible = true ;
}
if ( _ stationType = = "下线点修补" )
{
btnNok . Visible = false ;
}
// }
}
void HidenColorSelect ( bool isHidden )
@ -125,11 +152,12 @@ namespace PaintingPC
{
try
{
string title = _ stationType ;
string title = ConfigurationManager . AppSettings [ "Display" ] . ToString ( ) ; ;
string workClass = Function . GetWorkClass2 ( ) ;
string station = ConfigurationManager . AppSettings [ "Station" ] . ToString ( ) ;
labTitle . Text = title ;
labWorkClass . Text = workClass ;
labStation . Text = station ;
labelVersion . Text = System . Reflection . Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version . ToString ( ) ;
@ -1059,10 +1087,14 @@ namespace PaintingPC
DataTable dt3 = Function . SearchDefectInfo ( ConfigurationManager . AppSettings [ "Station" ] . Trim ( ) ) ;
if ( dt3 ! = null & & dt3 . Rows . Count > 0 )
{
DataRow newRow = dt3 . NewRow ( ) ;
newRow . ItemArray = dt3 . Rows [ 0 ] . ItemArray ;
newRow [ "DefectName" ] = "点修补" ;
dt3 . Rows . InsertAt ( newRow , 0 ) ;
if ( _ stationType ! = "下线点修补" )
{
DataRow newRow = dt3 . NewRow ( ) ;
newRow . ItemArray = dt3 . Rows [ 0 ] . ItemArray ;
newRow [ "DefectName" ] = "点修补" ;
dt3 . Rows . InsertAt ( newRow , 0 ) ;
}
drow = Convert . ToInt32 ( Math . Ceiling ( ( double ) dt3 . Rows . Count / dcol ) ) ;
Label [ ] dLb = new Label [ 7 ] ;
@ -1080,19 +1112,7 @@ namespace PaintingPC
dLb [ i ] = new Label ( ) ;
if ( ( i + dcol * j ) < dstr . Length )
{
//if(i==0 && j == 0)
//{
// Label lbl = new Label();
// lbl.Text = "点修补";
// lbl.Font = new Font(dLb[i].Font.FontFamily, 36, FontStyle.Bold);
// lbl.Size = new Size(170, 60);
// lbl.Location = new Point(20 + i * (dLb[i].Size.Width + 25), 5 + j * (dLb[i].Size.Height + 20));
// lbl.BorderStyle = BorderStyle.FixedSingle;
// lbl.BackColor = Color.Red;
// lbl.TextAlign = ContentAlignment.MiddleCenter;
// panel2.Controls.Add(lbl);
// continue;
//}
dLb [ i ] . Text = dstr [ i + dcol * j ] . ToString ( ) ;
dLb [ i ] . Font = new Font ( dLb [ i ] . Font . FontFamily , 2 4 , FontStyle . Bold ) ;
dLb [ i ] . Size = new Size ( 1 5 0 , 5 0 ) ;
@ -1231,8 +1251,18 @@ namespace PaintingPC
position = dtInspect . Rows [ 0 ] [ "damnPosition" ] . ToString ( ) ; //缺陷位置
reason = dtInspect . Rows [ 0 ] [ "reason" ] . ToString ( ) ; //原因
paintId = dtInspect . Rows [ 0 ] [ "remark3" ] . ToString ( ) ; //原因
string stationNo = dtInspect . Rows [ 0 ] [ "stationNo" ] . ToString ( ) ; //质检工位
if ( ! _ stations . Contains ( stationNo ) )
{
string em = $"扫描条码[{barcode}]与当前产线[{_lineCodeSys}]不匹配,上一工序非当前产线完成!" ;
MessageBox . Show ( em ) ;
ShowHint ( em , false ) ;
txtBarCode . Text = "" ;
txtBarCode . TabIndex = 0 ;
txtBarCode . Select ( ) ;
return ;
}
#region 选中缺陷位置及原因
@ -1304,7 +1334,7 @@ namespace PaintingPC
paintId = info [ 2 ] ;
labProPosition . Tag = paintId ;
labProductInfo . Tag = Function . GetSide ( barcode , paintId ) ;
labProPosition . Text = labTitle . Text . Trim ( ) + " " + labProductInfo . Tag . ToString ( ) . Replace ( ';' , ' ' ) ;
labProPosition . Text = _ stationType + " " + labProductInfo . Tag . ToString ( ) . Replace ( ';' , ' ' ) ;
if ( info . Length = = 4 )
{
_f oreignPartCode = info [ 3 ] ;
@ -1346,7 +1376,7 @@ namespace PaintingPC
{
case "下线一检" : return First ( barcode ) ;
case "下线二检" : return Second ( barcode ) ; ;
case "点修补" : return Third ( barcode ) ;
case "下线 点修补" : return Third ( barcode ) ;
default : return true ;
}
@ -1355,6 +1385,12 @@ namespace PaintingPC
private bool First ( string barcode )
{
if ( _ isSingleStation = = true )
{
ShowHint ( "当前系统配置为[单工位生产],无法在此工位扫码,请去终检工位进行操作." , false ) ;
return false ;
}
DataTable dt = Function . GetLastResult ( barcode ) ;
if ( dt . Rows . Count > 0 )
{