diff --git a/Source/OposConfig/OposConfig.dof b/Source/OposConfig/OposConfig.dof
index cfeb526f6646d46fea7986f563efc8cc2cda4b56..b0fc24937613d5b3ce112442dcc9f71f975d9b14 100644
--- a/Source/OposConfig/OposConfig.dof
+++ b/Source/OposConfig/OposConfig.dof
@@ -136,16 +136,23 @@ ProductVersion=1.13
Comments=http://www.shtrih-m.ru
[Excluded Packages]
C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\PngComponentsD7.bpl=Png components
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Source/OposShtrih.bpg b/Source/OposShtrih.bpg
index 667c7dc75cf47a15de1cdfdd5a2057266296edbc..78884a5f4123d3f1f4a9d84d0a08e24d4e8a038e 100644
--- a/Source/OposShtrih.bpg
+++ b/Source/OposShtrih.bpg
@@ -12,7 +12,7 @@ BRCC = $(ROOT)\bin\brcc32.exe $**
PROJECTS = OposConfig.exe OposTest.exe SmFiscalPrinter.dll SmScale.dll \
OposConfigTest.exe OposConfigTestLib.dll SmFiscalPrinterTest.exe \
SmFiscalPrinterTestLib.dll OposTestTest.exe OposTestTestLib.dll SmScaleTest.exe \
- SmScaleTestLib.dll SmFptrSrv.exe
+ SmScaleTestLib.dll SmFptrSrv.exe AcceptanceTest.exe
#------------------------------------------------------------------------------
default: $(PROJECTS)
#------------------------------------------------------------------------------
@@ -56,4 +56,7 @@ SmScaleTest.exe: ..\Test\SmScaleTest\SmScaleTest.dpr
SmScaleTestLib.dll: ..\Test\SmScaleTest\SmScaleTestLib.dpr
$(DCC)
+AcceptanceTest.exe: ..\Test\AcceptanceTest\AcceptanceTest.dpr
+ $(DCC)
+
diff --git a/Source/OposShtrih.dsk b/Source/OposShtrih.dsk
index c8497064c801ef41ce0a76b380188fb88a97c37f..4e6a4fdfde1fa46a804fb891bab57ae3f82de46b 100644
--- a/Source/OposShtrih.dsk
+++ b/Source/OposShtrih.dsk
@@ -1,21 +1,41 @@
[Closed Files]
-File_0=SourceModule,'C:\projects\OPOSShtrih\Source\Opos\OposException.pas',0,1,68,74,77,0,0
-File_1=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\oleFiscalPrinter.pas',0,1,1,1,1,0,0
-File_2=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterImpl.pas',0,1,2605,55,2623,0,0
-File_3=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\DirectIOAPI.pas',0,1,396,1,418,0,0
-File_4=SourceModule,'C:\projects\OPOSShtrih\Source\Opos\OposFptr.pas',0,1,1,1,1,0,0
-File_5=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FSSalesReceipt.pas',0,1,1,65,14,0,0
-File_6=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\ReceiptItem.pas',0,1,473,5,493,0,0
-File_7=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\CustomReceipt.pas',0,1,484,3,491,0,0
-File_8=SourceModule,'C:\projects\OPOSShtrih\Source\Shared\DIOHandlers.pas',0,1,676,41,695,0,0
-File_9=SourceModule,'C:\projects\OPOSShtrih\Source\OposTest\Units\DIODescription.pas',0,1,25,27,10,0,0
+File_0=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\DirectIOAPI.pas',0,1,295,28,314,0,0
+File_1=SourceModule,'C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\FiscalPrinterDevice.pas',0,1,4999,1,5011,0,0
+File_2=SourceModule,'C:\projects\OPOSShtrih\Source\Opos\OposFiscalPrinter_1_12_Lib_TLB.pas',0,1,1,1,1,0,0
+File_3=SourceModule,'c:\program files (x86)\borland\delphi7\Comp\jvcl\run\JvInterpreter.pas',0,1,966,19,977,0,0
+File_4=SourceModule,'c:\program files (x86)\borland\delphi7\source\rtl\common\ComObj.pas',0,1,1384,1,1403,0,0
+File_5=SourceModule,'C:\Program Files (x86)\RemObjects Software\Pascal Script for Delphi\Source\uPSComponent.pas',0,1,593,1,613,0,0
[Modules]
-Count=0
-EditWindowCount=0
+Module0=C:\projects\OPOSShtrih\Test\AcceptanceTest\Units\duFiscalPrinter.pas
+Module1=C:\projects\OPOSShtrih\Source\Shared\LogFile.pas
+Module2=c:\program files (x86)\borland\delphi7\source\rtl\Sys\system.pas
+Module3=C:\projects\OPOSShtrih\Source\Shared\FileUtils.pas
+Count=4
+EditWindowCount=1
TypeLibWindowCount=3
-[C:\projects\OPOSShtrih\Source\SmFptrSrv\SmFptrSrv.dpr]
+[C:\projects\OPOSShtrih\Test\AcceptanceTest\Units\duFiscalPrinter.pas]
+ModuleType=SourceModule
+FormState=0
+FormOnTop=0
+
+[C:\projects\OPOSShtrih\Source\Shared\LogFile.pas]
+ModuleType=SourceModule
+FormState=0
+FormOnTop=0
+
+[c:\program files (x86)\borland\delphi7\source\rtl\Sys\system.pas]
+ModuleType=SourceModule
+FormState=0
+FormOnTop=0
+
+[C:\projects\OPOSShtrih\Source\Shared\FileUtils.pas]
+ModuleType=SourceModule
+FormState=0
+FormOnTop=0
+
+[C:\projects\OPOSShtrih\Source\SmFiscalPrinter\SmFiscalPrinter.tlb]
FormState=0
FormOnTop=0
@@ -39,10 +59,6 @@ FormOnTop=0
FormState=0
FormOnTop=0
-[C:\projects\OPOSShtrih\Source\SmFiscalPrinter\SmFiscalPrinter.tlb]
-FormState=0
-FormOnTop=0
-
[C:\projects\OPOSShtrih\Source\SmScale\SmScale.dpr]
FormState=0
FormOnTop=0
@@ -83,10 +99,76 @@ FormOnTop=0
FormState=0
FormOnTop=0
+[C:\projects\OPOSShtrih\Source\SmFptrSrv\SmFptrSrv.dpr]
+FormState=0
+FormOnTop=0
+
[C:\projects\OPOSShtrih\Source\SmFptrSrv\SmFptrSrv.tlb]
FormState=0
FormOnTop=0
+[C:\projects\OPOSShtrih\Test\AcceptanceTest\AcceptanceTest.dpr]
+FormState=0
+FormOnTop=0
+
+[EditWindow0]
+ViewCount=4
+CurrentView=0
+View0=0
+View1=1
+View2=2
+View3=3
+CodeExplorer=CodeExplorer@EditWindow0
+MessageView=MessageView@EditWindow0
+Create=1
+Visible=1
+State=2
+Left=309
+Top=138
+Width=1302
+Height=682
+MaxLeft=-8
+MaxTop=106
+MaxWidth=1936
+MaxHeight=952
+ClientWidth=1920
+ClientHeight=914
+LeftPanelSize=0
+LeftPanelClients=CodeExplorer@EditWindow0
+LeftPanelData=00000400010000000C000000436F64654578706C6F7265720000000000000000000000000000000000FFFFFFFF
+RightPanelSize=0
+BottomPanelSize=0
+BottomPanelClients=MessageView@EditWindow0
+BottomPanelData=00000400010000000B0000004D6573736167655669657700000000000000000000000000000000000100000000000000000B0000004D65737361676556696577FFFFFFFF
+
+[View0]
+Module=C:\projects\OPOSShtrih\Test\AcceptanceTest\Units\duFiscalPrinter.pas
+CursorX=30
+CursorY=86
+TopLine=71
+LeftCol=1
+
+[View1]
+Module=C:\projects\OPOSShtrih\Source\Shared\LogFile.pas
+CursorX=57
+CursorY=308
+TopLine=291
+LeftCol=1
+
+[View2]
+Module=c:\program files (x86)\borland\delphi7\source\rtl\Sys\system.pas
+CursorX=1
+CursorY=13549
+TopLine=13534
+LeftCol=1
+
+[View3]
+Module=C:\projects\OPOSShtrih\Source\Shared\FileUtils.pas
+CursorX=2
+CursorY=168
+TopLine=144
+LeftCol=1
+
[TypeLibEditWindow0]
Create=1
Visible=0
@@ -157,12 +239,7 @@ LRDockWidth=320
Dockable=1
[Breakpoints]
-Count=5
-Breakpoint0='C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\CustomReceipt.pas',161,'',0,1,'',1,0,0,'',1,'','',''
-Breakpoint1='C:\projects\OPOSShtrih\Source\SmFiscalPrinter\Units\MalinaPlugin.pas',194,'',0,1,'',1,0,0,'',1,'','',''
-Breakpoint2='C:\projects\OPOSShtrih\Source\OposTest\Fmu\fmuFptrThreadTest.pas',129,'',0,1,'',1,0,0,'',1,'','',''
-Breakpoint3='C:\projects\OPOSShtrih\Source\OposTest\Fmu\fmuFptrThreadTest.pas',148,'',0,1,'',1,0,0,'',1,'','',''
-Breakpoint4='C:\projects\OPOSShtrih\Source\OposTest\Fmu\fmuFptrThreadTest.pas',151,'',0,1,'',1,0,0,'',1,'','',''
+Count=0
[AddressBreakpoints]
Count=0
@@ -175,8 +252,8 @@ Left=345
Top=0
Width=1575
Height=122
-MaxLeft=-1
-MaxTop=-1
+MaxLeft=-8
+MaxTop=-8
MaxWidth=1936
MaxHeight=122
ClientWidth=1920
@@ -186,13 +263,13 @@ ClientHeight=84
Create=1
Visible=1
State=0
-Left=8
-Top=124
-Width=554
+Left=3
+Top=115
+Width=601
Height=589
MaxLeft=-1
MaxTop=-1
-ClientWidth=538
+ClientWidth=585
ClientHeight=555
TBDockHeight=681
LRDockWidth=445
@@ -230,7 +307,7 @@ ClientHeight=60
[PropertyInspector]
Create=1
-Visible=1
+Visible=0
State=0
Left=-1
Top=110
@@ -253,8 +330,8 @@ HiddenCategories=
Create=1
Visible=0
State=0
-Left=980
-Top=180
+Left=660
+Top=132
Width=835
Height=613
MaxLeft=-1
@@ -415,6 +492,38 @@ Column2Width=545
EntryPointPane=225
CompUnitPane=104
+[CodeExplorer@EditWindow0]
+Create=1
+Visible=0
+State=0
+Left=-113
+Top=-6
+Width=140
+Height=305
+MaxLeft=-1
+MaxTop=-1
+ClientWidth=140
+ClientHeight=305
+TBDockHeight=305
+LRDockWidth=140
+Dockable=1
+
+[MessageView@EditWindow0]
+Create=1
+Visible=0
+State=0
+Left=12
+Top=0
+Width=1274
+Height=85
+MaxLeft=-1
+MaxTop=-1
+ClientWidth=1274
+ClientHeight=85
+TBDockHeight=85
+LRDockWidth=443
+Dockable=1
+
[DockHosts]
DockHostCount=1
@@ -423,8 +532,8 @@ DockSiteType=0
Create=1
Visible=0
State=0
-Left=226
-Top=847
+Left=488
+Top=297
Width=1007
Height=500
MaxLeft=-1
diff --git a/Source/OposTest/Fmu/fmuCashGeneral.dfm b/Source/OposTest/Fmu/fmuCashGeneral.dfm
index 07407af426ded0a54c22e6c0be45494e76c9eb9c..d5744bae74e92ac35d994d62831e643faf8ecb01 100644
--- a/Source/OposTest/Fmu/fmuCashGeneral.dfm
+++ b/Source/OposTest/Fmu/fmuCashGeneral.dfm
@@ -1,6 +1,6 @@
object fmCashGeneral: TfmCashGeneral
- Left = 489
- Top = 119
+ Left = 858
+ Top = 305
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'General'
diff --git a/Source/OposTest/OposTest.dof b/Source/OposTest/OposTest.dof
index 0f9f3d815f9affdf2d272a2f6393d650bcff8eee..d4de24d31af961f195a1a8617220aff3e3b3ae4a 100644
--- a/Source/OposTest/OposTest.dof
+++ b/Source/OposTest/OposTest.dof
@@ -134,16 +134,23 @@ OriginalFilename=OposTest.exe
ProductName=OPOS drivers
ProductVersion=1.13
Comments=http://www.shtrih-m.ru
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Source/Shared/DIOHandlers.pas b/Source/Shared/DIOHandlers.pas
index 855d33c52b2a19a7a809bb5f0ab76d6137ac8344..e31e41edd14ac7d3ab60d78214ec34b1f6b02065 100644
--- a/Source/Shared/DIOHandlers.pas
+++ b/Source/Shared/DIOHandlers.pas
@@ -1888,6 +1888,7 @@ begin
DriverParameterCacheReceiptNumber: pString := BoolToStr(Printer.Parameters.CacheReceiptNumber);
DriverParameterBarLineByteMode: pString := IntToStr(Printer.Parameters.BarLineByteMode);
DriverParameterLogFilePath: pString := Printer.Parameters.LogFilePath;
+ DriverParameterLogFileName: pString := Logger.FileName;
DriverParameterParam1: pString := Printer.Parameters.Parameter1;
DriverParameterParam2: pString := Printer.Parameters.Parameter2;
diff --git a/Source/Shared/FileUtils.pas b/Source/Shared/FileUtils.pas
index e70a4ec06264c8efde5ea0842f178a424f7eb72c..44a51000042d847f4c0e270b6110560a820ea5eb 100644
--- a/Source/Shared/FileUtils.pas
+++ b/Source/Shared/FileUtils.pas
@@ -16,6 +16,7 @@ function GetLongFileName(const FileName: WideString): WideString;
function GetSystemPath: WideString;
function CLSIDToFileName(const CLSID: TGUID): WideString;
procedure DeleteFiles(const FileMask: WideString);
+procedure GetFileNames(const Mask: WideString; FileNames: TTntStrings);
implementation
diff --git a/Source/Shared/LogFile.pas b/Source/Shared/LogFile.pas
index dff8eeddb39f3c2baee6d27d90e8dc38498150e0..4f0617e58054cd6ceda237d522e2d3555916df52 100644
--- a/Source/Shared/LogFile.pas
+++ b/Source/Shared/LogFile.pas
@@ -35,25 +35,27 @@ type
procedure LogParam(const ParamName: AnsiString; const ParamValue: Variant);
procedure GetFileNames(const Mask: AnsiString; FileNames: TTntStrings);
- function GetSeparator: AnsiString;
- function GetMaxCount: Integer;
function GetEnabled: Boolean;
+ function GetMaxCount: Integer;
function GetFilePath: AnsiString;
- function GetDeviceName: AnsiString;
function GetFileName: AnsiString;
+ function GetSeparator: AnsiString;
+ function GetDeviceName: AnsiString;
+ function GetTimeStampEnabled: Boolean;
+ procedure CloseFile;
+ procedure CheckFilesMaxCount;
procedure SetEnabled(Value: Boolean);
+ procedure SetMaxCount(const Value: Integer);
+ procedure SetFileName(const Value: AnsiString);
procedure SetFilePath(const Value: AnsiString);
procedure SetSeparator(const Value: AnsiString);
- procedure SetMaxCount(const Value: Integer);
procedure SetDeviceName(const Value: AnsiString);
- function GetTimeStampEnabled: Boolean;
procedure SetTimeStampEnabled(const Value: Boolean);
- procedure CloseFile;
- procedure CheckFilesMaxCount;
property Enabled: Boolean read GetEnabled write SetEnabled;
property FilePath: AnsiString read GetFilePath write SetFilePath;
+ property FileName: AnsiString read GetFileName write SetFileName;
property MaxCount: Integer read GetMaxCount write SetMaxCount;
property Separator: AnsiString read GetSeparator write SetSeparator;
property DeviceName: AnsiString read GetDeviceName write SetDeviceName;
@@ -75,33 +77,36 @@ type
FDeviceName: AnsiString;
FTimeStampEnabled: Boolean;
+ function GetOpened: Boolean;
+ function GetEnabled: Boolean;
+ function GetMaxCount: Integer;
+ function GetFilePath: AnsiString;
+ function GetFileName: AnsiString;
+ function GetSeparator: AnsiString;
+ function GetDeviceName: AnsiString;
+ function GetTimeStampEnabled: Boolean;
+ function GetDefaultFileName: AnsiString;
+
procedure OpenFile;
procedure CloseFile;
procedure SetDefaults;
procedure CheckFilesMaxCount;
- function GetOpened: Boolean;
- function GetFileName: AnsiString;
+ procedure SetEnabled(Value: Boolean);
procedure Write(const Data: AnsiString);
procedure AddLine(const Data: AnsiString);
- procedure SetFileName(const Value: AnsiString);
-
- property Opened: Boolean read GetOpened;
- class function ParamsToStr(const Params: array of const): AnsiString;
- class function VariantToStr(V: Variant): AnsiString;
- class function VarArrayToStr(const AVarArray: TVariantArray): AnsiString;
- procedure GetFileNames(const Mask: AnsiString; FileNames: TTntStrings);
- function GetSeparator: AnsiString;
- procedure SetSeparator(const Value: AnsiString);
- function GetMaxCount: Integer;
procedure SetMaxCount(const Value: Integer);
- function GetEnabled: Boolean;
- procedure SetEnabled(Value: Boolean);
- function GetFilePath: AnsiString;
procedure SetFilePath(const Value: AnsiString);
- function GetDeviceName: AnsiString;
+ procedure SetFileName(const Value: AnsiString);
+ procedure SetSeparator(const Value: AnsiString);
procedure SetDeviceName(const Value: AnsiString);
- function GetTimeStampEnabled: Boolean;
procedure SetTimeStampEnabled(const Value: Boolean);
+ procedure GetFileNames(const Mask: AnsiString; FileNames: TTntStrings);
+
+ class function VariantToStr(V: Variant): AnsiString;
+ class function ParamsToStr(const Params: array of const): AnsiString;
+ class function VarArrayToStr(const AVarArray: TVariantArray): AnsiString;
+
+ property Opened: Boolean read GetOpened;
public
constructor Create;
destructor Destroy; override;
@@ -130,7 +135,7 @@ type
property Enabled: Boolean read GetEnabled write SetEnabled;
property FilePath: AnsiString read GetFilePath write SetFilePath;
- property FileName: AnsiString read FFileName write SetFileName;
+ property FileName: AnsiString read GetFileName write SetFileName;
property MaxCount: Integer read GetMaxCount write SetMaxCount;
property Separator: AnsiString read GetSeparator write SetSeparator;
property DeviceName: AnsiString read GetDeviceName write SetDeviceName;
@@ -283,12 +288,17 @@ begin
//FLock.Leave;
end;
-function TLogFile.GetFileName: AnsiString;
+function TLogFile.GetDefaultFileName: AnsiString;
begin
Result := IncludeTrailingBackSlash(FilePath) + DeviceName + '_' +
FormatDateTime('yyyy.mm.dd', Date) + '.log';
end;
+function TLogFile.GetFileName: AnsiString;
+begin
+ Result := FFileName;
+end;
+
procedure TLogFile.SetDefaults;
begin
MaxCount := 10;
diff --git a/Source/SmFiscalPrinter/FiscalPrinter.ini b/Source/SmFiscalPrinter/FiscalPrinter.ini
new file mode 100644
index 0000000000000000000000000000000000000000..0a22adcc5d420112a373085572195084b0cea535
--- /dev/null
+++ b/Source/SmFiscalPrinter/FiscalPrinter.ini
@@ -0,0 +1,135 @@
+[FiscalPrinter_SHTRIH-M-OPOS-1]
+Storage=0
+Header=486561646572206C696E6520310D0A486561646572206C696E6520320D0A486561646572206C696E6520330D0A486561646572206C696E6520340D0A486561646572206C696E6520350D0A486561646572206C696E652036
+Trailer=547261696C6572206C696E6520310D0A547261696C6572206C696E6520320D0A547261696C6572206C696E6520330D0A547261696C6572206C696E652034
+HeaderPrinted=1
+LogoSize=0
+LogoReloadEnabled=0
+LogoCenter=1
+IsLogoLoaded=0
+LogoFileName=
+Department=1
+ZeroReceiptNumber=1
+ConnectionType=0
+RemotePort=7778
+RemoteHost=3139322E3136382E3133372E313131
+PortNumber=56
+BaudRate=115200
+SysPassword=30
+UsrPassword=1
+SubtotalText=535542544F54414C
+CloseRecText=
+VoidRecText=5245434549505420564F49444544
+FontNumber=1
+ByteTimeout=1000
+MaxRetryCount=3
+SearchByPortEnabled=0
+SearchByBaudRateEnabled=1
+PollIntervalInSeconds=5
+DeviceByteTimeout=1000
+StatusInterval=100
+LogFileEnabled=1
+CutType=1
+LogoPosition=0
+NumHeaderLines=6
+NumTrailerLines=4
+HeaderFont=1
+TrailerFont=1
+Encoding=0
+BarLinePrintDelay=100
+StatusCommand=0
+HeaderType=1
+CompatLevel=0
+ReceiptType=0
+ZeroReceiptType=0
+CCOType=0
+TableEditEnabled=1
+XmlZReportEnabled=0
+CsvZReportEnabled=0
+XmlZReportFileName=C:\projects\OPOSShtrih\bin\ZReport.xml
+CsvZReportFileName=C:\projects\OPOSShtrih\bin\ZReport.csv
+LogMaxCount=10
+VoidReceiptOnMaxItems=0
+MaxReceiptItems=100
+JournalPrintHeader=1
+JournalPrintTrailer=1
+CacheReceiptNumber=0
+BarLineByteMode=0
+PrintRecSubtotal=1
+StatusTimeout=60
+SetHeaderLineEnabled=1
+SetTrailerLineEnabled=1
+RFAmountLength=10
+RFQuantityLength=10
+RFSeparatorLine=1
+RFShowTaxLetters=0
+MonitoringPort=50000
+MonitoringEnabled=0
+PropertyUpdateMode=0
+ReceiptReportFileName=C:\projects\OPOSShtrih\bin\ZCheckReport.xml
+ReceiptReportEnabled=0
+ZReceiptBeforeZReport=1
+DepartmentInText=0
+CenterHeader=0
+AmountDecimalPlaces=1
+CapRecNearEndSensorMode=0
+FPSerial=
+LogFilePath=C:\projects\OPOSShtrih\bin\Logs
+ReportDateStamp=0
+FSBarcodeEnabled=0
+FSAddressEnabled=0
+FSUpdatePrice=0
+BarcodePrefix=BARCODE:
+BarcodeHeight=100
+BarcodeType=0
+BarcodeModuleWidth=2
+BarcodeAlignment=0
+BarcodeParameter1=0
+BarcodeParameter2=0
+BarcodeParameter3=0
+XReport=0
+WrapText=1
+WritePaymentNameEnabled=1
+TimeUpdateMode=0
+ReceiptItemsHeader=2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D
+ReceiptItemsTrailer=2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D
+ReceiptItemFormat=253363504F5325202532306C5449544C45252025366C53554D25202A2025365155414E25203D253130544F54414C5F54415825
+RecPrintType=0
+PrintSingleQuantity=1
+TableFilePath=C:\projects\OPOSShtrih\bin\Tables
+VatCodeEnabled=0
+HandleErrorCode=0
+FSServiceEnabled=0
+PrinterProtocol=0
+PrintUnitName=0
+OpenReceiptEnabled=0
+QuantityDecimalPlaces=0
+PingEnabled=0
+DocumentBlockSize=50
+PrintRecMessageMode=1
+EkmServerHost=80.243.2.202
+EkmServerPort=2003
+EkmServerTimeout=5
+EkmServerEnabled=0
+FSMarkCheckEnabled=0
+[FiscalPrinter_SHTRIH-M-OPOS-1_PaymentTypes]
+0=0
+1=1
+2=2
+3=3
+4=4
+5=5
+6=6
+7=7
+8=8
+9=9
+10=10
+11=11
+12=12
+13=13
+14=14
+15=15
+[FiscalPrinter_SHTRIH-M-OPOS-1_VatCodes]
+1=3
+2=2
+4=1
diff --git a/Source/SmFiscalPrinter/SmFiscalPrinter.dof b/Source/SmFiscalPrinter/SmFiscalPrinter.dof
index a4e8405d0d5f92267b61c043cfd8df99ba047f92..2662940f6288143a3c494b26c2ad7197b90e2887 100644
--- a/Source/SmFiscalPrinter/SmFiscalPrinter.dof
+++ b/Source/SmFiscalPrinter/SmFiscalPrinter.dof
@@ -143,16 +143,23 @@ ProductVersion=1.13
Comments=http://www.shtrih-m.ru
[Excluded Packages]
C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\PngComponentsD7.bpl=Png components
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Source/SmFiscalPrinter/SmFiscalPrinterLib_TLB.pas b/Source/SmFiscalPrinter/SmFiscalPrinterLib_TLB.pas
index ebdeecf2a9cd7d829bfc68c1e60586733b400e42..f36606aa7919cdab8f9f667230a79c096d66b959 100644
--- a/Source/SmFiscalPrinter/SmFiscalPrinterLib_TLB.pas
+++ b/Source/SmFiscalPrinter/SmFiscalPrinterLib_TLB.pas
@@ -12,7 +12,7 @@ unit SmFiscalPrinterLib_TLB;
// ************************************************************************ //
// PASTLWTR : 1.2
-// File generated on 28.05.2018 11:29:19 from Type Library described below.
+// File generated on 06.07.2018 15:48:13 from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\projects\OPOSShtrih\Source\SmFiscalPrinter\SmFiscalPrinter.tlb (1)
diff --git a/Source/SmFiscalPrinter/Units/DirectIOAPI.pas b/Source/SmFiscalPrinter/Units/DirectIOAPI.pas
index 8b23eee2a6cb48135b757ac624dd5fdba15f6619..1f27f14a23be8781a2562776fbb50c96f4eefbfc 100644
--- a/Source/SmFiscalPrinter/Units/DirectIOAPI.pas
+++ b/Source/SmFiscalPrinter/Units/DirectIOAPI.pas
@@ -313,6 +313,7 @@ const
DriverParameterCacheReceiptNumber = 66;
DriverParameterBarLineByteMode = 67;
DriverParameterLogFilePath = 68;
+ DriverParameterLogFileName = 69;
DriverParameterParam1 = 70;
DriverParameterParam2 = 71;
diff --git a/Source/SmFptrSrv/FptrServerLib_TLB.pas b/Source/SmFptrSrv/FptrServerLib_TLB.pas
index 5181ed0c98aebce72b69f09e83268f47aff42ca2..965f02c154144e12806d3d707846057c8c7e283a 100644
--- a/Source/SmFptrSrv/FptrServerLib_TLB.pas
+++ b/Source/SmFptrSrv/FptrServerLib_TLB.pas
@@ -12,7 +12,7 @@ unit FptrServerLib_TLB;
// ************************************************************************ //
// PASTLWTR : 1.2
-// File generated on 04.07.2018 19:52:28 from Type Library described below.
+// File generated on 06.07.2018 15:48:11 from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\projects\OPOSShtrih\Source\SmFptrSrv\SmFptrSrv.tlb (1)
diff --git a/Source/SmFptrSrv/SmFptrSrv.dof b/Source/SmFptrSrv/SmFptrSrv.dof
index a5cdcd82a959a485559ad8d21129963778236cd3..9c7f6bde3309d7ebf13790d2854095cba023e804 100644
--- a/Source/SmFptrSrv/SmFptrSrv.dof
+++ b/Source/SmFptrSrv/SmFptrSrv.dof
@@ -134,16 +134,23 @@ OriginalFilename=SmFptrSrv.exe
ProductName=OPOS drivers
ProductVersion=1.12
Comments=http://www.shtrih-m.ru
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Source/SmScale/SmScale.dof b/Source/SmScale/SmScale.dof
index 0d65b960e146ec3ee6c6535021da907a8282f710..a44995f538421cc52ec6c83b2597ec2b7b652ab5 100644
--- a/Source/SmScale/SmScale.dof
+++ b/Source/SmScale/SmScale.dof
@@ -134,16 +134,23 @@ OriginalFilename=SmScale.dll
ProductName=OPOS drivers
ProductVersion=1.12
Comments=http://www.shtrih-m.ru
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Source/SmScale/SmScale_TLB.pas b/Source/SmScale/SmScale_TLB.pas
index b0baf2d81be27bd09def2856325cf9ee97e3cd7b..e7312623c6993f132fd7409d7a9fda935cfa512f 100644
--- a/Source/SmScale/SmScale_TLB.pas
+++ b/Source/SmScale/SmScale_TLB.pas
@@ -12,7 +12,7 @@ unit SmScale_TLB;
// ************************************************************************ //
// PASTLWTR : 1.2
-// File generated on 28.05.2018 14:19:52 from Type Library described below.
+// File generated on 06.07.2018 15:48:14 from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\projects\OPOSShtrih\Source\SmScale\SmScale.tlb (1)
diff --git a/Test/FptrAcceptanceTest/FptrAcceptanceTest.cfg b/Test/AcceptanceTest/AcceptanceTest.cfg
similarity index 100%
rename from Test/FptrAcceptanceTest/FptrAcceptanceTest.cfg
rename to Test/AcceptanceTest/AcceptanceTest.cfg
diff --git a/Test/FptrAcceptanceTest/FptrAcceptanceTest.dof b/Test/AcceptanceTest/AcceptanceTest.dof
similarity index 100%
rename from Test/FptrAcceptanceTest/FptrAcceptanceTest.dof
rename to Test/AcceptanceTest/AcceptanceTest.dof
diff --git a/Test/AcceptanceTest/AcceptanceTest.dpr b/Test/AcceptanceTest/AcceptanceTest.dpr
new file mode 100644
index 0000000000000000000000000000000000000000..cb5b1c7a1e92591df3f586051563fceb7f2e564a
--- /dev/null
+++ b/Test/AcceptanceTest/AcceptanceTest.dpr
@@ -0,0 +1,41 @@
+program AcceptanceTest;
+
+uses
+ TestFramework,
+ GUITestRunner,
+ OposFiscalPrinter_1_11_Lib_TLB in '..\..\Source\Opos\OposFiscalPrinter_1_11_Lib_TLB.pas',
+ duFiscalPrinter in 'Units\duFiscalPrinter.pas',
+ DirectIOAPI in '..\..\Source\SmFiscalPrinter\Units\DirectIOAPI.pas',
+ Opos in '..\..\Source\Opos\Opos.pas',
+ OposFptrUtils in '..\..\Source\Opos\OposFptrUtils.pas',
+ OposUtils in '..\..\Source\Opos\OposUtils.pas',
+ Oposhi in '..\..\Source\Opos\Oposhi.pas',
+ OPOSException in '..\..\Source\Opos\OposException.pas',
+ WException in '..\..\Source\Shared\WException.pas',
+ OposFptr in '..\..\Source\Opos\OposFptr.pas',
+ OposFptrhi in '..\..\Source\Opos\OposFptrhi.pas',
+ SMFiscalPrinter in '..\..\Source\Opos\SMFiscalPrinter.pas',
+ PrinterEncoding in '..\..\Source\Opos\PrinterEncoding.pas',
+ StringUtils in '..\..\Source\Shared\StringUtils.pas',
+ PrinterTypes in '..\..\Source\SmFiscalPrinter\Units\PrinterTypes.pas',
+ PrinterParameters in '..\..\Source\SmFiscalPrinter\Units\PrinterParameters.pas',
+ PayType in '..\..\Source\SmFiscalPrinter\Units\PayType.pas',
+ LogFile in '..\..\Source\Shared\LogFile.pas',
+ FileUtils in '..\..\Source\Shared\FileUtils.pas',
+ VatCode in '..\..\Source\SmFiscalPrinter\Units\VatCode.pas',
+ PrinterParametersX in '..\..\Source\SmFiscalPrinter\Units\PrinterParametersX.pas',
+ PrinterParametersReg in '..\..\Source\SmFiscalPrinter\Units\PrinterParametersReg.pas',
+ SmIniFile in '..\..\Source\SmFiscalPrinter\Units\SmIniFile.pas',
+ TntIniFiles in '..\..\Source\Shared\TntIniFiles.pas',
+ DriverError in '..\..\Source\Shared\DriverError.pas',
+ PrinterParametersRegIBT in '..\..\Source\SmFiscalPrinter\Units\PrinterParametersRegIBT.pas',
+ PrinterParametersIni in '..\..\Source\SmFiscalPrinter\Units\PrinterParametersIni.pas',
+ SmFiscalPrinterLib_TLB in '..\..\Source\SmFiscalPrinter\SmFiscalPrinterLib_TLB.pas',
+ OposFiscalPrinter_1_12_Lib_TLB in '..\..\Source\Opos\OposFiscalPrinter_1_12_Lib_TLB.pas',
+ OposFiscalPrinter_1_13_Lib_TLB in '..\..\Source\Opos\OposFiscalPrinter_1_13_Lib_TLB.pas';
+
+{$R *.RES}
+
+begin
+ TGUITestRunner.RunTest(RegisteredTests);
+end.
diff --git a/Test/FptrAcceptanceTest/FptrAcceptanceTest.res b/Test/AcceptanceTest/AcceptanceTest.res
similarity index 100%
rename from Test/FptrAcceptanceTest/FptrAcceptanceTest.res
rename to Test/AcceptanceTest/AcceptanceTest.res
diff --git a/Test/FptrAcceptanceTest/Bin/dunit.ini b/Test/AcceptanceTest/Bin/dunit.ini
similarity index 81%
rename from Test/FptrAcceptanceTest/Bin/dunit.ini
rename to Test/AcceptanceTest/Bin/dunit.ini
index 8e5ab1d843627e2c8b0ece060f2307911c860270..948c478f699721948299c6e50dc99668e2626953 100644
--- a/Test/FptrAcceptanceTest/Bin/dunit.ini
+++ b/Test/AcceptanceTest/Bin/dunit.ini
@@ -1,6 +1,7 @@
[Tests]
FiscalPrinterAcceptanceTest.exe=1
FptrAcceptanceTest.exe=1
+AcceptanceTest.exe=1
[Tests.FiscalPrinterAcceptanceTest.exe]
TFiscalPrinterTest=1
TFiscalPrinterVarTest=0
@@ -9,9 +10,9 @@ CheckOpen=0
CheckOpenMulti=1
[GUITestRunner Config]
AutoSave=1
-Left=273
-Top=273
-Width=850
+Left=223
+Top=53
+Width=953
Height=612
Maximized=0
UseRegistry=0
@@ -20,8 +21,8 @@ ErrorMessage.Height=75
ErrorMessage.Visible=1
FailureList.ColumnWidth[0]=120
FailureList.ColumnWidth[1]=100
-FailureList.ColumnWidth[2]=483
-FailureList.ColumnWidth[3]=119
+FailureList.ColumnWidth[2]=600
+FailureList.ColumnWidth[3]=105
HideTestNodesOnOpen=0
BreakOnFailures=0
SelectTestedNode=1
@@ -44,3 +45,7 @@ CheckOpen=1
CheckOpenMulti=1
[Tests.FptrAcceptanceTest.exe.TFptrControlTest]
CheckOpen=0
+[Tests.AcceptanceTest.exe]
+TFiscalPrinterTest=1
+[Tests.AcceptanceTest.exe.TFiscalPrinterTest]
+ExecuteLogFiles=1
diff --git a/Test/AcceptanceTest/Units/duFiscalPrinter.pas b/Test/AcceptanceTest/Units/duFiscalPrinter.pas
new file mode 100644
index 0000000000000000000000000000000000000000..f99b469e8009f3f327fadda4be04ea663b586c98
--- /dev/null
+++ b/Test/AcceptanceTest/Units/duFiscalPrinter.pas
@@ -0,0 +1,310 @@
+unit duFiscalPrinter;
+
+interface
+
+uses
+ // VCL
+ Windows, SysUtils, Classes, ActiveX, ComObj,
+ // JVCL
+ JvInterpreter,
+ // DUnit
+ TestFramework,
+ // Tnt
+ TntClasses, TntSysUtils,
+ // This
+ Opos, OposFptrUtils, OposFiscalPrinter_1_11_Lib_TLB, DirectIOAPI,
+ SMFiscalPrinter, FileUtils, SmFiscalPrinterLib_TLB;
+
+type
+ { TFiscalPrinterTest }
+
+ TFiscalPrinterTest = class(TTestCase)
+ private
+ FDriver: TSMFiscalPrinter;
+
+ procedure ExecuteScript(const FileName: WideString);
+ procedure ExecuteLogFile(const FileName: WideString);
+ procedure ReadLogCommands(const FileName: WideString; Commands: TTntStrings);
+ procedure RunScript(const Text: string);
+ procedure DeleteLogFiles;
+ function GetLogFileName: string;
+ protected
+ procedure Setup; override;
+ procedure TearDown; override;
+ property Driver: TSMFiscalPrinter read FDriver;
+ published
+ procedure ExecuteLogFiles;
+ end;
+
+implementation
+
+{ TFiscalPrinterTest }
+
+procedure TFiscalPrinterTest.Setup;
+begin
+ FDriver := TSMFiscalPrinter.Create;
+end;
+
+procedure TFiscalPrinterTest.TearDown;
+begin
+ FDriver.Free;
+end;
+
+procedure TFiscalPrinterTest.ExecuteLogFiles;
+var
+ i: Integer;
+ FileMask: WideString;
+ FileNames: TTntStrings;
+begin
+ DeleteLogFiles;
+ FileNames := TTntStringList.Create;
+ try
+ FileMask := GetModulePath + 'Logs\*.Log';
+ GetFileNames(FileMask, FileNames);
+ for i := 0 to FileNames.Count-1 do
+ begin
+ ExecuteLogFile(FileNames[i]);
+ end;
+ finally
+ FileNames.Free;
+ end;
+end;
+
+procedure TFiscalPrinterTest.DeleteLogFiles;
+var
+ Path: string;
+ FileNames: TTntStringList;
+begin
+ Path := CLSIDToFileName(CLASS_FiscalPrinter);
+ Path := WideIncludeTrailingPathDelimiter(ExtractFilePath(Path)) + 'Logs';
+
+ FileNames := TTntStringList.Create;
+ try
+ GetFileNames(FileMask, FileNames);
+ if FileNames.Count > 0 then
+ begin
+ Result := FileNames[0];
+ end;
+ finally
+ FileNames.Free;
+ end;
+end;
+
+procedure TFiscalPrinterTest.ReadLogCommands(const FileName: WideString;
+ Commands: TTntStrings);
+
+ function GetCommand(const Line: WideString): WideString;
+ var
+ P: Integer;
+ const
+ TxTag = '->';
+ begin
+ Result := '';
+ P := Pos(TxTag, Line);
+ if P <> 0 then
+ begin
+ Result := Trim(Copy(Line, P + Length(TxTag), Length(Line)));
+ if (Result = '05')or(Result = '06')or(Copy(Result, 1, 8) = '02 05 11') or (Copy(Result, 1, 8) = '02 05 10')then
+ begin
+ Result := '';
+ Exit;
+ end;
+ Result := TxTag + ' ' + Result;
+ end;
+ end;
+
+var
+ i: Integer;
+ Line: WideString;
+ Command: WideString;
+ Lines: TTntStrings;
+begin
+ Lines := TTntStringList.Create;
+ try
+ Lines.LoadFromFile(FileName);
+ for i := 0 to Lines.Count-1 do
+ begin
+ Line := Lines[i];
+ Command := GetCommand(Line);
+ if Command <> '' then
+ begin
+ Commands.Add(Command);
+ end;
+ end;
+ finally
+ Lines.Free;
+ end;
+end;
+(*
+procedure TFiscalPrinterTest.RunScript(const Text: string);
+var
+ Script: TPSScript;
+begin
+ Script := TPSScript.Create(nil);
+ try
+ Script.Script.Text := Text;
+
+ if not Script.Compile then
+ raise Exception.Create(Script.ExecErrorToString);
+
+ if not Script.Execute then
+ raise Exception.Create(Script.ExecErrorToString);
+
+ finally
+ Script.Free;
+ end;
+end;
+*)
+
+procedure TFiscalPrinterTest.RunScript(const Text: string);
+var
+ Script: TJvInterpreterProgram;
+begin
+ Script := TJvInterpreterProgram.Create(nil);
+ try
+ Script.Pas.Text := Text;
+
+ Script.Compile;
+ Script.Run;
+
+ finally
+ Script.Free;
+ end;
+end;
+
+procedure TFiscalPrinterTest.ExecuteScript(const FileName: WideString);
+
+ function GetCommand(const Line: WideString): WideString;
+ var
+ P: Integer;
+ const
+ CommandTag = 'ToleFiscalPrinter.';
+ begin
+ Result := '';
+ P := Pos(CommandTag, Line);
+ if (P <> 0)and((Pos('=', Line) = 0)or(Pos('OpenService', Line) <> 0))and
+ (Pos('GetProperty', Line) = 0)and (Pos(': OK', Line) = 0) then
+ begin
+ Result := ' Driver.' + Copy(Line, P + Length(CommandTag), Length(Line)) + ';';
+ end;
+ if (Copy(Result, Length(Result)-2, 3) = '=0;') then
+ Result := StringReplace(Result, '=0', '', []);
+
+ Result := StringReplace(Result, '#$0D#$0A', ' + CRLF +', []);
+ Result := StringReplace(Result, 'OpenService', 'Open', []);
+ Result := StringReplace(Result, '''FiscalPrinter'', ', '', []);
+ if Pos('SetPropertyNumber', Result) <> 0 then
+ begin
+ Result := StringReplace(Result, 'SetPropertyNumber(''PIDX_', '', []);
+ Result := StringReplace(Result, 'SetPropertyNumber(''PIDXFptr_', '', []);
+ Result := StringReplace(Result, ''', ', ' := ', []);
+ Result := StringReplace(Result, ')', '', []);
+ end;
+ if Pos('SetPropertyString', Result) <> 0 then
+ begin
+ Result := StringReplace(Result, 'SetPropertyString(''PIDX_', '', []);
+ Result := StringReplace(Result, 'SetPropertyString(''PIDXFptr_', '', []);
+ Result := StringReplace(Result, ''', ', ' := ', []);
+ Result := StringReplace(Result, ')', '', []);
+ end;
+ end;
+
+var
+ i: Integer;
+ Line: WideString;
+ Command: WideString;
+ Lines: TTntStrings;
+ Commands: TTntStrings;
+begin
+ Lines := TTntStringList.Create;
+ Commands := TTntStringList.Create;
+ try
+ Lines.LoadFromFile(FileName);
+ for i := 0 to Lines.Count-1 do
+ begin
+ Line := Lines[i];
+ Command := GetCommand(Line);
+ if Command <> '' then
+ begin
+ Commands.Add(Command);
+ end;
+ end;
+ Commands.SaveToFile(FileName + '_Commands');
+
+
+ Lines.Clear;
+ Lines.Add('unit Acceptance;');
+ Lines.Add('interface');
+ Lines.Add('procedure Main;');
+ Lines.Add('implementation');
+ Lines.Add('procedure Main;');
+ Lines.Add('const');
+ Lines.Add(' CRLF = #13#10;');
+ Lines.Add('var');
+ Lines.Add(' Driver: OleVariant;');
+ Lines.Add('begin');
+ Lines.Add(' Driver := CreateOleObject(''OPOS.FiscalPrinter'');');
+ Lines.AddStrings(Commands);
+ Lines.Add('end;');
+ Lines.Add('end.');
+
+ Lines.SaveToFile(FileName + '_Script');
+
+ RunScript(Lines.Text);
+ finally
+ Lines.Free;
+ Commands.Free;
+ end;
+end;
+
+function TFiscalPrinterTest.GetLogFileName: string;
+var
+ Path: string;
+begin
+ Path := CLSIDToFileName(CLASS_FiscalPrinter);
+ Path := WideIncludeTrailingPathDelimiter(ExtractFilePath(Path)) + 'Logs\';
+ Result := IncludeTrailingBackSlash(FilePath) + DeviceName + '_' +
+ FormatDateTime('yyyy.mm.dd', Date) + '.log';
+end;
+
+procedure TFiscalPrinterTest.ExecuteLogFile(const FileName: WideString);
+var
+ Commands1: TTntStrings;
+ Commands2: TTntStrings;
+begin
+ Commands1 := TTntStringList.Create;
+ Commands2 := TTntStringList.Create;
+ try
+ ReadLogCommands(FileName, Commands1);
+ ExecuteScript(FileName);
+
+ ReadLogCommands(GetLogFileName, Commands2);
+
+
+ WriteFileData(FileName + '_TxCommands1', Commands1.Text);
+ WriteFileData(FileName + '_TxCommands2', Commands2.Text);
+ CheckEquals(Commands1.Text, Commands2.Text, 'Commands1.Text <> Commands2.Text')
+ finally
+ Commands1.Free;
+ Commands2.Free;
+ end;
+end;
+
+
+ (*
+ for i := 0 to Commands.Count-1 do
+ begin
+ if (Pos('Open(', Commands[i]) <> 0) then
+ begin
+ Commands.Insert(i+2, Format(' Driver.DirectIO(30, 68, ''%s'');', [GetModulePath + 'Logs']));
+ Commands.Insert(i+1, ' Driver.DirectIO(30, 35, 1);');
+ Break;
+ end;
+ end;
+ *)
+
+initialization
+ RegisterTest('', TFiscalPrinterTest.Suite);
+
+
+end.
diff --git a/Test/FptrAcceptanceTest/Events.txt b/Test/FptrAcceptanceTest/Events.txt
deleted file mode 100644
index 95120dec7d5254e2e651c321703721dbc246ea6f..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/Events.txt
+++ /dev/null
@@ -1,216 +0,0 @@
-ODS: [14.09.2010 14:19:32.512 ] [00002116] [DEBUG] ToleFiscalPrinter.Initialize
-ODS: [14.09.2010 14:19:32.522 ] [00002116] [DEBUG] ToleFiscalPrinter.OpenService(FiscalPrinter, SHTRIH-M-OPOS-1)
-ODS: [14.09.2010 14:19:32.532 ] [00002116] [ERROR] '' is not a valid integer value
-ODS: [14.09.2010 14:19:32.532 ] [00002116] [ERROR] '' is not a valid integer value
-ODS: [14.09.2010 14:19:32.542 ] [00002116] [ERROR] '' is not a valid integer value
-ODS: [14.09.2010 14:19:32.542 ] [00002116] [ERROR] '' is not a valid integer value
-ODS: [14.09.2010 14:19:32.542 ] [00002116] [ERROR] '' is not a valid integer value
-ODS: [14.09.2010 14:19:32.542 ] [00002116] [DEBUG] TSysPrinterParameters.Load(SHTRIH-M-OPOS-1)
-ODS: [14.09.2010 14:19:32.552 ] [00002116] [DEBUG] **************************************************************
-ODS: [14.09.2010 14:19:32.562 ] [00002116] [DEBUG] LOG START
-ODS: [14.09.2010 14:19:32.562 ] [00002116] [DEBUG] OPOS Fiscal Printer Service. SHTRIH-M, 2010
-ODS: [14.09.2010 14:19:32.572 ] [00002116] [DEBUG] ServiceObjectVersion : 1012062
-ODS: [14.09.2010 14:19:32.572 ] [00002116] [DEBUG] File version : 1.12.0.68
-ODS: [14.09.2010 14:19:32.572 ] [00002116] [DEBUG] **************************************************************
-ODS: [14.09.2010 14:19:32.572 ] [00002116] [DEBUG] SysParameters.Begin
-ODS: [14.09.2010 14:19:32.572 ] [00002116] [DEBUG] RemoteHost: 127.0.0.1
-ODS: [14.09.2010 14:19:32.572 ] [00002116] [DEBUG] RemotePort: 211
-ODS: [14.09.2010 14:19:32.572 ] [00002116] [DEBUG] ConnectionType: 0
-ODS: [14.09.2010 14:19:32.572 ] [00002116] [DEBUG] ComNumber: 1
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] BaudRate: 115200
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] SysPassword: 30
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] UsrPassword: 1
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] SubtotalText: SUBTOTAL
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] CloseRecText:
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] VoidRecText: RECEIPT VOIDED
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] FontNumber: 1
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] ByteTimeout: 100
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] MaxRetryCount: 5
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] SearchByPortEnabled: False
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] SearchByBaudRateEnabled: True
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] PollInterval: 100
-ODS: [14.09.2010 14:19:32.582 ] [00002116] [DEBUG] DeviceByteTimeout: 1000
-ODS: [14.09.2010 14:19:32.592 ] [00002116] [DEBUG] TimeToSleep: 100
-ODS: [14.09.2010 14:19:32.592 ] [00002116] [DEBUG] MonitoringEnabled: False
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] LogFileEnabled: True
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] CutType: 1
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] LogoPosition: 0
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] NumHeaderLines: 4
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] NumTrailerLines: 0
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] HeaderFont: 1
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] TrailerFont: 1
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] Encoding: 0
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] TrainModeText: TRAINING MODE
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] TrainCashInText: CASH IN
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] TrainCashOutText: CASH OUT
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] TrainSaleText: SALE
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] TrainVoidRecText: RECEIPT VOIDED
-ODS: [14.09.2010 14:19:32.602 ] [00002116] [DEBUG] TrainTotalText: TOTAL
-ODS: [14.09.2010 14:19:32.632 ] [00002116] [DEBUG] TrainCashPayText: CASH
-ODS: [14.09.2010 14:19:32.642 ] [00002116] [DEBUG] TrainPay2Text: PAY TYPE 1
-ODS: [14.09.2010 14:19:32.662 ] [00002116] [DEBUG] TrainPay3Text: PAY TYPE 2
-ODS: [14.09.2010 14:19:32.672 ] [00002116] [DEBUG] TrainPay4Text: PAY TYPE 3
-ODS: [14.09.2010 14:19:32.682 ] [00002116] [DEBUG] TrainChangeText: CHANGE
-ODS: [14.09.2010 14:19:32.692 ] [00002116] [DEBUG] TrainStornoText: VOID
-ODS: [14.09.2010 14:19:32.712 ] [00002116] [DEBUG] PayType 0: 0
-ODS: [14.09.2010 14:19:32.722 ] [00002116] [DEBUG] PayType 1: 1
-ODS: [14.09.2010 14:19:32.732 ] [00002116] [DEBUG] PayType 2: 2
-ODS: [14.09.2010 14:19:32.742 ] [00002116] [DEBUG] PayType 3: 3
-ODS: [14.09.2010 14:19:32.762 ] [00002116] [DEBUG] SysParameters.End
-ODS: [14.09.2010 14:19:32.772 ] [00002116] [DEBUG] UsrParameters.Begin
-ODS: [14.09.2010 14:19:32.782 ] [00002116] [DEBUG] LogoSize: 195
-ODS: [14.09.2010 14:19:32.792 ] [00002116] [DEBUG] LogoCenter: True
-ODS: [14.09.2010 14:19:32.802 ] [00002116] [DEBUG] Department: 3
-ODS: [14.09.2010 14:19:32.822 ] [00002116] [DEBUG] LogoEnabled: False
-ODS: [14.09.2010 14:19:32.832 ] [00002116] [DEBUG] HeaderPrinted: True
-ODS: [14.09.2010 14:19:32.842 ] [00002116] [DEBUG] UsrParameters.End
-ODS: [14.09.2010 14:19:32.862 ] [00002116] [DEBUG] ToleFiscalPrinter.OpenService(FiscalPrinter, SHTRIH-M-OPOS-1) = 0
-ODS: [14.09.2010 14:19:32.872 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ServiceObjectVersion) = 1012062
-ODS: [14.09.2010 14:19:32.882 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:32.902 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:32.912 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyString(PIDXFptr_ErrorString) = ""
-ODS: [14.09.2010 14:19:32.922 ] [00002116] [DEBUG] ToleFiscalPrinter.ClaimDevice(0)
-ODS: [14.09.2010 14:19:32.932 ] [00002116] [DEBUG] ToleFiscalPrinter.ClaimDevice(0)=0
-ODS: [14.09.2010 14:19:32.952 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:32.962 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:32.972 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyString(PIDXFptr_ErrorString) = ""
-ODS: [14.09.2010 14:19:32.982 ] [00002116] [DEBUG] ToleFiscalPrinter.Initialize
-ODS: [14.09.2010 14:19:33.002 ] [00002116] [DEBUG] ToleFiscalPrinter.OpenService(FiscalPrinter, SHTRIH-M-OPOS-1)
-ODS: [14.09.2010 14:19:33.022 ] [00002116] [DEBUG] **************************************************************
-ODS: [14.09.2010 14:19:33.032 ] [00002116] [DEBUG] LOG START
-ODS: [14.09.2010 14:19:33.042 ] [00002116] [DEBUG] OPOS Fiscal Printer Service. SHTRIH-M, 2010
-ODS: [14.09.2010 14:19:33.062 ] [00002116] [DEBUG] ServiceObjectVersion : 1012062
-ODS: [14.09.2010 14:19:33.083 ] [00002116] [DEBUG] File version : 1.12.0.68
-ODS: [14.09.2010 14:19:33.113 ] [00002116] [DEBUG] **************************************************************
-ODS: [14.09.2010 14:19:33.133 ] [00002116] [DEBUG] SysParameters.Begin
-ODS: [14.09.2010 14:19:33.143 ] [00002116] [DEBUG] RemoteHost: 127.0.0.1
-ODS: [14.09.2010 14:19:33.163 ] [00002116] [DEBUG] RemotePort: 211
-ODS: [14.09.2010 14:19:33.173 ] [00002116] [DEBUG] ConnectionType: 0
-ODS: [14.09.2010 14:19:33.183 ] [00002116] [DEBUG] ComNumber: 1
-ODS: [14.09.2010 14:19:33.193 ] [00002116] [DEBUG] BaudRate: 115200
-ODS: [14.09.2010 14:19:33.213 ] [00002116] [DEBUG] SysPassword: 30
-ODS: [14.09.2010 14:19:33.223 ] [00002116] [DEBUG] UsrPassword: 1
-ODS: [14.09.2010 14:19:33.233 ] [00002116] [DEBUG] SubtotalText: SUBTOTAL
-ODS: [14.09.2010 14:19:33.243 ] [00002116] [DEBUG] CloseRecText:
-ODS: [14.09.2010 14:19:33.263 ] [00002116] [DEBUG] VoidRecText: RECEIPT VOIDED
-ODS: [14.09.2010 14:19:33.273 ] [00002116] [DEBUG] FontNumber: 1
-ODS: [14.09.2010 14:19:33.283 ] [00002116] [DEBUG] ByteTimeout: 100
-ODS: [14.09.2010 14:19:33.293 ] [00002116] [DEBUG] MaxRetryCount: 5
-ODS: [14.09.2010 14:19:33.313 ] [00002116] [DEBUG] SearchByPortEnabled: False
-ODS: [14.09.2010 14:19:33.323 ] [00002116] [DEBUG] SearchByBaudRateEnabled: True
-ODS: [14.09.2010 14:19:33.333 ] [00002116] [DEBUG] PollInterval: 100
-ODS: [14.09.2010 14:19:33.343 ] [00002116] [DEBUG] DeviceByteTimeout: 1000
-ODS: [14.09.2010 14:19:33.353 ] [00002116] [DEBUG] TimeToSleep: 100
-ODS: [14.09.2010 14:19:33.373 ] [00002116] [DEBUG] MonitoringEnabled: False
-ODS: [14.09.2010 14:19:33.383 ] [00002116] [DEBUG] LogFileEnabled: True
-ODS: [14.09.2010 14:19:33.393 ] [00002116] [DEBUG] CutType: 1
-ODS: [14.09.2010 14:19:33.403 ] [00002116] [DEBUG] LogoPosition: 0
-ODS: [14.09.2010 14:19:33.423 ] [00002116] [DEBUG] NumHeaderLines: 4
-ODS: [14.09.2010 14:19:33.433 ] [00002116] [DEBUG] NumTrailerLines: 0
-ODS: [14.09.2010 14:19:33.443 ] [00002116] [DEBUG] HeaderFont: 1
-ODS: [14.09.2010 14:19:33.453 ] [00002116] [DEBUG] TrailerFont: 1
-ODS: [14.09.2010 14:19:33.473 ] [00002116] [DEBUG] Encoding: 0
-ODS: [14.09.2010 14:19:33.483 ] [00002116] [DEBUG] TrainModeText: TRAINING MODE
-ODS: [14.09.2010 14:19:33.493 ] [00002116] [DEBUG] TrainCashInText: CASH IN
-ODS: [14.09.2010 14:19:33.503 ] [00002116] [DEBUG] TrainCashOutText: CASH OUT
-ODS: [14.09.2010 14:19:33.523 ] [00002116] [DEBUG] TrainSaleText: SALE
-ODS: [14.09.2010 14:19:33.533 ] [00002116] [DEBUG] TrainVoidRecText: RECEIPT VOIDED
-ODS: [14.09.2010 14:19:33.543 ] [00002116] [DEBUG] TrainTotalText: TOTAL
-ODS: [14.09.2010 14:19:33.553 ] [00002116] [DEBUG] TrainCashPayText: CASH
-ODS: [14.09.2010 14:19:33.563 ] [00002116] [DEBUG] TrainPay2Text: PAY TYPE 1
-ODS: [14.09.2010 14:19:33.583 ] [00002116] [DEBUG] TrainPay3Text: PAY TYPE 2
-ODS: [14.09.2010 14:19:33.593 ] [00002116] [DEBUG] TrainPay4Text: PAY TYPE 3
-ODS: [14.09.2010 14:19:33.613 ] [00002116] [DEBUG] TrainChangeText: CHANGE
-ODS: [14.09.2010 14:19:33.623 ] [00002116] [DEBUG] TrainStornoText: VOID
-ODS: [14.09.2010 14:19:33.643 ] [00002116] [DEBUG] PayType 0: 0
-ODS: [14.09.2010 14:19:33.653 ] [00002116] [DEBUG] PayType 1: 1
-ODS: [14.09.2010 14:19:33.663 ] [00002116] [DEBUG] PayType 2: 2
-ODS: [14.09.2010 14:19:33.673 ] [00002116] [DEBUG] PayType 3: 3
-ODS: [14.09.2010 14:19:33.693 ] [00002116] [DEBUG] SysParameters.End
-ODS: [14.09.2010 14:19:33.703 ] [00002116] [DEBUG] UsrParameters.Begin
-ODS: [14.09.2010 14:19:33.713 ] [00002116] [DEBUG] LogoSize: 195
-ODS: [14.09.2010 14:19:33.723 ] [00002116] [DEBUG] LogoCenter: True
-ODS: [14.09.2010 14:19:33.743 ] [00002116] [DEBUG] Department: 3
-ODS: [14.09.2010 14:19:33.753 ] [00002116] [DEBUG] LogoEnabled: False
-ODS: [14.09.2010 14:19:33.774 ] [00002116] [DEBUG] HeaderPrinted: True
-ODS: [14.09.2010 14:19:33.784 ] [00002116] [DEBUG] UsrParameters.End
-ODS: [14.09.2010 14:19:33.794 ] [00002116] [DEBUG] ToleFiscalPrinter.OpenService(FiscalPrinter, SHTRIH-M-OPOS-1) = 0
-ODS: [14.09.2010 14:19:33.814 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ServiceObjectVersion) = 1012062
-ODS: [14.09.2010 14:19:33.824 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:33.844 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:33.854 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyString(PIDXFptr_ErrorString) = ""
-ODS: [14.09.2010 14:19:33.864 ] [00002116] [DEBUG] ToleFiscalPrinter.ClaimDevice(0)
-ODS: [14.09.2010 14:19:33.884 ] [00002116] [DEBUG] ToleFiscalPrinter.ClaimDevice(0)=0
-ODS: [14.09.2010 14:19:33.894 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:33.904 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:33.914 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyString(PIDXFptr_ErrorString) = ""
-ODS: [14.09.2010 14:19:33.934 ] [00002116] [DEBUG] ToleFiscalPrinter.Initialize
-ODS: [14.09.2010 14:19:33.944 ] [00002116] [DEBUG] ToleFiscalPrinter.OpenService(FiscalPrinter, SHTRIH-M-OPOS-1)
-ODS: [14.09.2010 14:19:33.964 ] [00002116] [DEBUG] **************************************************************
-ODS: [14.09.2010 14:19:33.974 ] [00002116] [DEBUG] LOG START
-ODS: [14.09.2010 14:19:33.984 ] [00002116] [DEBUG] OPOS Fiscal Printer Service. SHTRIH-M, 2010
-ODS: [14.09.2010 14:19:34.004 ] [00002116] [DEBUG] ServiceObjectVersion : 1012062
-ODS: [14.09.2010 14:19:34.014 ] [00002116] [DEBUG] File version : 1.12.0.68
-ODS: [14.09.2010 14:19:34.024 ] [00002116] [DEBUG] **************************************************************
-ODS: [14.09.2010 14:19:34.034 ] [00002116] [DEBUG] SysParameters.Begin
-ODS: [14.09.2010 14:19:34.054 ] [00002116] [DEBUG] RemoteHost: 127.0.0.1
-ODS: [14.09.2010 14:19:34.074 ] [00002116] [DEBUG] RemotePort: 211
-ODS: [14.09.2010 14:19:34.114 ] [00002116] [DEBUG] ConnectionType: 0
-ODS: [14.09.2010 14:19:34.124 ] [00002116] [DEBUG] ComNumber: 1
-ODS: [14.09.2010 14:19:34.144 ] [00002116] [DEBUG] BaudRate: 115200
-ODS: [14.09.2010 14:19:34.154 ] [00002116] [DEBUG] SysPassword: 30
-ODS: [14.09.2010 14:19:34.164 ] [00002116] [DEBUG] UsrPassword: 1
-ODS: [14.09.2010 14:19:34.184 ] [00002116] [DEBUG] SubtotalText: SUBTOTAL
-ODS: [14.09.2010 14:19:34.194 ] [00002116] [DEBUG] CloseRecText:
-ODS: [14.09.2010 14:19:34.204 ] [00002116] [DEBUG] VoidRecText: RECEIPT VOIDED
-ODS: [14.09.2010 14:19:34.214 ] [00002116] [DEBUG] FontNumber: 1
-ODS: [14.09.2010 14:19:34.234 ] [00002116] [DEBUG] ByteTimeout: 100
-ODS: [14.09.2010 14:19:34.244 ] [00002116] [DEBUG] MaxRetryCount: 5
-ODS: [14.09.2010 14:19:34.254 ] [00002116] [DEBUG] SearchByPortEnabled: False
-ODS: [14.09.2010 14:19:34.264 ] [00002116] [DEBUG] SearchByBaudRateEnabled: True
-ODS: [14.09.2010 14:19:34.284 ] [00002116] [DEBUG] PollInterval: 100
-ODS: [14.09.2010 14:19:34.294 ] [00002116] [DEBUG] DeviceByteTimeout: 1000
-ODS: [14.09.2010 14:19:34.304 ] [00002116] [DEBUG] TimeToSleep: 100
-ODS: [14.09.2010 14:19:34.314 ] [00002116] [DEBUG] MonitoringEnabled: False
-ODS: [14.09.2010 14:19:34.334 ] [00002116] [DEBUG] LogFileEnabled: True
-ODS: [14.09.2010 14:19:34.344 ] [00002116] [DEBUG] CutType: 1
-ODS: [14.09.2010 14:19:34.354 ] [00002116] [DEBUG] LogoPosition: 0
-ODS: [14.09.2010 14:19:34.364 ] [00002116] [DEBUG] NumHeaderLines: 4
-ODS: [14.09.2010 14:19:34.384 ] [00002116] [DEBUG] NumTrailerLines: 0
-ODS: [14.09.2010 14:19:34.394 ] [00002116] [DEBUG] HeaderFont: 1
-ODS: [14.09.2010 14:19:34.404 ] [00002116] [DEBUG] TrailerFont: 1
-ODS: [14.09.2010 14:19:34.414 ] [00002116] [DEBUG] Encoding: 0
-ODS: [14.09.2010 14:19:34.434 ] [00002116] [DEBUG] TrainModeText: TRAINING MODE
-ODS: [14.09.2010 14:19:34.444 ] [00002116] [DEBUG] TrainCashInText: CASH IN
-ODS: [14.09.2010 14:19:34.454 ] [00002116] [DEBUG] TrainCashOutText: CASH OUT
-ODS: [14.09.2010 14:19:34.464 ] [00002116] [DEBUG] TrainSaleText: SALE
-ODS: [14.09.2010 14:19:34.485 ] [00002116] [DEBUG] TrainVoidRecText: RECEIPT VOIDED
-ODS: [14.09.2010 14:19:34.495 ] [00002116] [DEBUG] TrainTotalText: TOTAL
-ODS: [14.09.2010 14:19:34.505 ] [00002116] [DEBUG] TrainCashPayText: CASH
-ODS: [14.09.2010 14:19:34.515 ] [00002116] [DEBUG] TrainPay2Text: PAY TYPE 1
-ODS: [14.09.2010 14:19:34.525 ] [00002116] [DEBUG] TrainPay3Text: PAY TYPE 2
-ODS: [14.09.2010 14:19:34.545 ] [00002116] [DEBUG] TrainPay4Text: PAY TYPE 3
-ODS: [14.09.2010 14:19:34.555 ] [00002116] [DEBUG] TrainChangeText: CHANGE
-ODS: [14.09.2010 14:19:34.565 ] [00002116] [DEBUG] TrainStornoText: VOID
-ODS: [14.09.2010 14:19:34.575 ] [00002116] [DEBUG] PayType 0: 0
-ODS: [14.09.2010 14:19:34.595 ] [00002116] [DEBUG] PayType 1: 1
-ODS: [14.09.2010 14:19:34.605 ] [00002116] [DEBUG] PayType 2: 2
-ODS: [14.09.2010 14:19:34.615 ] [00002116] [DEBUG] PayType 3: 3
-ODS: [14.09.2010 14:19:34.625 ] [00002116] [DEBUG] SysParameters.End
-ODS: [14.09.2010 14:19:34.635 ] [00002116] [DEBUG] UsrParameters.Begin
-ODS: [14.09.2010 14:19:34.655 ] [00002116] [DEBUG] LogoSize: 195
-ODS: [14.09.2010 14:19:34.665 ] [00002116] [DEBUG] LogoCenter: True
-ODS: [14.09.2010 14:19:34.675 ] [00002116] [DEBUG] Department: 3
-ODS: [14.09.2010 14:19:34.685 ] [00002116] [DEBUG] LogoEnabled: False
-ODS: [14.09.2010 14:19:34.695 ] [00002116] [DEBUG] HeaderPrinted: True
-ODS: [14.09.2010 14:19:34.715 ] [00002116] [DEBUG] UsrParameters.End
-ODS: [14.09.2010 14:19:34.725 ] [00002116] [DEBUG] ToleFiscalPrinter.OpenService(FiscalPrinter, SHTRIH-M-OPOS-1) = 0
-ODS: [14.09.2010 14:19:34.735 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ServiceObjectVersion) = 1012062
-ODS: [14.09.2010 14:19:34.745 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:34.765 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:34.775 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyString(PIDXFptr_ErrorString) = ""
-ODS: [14.09.2010 14:19:34.785 ] [00002116] [DEBUG] ToleFiscalPrinter.ClaimDevice(0)
-ODS: [14.09.2010 14:19:34.795 ] [00002116] [DEBUG] ToleFiscalPrinter.ClaimDevice(0)=0
-ODS: [14.09.2010 14:19:34.815 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:34.825 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyNumber(PIDX_ResultCode) = 0
-ODS: [14.09.2010 14:19:34.835 ] [00002116] [DEBUG] ToleFiscalPrinter.GetPropertyString(PIDXFptr_ErrorString) = ""
diff --git a/Test/FptrAcceptanceTest/FptrAcceptanceTest.dpr b/Test/FptrAcceptanceTest/FptrAcceptanceTest.dpr
deleted file mode 100644
index d60c187275099f2959548b8ab7245d1012697670..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/FptrAcceptanceTest.dpr
+++ /dev/null
@@ -1,23 +0,0 @@
-program FptrAcceptanceTest;
-
-uses
- TestFramework,
- GUITestRunner,
- duFiscalPrinterVar in 'Units\duFiscalPrinterVar.pas',
- OposFiscalPrinter_1_11_Lib_TLB in '..\..\Source\Opos\OposFiscalPrinter_1_11_Lib_TLB.pas',
- duFptrServiceTest in 'Units\duFptrServiceTest.pas',
- OposFptrUtils in '..\..\Source\Opos\OposFptrUtils.pas',
- OposUtils in '..\..\Source\Opos\OposUtils.pas',
- Opos in '..\..\Source\Opos\Opos.pas',
- Oposhi in '..\..\Source\Opos\Oposhi.pas',
- OPOSException in '..\..\Source\Opos\OposException.pas',
- OposFptr in '..\..\Source\Opos\OposFptr.pas',
- OposFptrhi in '..\..\Source\Opos\OposFptrhi.pas',
- duFiscalPrinter in 'Units\duFiscalPrinter.pas',
- DirectIOAPI in '..\..\Source\SmFiscalPrinter\Units\DirectIOAPI.pas';
-
-{$R *.RES}
-
-begin
- TGUITestRunner.RunTest(RegisteredTests);
-end.
diff --git a/Test/FptrAcceptanceTest/FptrAcceptanceTest.dproj b/Test/FptrAcceptanceTest/FptrAcceptanceTest.dproj
deleted file mode 100644
index d0143214eef8fb2ff60d9acd8ebcebcd04a174d9..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/FptrAcceptanceTest.dproj
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
- {4CEF4816-A841-4AD5-9781-08000493AA29}
- FptrAcceptanceTest.dpr
- Debug
- DCC32
- 12.0
-
-
- true
-
-
- true
- Base
- true
-
-
- true
- Base
- true
-
-
- $(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug;$(DCC_UnitSearchPath)
- Bin
- Bin\FptrAcceptanceTest.exe
- VCL50;VCLX50;VCLSMP50;VCLDB50;VCLADO50;ibevnt50;VCLBDE50;VCLDBX50;VCLIE50;INETDB50;INET50;VCLMID50;WEBMID50;dclocx50;dclaxserver50;QRPT50;TEEQR50;NMFAST50;TEEUI50;TEEDB50;TEE50;DSS50;RXCTL5;RXBDE5;RXDB5;Dclusr50
- 00400000
- 1
- false
- WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias)
- false
- x86
- true
- false
- false
- false
- false
- true
- C:\Components\DUnit\src\;$(DebugSourcePath)
- false
- 1
- DCU
- false
-
-
- false
- RELEASE;$(DCC_Define)
- 0
- false
-
-
- DEBUG;$(DCC_Define)
-
-
-
- MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Base
-
-
- Cfg_2
- Base
-
-
- Cfg_1
- Base
-
-
-
-
- Delphi.Personality.12
- VCLApplication
-
-
-
- FptrAcceptanceTest.dpr
-
-
- False
- True
- False
-
-
- False
- False
- 1
- 0
- 0
- 0
- False
- False
- False
- False
- False
- 1049
- 1251
-
-
-
-
- 1.0.0.0
-
-
-
-
-
- 1.0.0.0
-
-
-
-
- 12
-
-
diff --git a/Test/FptrAcceptanceTest/FptrAcceptanceTest.dproj.local b/Test/FptrAcceptanceTest/FptrAcceptanceTest.dproj.local
deleted file mode 100644
index b3811b7eccaaa2d5be74c89d21026fb8b2a279dd..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/FptrAcceptanceTest.dproj.local
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/Test/FptrAcceptanceTest/FptrAcceptanceTest.identcache b/Test/FptrAcceptanceTest/FptrAcceptanceTest.identcache
deleted file mode 100644
index e7a203fc7cde153b6c0f1c639edf661a85900895..0000000000000000000000000000000000000000
Binary files a/Test/FptrAcceptanceTest/FptrAcceptanceTest.identcache and /dev/null differ
diff --git a/Test/FptrAcceptanceTest/Units/OposDevice.pas b/Test/FptrAcceptanceTest/Units/OposDevice.pas
deleted file mode 100644
index 88840ceccf3d174f900a89379497a267c0ab232b..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/Units/OposDevice.pas
+++ /dev/null
@@ -1,331 +0,0 @@
-unit OposDevice;
-
-interface
-
-Uses
- // VCL
- Windows, Classes, Registry, SysUtils, ComObj,
- // Opos
- Oposhi, VersionInfo;
-
-type
- TOposDevice = class;
-
- { TOposDevices }
-
- TOposDevices = class
- private
- FList: TList;
- function GetCount: Integer;
- function GetItem(Index: Integer): TOposDevice;
- procedure Clear;
- procedure InsertItem(AItem: TOposDevice);
- procedure RemoveItem(AItem: TOposDevice);
- public
- constructor Create;
- destructor Destroy; override;
-
- function ValidIndex(Index: Integer): Boolean;
-
- property Count: Integer read GetCount;
- property Items[Index: Integer]: TOposDevice read GetItem; default;
- end;
-
- { TOposDevice }
-
- TOposDevice = class
- private
- FText: string;
- FRegKey: string;
- FProgID: string;
- FOwner: TOposDevices;
-
- function GetRegKeyName: string;
- procedure SetOwner(AOwner: TOposDevices);
- public
- constructor Create(AOwner: TOposDevices;
- const ARegKey, AText, AProgID: string);
- destructor Destroy; override;
-
- procedure Add(const DeviceName: string);
- procedure Delete(const DeviceName: string);
- procedure GetDeviceNames(DeviceNames: TStrings);
- procedure GetDeviceNames2(DeviceNames: TStrings);
- procedure ShowDialog(const DeviceName: string); virtual;
- function ReadServiceName(const DeviceName: string): string;
- function ReadServiceVersion(const ProgID: string): string;
- class function ProgIDToFileVersion(const ProgID: string): string;
-
- property Text: string read FText;
- property RegKey: string read FRegKey;
- property ProgID: string read FProgID;
- end;
-
-function CLSIDToFileName(const CLSID: TGUID): String;
-function ProgIDToFileName(const ProgID: string): string;
-
-implementation
-
-resourcestring
- MsgKeyOpenError = 'Error opening registry key: %s';
-
-function ExtractQuotedStr(const Src: String): String;
-begin
- Result := Src;
- if Src[1] = '"' then Delete(Result, 1, 1);;
- if Result[Length(Result)] = '"' then SetLength(Result, Length(Result) - 1);
-end;
-
-function CLSIDToFileName(const CLSID: TGUID): String;
-var
- Reg: TRegistry;
- strCLSID: String;
-begin
- Result := '';
- Reg := TRegistry.Create;
- try
- Reg.RootKey:= HKEY_CLASSES_ROOT;
- strCLSID := GUIDToString(CLSID);
- if Reg.OpenKey(Format('CLSID\%s\InProcServer32', [strCLSID]), False)
- or Reg.OpenKey(Format('CLSID\%s\LocalServer32', [strCLSID]), False) then
- begin
- try
- Result := ExtractQuotedStr(Reg.ReadString(''));
- finally
- Reg.CloseKey;
- end;
- end;
- finally
- Reg.Free;
- end;
-end;
-
-function ProgIDToFileName(const ProgID: string): string;
-begin
- Result := CLSIDToFileName(ProgIDToClassID(ProgID));
-end;
-
-{ TOposDevices }
-
-constructor TOposDevices.Create;
-begin
- inherited Create;
- FList := TList.Create;
-end;
-
-destructor TOposDevices.Destroy;
-begin
- Clear;
- FList.Free;
- inherited Destroy;
-end;
-
-procedure TOposDevices.Clear;
-begin
- while Count > 0 do Items[0].Free;
-end;
-
-function TOposDevices.GetCount: Integer;
-begin
- Result := FList.Count;
-end;
-
-function TOposDevices.GetItem(Index: Integer): TOposDevice;
-begin
- Result := FList[Index];
-end;
-
-procedure TOposDevices.InsertItem(AItem: TOposDevice);
-begin
- FList.Add(AItem);
- AItem.FOwner := Self;
-end;
-
-procedure TOposDevices.RemoveItem(AItem: TOposDevice);
-begin
- AItem.FOwner := nil;
- FList.Remove(AItem);
-end;
-
-function TOposDevices.ValidIndex(Index: Integer): Boolean;
-begin
- Result := (Index >= 0)and(Index < Count);
-end;
-
-{ TOposDevice }
-
-constructor TOposDevice.Create(AOwner: TOposDevices;
- const ARegKey, AText, AProgID: string);
-begin
- inherited Create;
- FRegKey := ARegKey;
- FText := AText;
- FProgID := AProgID;
-
- SetOwner(AOwner);
-end;
-
-destructor TOposDevice.Destroy;
-begin
- SetOwner(nil);
- inherited Destroy;
-end;
-
-procedure TOposDevice.SetOwner(AOwner: TOposDevices);
-begin
- if AOwner <> FOwner then
- begin
- if FOwner <> nil then FOwner.RemoveItem(Self);
- if AOwner <> nil then AOwner.InsertItem(Self);
- end;
-end;
-
-function TOposDevice.GetRegKeyName: string;
-begin
- Result := OPOS_ROOTKEY + '\' + RegKey;
-end;
-
-procedure TOposDevice.Add(const DeviceName: string);
-var
- Reg: TRegistry;
- KeyName: string;
-begin
- Reg := TRegistry.Create;
- try
- Reg.Access := KEY_ALL_ACCESS;
- Reg.RootKey := HKEY_LOCAL_MACHINE;
-
- KeyName := GetRegKeyName;
- if not Reg.OpenKey(KeyName, True) then
- raise Exception.CreateFmt(MsgKeyOpenError, [KeyName]);
-
- Reg.CreateKey(DeviceName);
- Reg.CloseKey;
- if Reg.OpenKey(KeyName + '\' + DeviceName, False) then
- begin
- Reg.WriteString('', ProgID);
- end;
- finally
- Reg.Free;
- end;
-end;
-
-procedure TOposDevice.Delete(const DeviceName: string);
-var
- Reg: TRegistry;
- KeyName: string;
-begin
- Reg := TRegistry.Create;
- try
- Reg.Access := KEY_ALL_ACCESS;
- Reg.RootKey := HKEY_LOCAL_MACHINE;
- KeyName := GetRegKeyName;
- if not Reg.OpenKey(KeyName, False) then
- raise Exception.CreateFmt(MsgKeyOpenError, [KeyName]);
-
- Reg.DeleteKey(DeviceName);
- finally
- Reg.Free;
- end;
-end;
-
-procedure TOposDevice.GetDeviceNames(DeviceNames: TStrings);
-var
- Reg: TRegistry;
- KeyName: string;
-begin
- Reg := TRegistry.Create;
- try
- Reg.Access := KEY_READ;
- Reg.RootKey := HKEY_LOCAL_MACHINE;
- KeyName := GetRegKeyName;
- if not Reg.OpenKey(KeyName, False) then
- raise Exception.CreateFmt(MsgKeyOpenError, [KeyName]);
-
- Reg.GetKeyNames(DeviceNames);
- finally
- Reg.Free;
- end;
-end;
-
-function TOposDevice.ReadServiceName(const DeviceName: string): string;
-var
- Reg: TRegistry;
- KeyName: string;
-begin
- Result := '';
- Reg := TRegistry.Create;
- try
- Reg.Access := KEY_READ;
- Reg.RootKey := HKEY_LOCAL_MACHINE;
-
- KeyName := OPOS_ROOTKEY + '\' + RegKey + '\' + DeviceName;
- if Reg.OpenKey(KeyName, False) then
- begin
- Result := Reg.ReadString('');
- end;
- finally
- Reg.Free;
- end;
-end;
-
-function TOposDevice.ReadServiceVersion(const ProgID: string): string;
-var
- Service: OleVariant;
-begin
- Result := '';
- try
- Service := CreateOleObject(ProgID);
- Result := Service.GetPropertyNumber(PIDX_ServiceObjectVersion);
- except
- on E: Exception do
- Result := E.Message;
- end;
-end;
-
-class function TOposDevice.ProgIDToFileVersion(const ProgID: string): string;
-begin
- Result := '';
- try
- Result := VersionInfoToStr(ReadFileVersion(ProgIDToFileName(ProgID)));
- except
- on E: Exception do
- Result := E.Message;
- end;
-end;
-
-procedure TOposDevice.GetDeviceNames2(DeviceNames: TStrings);
-var
- i: Integer;
- Reg: TRegistry;
- KeyName: string;
- DeviceName: string;
-begin
- Reg := TRegistry.Create;
- try
- Reg.Access := KEY_READ;
- Reg.RootKey := HKEY_LOCAL_MACHINE;
- KeyName := GetRegKeyName;
- if not Reg.OpenKey(KeyName, False) then
- raise Exception.CreateFmt(MsgKeyOpenError, [KeyName]);
-
- Reg.GetKeyNames(DeviceNames);
- Reg.CloseKey;
-
- for i := 0 to DeviceNames.Count-1 do
- begin
- DeviceName := DeviceNames[i];
- DeviceNames[i] := Format('%s, %s', [DeviceName,
- ReadServiceVersion(DeviceName)]);
- end;
- finally
- Reg.Free;
- end;
-end;
-
-procedure TOposDevice.ShowDialog(const DeviceName: string);
-begin
-
-end;
-
-end.
diff --git a/Test/FptrAcceptanceTest/Units/duFiscalPrinter.pas b/Test/FptrAcceptanceTest/Units/duFiscalPrinter.pas
deleted file mode 100644
index 20261f100e4f69c1bc17520c1089233578e7833f..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/Units/duFiscalPrinter.pas
+++ /dev/null
@@ -1,78 +0,0 @@
-unit duFiscalPrinter;
-
-interface
-
-uses
- // VCL
- Windows, SysUtils, Classes, ActiveX, ComObj,
- // DUnit
- TestFramework,
- // This
- Opos, OposFptrUtils, OposFiscalPrinter_1_11_Lib_TLB, DirectIOAPI;
-
-type
- { TFiscalPrinterTest }
-
- TFiscalPrinterTest = class(TTestCase)
- published
- procedure CheckOpenMulti;
- end;
-
-implementation
-
-{ TFiscalPrinterTest }
-
-procedure TFiscalPrinterTest.CheckOpenMulti;
-const
- IPAddressList: array
- [1..3] of string = (
- '192.168.137.110', '192.168.137.111', '192.168.137.112'
- );
-
- procedure DirectIO(Printer: TOPOSFiscalPrinter; Command, pData: Integer;
- const pString: WideString);
- var
- pStringOut: WideString;
- begin
- pStringOut := pString;
- CheckEquals(0, printer.DirectIO(Command, pData, pStringOut));
- end;
-
-var
- i: Integer;
- Printer: TOPOSFiscalPrinter;
-begin
- for i := Low(IPAddressList) to High(IPAddressList) do
- begin
- Printer := TOPOSFiscalPrinter.Create(nil);
- try
- CheckEquals(0, Printer.Open('SHTRIH-M-OPOS-1'),
- 'Printer.Open(''SHTRIH-M-OPOS-1'')');
-
- DirectIO(Printer, DIO_SET_DRIVER_PARAMETER,
- DriverParameterPropertyUpdateMode, '0');
-
- DirectIO(Printer, DIO_SET_DRIVER_PARAMETER,
- DriverParameterConnectionType, '3');
-
- DirectIO(Printer, DIO_SET_DRIVER_PARAMETER,
- DriverParameterRemoteHost, IPAddressList[i]);
-
- DirectIO(Printer, DIO_SET_DRIVER_PARAMETER,
- DriverParameterRemotePort, '7778');
-
- CheckEquals(0, Printer.ClaimDevice(0),
- 'Printer.ClaimDevice(0)');
-
- CheckEquals(0, Printer.Close, 'Printer.Close');
- finally
- Printer.Free;
- end;
- end;
-end;
-
-initialization
- RegisterTest('', TFiscalPrinterTest.Suite);
-
-
-end.
diff --git a/Test/FptrAcceptanceTest/Units/duFiscalPrinterVar.pas b/Test/FptrAcceptanceTest/Units/duFiscalPrinterVar.pas
deleted file mode 100644
index fac8daa729c59837b76b478f645cc947b5340145..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/Units/duFiscalPrinterVar.pas
+++ /dev/null
@@ -1,68 +0,0 @@
-unit duFiscalPrinterVar;
-
-interface
-
-uses
- // VCL
- Windows, SysUtils, Classes, ActiveX, ComObj, Variants,
- // DUnit
- TestFramework, OposFptrUtils;
-
-type
- { TFiscalPrinterVarTest }
-
- TFiscalPrinterVarTest = class(TTestCase)
- private
- Printer: OleVariant;
- protected
- procedure Setup; override;
- procedure TearDown; override;
- published
- procedure CheckOpen;
- procedure CheckOpenMulti;
- end;
-
-implementation
-
-{ TFiscalPrinterVarTest }
-
-procedure TFiscalPrinterVarTest.Setup;
-begin
- inherited Setup;
- Printer := CreateOleObject('OPOS.FiscalPrinter');
-end;
-
-procedure TFiscalPrinterVarTest.TearDown;
-begin
- inherited TearDown;
- VarClear(Printer);
-end;
-
-procedure TFiscalPrinterVarTest.CheckOpen;
-begin
- CheckEquals(0, Printer.Open('SHTRIH-M-OPOS-1'),
- 'Printer.Open(''SHTRIH-M-OPOS-1'')');
- CheckEquals(0, Printer.ClaimDevice(0), 'Printer.ClaimDevice(0)');
- Printer.DeviceEnabled := True;
- CheckEquals(True, Printer.DeviceEnabled, 'Printer.DeviceEnabled = False');
- Printer.DeviceEnabled := False;
- CheckEquals(False, Printer.DeviceEnabled, 'Printer.DeviceEnabled = True');
- CheckEquals(0, Printer.ReleaseDevice, 'Printer.ReleaseDevice');
- CheckEquals(0, Printer.Close, 'Printer.Close');
-end;
-
-procedure TFiscalPrinterVarTest.CheckOpenMulti;
-var
- i: Integer;
-begin
- for i := 1 to 3 do
- begin
- CheckOpen;
- end;
-end;
-
-initialization
- RegisterTest('', TFiscalPrinterVarTest.Suite);
-
-
-end.
diff --git a/Test/FptrAcceptanceTest/Units/duFptrControlTest.pas b/Test/FptrAcceptanceTest/Units/duFptrControlTest.pas
deleted file mode 100644
index a920bc34fb8177a5cd79de46126ab693231aa862..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/Units/duFptrControlTest.pas
+++ /dev/null
@@ -1,80 +0,0 @@
-unit duFptrControlTest;
-
-interface
-
-uses
- // VCL
- Windows, SysUtils, Classes, ActiveX, ComObj, Registry,
- // DUnit
- TestFramework,
- // PascalMock
- PascalMock,
- // This
- Opos, Oposhi, OposFptrhi, OposFptrUtils, OposFiscalPrinter_1_11_Lib_TLB;
-
-const
- FptrDeviceName = 'MockFiscalPrinter';
- FptrProgID = 'MockOposShtrih.FiscalPrinter';
-
-type
- { TFptrControlTest }
-
- TFptrControlTest = class(TTestCase)
- published
- procedure CheckOpen;
- end;
-
-implementation
-
-
-procedure RegisterMockOposShtrih;
-var
- Reg: TRegistry;
- KeyName: string;
-resourcestring
- MsgKeyOpenError = 'Error opening registry key: %s';
-begin
- Reg := TRegistry.Create;
- try
- Reg.Access := KEY_ALL_ACCESS;
- Reg.RootKey := HKEY_LOCAL_MACHINE;
-
- KeyName := OPOS_ROOTKEY + '\' + OPOS_CLASSKEY_FPTR;
- if not Reg.OpenKey(KeyName, True) then
- raise Exception.CreateFmt(MsgKeyOpenError, [KeyName]);
-
- Reg.CreateKey(FptrDeviceName);
- Reg.CloseKey;
- if Reg.OpenKey(KeyName + '\' + FptrDeviceName, False) then
- begin
- Reg.WriteString('', FptrProgID);
- end;
- finally
- Reg.Free;
- end;
-end;
-
-{ TFptrControlTest }
-
-procedure TFptrControlTest.CheckOpen;
-var
- Service: IMock;
- Printer: IOPOSFiscalPrinter;
-begin
- RegisterMockOposShtrih;
- Printer := TOPOSFiscalPrinter.Create(nil).ControlInterface;
- Service := CoFiscalPrinter.Create as IMock;
- Service.Expects('OpenService').WithParams(['FiscalPrinter', FptrDeviceName]).Returns(0);
- Service.Expects('GetPropertyNumber').WithParams([PIDX_ServiceObjectVersion]).Returns(001012001);
- Service.Expects('Destroy');
-
- CheckEquals(0, Printer.Open(FptrDeviceName), 'Printer.Open');
- Printer := nil;
-
- Service.Verify('Service.Verify');
-end;
-
-initialization
- RegisterTest('', TFptrControlTest.Suite);
-
-end.
diff --git a/Test/FptrAcceptanceTest/Units/duFptrServiceTest.pas b/Test/FptrAcceptanceTest/Units/duFptrServiceTest.pas
deleted file mode 100644
index b3d30c789d38efbe4835405ca228d7ba1dae08ac..0000000000000000000000000000000000000000
--- a/Test/FptrAcceptanceTest/Units/duFptrServiceTest.pas
+++ /dev/null
@@ -1,81 +0,0 @@
-unit duFptrServiceTest;
-
-interface
-
-uses
- // VCL
- Windows, SysUtils, Classes, ActiveX, ComObj,
- // DUnit
- TestFramework,
- // This
- Opos, OposHi, OposFptrHi, OposFptrUtils, OposUtils,
- OposFiscalPrinter_1_11_Lib_TLB;
-
-type
- { TFptrServiceTest }
-
- TFptrServiceTest = class(TTestCase)
- private
- Printer: TOPOSFiscalPrinter;
- procedure DrvCheck(AResultCode: Integer);
- published
- procedure CheckOpenMulti;
- end;
-
-implementation
-
-{ TFptrServiceTest }
-
-procedure TFptrServiceTest.DrvCheck(AResultCode: Integer);
-begin
- if AResultCode <> OPOS_SUCCESS then
- begin
- raise Exception.CreateFmt('%d, %s, %s', [
- AResultCode, GetResultCodeText(AResultCode), Printer.ErrorString]);
- end;
-end;
-
-procedure TFptrServiceTest.CheckOpenMulti;
-begin
- Printer := TOPOSFiscalPrinter.Create(nil);
- try
- Printer.Close;
- DrvCheck(Printer.Open('SHTRIH-M-OPOS-1'));
- DrvCheck(Printer.OpenResult);
- DrvCheck(Printer.ClaimDevice(0));
- Check(Printer.Claimed, 'Printer.Claimed');
- Printer.ServiceObjectVersion;
- Printer.ServiceObjectDescription;
- Printer.ServiceObjectVersion;
- Printer.DeviceDescription;
- Printer.DeviceName;
- Printer.PowerNotify := 1;
- Printer.DeviceEnabled := True;
- Printer.DeviceEnabled;
- Printer.DescriptionLength;
- Printer.CapPredefinedPaymentLines;
- Printer.PredefinedPaymentLines;
- Printer.DeviceName;
- Printer.Claimed;
- Printer.AsyncMode := False;
- Printer.CheckHealth(1);
-
- DrvCheck(Printer.BeginFiscalReceipt(True));
- Printer.PreLine := 'ÒÐÊ 3: Òðç 0 ';
- DrvCheck(Printer.PrintRecItem('ÀÈ-92-3in', 50.11, 2610, 4, 19.2, ''));
- DrvCheck(Printer.PrintRecSubtotal(0));
- DrvCheck(Printer.PrintRecTotal(50.11, 50.11, '0'));
- DrvCheck(Printer.PrintRecMessage('ÍÄÑ 18% 7.64'));
- DrvCheck(Printer.PrintRecMessage('Îïåðàòîð: ts'));
- DrvCheck(Printer.PrintRecMessage('Òðàíç.: 32114 '));
- DrvCheck(Printer.EndFiscalReceipt(False));
- finally
- Printer.Free;
- end;
-end;
-
-initialization
- RegisterTest('', TFptrServiceTest.Suite);
-
-
-end.
diff --git a/Test/OposConfigTest/OposConfigTest.dof b/Test/OposConfigTest/OposConfigTest.dof
index ff5086985783a352ec9d64e4f54a11d2f4682660..56e54bc12f7828319009ca42103842d2c1ca11d6 100644
--- a/Test/OposConfigTest/OposConfigTest.dof
+++ b/Test/OposConfigTest/OposConfigTest.dof
@@ -134,16 +134,23 @@ OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Test/OposConfigTest/OposConfigTestLib.dof b/Test/OposConfigTest/OposConfigTestLib.dof
index ff5086985783a352ec9d64e4f54a11d2f4682660..56e54bc12f7828319009ca42103842d2c1ca11d6 100644
--- a/Test/OposConfigTest/OposConfigTestLib.dof
+++ b/Test/OposConfigTest/OposConfigTestLib.dof
@@ -134,16 +134,23 @@ OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Test/OposTestTest/OposTestTest.dof b/Test/OposTestTest/OposTestTest.dof
index 561c692b4dd9cbdaf9c67380051b3f5be6141e46..bb62c70dd72f279f1af2ce66dfd0b943b92a9bd5 100644
--- a/Test/OposTestTest/OposTestTest.dof
+++ b/Test/OposTestTest/OposTestTest.dof
@@ -137,16 +137,23 @@ Comments=
[Excluded Packages]
C:\WINDOWS\system32\OO_delphi_bridge.bpl=(untitled)
C:\Program Files\Borland\Delphi7\LibIndy\dclindy70.bpl=Internet Direct (Indy) for D7 Property and Component Editors
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Test/OposTestTest/OposTestTestLib.dof b/Test/OposTestTest/OposTestTestLib.dof
index 561c692b4dd9cbdaf9c67380051b3f5be6141e46..bb62c70dd72f279f1af2ce66dfd0b943b92a9bd5 100644
--- a/Test/OposTestTest/OposTestTestLib.dof
+++ b/Test/OposTestTest/OposTestTestLib.dof
@@ -137,16 +137,23 @@ Comments=
[Excluded Packages]
C:\WINDOWS\system32\OO_delphi_bridge.bpl=(untitled)
C:\Program Files\Borland\Delphi7\LibIndy\dclindy70.bpl=Internet Direct (Indy) for D7 Property and Component Editors
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Test/SmFiscalPrinterTest/SmFiscalPrinterTest.dof b/Test/SmFiscalPrinterTest/SmFiscalPrinterTest.dof
index 857717ad8d16e4db0fe8330ecb73f0a4330f92d7..9096b629c6817a7db7da118d2d47c7a33f116693 100644
--- a/Test/SmFiscalPrinterTest/SmFiscalPrinterTest.dof
+++ b/Test/SmFiscalPrinterTest/SmFiscalPrinterTest.dof
@@ -134,16 +134,23 @@ OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Test/SmFiscalPrinterTest/SmFiscalPrinterTestLib.dof b/Test/SmFiscalPrinterTest/SmFiscalPrinterTestLib.dof
index 7a5025137de5fdad23947200b50ff5bffc56d58b..fdd026a7cf8af9b94128cae7db10738230b8850d 100644
--- a/Test/SmFiscalPrinterTest/SmFiscalPrinterTestLib.dof
+++ b/Test/SmFiscalPrinterTest/SmFiscalPrinterTestLib.dof
@@ -136,16 +136,23 @@ ProductVersion=1.0.0.0
Comments=
[Excluded Packages]
C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\JvControlsDesign70.bpl=JVCL Visual Controls
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Test/SmScaleTest/SmScaleTest.dof b/Test/SmScaleTest/SmScaleTest.dof
index 441b34d608d8d0f9588b16b8be0e9aca6443277d..5f07e4c573d682ffdc9e0b27827a81d21c245bac 100644
--- a/Test/SmScaleTest/SmScaleTest.dof
+++ b/Test/SmScaleTest/SmScaleTest.dof
@@ -134,16 +134,23 @@ OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/Test/SmScaleTest/SmScaleTestLib.dof b/Test/SmScaleTest/SmScaleTestLib.dof
index b5ed1e06da6bba1bb4ba5aaa55058e60bf287d57..2079ecf6110f808d44c22bacda12d3ebd22e1b52 100644
--- a/Test/SmScaleTest/SmScaleTestLib.dof
+++ b/Test/SmScaleTest/SmScaleTestLib.dof
@@ -136,16 +136,23 @@ ProductVersion=1.0.0.0
Comments=
[Excluded Packages]
C:\Program Files\Borland\Delphi7\Bin\QR5DesignD7.bpl=QuickReport 5.02.1 Components Delphi 7
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=C:\Components\DUnit\src\
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=$(DELPHI)\Lib\Debug
+Count=2
+Item0=$(DELPHI)\Lib\Debug;C:\COMPON~1\JVCL\jcl\lib\d7\debug;C:\COMPON~1\jcl\lib\d7\debug
+Item1=$(DELPHI)\Lib\Debug
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=DCU
Item1=..\lib\D7
+[HistoryLists\hlOutputDirectorry]
+Count=1
+Item0=Bin
[HistoryLists\hlBPLOutput]
Count=3
Item0=$(DELPHI)\Bin\
diff --git a/bin/FiscalPrinter.ini b/bin/FiscalPrinter.ini
new file mode 100644
index 0000000000000000000000000000000000000000..3637284fa65a10cdb6c473180529385f21766f6c
--- /dev/null
+++ b/bin/FiscalPrinter.ini
@@ -0,0 +1,135 @@
+[FiscalPrinter_SHTRIH-M-OPOS-1]
+Storage=1
+Header=486561646572206C696E6520310D0A486561646572206C696E6520320D0A486561646572206C696E6520330D0A486561646572206C696E6520340D0A486561646572206C696E6520350D0A486561646572206C696E652036
+Trailer=547261696C6572206C696E6520310D0A547261696C6572206C696E6520320D0A547261696C6572206C696E6520330D0A547261696C6572206C696E652034
+HeaderPrinted=0
+LogoSize=0
+LogoReloadEnabled=0
+LogoCenter=1
+IsLogoLoaded=0
+LogoFileName=
+Department=1
+ZeroReceiptNumber=1
+ConnectionType=0
+RemotePort=7778
+RemoteHost=3139322E3136382E3133372E313131
+PortNumber=56
+BaudRate=115200
+SysPassword=30
+UsrPassword=1
+SubtotalText=535542544F54414C
+CloseRecText=
+VoidRecText=5245434549505420564F49444544
+FontNumber=1
+ByteTimeout=1000
+MaxRetryCount=3
+SearchByPortEnabled=0
+SearchByBaudRateEnabled=1
+PollIntervalInSeconds=5
+DeviceByteTimeout=1000
+StatusInterval=100
+LogFileEnabled=1
+CutType=1
+LogoPosition=0
+NumHeaderLines=6
+NumTrailerLines=4
+HeaderFont=1
+TrailerFont=1
+Encoding=0
+BarLinePrintDelay=100
+StatusCommand=0
+HeaderType=1
+CompatLevel=0
+ReceiptType=0
+ZeroReceiptType=0
+CCOType=0
+TableEditEnabled=1
+XmlZReportEnabled=0
+CsvZReportEnabled=0
+XmlZReportFileName=C:\projects\OPOSShtrih\bin\ZReport.xml
+CsvZReportFileName=C:\projects\OPOSShtrih\bin\ZReport.csv
+LogMaxCount=10
+VoidReceiptOnMaxItems=0
+MaxReceiptItems=100
+JournalPrintHeader=1
+JournalPrintTrailer=1
+CacheReceiptNumber=0
+BarLineByteMode=0
+PrintRecSubtotal=1
+StatusTimeout=60
+SetHeaderLineEnabled=1
+SetTrailerLineEnabled=1
+RFAmountLength=10
+RFQuantityLength=10
+RFSeparatorLine=1
+RFShowTaxLetters=0
+MonitoringPort=50000
+MonitoringEnabled=0
+PropertyUpdateMode=0
+ReceiptReportFileName=C:\projects\OPOSShtrih\bin\ZCheckReport.xml
+ReceiptReportEnabled=0
+ZReceiptBeforeZReport=1
+DepartmentInText=0
+CenterHeader=0
+AmountDecimalPlaces=1
+CapRecNearEndSensorMode=0
+FPSerial=
+LogFilePath=C:\projects\OPOSShtrih\bin\Logs
+ReportDateStamp=0
+FSBarcodeEnabled=0
+FSAddressEnabled=0
+FSUpdatePrice=0
+BarcodePrefix=BARCODE:
+BarcodeHeight=100
+BarcodeType=0
+BarcodeModuleWidth=2
+BarcodeAlignment=0
+BarcodeParameter1=0
+BarcodeParameter2=0
+BarcodeParameter3=0
+XReport=0
+WrapText=1
+WritePaymentNameEnabled=1
+TimeUpdateMode=0
+ReceiptItemsHeader=2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D
+ReceiptItemsTrailer=2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D
+ReceiptItemFormat=253363504F5325202532306C5449544C45252025366C53554D25202A2025365155414E25203D253130544F54414C5F54415825
+RecPrintType=0
+PrintSingleQuantity=1
+TableFilePath=C:\projects\OPOSShtrih\bin\Tables
+VatCodeEnabled=0
+HandleErrorCode=0
+FSServiceEnabled=0
+PrinterProtocol=0
+PrintUnitName=0
+OpenReceiptEnabled=0
+QuantityDecimalPlaces=0
+PingEnabled=0
+DocumentBlockSize=50
+PrintRecMessageMode=1
+EkmServerHost=80.243.2.202
+EkmServerPort=2003
+EkmServerTimeout=5
+EkmServerEnabled=0
+FSMarkCheckEnabled=0
+[FiscalPrinter_SHTRIH-M-OPOS-1_PaymentTypes]
+0=0
+1=1
+2=2
+3=3
+4=4
+5=5
+6=6
+7=7
+8=8
+9=9
+10=10
+11=11
+12=12
+13=13
+14=14
+15=15
+[FiscalPrinter_SHTRIH-M-OPOS-1_VatCodes]
+1=3
+2=2
+4=1
diff --git a/bin/OposStatistics.ini b/bin/OposStatistics.ini
new file mode 100644
index 0000000000000000000000000000000000000000..a99a509affc4d67e70d91dd3679261064563a51e
--- /dev/null
+++ b/bin/OposStatistics.ini
@@ -0,0 +1,24 @@
+[FiscalPrinterSHTRIH-M-OPOS-1]
+HoursPoweredCount=0
+CommunicationErrorCount=0
+BarcodePrintedCount=0
+FormInsertionCount=0
+HomeErrorCount=0
+JournalCharacterPrintedCount=0
+JournalLinePrintedCount=0
+MaximumTempReachedCount=0
+NVRAMWriteCount=0
+PaperCutCount=0
+FailedPaperCutCount=0
+PrinterFaultCount=0
+PrintSideChangeCount=0
+FailedPrintSideChangeCount=0
+ReceiptCharacterPrintedCount=0
+ReceiptCoverOpenCount=0
+ReceiptLineFeedCount=0
+ReceiptLinePrintedCount=0
+SlipCharacterPrintedCount=0
+SlipCoverOpenCount=0
+SlipLineFeedCount=0
+SlipLinePrintedCount=0
+StampFiredCount=0