📄 okc21mainut.pas.bak
字号:
okSetVideoParam(Handle1,AD_Source,5);
end;
procedure Tokc21CapFm.BrightnessTBChange(Sender: TObject);
begin
okSetVideoParam(Handle1,AD_Brightness,BrightnessTB.Position);
BrightnessTB.Hint:='亮度值:'+IntToStr(BrightnessTB.Position);
MyIni:= TIniFile.Create('c:\mark.ini');
MyIni.Writeinteger('Disk_set', 'brightness', BrightnessTB.Position);
MyIni.Free;
end;
procedure Tokc21CapFm.ContrastTBChange(Sender: TObject);
begin
okSetVideoParam(Handle1,AD_Contrast,ContrastTB.Position);
ContrastTB.Hint:='对比度:'+IntToStr(ContrastTB.Position);
MyIni:= TIniFile.Create('c:\mark.ini');
MyIni.Writeinteger('Disk_set', 'contrast', ContrastTB.Position);
MyIni.Free;
end;
procedure Tokc21CapFm.HueTBChange(Sender: TObject);
begin
okSetVideoParam(Handle1,AD_Hue,HueTB.Position);
HueTB.Hint:='色度值:'+IntToStr(HueTB.Position);
end;
procedure Tokc21CapFm.SaturationTBChange(Sender: TObject);
begin
okSetVideoParam(Handle1,AD_Saturation,SaturationTB.Position);
SaturationTB.Hint:='饱和度:'+IntToStr(SaturationTB.Position);
end;
procedure Tokc21CapFm.Timer2Timer(Sender: TObject);
var i:word;
begin
Timer2.Enabled:=False;
cancap:=false;
okStopCapture(Handle1);
GetCap_MoveDrive;
ADate:=now();
SaturationTB.Position:=198;
if (hourof(now)>20)or(hourof(now)<7) then
BrightnessTB.Position:=228
else
BrightnessTB.Position:=190;
if hourof(ADate)=2 then
begin
DateDir:=CapDrive+':\'+GetDateStr(ADate+1);
if not(DirectoryExists(DateDir) )then
createDir(DateDir);
questionTb.open;
i:=(questionTb.RecordCount*questionTb.RecordSize)div Meg;
if(i>=maxSize) then
begin
questionTb.close;
DateDir:=GetDateStr(now());
MyIni:=TIniFile.Create(CapDrive+':\mark.ini');
MyIni.WriteString('Disk_set','CurrentDB',DateDir+'.DBF');
MyIni.Free;
fillchar(sPath,61,0);
fillchar(dPath,61,0);
tempstr:=SysDrive+':\Sys\System.dbf';
StrPCopy(sPath,tempstr);
tempstr:=CapDrive+':\'+DateDir+'.dbf';
StrPCopy(dPath,Tempstr);
copyfile(sPath,dPath,false);
QuestionTb.TableName:=DateDir+'.dbf';
QuestionTb.DatabaseName:=CapDrive+':\';
QuestionTb.open;
end;
if CapDrive<>MoveToDrive then
begin
Animate1.Visible :=true;
StatusBar1.Panels[7].Text:='移动数据..';
Animate1.Active:=true;
MoveDirTo(CapDrive,MoveToDrive);
Animate1.Active:=false;
Animate1.Visible:=false;
StatusBar1.Panels[7].Text:='移动完成..';
end;
application.ProcessMessages;
tempstr:=FindDrives_defgh();
if (dayof(ADate)=1)and(tempstr[5]<>' ') then
begin
HdFormat(tempstr[5]);
StatusBar1.Panels[7].Text:='拷贝D盘到H盘...';
Animate1.Visible :=true;
Animate1.Active:=true;
CopyDir(tempstr[1]+':\',tempstr[5]+':\');
Animate1.Active:=false;
Animate1.Visible:=false;
HdFormat(tempstr[1]);
StatusBar1.Panels[7].Text:='拷贝H盘到D盘...';
Animate1.Visible :=true;
Animate1.Active:=true;
CopyDir(tempstr[5]+':\',tempstr[1]+':\');
Animate1.Active:=false;
Animate1.Visible:=false;
StatusBar1.Panels[7].Text:=datetimetostr(now);
MyIni:=TIniFile.Create(tempstr[5]+':\mark.ini');
MyIni.WriteString('Disk_set','disk','H');
MyIni.Free;
end;
updatefromServer;
end;
cancap:=true;
Timer2.Enabled:=True;
okCaptureToScreen(Handle1);
end;
procedure Tokc21CapFm.Capture(i:byte);
begin
okSetVideoParam(Handle1,AD_Source,i-1);
case i of
1: RadioBtn1.Checked:=true;
2: RadioBtn2.Checked:=true;
3: RadioBtn3.Checked:=true;
4: RadioBtn4.Checked:=true;
5: RadioBtn5.Checked:=true;
6: RadioBtn6.Checked:=true;
end;
if i>(lanes div 2) then
BrightnessTB.Position:=LeftB
else
BrightnessTB.Position:=RightB;
sleep(delta);
okCaptureSingle(Handle1,VGASCREEN,0);
images[i,flags[i]].Canvas.CopyRect(Rect(0,0,384,288),okc21CapFm.Canvas,Rect(9,7,393,295));
flags[i]:=not flags[i];
okCaptureToScreen(Handle1);
end;
procedure Tokc21CapFm.Savedata(Buf:DataRec;Cartype,lane:byte);
begin
if (trim(GetImageName(Buf))='')or(Buf.day=0) then exit;
try
questionTb.open;
questionTb.Append;
questionTb['文件名']:=GetImageName(Buf);
questionTb['收费员编号']:=intTostr(Buf.Tollor_Id);
questionTb['收费员姓名']:=TollorTab.fieldbyname('Name').AsString;
NameEdit.text:=TollorTab.fieldbyname('Name').AsString;
questionTb['年']:=Format('%4.4d',[Buf.year]);
questionTb['月']:=Format('%2.2d',[Buf.month]);
questionTb['日']:=Format('%2.2d',[Buf.day]);
questionTb['时']:=Format('%2.2d',[Buf.hour]);
questionTb['分']:=Format('%2.2d',[Buf.minute]);
questionTb['秒']:=Format('%2.2d',[Buf.second]);
questionTb['车道']:=Format('%2.2d',[Buf.lane]);
questionTb['机判车型']:=Format('%2.2d',[CarType]);
questionTb['人判车型']:=Format('%2.2d',[Buf.car_type]);
questionTb['机判金额']:=FeeTab.fieldbyname('VFee').asstring;
questionTb['实收金额']:=intTostr(Buf.cash);
questionTb['工班']:=Format('%2.2d',[TollorTab.fieldbyname('DptID').asinteger]);
case Buf.command of
'B':questionTb['问题类别']:='4';
'E':questionTb['问题类别']:='5';
'I':questionTb['问题类别']:='6';
'D': case buf.attrib of
0,8:questionTb['问题类别']:='0';
9: questionTb['问题类别']:='6';
10: questionTb['问题类别']:='1';
12: questionTb['问题类别']:='2';
13: questionTb['问题类别']:='3';
end;
end;
if (Buf.command='B')and(questionTb['人判车型']=questionTb['机判车型']) then
begin
questionTb['机判车型']:='00';
questionTb['机判金额']:='0';
end;
if (Buf.command='D')and(Buf.attrib in [10,12,13]) then
begin
questionTb['人判车型']:='00';
questionTb['实收金额']:='0';
end;
QestionTypeEdit.text:=questionTb.fieldbyname('问题类别').AsString;
questionTb.post;
questionTb.close;
image.Picture:=Images[Buf.lane,not flags[Buf.lane]].Picture;
image.Refresh;
with Jpg do
begin
Assign(Images[Buf.lane,not flags[Buf.lane]].Picture.Bitmap);
if not empty then
begin
CompressionQuality:=86;
compress;
DateDir:=GetDateStr(now());
if not(DirectoryExists(DateDir)) then
createDir(DateDir);
SaveToFile(DateDir+'\'+GetImageName(Buf)+'.jpg');
end;
end;
DateTimeEdit.Text:=inttostr(Buf.year)+'年'+inttostr(Buf.month)+'月'+inttostr(Buf.day);
DateTimeEdit.Text:=DateTimeEdit.Text+'日'+inttostr(Buf.hour)+'时'+ inttostr(Buf.minute)+'分'+inttostr(Buf.second)+'秒';
ChanelEdit.Text:=IntToStr(Buf.lane);
WorkNoEdit.Text:=IntToStr(Buf.Tollor_Id);
ShiftEdit.text:=copy(WorkNoEdit.Text,1,1);
PsnCarTypeEdit.text:=inttostr(Buf.car_type);
AutoCarTypeEdit.text:=intTostr(Cartype);
except
questionTb.Cancel;
questionTb.close;
StatusBar1.Panels[7].Text:='An error occurred when saving data';
end;
end;
procedure Tokc21CapFm.Timer1Timer(Sender: TObject);
var i,j:byte; st:string[16];
begin
okCaptureToScreen(Handle1);
Timer1.Enabled:=false;
Timer2.Enabled:=true;
MainLoop:=true;
NameAdded:=false;
cancap:=true;
while Mainloop do
begin
try
if (not NameAdded)and NcbResetok then
begin
AddNameNcb.ncb_name:='XL_Video_000010 ';
AddNameNcb.ncb_post:=nil;
AddNameNcb.ncb_lana_num:=lana_num;
AddNameNcb.ncb_command:=NCBADDNAME or ASYNCH;
Netbios(addr(AddNameNcb));
delay:=0;
Repeat sleep(20);inc(delay); until (AddNameNcb.ncb_cmd_cplt<>NRC_PENDING)or(delay>=300);
if AddNameNcb.ncb_cmd_cplt=$0d then
begin
AddNameNcb.ncb_lana_num:=lana_num;
AddNameNcb.ncb_name:='XL_Video_000010 ';
AddNameNcb.ncb_post:=nil;
AddNameNcb.ncb_command:=NCBDELNAME or ASYNCH ;
Netbios(addr(AddNameNcb));
delay:=0;
Repeat sleep(20);inc(delay); until (AddNameNcb.ncb_cmd_cplt<>NRC_PENDING) or (delay>=300);
end else
if AddNameNcb.ncb_cmd_cplt=NRC_GOODRET then
begin
StatusBar1.Panels[1].Text:='加名成功:'+' '+inttostr(AddNameNcb.ncb_cmd_cplt);
NameAdded:=true;
end else
begin
StatusBar1.Panels[1].Text:='加名失败:'+' '+inttostr(AddNameNcb.ncb_cmd_cplt);
StatusBar1.Panels[7].Text:=GetRetStr(AddNameNcb.ncb_cmd_cplt);
end;
end;
if (not NameAdded)then
begin
if not NcbResetok then
NcbResetok:=Ncb_Reset;
Rep[0]:=Rep[0]+1;
if(Rep[0]<7)then
continue
else
begin
mainloop:=false;
continue;
end;
end;
for i:=1 to lanes do
begin
if i in NoCapLane then continue;
case ListenFlag[i] of
0:begin
case i of
1:LNcb[i].ncb_post:=addr(postrout1);
2:LNcb[i].ncb_post:=addr(postrout2);
3:LNcb[i].ncb_post:=addr(postrout3);
4:LNcb[i].ncb_post:=addr(postrout4);
5:LNcb[i].ncb_post:=addr(postrout5);
6:LNcb[i].ncb_post:=addr(postrout6);
end;
LNcb[i].ncb_name:='XL_Video_000010 ';
st:='XL_Lane_Ctl_00'+trim(inttostr(i))+' ';
for j:=0 to 15 do
LNcb[i].ncb_callname[j]:=st[j+1];
LNcb[i].ncb_lana_num:=lana_num;
LNcb[i].ncb_rto:=28;
LNcb[i].ncb_sto:=28;
LNcb[i].ncb_event:=0;
for j:=0 to 9 do
LNcb[i].ncb_reserve[j]:=0;
LNcb[i].ncb_command:= NCBLISTEN or ASYNCH ;
Netbios(addr(LNcb[i]));
ListenFlag[i]:=1;
end;
end;
end;
application.ProcessMessages;
for i:=1 to lanes do
begin
if ListenFlag[i]=2 then
case ReceiveFlag[i] of
0:begin
case i of
1:LNcb[i].ncb_post:=addr(postroute1);
2:LNcb[i].ncb_post:=addr(postroute2);
3:LNcb[i].ncb_post:=addr(postroute3);
4:LNcb[i].ncb_post:=addr(postroute4);
5:LNcb[i].ncb_post:=addr(postroute5);
6:LNcb[i].ncb_post:=addr(postroute6);
end;
LNcb[i].ncb_buffer:=addr(RecBuf[i]);
LNcb[i].ncb_lana_num:=lana_num;
LNcb[i].ncb_event:= 0;
LNcb[i].ncb_name:='XL_Video_000010 ';
st:='XL_Lane_Ctl_00'+trim(inttostr(i))+' ';
for j:=0 to 15 do
LNcb[i].ncb_callname[j]:=st[j+1];
for j:=0 to 9 do
LNcb[i].ncb_reserve[j]:=0;
LNcb[i].ncb_length:=94;
LNcb[i].ncb_command:= NCBRECV or ASYNCH ;
Netbios(addr(LNcb[i]));
ReceiveFlag[i]:=1;
end;
end;
end;
application.ProcessMessages;
if not mainloop then timer3.Enabled:=true;
except
mainloop:=false;
StatusBar1.Panels[7].Text:='error in mainloop:'+timetostr(now);
timer3.Enabled:=true;
end;
end;
end;
procedure Tokc21CapFm.Timer3Timer(Sender: TObject);
begin
timer3.Enabled:=false;
timer2.Enabled:=false;
timer1.Enabled:=false;
FmtTimer.Enabled:=false;
close;
end;
procedure Tokc21CapFm.HDRefreshBtnClick(Sender: TObject);
begin
okStopCapture(Handle1);
if (ScanScsi='NoScsiDisk') then
ScanScsi;
GetCap_MoveDrive;
okCaptureToScreen(Handle1);
end;
procedure Tokc21CapFm.ListBox1Exit(Sender: TObject);
begin
if ListBox1.itemIndex<>-1 then
begin
MyIni:= TIniFile.Create(CapDrive+':\mark.ini');
MyIni.WriteString('Disk_set', 'maxfile',trim(ListBox1.Items[ListBox1.itemIndex]));
MyIni.Free;
MaxSize:=StrToint(ListBox1.Items[ListBox1.itemIndex]);
end;
end;
procedure Tokc21CapFm.ForbidenCapBtnClick(Sender: TObject);
begin
NoCapLane:=[];
if CB1.Checked then include(NoCapLane,1);
if CB2.Checked then include(NoCapLane,2);
if CB3.Checked then include(NoCapLane,3);
if CB4.Checked then include(NoCapLane,4);
if CB5.Checked then include(NoCapLane,5);
if CB6.Checked then include(NoCapLane,6);
end;
procedure Tokc21CapFm.FormDestroy(Sender: TObject);
begin
jpg.Free ;
end;
procedure Tokc21CapFm.ExitBtnClick(Sender: TObject);
begin
mainloop:=false;
end;
procedure Tokc21CapFm.FmtTimerTimer(Sender: TObject);
begin
FmtTimer.Enabled:=false;
if firstRun then
begin
firstRun:=false;
keybd_event(vk_menu,0,0,0);
keybd_event($51,0,0,0);
keybd_event($51,0,KEYEVENTF_KEYUP,0);
keybd_event($53,0,0,0);
keybd_event($53,0,KEYEVENTF_KEYUP,0);
keybd_event(vk_menu,0,KEYEVENTF_KEYUP,0);
end
else
begin
keybd_event(vk_return,0,0,0);
keybd_event(vk_return,0,KEYEVENTF_KEYUP,0);
end;
FmtTimer.Enabled:=true;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -