1696 lines
51 KiB
ObjectPascal
1696 lines
51 KiB
ObjectPascal
unit uMain;
|
||
|
||
interface
|
||
|
||
uses
|
||
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,utcpdevice,
|
||
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Objects,ShellAPI,
|
||
Winapi.Messages,Winapi.Windows, System.IOUtils,System.StrUtils,uSafeLog,uKsoap,
|
||
System.ImageList, FMX.ImgList, FMX.Controls.Presentation, FMX.Edit,iniFiles,FMX.Pickers,
|
||
uPucFun,uPassword,uAlarmLed,ActiveX,uShowInfo,udm, FMX.ListBox, FMX.ComboEdit,
|
||
uFrameBase, FMX.Layouts, FMX.StdCtrls,
|
||
uInkPrintConent, MahUSB, uFrameBaseBland; // 确保包含布局控件单元;
|
||
|
||
type
|
||
TfrmMain = class(TForm)
|
||
LayoutMain: TRectangle;
|
||
Rectangle7: TRectangle;
|
||
Rectangle188: TRectangle;
|
||
Rectangle9: TRectangle;
|
||
Glyph1: TGlyph;
|
||
ImageList1: TImageList;
|
||
Rectangle001: TRectangle;
|
||
Text3: TText;
|
||
Rectangle102: TRectangle;
|
||
TxtPc: TText;
|
||
Rectangle13: TRectangle;
|
||
Rectangle12: TRectangle;
|
||
Rectangle14: TRectangle;
|
||
Text7: TText;
|
||
Rectangle15: TRectangle;
|
||
Glyph4: TGlyph;
|
||
Text8: TText;
|
||
Text9: TText;
|
||
EdtEmpNo: TEdit;
|
||
Rectangle16: TRectangle;
|
||
Glyph5: TGlyph;
|
||
Text10: TText;
|
||
Text11: TText;
|
||
EdtGoodsNo: TEdit;
|
||
RectangleLotNo: TRectangle;
|
||
Glyph6: TGlyph;
|
||
Text12: TText;
|
||
Text13: TText;
|
||
EdtLotNo: TEdit;
|
||
Rectangle18: TRectangle;
|
||
Glyph7: TGlyph;
|
||
Text14: TText;
|
||
TxtLineNum: TText;
|
||
Rectangle19: TRectangle;
|
||
Glyph8: TGlyph;
|
||
Text16: TText;
|
||
TxtLine: TText;
|
||
Rectangle2: TRectangle;
|
||
Rectangle3: TRectangle;
|
||
Rectangle6: TRectangle;
|
||
Rectangle4: TRectangle;
|
||
TxtFactoryCode: TText;
|
||
Text2: TText;
|
||
Rectangle5: TRectangle;
|
||
Text21: TText;
|
||
Timer1: TTimer;
|
||
Rectangle35: TRectangle;
|
||
Text49: TText;
|
||
Rectangle36: TRectangle;
|
||
TxtEmpNoError: TText;
|
||
Glyph23: TGlyph;
|
||
Text4: TText;
|
||
TxtVerInfo: TText;
|
||
TxtLotnoError: TText;
|
||
Text5: TText;
|
||
TxtOffline: TText;
|
||
TxtGoodsNoError: TText;
|
||
ComboBoxP_PC: TComboBox;
|
||
StyleBook1: TStyleBook;
|
||
GridLayout1: TGridLayout;
|
||
Rectangle8: TRectangle;
|
||
CheckBox1: TCheckBox;
|
||
Label1: TLabel;
|
||
RectangleChild: TRectangle;
|
||
procedure Text7Click(Sender: TObject);
|
||
procedure FormCreate(Sender: TObject);
|
||
procedure Timer1Timer(Sender: TObject);
|
||
procedure Rectangle2Click(Sender: TObject);
|
||
procedure Text4Click(Sender: TObject);
|
||
procedure FormDestroy(Sender: TObject);
|
||
procedure EdtEmpNoKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char;
|
||
Shift: TShiftState);
|
||
procedure EdtLotNoKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char;
|
||
Shift: TShiftState);
|
||
procedure EdtLotNoExit(Sender: TObject);
|
||
procedure Text5Click(Sender: TObject);
|
||
procedure AppctionError(Sender: TObject; E: Exception);
|
||
procedure ComboBoxP_PCExit(Sender: TObject);
|
||
procedure TxtVerInfoClick(Sender: TObject);
|
||
procedure EdtEmpNoChange(Sender: TObject);
|
||
procedure EdtLotNoChange(Sender: TObject);
|
||
procedure EdtEmpNoExit(Sender: TObject);
|
||
procedure EdtLotNoClick(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure ComboBoxP_PCChange(Sender: TObject);
|
||
procedure EdtGoodsNoExit(Sender: TObject);
|
||
private
|
||
FUsb : TUsbClass;
|
||
procedure Clear;
|
||
procedure SetMainUIParameter;
|
||
procedure SetRadioOption(sRadioList: string);
|
||
procedure ShowMainError(EmpNoError,LotNoError,GoodsNoError:string);
|
||
procedure aaaWork(Avalue: string);
|
||
function EdtLotPartnum(Value: string): Boolean;
|
||
|
||
procedure UsbIN(ASender : TObject; const ADevType,ADriverName,
|
||
AFriendlyName : string);
|
||
procedure UsbOUT(ASender : TObject; const ADevType,ADriverName,
|
||
AFriendlyName : string);
|
||
procedure comlista;
|
||
procedure CreateEmpNoExit;
|
||
procedure EdtEmpNoExitList;
|
||
procedure EdtLotNoExit1;
|
||
procedure HandleFrameButtonClick(Sender: TObject);
|
||
{ Private declarations }
|
||
public
|
||
DisplayFrame:TFrameBase;
|
||
|
||
sLotNum:string; //批号的数量
|
||
sPartnumValue:string; //获取料号返回的数据
|
||
|
||
DbSoapThread:TDbSoapThread;
|
||
end;
|
||
|
||
var
|
||
frmMain: TfrmMain;
|
||
iniListName:TStrings;
|
||
|
||
implementation
|
||
|
||
{$R *.fmx}
|
||
{ 二维要代出
|
||
259->261
|
||
259-R->261-R
|
||
54-> 18K预烤 ?
|
||
541-> 18K后烤
|
||
18B油墨印刷机->18B大气烤箱
|
||
182-B景晖手动印刷机->182-B烤箱
|
||
}
|
||
|
||
uses uSetMain, uListMoreConent, uListConent,
|
||
uAlarmCom, json_webservice, uFrame_Dyp001, uFrame_Dyp_Setup,
|
||
uFrame_Dyp002, uFrame_Dyp003, uFrame_Dyp000;
|
||
|
||
procedure TfrmMain.EdtEmpNoChange(Sender: TObject);
|
||
begin
|
||
if EdtEmpNo.Text='' then TxtShowErrorInfo(TxtEmpNoError,'');
|
||
end;
|
||
|
||
procedure TfrmMain.EdtEmpNoExit(Sender: TObject); //查用户表
|
||
var
|
||
sError:string;
|
||
begin
|
||
if EdtEmpNo.Text='' then exit;
|
||
|
||
ShowMainError('','','');
|
||
TThread.CreateAnonymousThread(
|
||
procedure
|
||
var
|
||
sError:string;
|
||
begin
|
||
CoInitialize(nil);
|
||
TRY
|
||
KJSon. REST_pro_List(EdtEmpNo.Text, 2, sError);
|
||
if (KJSon.List_system_users.Count = 0 ) or (KJSon.REST_Value(KJSon.List_system_users[0],'userName')<>EdtEmpNo.Text) then
|
||
begin
|
||
TxtEmpNoError.TextSettings.FontColor:= $FFFF0000;
|
||
ShowMainError('用户账号错误','','');
|
||
Exit;
|
||
end;
|
||
FINALLY
|
||
CoUninitialize;
|
||
END;
|
||
end).Start;
|
||
|
||
// EdtEmpNoExitList;
|
||
end;
|
||
|
||
//procedure TfrmMain.EdtGoodsNoExit(Sender: TObject);
|
||
//
|
||
//begin
|
||
// if (EdtGoodsNo.Text='') or (ComboBoxP_PC.ItemIndex<0) or (EdtLotNo.Text='') then exit;
|
||
//
|
||
// ShowMainError('','','');
|
||
// TThread.CreateAnonymousThread(
|
||
// procedure
|
||
// var
|
||
// sError:string;
|
||
// begin
|
||
// CoInitialize(nil);
|
||
// TRY
|
||
// if (KJSon. FList_pro_process.Count>0) and (ComboBoxP_PC.ItemIndex>-1) then
|
||
// KJSon. REST_pro_List(Format('&item_code=%s&process_code=%s&workorder_code=%s',[EdtGoodsNo.Text,KJSon. REST_Value(KJSon. FList_pro_process.Strings[ComboBoxP_PC.ItemIndex], 'number'),EdtLotNo.Text]), 4, sError);
|
||
//
|
||
// if (KJSon.List_Code_workorder.Count = 0 ) then
|
||
// begin
|
||
// TxtEmpNoError.TextSettings.FontColor:= $FFFF0000;
|
||
// ShowMainError('二维码错误或还没有检验过','','');
|
||
// Exit;
|
||
// end;
|
||
// FINALLY
|
||
// CoUninitialize;
|
||
// END;
|
||
// end).Start;
|
||
//
|
||
//end;
|
||
|
||
procedure TfrmMain.EdtGoodsNoExit(Sender: TObject);
|
||
begin
|
||
if (EdtGoodsNo.Text = '') or (ComboBoxP_PC.ItemIndex < 0) or (EdtLotNo.Text = '') then
|
||
Exit;
|
||
|
||
ShowMainError('', '', '');
|
||
|
||
// 提前获取需要在线程中使用的值,避免跨线程访问VCL控件
|
||
var LItemCode := EdtGoodsNo.Text;
|
||
var LLotNo := EdtLotNo.Text;
|
||
var LProcessIndex := ComboBoxP_PC.ItemIndex;
|
||
var LProcessNumber := '';
|
||
|
||
if LProcessIndex >= 0 then
|
||
LProcessNumber := KJSon.REST_Value(KJSon.FList_pro_process.Strings[LProcessIndex], 'number');
|
||
|
||
TThread.CreateAnonymousThread(
|
||
procedure
|
||
var
|
||
sError: string;
|
||
LNeedsSync: Boolean;
|
||
begin
|
||
CoInitialize(nil);
|
||
try
|
||
sError := '';
|
||
LNeedsSync := False;
|
||
|
||
// 检查是否满足执行条件
|
||
if (KJSon.FList_pro_process.Count > 0) and (LProcessIndex > -1) then
|
||
begin
|
||
KJSon.REST_pro_List(Format('&snArray=%s&process_code=%s&workOrderNumber=%s',
|
||
[LItemCode, LProcessNumber, LLotNo]), 4, sError);
|
||
end;
|
||
|
||
// 检查结果并在需要时更新UI
|
||
if (KJSon.List_Code_workorder.Count = 0) then
|
||
begin
|
||
LNeedsSync := True;
|
||
TThread.Synchronize(nil,
|
||
procedure
|
||
begin
|
||
TxtEmpNoError.TextSettings.FontColor := $FFFF0000;
|
||
ShowMainError('二维码错误或还没有检验过', '', '');
|
||
end);
|
||
end;
|
||
|
||
// 如果有错误信息,也同步显示
|
||
if sError <> '' then
|
||
begin
|
||
if not LNeedsSync then // 如果尚未同步,则需要新的同步
|
||
begin
|
||
TThread.Synchronize(nil,
|
||
procedure
|
||
begin
|
||
ShowMainError(sError, '', '');
|
||
end);
|
||
end
|
||
else
|
||
begin
|
||
// 如果已经需要同步,可以合并错误信息(根据实际需求调整)
|
||
TThread.Synchronize(nil,
|
||
procedure
|
||
begin
|
||
ShowMainError('二维码错误或还没有检验过', sError, '');
|
||
end);
|
||
end;
|
||
end;
|
||
|
||
finally
|
||
CoUninitialize;
|
||
end;
|
||
end).Start;
|
||
end;
|
||
|
||
procedure TfrmMain.EdtEmpNoExitList;
|
||
begin
|
||
if (EdtEmpNo.Text<>'') and (not TxtOffline.Visible) then //不是手工操作
|
||
TThread.CreateAnonymousThread(
|
||
procedure
|
||
var
|
||
sError:string;
|
||
I: Integer;
|
||
begin
|
||
CoInitialize(nil);
|
||
TRY
|
||
|
||
//检查工号
|
||
if KJSon.REST_pro_List(EdtEmpNo.Text,2,sError)<>'' then
|
||
begin
|
||
TxtEmpNoError.TextSettings.FontColor:= $FFFF0000;
|
||
ShowMainError(sError,'','');
|
||
Exit;
|
||
end;
|
||
|
||
// if (not Ksoap.xxcc_work_num_f(FactoryCode,EdtEmpNo.Text,TxtPc.Text,TxtLine.Text,sError)) then
|
||
// begin
|
||
// TxtEmpNoError.TextSettings.FontColor:= $FFFF0000;
|
||
// ShowMainError(sError,'','');
|
||
// Exit;
|
||
// end
|
||
// else
|
||
// begin
|
||
// TxtEmpNoError.TextSettings.FontColor:= $FF0003F3;
|
||
// ShowMainError('ok','','');
|
||
// end;
|
||
finally
|
||
CoUninitialize;
|
||
end;
|
||
end
|
||
).Start;
|
||
end;
|
||
|
||
procedure TfrmMain.EdtEmpNoKeyDown(Sender: TObject; var Key: Word;
|
||
var KeyChar: Char; Shift: TShiftState);
|
||
var
|
||
i: Boolean;
|
||
begin
|
||
if Key = vk_Return then
|
||
begin
|
||
TxtEmpNoError.Text:='';
|
||
EdtGoodsNo.Text:='';
|
||
EdtLotNo.SetFocus;
|
||
end;
|
||
|
||
// i := (KeyChar <= #8) or (KeyChar <= #8) and (KeyChar < #48) or (KeyChar > #57);
|
||
// if i then
|
||
// KeyChar := #0;
|
||
//
|
||
// if not (KeyChar in ['0'..'9', #13]) then
|
||
// KeyChar := #0;
|
||
|
||
end;
|
||
|
||
procedure TfrmMain.EdtLotNoKeyDown(Sender: TObject; var Key: Word;
|
||
var KeyChar: Char; Shift: TShiftState);
|
||
begin
|
||
if Key = vk_Return then EdtGoodsNo.SetFocus;
|
||
end;
|
||
|
||
procedure TfrmMain.aaaWork(Avalue:string);
|
||
begin
|
||
//连接数据库服务器
|
||
TThread.Synchronize(nil,
|
||
procedure
|
||
begin
|
||
TxtLineNum.Text:=Avalue;
|
||
//Form1.Memo1.Lines.Add();
|
||
end);
|
||
end;
|
||
|
||
procedure TfrmMain.Clear();
|
||
VAR
|
||
I:INTEGER;
|
||
begin
|
||
WorkLog.MessageInfo('界面初始化');
|
||
|
||
TxtShowErrorInfo(TxtEmpNoError,'');
|
||
TxtShowErrorInfo(TxtLotNoError,'');
|
||
TxtShowErrorInfo(TxtGoodsNoError,'');
|
||
// EdtEmpNo.Text:='';
|
||
//EdtLotNo.Text:='';
|
||
EdtGoodsNo.Text:='';
|
||
for I :=GridLayout1.ChildrenCount-1 downto 0 do
|
||
begin
|
||
TRadioButton(GridLayout1.Children[i]).IsChecked:=false;
|
||
end;
|
||
|
||
if DisplayFrame<>nil then
|
||
begin
|
||
DisplayFrame.ClearAll;
|
||
end;
|
||
|
||
EdtEmpNo.SetFocus;
|
||
end;
|
||
|
||
procedure TfrmMain.ComboBoxP_PCChange(Sender: TObject);
|
||
begin
|
||
// ShowMainError('1','','');
|
||
if (ComboBoxP_PC.ItemIndex>-1) and (KJSon. FList_pro_process.Count>0) then
|
||
TxtLine.Text:= KJSon. REST_Value(KJSon. FList_pro_process.Strings[ComboBoxP_PC.ItemIndex], 'name'); //ComboBoxP_PC.Items.Add(KJSon. REST_Value(KJSon. FList_Str.Strings[i], 'number'));
|
||
|
||
// 安全释放方案
|
||
// if (ComboBoxP_PC.ItemIndex > -1) and (KJSon. FList_pro_process.Count>0) then begin
|
||
if Assigned(DisplayFrame) then // 更标准的Delphi对象检查方式
|
||
begin
|
||
try
|
||
DisplayFrame.Free;
|
||
finally
|
||
DisplayFrame := nil; // 重要:立即置空指针
|
||
end;
|
||
end;
|
||
// end;
|
||
|
||
//电应普
|
||
if (DisplayFrame=nil) and (ComboBoxP_PC.ItemIndex > -1) and (trim(KJSon. REST_Value(KJSon. FList_pro_process.Strings[ComboBoxP_PC.ItemIndex], 'attention'))<>'') then
|
||
begin
|
||
// ShowMainError('2','','');
|
||
if copy(trim(KJSon. REST_Value(KJSon. FList_pro_process.Strings[ComboBoxP_PC.ItemIndex], 'attention')),1,2)=UpperCase('bx') then
|
||
begin
|
||
DisplayFrame:=TFrame_Dyp001.Create(nil);
|
||
DisplayFrame.Parent:=RectangleChild;
|
||
DisplayFrame.Align:=TAlignLayout.Top;
|
||
DisplayFrame.GridLayout:=GridLayout1;
|
||
DisplayFrame.OnButtonClick := HandleFrameButtonClick;
|
||
DisplayFrame.Tag:= ComboBoxP_PC.ItemIndex;
|
||
// ShowMainError('3','','');
|
||
exit;
|
||
end;
|
||
|
||
if copy(trim(KJSon. REST_Value(KJSon. FList_pro_process.Strings[ComboBoxP_PC.ItemIndex], 'attention')),1,2)=UpperCase('bd') then
|
||
begin
|
||
DisplayFrame:=TFrame_Dyp002.Create(nil);
|
||
DisplayFrame.Parent:=RectangleChild;
|
||
DisplayFrame.Align:=TAlignLayout.Top;
|
||
DisplayFrame.GridLayout:=GridLayout1;
|
||
DisplayFrame.OnButtonClick := HandleFrameButtonClick;
|
||
DisplayFrame.Tag:= ComboBoxP_PC.ItemIndex;
|
||
exit;
|
||
end;
|
||
|
||
if copy(trim(KJSon. REST_Value(KJSon. FList_pro_process.Strings[ComboBoxP_PC.ItemIndex], 'attention')),1,2)=UpperCase('cl') then
|
||
begin
|
||
DisplayFrame:=TFrame_Dyp003.Create(nil);
|
||
DisplayFrame.Parent:=RectangleChild;
|
||
DisplayFrame.Align:=TAlignLayout.Top;
|
||
DisplayFrame.GridLayout:=GridLayout1;
|
||
DisplayFrame.OnButtonClick := HandleFrameButtonClick;
|
||
DisplayFrame.Tag:= ComboBoxP_PC.ItemIndex;
|
||
exit;
|
||
end;
|
||
|
||
if trim(KJSon. REST_Value(KJSon. FList_pro_process.Strings[ComboBoxP_PC.ItemIndex], 'attention'))='null' then
|
||
begin
|
||
DisplayFrame:=TFrame_Dyp000.Create(nil);
|
||
DisplayFrame.Parent:=RectangleChild;
|
||
DisplayFrame.Align:=TAlignLayout.Top;
|
||
DisplayFrame.GridLayout:=GridLayout1;
|
||
DisplayFrame.Tag:= ComboBoxP_PC.ItemIndex;
|
||
exit;
|
||
end;
|
||
|
||
if trim(KJSon. REST_Value(KJSon. FList_pro_process.Strings[ComboBoxP_PC.ItemIndex], 'attention'))='' then
|
||
begin
|
||
DisplayFrame:=TFrame_Dyp_Setup.Create(nil);
|
||
DisplayFrame.Parent:=RectangleChild;
|
||
DisplayFrame.Align:=TAlignLayout.Top;
|
||
DisplayFrame.GridLayout:=GridLayout1;
|
||
DisplayFrame.Tag:= ComboBoxP_PC.ItemIndex;
|
||
exit;
|
||
end;
|
||
|
||
// SetRadioOption('TOP面,BOT面');
|
||
Exit;
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmMain.ComboBoxP_PCExit(Sender: TObject);
|
||
begin
|
||
if (ComboBoxP_PC.Count>0) and (ComboBoxP_PC.Selected<>nil) then
|
||
TxtPc.Text:=ComboBoxP_PC.Selected.Text;
|
||
end;
|
||
|
||
procedure TfrmMain.SetMainUIParameter();
|
||
VAR
|
||
tmpList:Tstrings;
|
||
|
||
sP_KB: String;
|
||
|
||
procedure SetOption(Rectangle:TRectangle;sValue:string);
|
||
var
|
||
i:integer;
|
||
begin
|
||
if (sValue='#') then
|
||
begin
|
||
for I := 0 to Rectangle.ControlsCount-1 do
|
||
begin
|
||
if TControl(Rectangle.Controls[i]) is TGlyph then
|
||
TGlyph(Rectangle.Controls[i]).ImageIndex:=-1
|
||
else
|
||
TControl(Rectangle.Controls[i]).Visible:=false;
|
||
end;
|
||
end
|
||
else
|
||
begin
|
||
for i := 0 to Rectangle.ControlsCount-1 do
|
||
begin
|
||
if Pos('OptionLabel',Rectangle.Controls[i].Name)>0 then
|
||
TText(Rectangle.Controls[i]).Text:=sValue;
|
||
TControl(Rectangle.Controls[i]).Visible:=true;
|
||
if TControl(Rectangle.Controls[i]) is TGlyph then
|
||
TGlyph(Rectangle.Controls[i]).ImageIndex:=11;
|
||
end;
|
||
end;
|
||
end;
|
||
begin
|
||
|
||
sbaseUrl:=dm.MemTableReadKeyValue('tv_DirData','server_url');
|
||
if sbaseUrl='' then
|
||
sbaseUrl:= baseUrl;
|
||
|
||
FactoryCode:=dm.MemTableReadKeyValue('设备信息','FACTORY_CODE');
|
||
TxtFactoryCode.Text:= FactoryCode; //string类型
|
||
TxtPc.Text:= dm.MemTableReadKeyValue('设备信息','P_PC'); //string类型
|
||
TxtLine.Text:= dm.MemTableReadKeyValue('设备信息','P_LINE'); //string类型
|
||
TxtLineNum.Text:= dm.MemTableReadKeyValue('设备信息','P_LINE_NUM'); //string类型
|
||
sP_KB:=dm.MemTableReadKeyValue('设备信息','P_KB');
|
||
|
||
fDevRecord.FP_User:= dm.MemTableReadKeyValue('tv_DirData','u_user');
|
||
fDevRecord.FP_Pass:= dm.MemTableReadKeyValue('tv_DirData','u_pass');
|
||
|
||
|
||
try
|
||
dm.Operate:=StrToInt(dm.MemTableReadKeyValue('主要参数','tv_Operate'));
|
||
except
|
||
dm.Operate:= 1;
|
||
end;
|
||
|
||
WorkLog.MessageInfo('设备信息:'+FactoryCode+','+TxtPc.Text+','+TxtLine.Text+','+TxtLineNum.Text+','+sP_KB);
|
||
|
||
try
|
||
dm.MainUI:=StrToInt(dm.MemTableReadKeyValue('主要参数','MainUI'));
|
||
except
|
||
dm.MainUI:= 1;
|
||
end;
|
||
|
||
// EdtGoodsNo.ReadOnly:=not TxtOffline.Visible;
|
||
if dm.MemTableReadKeyValue('主要参数','DataOpline')<>'' then
|
||
try
|
||
dm.DataOpline:=StrToInt(dm.MemTableReadKeyValue('主要参数','DataOpline'));
|
||
except
|
||
dm.DataOpline:= 0;
|
||
end;
|
||
|
||
|
||
TThread.CreateAnonymousThread(
|
||
procedure
|
||
var
|
||
i:integer;
|
||
sTemp,sError:string;
|
||
begin
|
||
CoInitialize(nil);
|
||
TRY
|
||
|
||
//登录用户
|
||
if KJSon.PostJSONWithREST_Login(fDevRecord.FP_User,fDevRecord.FP_Pass,sP_KB)='' then
|
||
begin
|
||
TxtEmpNoError.TextSettings.FontColor:= $FFFF0000;
|
||
ShowMainError(sP_KB,'','');
|
||
Exit;
|
||
end;
|
||
|
||
KJSon.REST_pro_List('', 1, sP_KB);
|
||
ComboBoxP_PC.Items.Clear;
|
||
if KJSon. FList_pro_process.Count>0 then
|
||
begin
|
||
for I := 0 to KJSon. FList_pro_process.Count - 1 do
|
||
begin
|
||
sTemp:= KJSon. REST_Value(KJSon. FList_pro_process.Strings[i], 'attention').Replace('null','');
|
||
if (sTemp<>'') then sTemp:= UpperCase(Copy(sTemp, 1, 2)) + '-';
|
||
|
||
ComboBoxP_PC.Items.Add(sTemp + KJSon. REST_Value(KJSon. FList_pro_process.Strings[i], 'name'));
|
||
end;
|
||
end;
|
||
|
||
// if ComboBoxP_PC.Items.Count>0 then
|
||
// ComboBoxP_PC.ItemIndex:= 0;
|
||
|
||
// KJSon.REST_pro_List(1, sP_KB);
|
||
// ComboBoxP_PC.Items.Clear;
|
||
// if KJSon. FList_Str.Count>0 then
|
||
// begin
|
||
// for I := 0 to KJSon. FList_Str.Count - 1 do
|
||
// begin
|
||
// ComboBoxP_PC.Items.Add(KJSon. REST_Value(KJSon. FList_Str.Strings[i], 'number'));
|
||
// end;
|
||
// end;
|
||
|
||
|
||
with ComboBoxP_PC do
|
||
begin
|
||
DropDownKind := TDropDownKind.Custom;
|
||
for i := 0 to Count - 1 do
|
||
begin
|
||
ListBox.ListItems[i].TextSettings.Font.Size := 16;
|
||
ListBox.ListItems[i].StyledSettings :=ListBox.ListItems[i].StyledSettings-[TStyledSetting.Size];
|
||
end;
|
||
end;
|
||
|
||
if dm.MainUI=2 then //特殊处理 'VCP F线A列'=trim(TxtLine.Text)
|
||
begin
|
||
RectangleLotNo.Visible:=false;
|
||
Rectangle16.Visible:=false;
|
||
end;
|
||
|
||
if dm.MainUI=4 then
|
||
begin
|
||
// 安全释放方案
|
||
if Assigned(DisplayFrame) then // 更标准的Delphi对象检查方式
|
||
begin
|
||
try
|
||
DisplayFrame.Free;
|
||
finally
|
||
DisplayFrame := nil; // 重要:立即置空指针
|
||
end;
|
||
end;
|
||
|
||
Rectangle001.Visible:= False;
|
||
TxtLineNum.Text:= '修维部';
|
||
DisplayFrame:=TFrame_Dyp_Setup.Create(nil);
|
||
DisplayFrame.Parent:=RectangleChild;
|
||
DisplayFrame.Align:=TAlignLayout.Top;
|
||
DisplayFrame.GridLayout:=GridLayout1;
|
||
DisplayFrame.FillDefaultValue('sPartnumValue','');
|
||
WorkLog.MessageInfo('修维部1');
|
||
// exit;
|
||
// Rectangle16.Visible:=false;
|
||
end;
|
||
|
||
FINALLY
|
||
CoUninitialize;
|
||
END;
|
||
end).Start;
|
||
|
||
end;
|
||
|
||
procedure TfrmMain.AppctionError(Sender: TObject; E: Exception);
|
||
begin
|
||
WorkLog.Error('AppctionError:'+E.Message);
|
||
ShowError('程序异常,请与技术人员联系!');
|
||
end;
|
||
|
||
procedure TfrmMain.comlista;
|
||
var
|
||
ADevType,ADriverDesc,
|
||
AFriendlyName : string;
|
||
begin
|
||
UsbOUT(nil,ADevType,ADriverDesc,AFriendlyName);
|
||
end;
|
||
|
||
procedure TfrmMain.FormCreate(Sender: TObject);
|
||
var
|
||
Filename: string;
|
||
vs,sError: string;
|
||
i:integer;
|
||
f:TStrings;
|
||
begin
|
||
//http://home09.compeq.huizhou.gd.cn/ctshopfloor/Mor/PRM/MorQuery.asp 查询 制程名称 設備統稱
|
||
|
||
Application.OnException:=AppctionError;
|
||
WorkLog.MessageInfo('');
|
||
WorkLog.MessageInfo('程序开始');
|
||
DbApiLog.MessageInfo('');
|
||
DbApiLog.MessageInfo('程序开始');
|
||
ksoap.OnLine:=true;
|
||
sError:= '';
|
||
|
||
// ksoap.Thread_ExecuteDataSet('select sysdate from dual',sError);//查时间
|
||
// Ksoap.getPartnumTime('R300000100','TIME',sError);
|
||
try
|
||
// SetTime(sError);
|
||
Except
|
||
end;
|
||
|
||
TxtOffline.Visible:=false; //手工操作
|
||
dm.LoadMain();
|
||
dm.LoadDetail();
|
||
|
||
|
||
//R3003420L
|
||
//R3003420L12001
|
||
|
||
ComName:=dm.MemTableReadKeyValue('报警灯','DevName');
|
||
|
||
if ComName<>'' then
|
||
begin
|
||
ComType:=dm.MemTableReadKeyValue('报警灯','ComType');
|
||
if ComType='1' then //使用IO盒子控制
|
||
begin
|
||
AlarmCom:=TAlarmCom.Create;
|
||
AlarmCom.open(ComName,sError);
|
||
sleep(200);
|
||
AlarmCom.GreenLed(sError);
|
||
sleep(800);
|
||
end
|
||
else
|
||
begin
|
||
// ComName:= comName_a;
|
||
// AlarmLed:=TAlarmLed.Create;
|
||
// AlarmLed.open(ComName,sError);
|
||
end;
|
||
end;
|
||
|
||
iniListName:= TStringList.Create;
|
||
dm.MemTableReadTabList(iniListName);
|
||
Clear();
|
||
TxtVerInfo.Text:=GetBuildInfo;
|
||
|
||
TThread.CreateAnonymousThread(
|
||
procedure
|
||
var
|
||
sError:string;
|
||
I: Integer;
|
||
begin
|
||
CoInitialize(nil);
|
||
TRY
|
||
SetMainUIParameter();
|
||
finally
|
||
CoUninitialize;
|
||
end;
|
||
end
|
||
).Start;
|
||
|
||
|
||
DbSoapThread:=TDbSoapThread.Create;
|
||
DbSoapThread.Start; //开始提交失败数据
|
||
if ComName<>'' then
|
||
begin
|
||
if AlarmLed<>nil then
|
||
AlarmLed.YellowLed(sError);
|
||
if AlarmCom<>nil then
|
||
AlarmCom.YellowLed(sError);
|
||
end;
|
||
|
||
// sError:= bgweb_Service.GetServiceSoap().xxcf_get_basic_msg('D301909600');
|
||
// WorkLog.MessageInfo('程序开始1:'+sError);
|
||
// sError:= bgweb_Service.GetServiceSoap().xxcf_chk_barcode('D301909600',
|
||
// '1688187-A01-0F',
|
||
// 'D','DK323330480104447060FF4');
|
||
// f:= TStringlist.Create;
|
||
// DataSavaLog('').OpenLog('Api20230816.log',f);
|
||
// DataSavaLog('').MessageInfo('D301909600'+','+'1688187-A01-0F,2,',f.Text);
|
||
// f.Destroy;
|
||
|
||
// DataSavaLog('D301909600'+','+'1688187-A01-0F,').MessageInfo('DK323330480104447060FF4');
|
||
// WorkLog.MessageInfo('xxcf_chk_barcode提交:'+'D301909600,'+
|
||
// '1688187-A01-0F,'+
|
||
// 'D,'+'DK323330480104447060FF4');
|
||
// WorkLog.MessageInfo('xxcf_chk_barcode返回:'+sError);
|
||
//加载不同的界面 三楼 8台 不用扫码 不用参数带入
|
||
// if (trim(TxtLine.Text)='AOI檢測') and (trim(TxtPc.Text)='59-R') then
|
||
// begin
|
||
// DisplayFrame:=TFrame_59R_AOI.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// // SetRadioOption('TOP面,BOT面');
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// if (trim(TxtLine.Text)='AOI檢測') and (trim(TxtPc.Text)='594-R') and (trim(TxtLine.Text)='牧德AOI检测') then
|
||
// begin
|
||
// DisplayFrame:=TFrame_594R_AOI.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// // SetRadioOption('Lay2,Lay3');
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //VRS 三楼 8台 不用扫码 不用参数带入
|
||
// if trim(TxtLine.Text)='STS VRS' then
|
||
// begin
|
||
// DisplayFrame:=TFrame_STSVRS.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //油墨 一楼 几台 扫码
|
||
// if trim(TxtLine.Text)='油墨印刷機' then
|
||
// begin
|
||
// DisplayFrame:=TFrame_InkPrinter.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// SetRadioOption('TOP面,BOT面');
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //四楼 扫码 二台 参数带入
|
||
// if trim(TxtLine.Text)='自動開蓋機' then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Uncap.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// SetRadioOption('TOP面,BOT面');
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //一楼 几台 参数带入 孙天俊
|
||
// if Pos('ORC曝光機',trim(TxtLine.Text))>0 then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Exposure.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// SetRadioOption('TOP面,BOT面');
|
||
// DisplayFrame.Initialize();
|
||
// end
|
||
// else
|
||
// if Pos('曝光機',trim(TxtLine.Text))>0 then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Exposure.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //5台 一楼4台双面,有一台是单机的,二楼一台,参数带入,扫框架 孙天俊
|
||
// if Pos('烤箱',trim(TxtLine.Text))>0 then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Ofen.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// if TxtLine.Text='大氣烤箱' then
|
||
// begin
|
||
// SetRadioOption('TOP面,BOT面');
|
||
// end;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
//// //显影线后叠板
|
||
//// if Pos('后',trim(TxtLine.Text)) then
|
||
//// begin
|
||
////
|
||
//// end;
|
||
//
|
||
// //二楼四台,有扫码
|
||
// if (TxtLine.Text.ToUpper='PLASMA') or (TxtLine.Text.ToUpper='PLASMA電漿機') then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Plasma.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //三菱五代, 有扫码,三、四楼 9台,世育 参数带入?
|
||
// if (TxtLine.Text.ToUpper='三菱 LDD') then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Ldd.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// SetRadioOption('TOP面,BOT面');
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //三菱鐳射鉆孔機 三菱五代, 有扫码,三、四楼 9台,世育 参数带入?
|
||
// if (TxtLine.Text.ToUpper='三菱鐳射鉆孔機') then //LDD鐳射鑽孔 62B-B
|
||
// begin
|
||
// DisplayFrame:=TFrame_LddLSZK.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// SetRadioOption('TOP面,BOT面');
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //2台 二楼
|
||
// if TxtLine.Text.ToUpper='打靶機' then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Blank.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //二楼 一台 程式
|
||
// if TxtLine.Text.ToUpper='ADARA熱壓機' then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Adara.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //一、三楼 5台 扫码 参数带入
|
||
// if Pos('壓膜機',trim(TxtLine.Text))>0 then
|
||
// begin
|
||
// DisplayFrame:=TFrame_Moldpress.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //一楼 1台 扫码 参数带入
|
||
// if dm.MainUI=2 then
|
||
// //if 'STS VCP線'=trim(TxtLine.Text) then // VCP F线A列
|
||
// begin
|
||
// DisplayFrame:=TListMore_Frame.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
//
|
||
// ksoap.P_ORG_CODE:=FactoryCode; //廠區
|
||
// ksoap.P_WORK_NUM:=EdtEmpNo.Text; //工號
|
||
// ksoap.P_PC:=TxtPc.Text; //製程
|
||
// ksoap.P_LINE:=TxtLine.Text; //線別
|
||
// ksoap.P_LINE_NUM:=TxtLineNum.Text; //線別編號
|
||
//
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //自动M动 AVI 外觀檢測
|
||
// if '外觀檢測'=trim(TxtLine.Text) then //AVI
|
||
// begin
|
||
// DisplayFrame:=TFrameAVI.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// Exit;
|
||
// end;
|
||
// //疊板機
|
||
//
|
||
// if '疊板機'=trim(TxtLine.Text) then //疊板機
|
||
// begin
|
||
// DisplayFrame:=TFrameDBJ.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //油墨顯影線
|
||
// if '油墨顯影線'=trim(TxtLine.Text) then //油墨顯影線
|
||
// begin
|
||
// DisplayFrame:=TFrame_bghBlank.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //yamaha
|
||
// if 'Yamaha測試機'=trim(TxtLine.Text) then //yamaha
|
||
// begin
|
||
// DisplayFrame:=TFrame_yamaha.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Top;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //理德M6
|
||
// if '理德M6'=trim(TxtLine.Text) then //理德M6
|
||
// begin
|
||
// DisplayFrame:=TFrameM6.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// //自动M动
|
||
// if '自動預粘機'=trim(TxtLine.Text) then //自動預粘機 純膠預粘
|
||
// begin
|
||
// DisplayFrame:=TFrameAutoYLBland.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// DisplayFrame.DoPlc;
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// if '平刀模切機'=trim(TxtLine.Text) then //平刀模切機 230-R
|
||
// begin
|
||
// DisplayFrame:=TFrame_pingdao.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// //Text21.Text:= DisplayFrame.Name;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// if '圓刀模切機'=trim(TxtLine.Text) then //229-R 圓刀模切機
|
||
// begin
|
||
// DisplayFrame:=TFrame_yandao.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// //Text21.Text:= DisplayFrame.Name;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// if '貼合分條機'=trim(TxtLine.Text) then //貼合分條機 221-R
|
||
// begin
|
||
// DisplayFrame:=TFrame_fengtiao.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// //Text21.Text:= DisplayFrame.Name;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// if '模切機'=trim(TxtLine.Text) then //模切機 38-R
|
||
// begin
|
||
// DisplayFrame:=TFrame_maoqie.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// //Text21.Text:= DisplayFrame.Name;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
//// //2台 二楼
|
||
//// if TxtLine.Text.ToUpper='水洗線' then
|
||
//// begin
|
||
//// DisplayFrame:=TFrame_Blank.Create(nil);
|
||
//// DisplayFrame.Parent:=RectangleChild;
|
||
//// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
//// DisplayFrame.GridLayout:=GridLayout1;
|
||
//// Exit;
|
||
//// end;
|
||
//
|
||
// if '朗華快壓機'=trim(TxtLine.Text) then //朗華快壓機
|
||
// begin
|
||
// DisplayFrame:=TFrameBaseBland_lhkyj.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// //Text21.Text:= DisplayFrame.Name;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// if '欣中大自動貼合機'=trim(TxtLine.Text) then //欣中大自動貼合機
|
||
// begin
|
||
// DisplayFrame:=TFrameBaseBland_xzdkyj.Create(nil);
|
||
// DisplayFrame.Parent:=RectangleChild;
|
||
// DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
// DisplayFrame.GridLayout:=GridLayout1;
|
||
// //Text21.Text:= DisplayFrame.Name;
|
||
// DisplayFrame.Initialize();
|
||
// Exit;
|
||
// end;
|
||
|
||
if DisplayFrame=nil then //其他
|
||
begin
|
||
DisplayFrame:=TFrameBaseBland.Create(nil);
|
||
DisplayFrame.Parent:=RectangleChild;
|
||
DisplayFrame.Align:=TAlignLayout.Bottom;
|
||
DisplayFrame.GridLayout:=GridLayout1;
|
||
//Text21.Text:= DisplayFrame.Name;
|
||
DisplayFrame.Initialize();
|
||
Exit;
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmMain.FormDestroy(Sender: TObject);
|
||
var
|
||
sError:string;
|
||
begin
|
||
WorkLog.MessageInfo('程序退出1');
|
||
if Assigned(AlarmLed) then // 更标准的Delphi对象检查方式
|
||
begin
|
||
try
|
||
AlarmLed.CloseAllLed(sError);
|
||
AlarmLed.Free;
|
||
finally
|
||
AlarmLed := nil; // 重要:立即置空指针
|
||
end;
|
||
end;
|
||
|
||
WorkLog.MessageInfo('程序退出2');
|
||
if Assigned(DbSoapThread) then // 更标准的Delphi对象检查方式
|
||
begin
|
||
try
|
||
DbSoapThread.Free;
|
||
finally
|
||
DbSoapThread := nil; // 重要:立即置空指针
|
||
end;
|
||
end;
|
||
|
||
WorkLog.MessageInfo('程序退出3');
|
||
if Assigned(DisplayFrame) then // 更标准的Delphi对象检查方式
|
||
begin
|
||
try
|
||
DisplayFrame.Free;
|
||
finally
|
||
DisplayFrame := nil; // 重要:立即置空指针
|
||
end;
|
||
end;
|
||
|
||
WorkLog.MessageInfo('程序退出4');
|
||
if Assigned(iniListName) then // 更标准的Delphi对象检查方式
|
||
begin
|
||
try
|
||
iniListName.Free;
|
||
finally
|
||
iniListName := nil; // 重要:立即置空指针
|
||
end;
|
||
end;
|
||
|
||
WorkLog.MessageInfo('程序退出5');
|
||
if Assigned(FUsb) then // 更标准的Delphi对象检查方式
|
||
begin
|
||
try
|
||
FUsb.Free;
|
||
finally
|
||
FUsb := nil; // 重要:立即置空指针
|
||
end;
|
||
end;
|
||
|
||
// if AlarmLed<>nil then AlarmLed.CloseAllLed(sError);
|
||
|
||
// if DbSoapThread<>nil then DbSoapThread.Terminate;
|
||
// WorkLog.MessageInfo('程序退出3');
|
||
// if AlarmLed<>nil then AlarmLed.Free;
|
||
// WorkLog.MessageInfo('程序退出4');
|
||
// if DisplayFrame<>nil then DisplayFrame.Free;
|
||
|
||
// WorkLog.MessageInfo('程序退出');
|
||
// DbApiLog.MessageInfo('程序退出');
|
||
// iniListName.Free;
|
||
// WorkLog.MessageInfo('程序退出5');
|
||
// FreeAndNil(FUsb);
|
||
// WorkLog.MessageInfo('程序退出6');
|
||
end;
|
||
|
||
procedure TfrmMain.CreateEmpNoExit;
|
||
begin
|
||
// if (EdtEmpNo.Text<>'') and (not TxtOffline.Visible) then //不是手工操作
|
||
TThread.CreateAnonymousThread(
|
||
procedure
|
||
var
|
||
sError:string;
|
||
I: Integer;
|
||
begin
|
||
CoInitialize(nil);
|
||
TRY
|
||
|
||
// if (not Ksoap.xxcc_work_num_f(FactoryCode,EdtEmpNo.Text,TxtPc.Text,TxtLine.Text,sError)) then
|
||
// begin
|
||
// TxtEmpNoError.TextSettings.FontColor:= $FFFF0000;
|
||
// ShowMainError(sError,'','');
|
||
// Exit;
|
||
// end
|
||
// else
|
||
// begin
|
||
// TxtEmpNoError.TextSettings.FontColor:= $FF0003F3;
|
||
// ShowMainError('ok','','');
|
||
// end;
|
||
finally
|
||
CoUninitialize;
|
||
end;
|
||
end
|
||
).Start;
|
||
end;
|
||
|
||
procedure TfrmMain.FormShow(Sender: TObject);
|
||
begin
|
||
if FUsb=nil then
|
||
begin
|
||
FUsb := TUsbClass.Create;
|
||
FUsb.OnUsbInsertion := UsbIN;
|
||
FUsb.OnUsbRemoval := UsbOUT;
|
||
comlista;
|
||
CreateEmpNoExit;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmMain.HandleFrameButtonClick(Sender: TObject);
|
||
var
|
||
Frame: TFramebase;
|
||
begin
|
||
Frame := Sender as TFramebase;
|
||
EdtGoodsNo.Text:= fDevRecord.P_ORG_CODE;
|
||
|
||
if Copy(fDevRecord.P_DIE_NAME,1,3)='不合格' then
|
||
begin
|
||
Label1.Text:='NG';
|
||
Label1.FontColor:= TAlphaColor($eeff0000);
|
||
end
|
||
else
|
||
begin
|
||
Label1.Text:='OK';
|
||
Label1.FontColor:= TAlphaColor($ee06b75b);
|
||
end;
|
||
// ShowMessage(Frame.sLotNum);
|
||
end;
|
||
|
||
procedure TfrmMain.Rectangle2Click(Sender: TObject);
|
||
begin
|
||
FrmPassword:= TFrmPassword.Create(nil);
|
||
try
|
||
FrmPassword.Position:=TFormPosition.MainFormCenter;
|
||
if FrmPassword.ShowModal=mrOk then
|
||
begin
|
||
dm.MemTableReadTabList(iniListName);
|
||
frmSetMain:= TfrmSetMain.Create(nil);
|
||
try
|
||
frmSetMain.Position:=TFormPosition.MainFormCenter;
|
||
frmSetMain.TxtFactoryCode.Text:=FactoryCode; //厂区
|
||
frmSetMain.ShowModal;
|
||
TxtOffline.Visible:=frmSetMain.CheckBox1.IsChecked;
|
||
ksoap.OnLine:=not TxtOffline.Visible;
|
||
// if ksoap.OnLine then
|
||
// EdtGoodsNo.StyleLookup:='EdtGoodsNoStyle1'
|
||
// else
|
||
// EdtGoodsNo.StyleLookup:='';
|
||
|
||
//重新加载参数信息
|
||
SetMainUIParameter();
|
||
finally
|
||
frmSetMain.Free;
|
||
end;
|
||
end;
|
||
finally
|
||
FrmPassword.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmMain.Text4Click(Sender: TObject);
|
||
begin
|
||
ShowTouchKeyBoard();
|
||
end;
|
||
|
||
procedure TfrmMain.Text5Click(Sender: TObject);
|
||
begin
|
||
Clear();
|
||
end;
|
||
|
||
procedure TfrmMain.ShowMainError(EmpNoError,LotNoError,GoodsNoError:string);
|
||
begin
|
||
TThread.Synchronize(nil,
|
||
procedure
|
||
begin
|
||
TxtShowErrorInfo(TxtEmpNoError,EmpNoError);
|
||
TxtShowErrorInfo(TxtLotNoError,LotNoError);
|
||
if LotNoError<>'' then EdtLotNo.SetFocus;
|
||
TxtShowErrorInfo(TxtGoodsNoError,GoodsNoError);
|
||
// EdtGoodsNo.Text:='';//料号为空
|
||
end);
|
||
end;
|
||
|
||
procedure TfrmMain.Text7Click(Sender: TObject);
|
||
var
|
||
sError:string;
|
||
sFixture_Code:string;
|
||
begin
|
||
// showmessage('aa');
|
||
// WorkLog.MessageInfo('login点击');
|
||
|
||
//防止连续点击多次
|
||
if Text7.TextSettings.FontColor=TAlphaColorRec.Silver then
|
||
begin
|
||
WorkLog.MessageInfo('重复点击');
|
||
Exit;
|
||
|
||
end;
|
||
// showmessage('aa1');
|
||
Text7.TextSettings.FontColor:=TAlphaColorRec.Silver;
|
||
try
|
||
TxtShowErrorInfo(TxtEmpNoError,'');
|
||
if EdtEmpNo.Text='' then
|
||
begin
|
||
TxtShowErrorInfo(TxtEmpNoError,'工号不能为空');
|
||
TxtShowErrorInfo(TxtLotnoError,'');
|
||
TxtShowErrorInfo(TxtGoodsNoError,'');
|
||
EdtEmpNo.SetFocus;
|
||
Exit;
|
||
end;
|
||
// showmessage('aa11');
|
||
if RectangleLotNo.Visible then
|
||
begin
|
||
// showmessage('aa111');
|
||
if EdtLotno.Text='' then
|
||
begin
|
||
TxtShowErrorInfo(TxtEmpNoError,'');
|
||
TxtShowErrorInfo(TxtLotnoError,'条码不能为空');
|
||
TxtShowErrorInfo(TxtGoodsNoError,'');
|
||
EdtLotno.SetFocus;
|
||
Exit;
|
||
end;
|
||
// showmessage('aa1111');
|
||
// if ((Rectangle16.Visible) and (EdtGoodsNo.Text='')) then //批号带不出料号
|
||
// begin
|
||
// TxtShowErrorInfo(TxtEmpNoError,'');
|
||
// TxtShowErrorInfo(TxtLotnoError,'');
|
||
// TxtShowErrorInfo(TxtGoodsNoError,'料號不能為空');
|
||
// EdtLotno.SetFocus;
|
||
// Exit;
|
||
// end;
|
||
end;
|
||
// showmessage('aa2');
|
||
if not TxtOffline.Visible then //不是手工操作
|
||
begin
|
||
WorkLog.MessageInfo('开始提交数据到服务器...');
|
||
fDevRecord.P_BC:= EdtEmpNo.Text; //工号
|
||
fDevRecord.P_LOT:= EdtLotNo.Text; //单号
|
||
fDevRecord.P_LINE_index:= ComboBoxP_PC.ItemIndex; //线别序号
|
||
fDevRecord.P_LINE_id:= StrToInt(KJson.REST_Value(KJson.FList_pro_process.Strings[ComboBoxP_PC.ItemIndex],'id')); //线别ID
|
||
fDevRecord.P_LINE:= (KJson.REST_Value(KJson.FList_pro_process.Strings[ComboBoxP_PC.ItemIndex],'number')); //线别编号
|
||
fDevRecord.P_LINE_name:= (KJson.REST_Value(KJson.FList_pro_process.Strings[ComboBoxP_PC.ItemIndex],'name')); //线别名称
|
||
fDevRecord.P_ORG_CODE:= EdtGoodsNo.Text; //二维码
|
||
|
||
fDevRecord.P_COPPER_MODEL:= EdtGoodsNo.Text; //二维码ID
|
||
WorkLog.MessageInfo('提交数据main: ' +
|
||
'工号=' + fDevRecord.P_BC + ', ' +
|
||
'单号=' + fDevRecord.P_LOT + ', ' +
|
||
'线别=' + fDevRecord.P_LINE + ', ' +
|
||
'料号=' + fDevRecord.P_ORG_CODE);
|
||
|
||
//检查工号
|
||
if (not KJSon.Thread_xxcc_work_num_f(FactoryCode,EdtEmpNo.Text,TxtPc.Text,TxtLine.Text,sError)) then
|
||
begin
|
||
TxtShowErrorInfo(TxtEmpNoError,sError);
|
||
TxtShowErrorInfo(TxtLotnoError,'');
|
||
TxtShowErrorInfo(TxtGoodsNoError,'');
|
||
Exit;
|
||
end;
|
||
|
||
WorkLog.MessageInfo('提交数据main1:' + sError);
|
||
|
||
// //检查批号
|
||
// if RectangleLotNo.Visible then
|
||
// begin
|
||
// if (not Ksoap.Thread_XXCC_LOT_PC_F(EdtLotno.Text,TxtLineNum.Text,'1',sError)) then
|
||
// begin
|
||
// TxtShowErrorInfo(TxtEmpNoError,'');
|
||
// TxtShowErrorInfo(TxtLotNoError,sError);
|
||
// TxtShowErrorInfo(TxtGoodsNoError,'');
|
||
// Exit;
|
||
// end;
|
||
//
|
||
// sFixture_Code:=DisplayFrame.GetFixture_Code; //取治具ID
|
||
//
|
||
// //獲取治工具或者設備的狀態
|
||
// if not Ksoap.Thread_Check_tool_or_equip_status_f(EdtLotNo.Text,TxtLineNum.Text,sFixture_Code,'-1',sError) then
|
||
// begin
|
||
// ShowMainError('',sError,'');
|
||
// Exit;
|
||
// end;
|
||
// end;
|
||
end
|
||
else
|
||
begin
|
||
WorkLog.MessageInfo('提交数据:2');
|
||
ksoap.P_ORG_CODE:=FactoryCode; //廠區
|
||
ksoap.P_WORK_NUM:=EdtEmpNo.Text; //工號
|
||
ksoap.P_PC:=TxtPc.Text; //製程
|
||
ksoap.P_LINE:=TxtLine.Text; //線別
|
||
ksoap.P_LINE_NUM:=TxtLineNum.Text; //線別編號
|
||
ksoap.P_Goods_Num:=EdtGoodsNo.Text; //料号
|
||
ksoap.P_Lot:=EdtLotNo.Text; //批号
|
||
ksoap.P_Lot_Num:=0;
|
||
ksoap.Fixture_Code:=DisplayFrame.GetFixture_Code;
|
||
// TxtShowErrorInfo(TxtEmpNoError,'工號进入');
|
||
end;
|
||
|
||
// Text21.Text:= DisplayFrame.Name;
|
||
WorkLog.MessageInfo('提交数据main2:' + sError);
|
||
|
||
if (DisplayFrame<>nil) and (DisplayFrame.DoExec) then Clear;
|
||
finally
|
||
Text7.TextSettings.FontColor:=TAlphaColorRec.White;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmMain.Timer1Timer(Sender: TObject);
|
||
begin
|
||
Text2.Text:= GetSysTimeByFormate;
|
||
|
||
//判断整点,就上传日志
|
||
dm.Tim_Timer(Text2.Text);
|
||
end;
|
||
|
||
procedure TfrmMain.TxtVerInfoClick(Sender: TObject);
|
||
begin
|
||
// exit;
|
||
// frmListConent:=TfrmListConent.Create(nil); //多个读头
|
||
// try
|
||
// frmListConent.ShowModal;
|
||
// finally
|
||
// frmListConent.Free;
|
||
// end;
|
||
|
||
{ frmInkPrinterConent:=TfrmInkPrinterConent.Create(nil);
|
||
try
|
||
frmInkPrinterConent.ShowModal;
|
||
finally
|
||
frmInkPrinterConent.Free;
|
||
end; }
|
||
|
||
|
||
// frmListMoreConent:=TfrmListMoreConent.Create(nil); //多个批号
|
||
// try
|
||
// frmListMoreConent.ShowModal;
|
||
// finally
|
||
// frmListMoreConent.Free;
|
||
// end;
|
||
end;
|
||
|
||
procedure TfrmMain.UsbIN(ASender: TObject; const ADevType, ADriverName,
|
||
AFriendlyName: string);
|
||
var
|
||
sError:String;
|
||
begin
|
||
WorkLog.MessageInfo('USB Inserted - Device Type = ' + ADevType + #13#10 +
|
||
'Driver Name = ' + ADriverName + #13+#10 +
|
||
'Friendly Name = ' + AFriendlyName);
|
||
if (dm.MemTableReadKeyValue('报警灯','DevName')<>'') and (Pos('340',AFriendlyName)>0) then
|
||
begin
|
||
dm.MemTableWriteKeyValue('报警灯','DevName',ADriverName);
|
||
if AlarmLed<>nil then
|
||
begin
|
||
AlarmLed.open(ADriverName,sError);
|
||
sleep(100);
|
||
AlarmLed.YellowLed(sError);
|
||
end;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmMain.UsbOUT(ASender: TObject; const ADevType, ADriverName,
|
||
AFriendlyName: string);
|
||
begin
|
||
WorkLog.MessageInfo('USB Removed - Device Type = ' + ADevType + #13#10 +
|
||
'Driver Name = ' + ADriverName + #13+#10 +
|
||
'Friendly Name = ' + AFriendlyName);
|
||
end;
|
||
|
||
procedure TfrmMain.SetRadioOption(sRadioList:string);
|
||
VAR
|
||
i:integer;
|
||
tmpList:TStrings;
|
||
begin
|
||
if sRadioList='' then Exit;
|
||
|
||
// if (GridLayout1<>nil) and (GridLayout1.ChildrenCount>0) then //检测TOP面,BOT面
|
||
// begin
|
||
// while GridLayout1.ChildrenCount>0 do //有选项没显示,返回也为真
|
||
// begin
|
||
// GridLayout1.Children.Items[0].Destroy;
|
||
// end;
|
||
// end;
|
||
// WorkLog.Debug(Format('iLayerValue1:%s',[IntToStr(GridLayout1.ChildrenCount)]));
|
||
tmpList:=TStringlist.Create;
|
||
try
|
||
tmplist.DelimitedText:=sRadioList;
|
||
if tmpList.Count>10 then Exit;
|
||
|
||
if tmplist.Count>GridLayout1.ChildrenCount then //创建
|
||
begin
|
||
for i := 0 to tmplist.Count-GridLayout1.ChildrenCount-1 do
|
||
begin
|
||
WITH TRadioButton.Create(SELF) DO
|
||
BEGIN
|
||
PARENT:=GridLayout1;
|
||
GroupName:='a';
|
||
Height:=34;
|
||
END;
|
||
end;
|
||
end;
|
||
|
||
if tmplist.Count<GridLayout1.ChildrenCount then //隐藏
|
||
begin
|
||
for I :=GridLayout1.ChildrenCount-1 downto 0 do
|
||
begin
|
||
TRadioButton(GridLayout1.Children[i]).IsChecked:=false;
|
||
if i>=tmplist.Count then
|
||
TRadioButton(GridLayout1.Children[i]).Visible:=false
|
||
else
|
||
TRadioButton(GridLayout1.Children[i]).Text:=tmplist.Strings[i];
|
||
end;
|
||
if tmplist.Count>0 then
|
||
GridLayout1.ItemWidth:=GridLayout1.Width / tmplist.Count;
|
||
end
|
||
else //数量相同
|
||
begin
|
||
for I := 0 to GridLayout1.ChildrenCount-1 do
|
||
begin
|
||
TRadioButton(GridLayout1.Children[i]).IsChecked:=false;
|
||
TRadioButton(GridLayout1.Children[i]).Text:=tmplist.Strings[i];
|
||
TRadioButton(GridLayout1.Children[i]).Visible:=true;
|
||
end;
|
||
if GridLayout1.ChildrenCount>0 then
|
||
GridLayout1.ItemWidth:=GridLayout1.Width / GridLayout1.ChildrenCount;
|
||
end;
|
||
|
||
finally
|
||
tmpList.Free;
|
||
end;
|
||
WorkLog.Debug(Format('iLayerValue2:%s',[IntToStr(GridLayout1.ChildrenCount)]));
|
||
end;
|
||
|
||
procedure TfrmMain.EdtLotNoChange(Sender: TObject);
|
||
begin
|
||
if EdtLotNo.Text='' then TxtShowErrorInfo(TxtLotnoError,'');
|
||
EdtLotNo.Text:= Trim(EdtLotNo.Text.ToUpper);
|
||
end;
|
||
|
||
procedure TfrmMain.EdtLotNoClick(Sender: TObject);
|
||
begin
|
||
ShowTouchKeyBoard();
|
||
end;
|
||
|
||
function TfrmMain.EdtLotPartnum(Value: string): Boolean;
|
||
begin
|
||
Result:= False;
|
||
if Value<>'' then
|
||
begin
|
||
if ComboBoxP_PC.Items.IndexOf(Value)<0 then
|
||
// ComboBoxP_PC.Items.Add(sPc);
|
||
begin
|
||
TxtShowErrorInfo(TxtLotNoError,'该批当前站在'+Value);
|
||
end
|
||
else
|
||
begin
|
||
COMBOBOXp_PC.ItemIndex:=ComboBoxP_PC.Items.IndexOf(Value);
|
||
TxtPc.Text:=Value;
|
||
ksoap.P_PC:=TxtPc.Text; //製程
|
||
Result:= True;
|
||
end;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmMain.EdtLotNoExit(Sender: TObject); //离开单号处理
|
||
var
|
||
sError:string;
|
||
begin
|
||
//检查单号
|
||
if EdtLotNo.Text='' then exit;
|
||
ShowMainError('','','');
|
||
|
||
TThread.CreateAnonymousThread(
|
||
procedure
|
||
var
|
||
sError:string;
|
||
begin
|
||
CoInitialize(nil);
|
||
TRY
|
||
KJSon. REST_pro_List(EdtLotNo.Text, 3, sError);
|
||
if (KJSon.List_pro_workorder.Count = 0 ) then
|
||
begin
|
||
TxtEmpNoError.TextSettings.FontColor:= $FFFF0000;
|
||
ShowMainError('没有找到单号','','');
|
||
Exit;
|
||
end;
|
||
|
||
// if (KJson.REST_Value(KJson.List_pro_workorder.Strings[0],'number')=ComboBoxP_PC ) then //ComboBoxP_PC.ItemIndex
|
||
// begin
|
||
// TxtEmpNoError.TextSettings.FontColor:= $FFFF0000;
|
||
// ShowMainError('单号错误','','');
|
||
// Exit;
|
||
// end;
|
||
FINALLY
|
||
CoUninitialize;
|
||
END;
|
||
end).Start;
|
||
end;
|
||
|
||
procedure TfrmMain.EdtLotNoExit1; //离开二维码处理
|
||
var
|
||
sLayerValue,sDefaulValue:string;
|
||
sFixture_Code:string;
|
||
begin
|
||
if (EdtEmpNo.Text<>'') and (EdtLotNo.Text<>'') then //不是手工操作
|
||
TThread.CreateAnonymousThread(
|
||
procedure
|
||
var
|
||
sError:string;
|
||
sGoodsNo,sNum,sPc:string;
|
||
begin
|
||
CoInitialize(nil);
|
||
TRY
|
||
|
||
// ShowInfoOK('连接数据库中...');
|
||
|
||
if not EdtLotPartnum(sPc) then
|
||
begin
|
||
Exit;
|
||
end;
|
||
|
||
//检查批号
|
||
if (not Ksoap.XXCC_LOT_PC_F(EdtLotno.Text,TxtLineNum.Text,'1',sError)) then
|
||
begin
|
||
ShowMainError('',sError,'');
|
||
if (EdtLotno.Text<>'R30034200L') then
|
||
Exit;
|
||
end;
|
||
|
||
//得料号
|
||
if not Ksoap.getPartnum(EdtLotNo.Text,'',sGoodsNo,sNum,sPc,sPartnumValue,sError) then
|
||
begin
|
||
ShowMainError('',sError,'');
|
||
Exit;
|
||
end;
|
||
|
||
//获取缺省值
|
||
if DisplayFrame.DefaultXN and not Ksoap.return_default_values_f(sDefaulValue,sError) then
|
||
begin
|
||
ShowMainError('','Ksoap.return_default_values_f'+sError,'');
|
||
Exit;
|
||
end;
|
||
|
||
//根据料号,设置正反面板材
|
||
if not Ksoap.xxcf_get_layer_f(sGoodsNo,sLayerValue,sError) then
|
||
begin
|
||
ShowMainError('','',sError);
|
||
Exit;
|
||
end;
|
||
|
||
if sLayerValue<>'' then //面次
|
||
begin
|
||
SetRadioOption(sLayerValue);
|
||
WorkLog.Debug(Format('sLayerValue:%s',[sLayerValue]));
|
||
end;
|
||
|
||
// //原物料編號
|
||
// if (DisplayFrame<>nil) and ((DisplayFrame.ClassType=TFrame_maoqie) or (DisplayFrame.ClassType=TFrame_pingdao) or (DisplayFrame.ClassType=TFrame_yandao)) then
|
||
// begin
|
||
// DisplayFrame.F2DCodeCreate();
|
||
// end;
|
||
|
||
//参数带入,根据参数设置PLC
|
||
if (DisplayFrame.Name='FrameAutoYLBland') then
|
||
begin
|
||
//get_barcode_param_f
|
||
|
||
if (not Ksoap.xx_get_barcode_param_f(FactoryCode,EdtLotNo.Text,'yfynj',TxtLineNum.Text,sError)) then
|
||
begin
|
||
TThread.Synchronize(nil,
|
||
procedure
|
||
begin
|
||
TxtShowErrorInfo(TxtLotNoError,sError);
|
||
end);
|
||
Exit;
|
||
end;
|
||
end;
|
||
finally
|
||
CoUninitialize;
|
||
end;
|
||
|
||
TThread.Synchronize(nil,
|
||
procedure
|
||
begin
|
||
// EdtGoodsNo.Text:=sGoodsNo;
|
||
sLotNum:=sNum;
|
||
DisplayFrame.sLotNum:= sNum;
|
||
TxtShowErrorInfo(TxtLotNoError,'');
|
||
DisplayFrame.FillDefaultValue(sPartnumValue,sDefaulValue);
|
||
SetRadioOption(sDefaulValue);
|
||
//
|
||
// //根据批号,带出料号与当前制程,自动增加填写当前制程
|
||
// if sPc<>'' then
|
||
// begin
|
||
// if ComboBoxP_PC.Items.IndexOf(sPc)<0 then
|
||
// // ComboBoxP_PC.Items.Add(sPc);
|
||
// begin
|
||
// TxtShowErrorInfo(TxtLotNoError,'該批當前站在'+sPc);
|
||
// end
|
||
// else
|
||
// begin
|
||
// COMBOBOXp_PC.ItemIndex:=ComboBoxP_PC.Items.IndexOf(sPc);
|
||
// TxtPc.Text:=sPc;
|
||
// ksoap.P_PC:=TxtPc.Text; //製程
|
||
// end;
|
||
// end;
|
||
//设置PLC相关参数
|
||
end);
|
||
end
|
||
).Start;
|
||
end;
|
||
|
||
end.
|