nun schon recht funktional
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<CursorPos X="11" Y="8"/>
|
<CursorPos X="11" Y="8"/>
|
||||||
<UsageCount Value="27"/>
|
<UsageCount Value="29"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
@@ -18,18 +18,18 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<TopLine Value="10"/>
|
<TopLine Value="112"/>
|
||||||
<CursorPos Y="50"/>
|
<CursorPos X="73" Y="233"/>
|
||||||
<UsageCount Value="27"/>
|
<UsageCount Value="29"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="/usr/share/fpcsrc/3.0.4/rtl/objpas/sysutils/syshelph.inc"/>
|
<Filename Value="/usr/share/fpcsrc/3.0.4/rtl/objpas/sysutils/syshelph.inc"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<TopLine Value="119"/>
|
<TopLine Value="111"/>
|
||||||
<CursorPos X="14" Y="151"/>
|
<CursorPos X="14" Y="151"/>
|
||||||
<UsageCount Value="9"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="/usr/lib/lazarus/1.8.2/lcl/extdlgs.pas"/>
|
<Filename Value="/usr/lib/lazarus/1.8.2/lcl/extdlgs.pas"/>
|
||||||
@@ -81,123 +81,123 @@
|
|||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="115" Column="25" TopLine="61"/>
|
<Caret Line="190" Column="21" TopLine="149"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="58" Column="57" TopLine="17"/>
|
<Caret Line="185" Column="27" TopLine="151"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="101" Column="63" TopLine="61"/>
|
<Caret Line="206" Column="9" TopLine="166"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="109" Column="30" TopLine="69"/>
|
<Caret Line="195" Column="61" TopLine="166"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="208" Column="15" TopLine="199"/>
|
<Caret Line="193" Column="21" TopLine="153"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="214" Column="15" TopLine="199"/>
|
<Caret Line="194" Column="19" TopLine="153"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="241" Column="104" TopLine="199"/>
|
<Caret Line="193" Column="21" TopLine="154"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="97" Column="54" TopLine="40"/>
|
<Caret Line="195" Column="11" TopLine="154"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="75" Column="122" TopLine="35"/>
|
<Caret Line="210" Column="29" TopLine="176"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="18" Column="14" TopLine="5"/>
|
<Caret Line="52" Column="26" TopLine="12"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="102" Column="18" TopLine="69"/>
|
<Caret Line="124" Column="32" TopLine="69"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="105" Column="24" TopLine="64"/>
|
<Caret Line="128" Column="15" TopLine="98"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="9" Column="27"/>
|
<Caret Line="56" Column="27" TopLine="16"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="125" Column="25" TopLine="64"/>
|
<Caret Line="111" Column="28" TopLine="69"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="141" Column="178" TopLine="85"/>
|
<Caret Line="124" Column="23" TopLine="70"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="122" Column="9" TopLine="73"/>
|
<Caret Line="97" TopLine="79"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="123" Column="30" TopLine="68"/>
|
<Caret Line="216" Column="3" TopLine="209"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="125" Column="18" TopLine="83"/>
|
<Caret Line="102" TopLine="46"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="85" Column="5" TopLine="61"/>
|
<Caret Line="104" TopLine="48"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="86" Column="5" TopLine="62"/>
|
<Caret Line="229" Column="112" TopLine="209"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="85" Column="5" TopLine="61"/>
|
<Caret Line="23" Column="29" TopLine="4"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="84" Column="5" TopLine="60"/>
|
<Caret Line="29" Column="80"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="179" TopLine="139"/>
|
<Caret Line="75" Column="128"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="270" TopLine="84"/>
|
<Caret Line="106" Column="12" TopLine="66"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="51" Column="20" TopLine="11"/>
|
<Caret Line="108" Column="26" TopLine="68"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="175" Column="53" TopLine="111"/>
|
<Caret Line="305" Column="38" TopLine="252"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="174" Column="53" TopLine="110"/>
|
<Caret Line="306" Column="6" TopLine="252"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="148" Column="26" TopLine="110"/>
|
<Caret Line="268" Column="157" TopLine="253"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="176" Column="28" TopLine="136"/>
|
<Caret Line="316" Column="106" TopLine="254"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
<Position30>
|
<Position30>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="266" Column="5" TopLine="212"/>
|
<Caret Line="75" Column="30" TopLine="50"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectSession>
|
</ProjectSession>
|
||||||
|
|||||||
134
scanner.lfm
134
scanner.lfm
@@ -1,50 +1,50 @@
|
|||||||
object ScanForm: TScanForm
|
object ScanForm: TScanForm
|
||||||
Left = 1534
|
Left = 1534
|
||||||
Height = 1018
|
Height = 869
|
||||||
Top = 299
|
Top = 299
|
||||||
Width = 1215
|
Width = 1188
|
||||||
Caption = 'Belegscanner'
|
Caption = 'Belegscanner'
|
||||||
ClientHeight = 1018
|
ClientHeight = 869
|
||||||
ClientWidth = 1215
|
ClientWidth = 1188
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '1.8.2.0'
|
LCLVersion = '1.8.2.0'
|
||||||
object TypeSelector: TComboBox
|
object TypeSelector: TComboBox
|
||||||
Left = 344
|
Left = 904
|
||||||
Height = 29
|
Height = 29
|
||||||
Top = 32
|
Top = 208
|
||||||
Width = 216
|
Width = 276
|
||||||
Enabled = False
|
Enabled = False
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnChange = TypeSelectorChange
|
OnChange = TypeSelectorChange
|
||||||
TabOrder = 3
|
TabOrder = 1
|
||||||
Text = 'Select Type'
|
Text = 'Select Type'
|
||||||
end
|
end
|
||||||
object Origin: TComboBox
|
object Origin: TComboBox
|
||||||
Left = 568
|
Left = 904
|
||||||
Height = 29
|
Height = 29
|
||||||
Top = 32
|
Top = 240
|
||||||
Width = 192
|
Width = 272
|
||||||
Enabled = False
|
Enabled = False
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnChange = OriginChange
|
OnChange = OriginChange
|
||||||
TabOrder = 5
|
TabOrder = 3
|
||||||
Text = 'Start'
|
Text = 'Start'
|
||||||
end
|
end
|
||||||
object Destination: TComboBox
|
object Destination: TComboBox
|
||||||
Left = 948
|
Left = 904
|
||||||
Height = 29
|
Height = 29
|
||||||
Top = 32
|
Top = 304
|
||||||
Width = 196
|
Width = 272
|
||||||
Enabled = False
|
Enabled = False
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnChange = DestinationChange
|
OnChange = DestinationChange
|
||||||
TabOrder = 7
|
TabOrder = 5
|
||||||
Text = 'Ziel'
|
Text = 'Ziel'
|
||||||
end
|
end
|
||||||
object FolderName: TLabel
|
object FolderName: TLabel
|
||||||
Left = 344
|
Left = 8
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 64
|
Top = 840
|
||||||
Width = 103
|
Width = 103
|
||||||
Caption = 'Ordnername'
|
Caption = 'Ordnername'
|
||||||
Font.Height = -16
|
Font.Height = -16
|
||||||
@@ -53,86 +53,53 @@ object ScanForm: TScanForm
|
|||||||
ParentFont = False
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object Product: TComboBox
|
object Product: TComboBox
|
||||||
Left = 568
|
Left = 904
|
||||||
Height = 29
|
Height = 29
|
||||||
Top = 32
|
Top = 240
|
||||||
Width = 192
|
Width = 276
|
||||||
Enabled = False
|
Enabled = False
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnChange = ProductChange
|
OnChange = ProductChange
|
||||||
TabOrder = 4
|
TabOrder = 2
|
||||||
Text = 'Produkt'
|
Text = 'Produkt'
|
||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
object ScanButton: TButton
|
object ScanButton: TButton
|
||||||
Left = 664
|
Left = 904
|
||||||
Height = 49
|
Height = 49
|
||||||
Top = 88
|
Top = 400
|
||||||
Width = 112
|
Width = 272
|
||||||
Caption = 'scannen!'
|
Caption = 'scannen!'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
OnClick = ScanButtonClick
|
OnClick = ScanButtonClick
|
||||||
TabOrder = 8
|
TabOrder = 8
|
||||||
end
|
end
|
||||||
object IWidth: TEdit
|
|
||||||
Left = 344
|
|
||||||
Height = 27
|
|
||||||
Top = 88
|
|
||||||
Width = 80
|
|
||||||
Alignment = taRightJustify
|
|
||||||
TabOrder = 0
|
|
||||||
Text = '209'
|
|
||||||
end
|
|
||||||
object Times: TLabel
|
|
||||||
Left = 426
|
|
||||||
Height = 17
|
|
||||||
Top = 93
|
|
||||||
Width = 6
|
|
||||||
Caption = 'x'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object IHeight: TEdit
|
|
||||||
Left = 440
|
|
||||||
Height = 27
|
|
||||||
Top = 88
|
|
||||||
Width = 80
|
|
||||||
TabOrder = 1
|
|
||||||
Text = '297'
|
|
||||||
end
|
|
||||||
object Pixels: TLabel
|
|
||||||
Left = 524
|
|
||||||
Height = 17
|
|
||||||
Top = 93
|
|
||||||
Width = 27
|
|
||||||
Caption = 'px @'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object Resolution: TComboBox
|
object Resolution: TComboBox
|
||||||
Left = 560
|
Left = 904
|
||||||
Height = 29
|
Height = 29
|
||||||
Top = 88
|
Top = 368
|
||||||
Width = 68
|
Width = 120
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
ItemIndex = 0
|
ItemIndex = 0
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'150'
|
'150'
|
||||||
'300'
|
'300'
|
||||||
)
|
)
|
||||||
TabOrder = 2
|
TabOrder = 7
|
||||||
Text = '150'
|
Text = '150'
|
||||||
end
|
end
|
||||||
object DPI: TLabel
|
object DPI: TLabel
|
||||||
Left = 632
|
Left = 1032
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 93
|
Top = 376
|
||||||
Width = 17
|
Width = 17
|
||||||
Caption = 'dpi'
|
Caption = 'dpi'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object BaseFolder: TLabel
|
object BaseFolder: TLabel
|
||||||
Left = 344
|
Left = 8
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 8
|
Top = 816
|
||||||
Width = 88
|
Width = 88
|
||||||
Caption = 'BaseFolder'
|
Caption = 'BaseFolder'
|
||||||
Font.Height = -16
|
Font.Height = -16
|
||||||
@@ -142,31 +109,50 @@ object ScanForm: TScanForm
|
|||||||
OnClick = BaseFolderClick
|
OnClick = BaseFolderClick
|
||||||
end
|
end
|
||||||
object Stop: TComboBox
|
object Stop: TComboBox
|
||||||
Left = 768
|
Left = 904
|
||||||
Height = 29
|
Height = 29
|
||||||
Top = 32
|
Top = 272
|
||||||
Width = 176
|
Width = 272
|
||||||
Enabled = False
|
Enabled = False
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnChange = StopChange
|
OnChange = StopChange
|
||||||
TabOrder = 6
|
TabOrder = 4
|
||||||
Text = 'Zwischenhalt'
|
Text = 'Zwischenhalt'
|
||||||
end
|
end
|
||||||
object Preview: TImage
|
object Preview: TImage
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 800
|
Height = 800
|
||||||
Top = 208
|
Top = 8
|
||||||
Width = 1200
|
Width = 880
|
||||||
Center = True
|
Center = True
|
||||||
Proportional = True
|
Proportional = True
|
||||||
end
|
end
|
||||||
object Calendar: TCalendar
|
object Calendar: TCalendar
|
||||||
Left = 8
|
Left = 904
|
||||||
Height = 190
|
Height = 190
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 324
|
Width = 276
|
||||||
DateTime = 43775
|
DateTime = 43775
|
||||||
OnChange = CalendarChange
|
OnChange = CalendarChange
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object PicSize: TComboBox
|
||||||
|
Left = 904
|
||||||
|
Height = 29
|
||||||
|
Top = 336
|
||||||
|
Width = 272
|
||||||
|
ItemHeight = 0
|
||||||
|
TabOrder = 6
|
||||||
|
Text = '209 x 297 mm'
|
||||||
|
end
|
||||||
|
object DropButton: TButton
|
||||||
|
Left = 904
|
||||||
|
Height = 32
|
||||||
|
Top = 776
|
||||||
|
Width = 276
|
||||||
|
Caption = 'Löschen'
|
||||||
|
Enabled = False
|
||||||
|
OnClick = DropButtonClick
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
end
|
end
|
||||||
object BaseFolderDialog: TSelectDirectoryDialog
|
object BaseFolderDialog: TSelectDirectoryDialog
|
||||||
|
|||||||
81
scanner.pas
81
scanner.pas
@@ -13,28 +13,27 @@ type
|
|||||||
{ ScanThread }
|
{ ScanThread }
|
||||||
ScanThread = class(TThread)
|
ScanThread = class(TThread)
|
||||||
private
|
private
|
||||||
btn : TButton;
|
dbtn, sbtn : TButton;
|
||||||
folder,w,h,r :String;
|
folder,r :String;
|
||||||
|
s:TPoint;
|
||||||
p:TImage;
|
p:TImage;
|
||||||
protected
|
protected
|
||||||
procedure Execute; override;
|
procedure Execute; override;
|
||||||
public
|
public
|
||||||
constructor Create(button: TButton; dir: String; width: String; height: String; resolution: String; preview: TImage);
|
constructor Create(scanButton: TButton; dir: String; size: TPoint; resolution: String; preview: TImage; dropButton: TButton);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TScanForm }
|
{ TScanForm }
|
||||||
TScanForm = class(TForm)
|
TScanForm = class(TForm)
|
||||||
|
DropButton: TButton;
|
||||||
Calendar: TCalendar;
|
Calendar: TCalendar;
|
||||||
|
PicSize: TComboBox;
|
||||||
Preview: TImage;
|
Preview: TImage;
|
||||||
Stop: TComboBox;
|
Stop: TComboBox;
|
||||||
DPI: TLabel;
|
DPI: TLabel;
|
||||||
BaseFolder: TLabel;
|
BaseFolder: TLabel;
|
||||||
Resolution: TComboBox;
|
Resolution: TComboBox;
|
||||||
IHeight: TEdit;
|
|
||||||
Pixels: TLabel;
|
|
||||||
BaseFolderDialog: TSelectDirectoryDialog;
|
BaseFolderDialog: TSelectDirectoryDialog;
|
||||||
Times: TLabel;
|
|
||||||
IWidth: TEdit;
|
|
||||||
ScanButton: TButton;
|
ScanButton: TButton;
|
||||||
Product: TComboBox;
|
Product: TComboBox;
|
||||||
Destination: TComboBox;
|
Destination: TComboBox;
|
||||||
@@ -43,6 +42,7 @@ type
|
|||||||
TypeSelector: TComboBox;
|
TypeSelector: TComboBox;
|
||||||
|
|
||||||
procedure BaseFolderClick(Sender: TObject);
|
procedure BaseFolderClick(Sender: TObject);
|
||||||
|
procedure DropButtonClick(Sender: TObject);
|
||||||
procedure CalendarChange(Sender: TObject);
|
procedure CalendarChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure ProductChange(Sender: TObject);
|
procedure ProductChange(Sender: TObject);
|
||||||
@@ -58,6 +58,7 @@ type
|
|||||||
procedure MixLocations(d1: TComboBox; d2: TComboBox; d3: TComboBox);
|
procedure MixLocations(d1: TComboBox; d2: TComboBox; d3: TComboBox);
|
||||||
private
|
private
|
||||||
date: TDateTime;
|
date: TDateTime;
|
||||||
|
function getSize(): TPoint;
|
||||||
public
|
public
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@@ -71,12 +72,12 @@ implementation
|
|||||||
|
|
||||||
{ ScanThread }
|
{ ScanThread }
|
||||||
|
|
||||||
constructor ScanThread.Create(button: TButton; dir: String; width: String; height: String; resolution: String; preview: TImage);
|
constructor ScanThread.Create(scanButton: TButton; dir: String; size: TPoint; resolution: String; preview: TImage; dropButton: TButton );
|
||||||
begin
|
begin
|
||||||
btn := button;
|
sbtn := scanButton;
|
||||||
|
dbtn := dropButton;
|
||||||
folder:=dir;
|
folder:=dir;
|
||||||
w:=width;
|
s:=size;
|
||||||
h:=height;
|
|
||||||
r:=resolution;
|
r:=resolution;
|
||||||
p:=preview;
|
p:=preview;
|
||||||
inherited Create(false);
|
inherited Create(false);
|
||||||
@@ -92,18 +93,31 @@ begin
|
|||||||
num := 0;
|
num := 0;
|
||||||
repeat
|
repeat
|
||||||
num := num +1;
|
num := num +1;
|
||||||
fname := '/scan_';
|
fname := 'scan_';
|
||||||
if (num<10) then fname:=fname+'0';
|
if (num<10) then fname:=fname+'0';
|
||||||
fname := fname+IntToStr(num)+'.jpg';
|
fname := fname+IntToStr(num)+'.jpg';
|
||||||
until not FileExists(folder+fname);
|
until not FileExists(folder+fname);
|
||||||
fpSystem('scanimage -x '+w+' -y '+h+' --mode Color --resolution '+r+' --format jpeg > "'+folder+fname+'"');
|
fpSystem('scanimage -x '+IntToStr(s.x)+' -y '+IntToStr(s.y)+' --mode Color --resolution '+r+' --format jpeg > "'+folder+fname+'"');
|
||||||
try
|
try
|
||||||
pic:=TPicture.Create;
|
pic:=TPicture.Create;
|
||||||
pic.LoadFromFile(folder+fname);
|
pic.LoadFromFile(folder+fname);
|
||||||
p.Picture:=pic;
|
p.Picture:=pic;
|
||||||
|
p.Hint:=folder+fname;
|
||||||
finally
|
finally
|
||||||
end;
|
end;
|
||||||
btn.Enabled:=true;
|
dbtn.Hint:=folder+fname;
|
||||||
|
dbtn.Caption:=fname+' löschen';
|
||||||
|
dbtn.Enabled:=true;
|
||||||
|
sbtn.Enabled:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function allowed(s: String): boolean;
|
||||||
|
begin
|
||||||
|
Result := true;
|
||||||
|
if (s = '') then Result := false;
|
||||||
|
if (s = 'Start') then Result := false;
|
||||||
|
if (s = 'Ziel') then Result := false;
|
||||||
|
if (s = 'Zwischenhalt') then Result := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TScanForm.MixLocations(d1: TComboBox; d2: TComboBox; d3: TComboBox);
|
procedure TScanForm.MixLocations(d1: TComboBox; d2: TComboBox; d3: TComboBox);
|
||||||
@@ -112,9 +126,9 @@ var
|
|||||||
begin
|
begin
|
||||||
list := TStringList.Create;
|
list := TStringList.Create;
|
||||||
list.Sorted := True;
|
list.Sorted := True;
|
||||||
d1.Items.Add(d1.Text);
|
if (allowed(d1.Text)) then d1.Items.Add(d1.Text);
|
||||||
d2.Items.Add(d2.Text);
|
if (allowed(d2.Text)) then d2.Items.Add(d2.Text);
|
||||||
if not (d3.Text = '') then d3.Items.Add(d3.Text);
|
if (allowed(d3.Text)) then d3.Items.Add(d3.Text);
|
||||||
list.Assign(d1.Items);
|
list.Assign(d1.Items);
|
||||||
list.AddStrings(d2.Items);
|
list.AddStrings(d2.Items);
|
||||||
list.AddStrings(d3.Items);
|
list.AddStrings(d3.Items);
|
||||||
@@ -129,6 +143,7 @@ begin
|
|||||||
Result := Result + 'items:' + ExportOptions(Product) + #13;
|
Result := Result + 'items:' + ExportOptions(Product) + #13;
|
||||||
MixLocations(Origin, Destination, Stop);
|
MixLocations(Origin, Destination, Stop);
|
||||||
Result := Result + 'locations:' + ExportOPtions(Origin) + #13;
|
Result := Result + 'locations:' + ExportOPtions(Origin) + #13;
|
||||||
|
Result := Result + 'sizes:' + ExportOptions(PicSize) +#13;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TScanForm.ExportOptions(dropDown: TComboBox): string;
|
function TScanForm.ExportOptions(dropDown: TComboBox): string;
|
||||||
@@ -184,14 +199,30 @@ begin
|
|||||||
UpdateFolder();
|
UpdateFolder();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TScanForm.getSize(): TPoint;
|
||||||
|
var
|
||||||
|
arr: TStringArray;
|
||||||
|
s: String;
|
||||||
|
w, h: Integer;
|
||||||
|
begin
|
||||||
|
s:=PicSize.Text;
|
||||||
|
arr:=s.Split(['x','m']);
|
||||||
|
w:=StrToInt(arr[0].Trim);
|
||||||
|
h:=StrToInt(arr[1].Trim);
|
||||||
|
PicSize.Caption:=IntToStr(w)+' x '+IntToStr(h)+' mm';
|
||||||
|
Result := TPoint.Create(w,h);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TScanForm.ScanButtonClick(Sender: TObject);
|
procedure TScanForm.ScanButtonClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
config: TFileStream;
|
config: TFileStream;
|
||||||
filename: string;
|
filename: string;
|
||||||
json: string;
|
json: string;
|
||||||
|
size: TPoint;
|
||||||
begin
|
begin
|
||||||
ScanButton.Enabled:=false;
|
ScanButton.Enabled:=false;
|
||||||
filename := GetEnvironmentVariable('HOME') + '/.config/belegscanner.conf';
|
filename := GetEnvironmentVariable('HOME') + '/.config/belegscanner.conf';
|
||||||
|
size := getSize();
|
||||||
json := ExportConfig();
|
json := ExportConfig();
|
||||||
try
|
try
|
||||||
config := TFilestream.Create(filename, fmCreate);
|
config := TFilestream.Create(filename, fmCreate);
|
||||||
@@ -199,7 +230,7 @@ begin
|
|||||||
finally
|
finally
|
||||||
config.Free;
|
config.Free;
|
||||||
end;
|
end;
|
||||||
ScanThread.Create(ScanButton,BaseFolder.Caption+FolderName.Caption,IWidth.Caption,IHeight.Caption,Resolution.Caption,Preview);
|
ScanThread.Create(ScanButton,BaseFolder.Caption+FolderName.Caption+'/',size,Resolution.Caption,Preview,DropButton);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TScanForm.StopChange(Sender: TObject);
|
procedure TScanForm.StopChange(Sender: TObject);
|
||||||
@@ -245,6 +276,11 @@ begin
|
|||||||
line := line.Substring(6);
|
line := line.Substring(6);
|
||||||
Product.Items.AddStrings(line.Split(','));
|
Product.Items.AddStrings(line.Split(','));
|
||||||
end;
|
end;
|
||||||
|
if line.StartsWith('sizes:') then
|
||||||
|
begin
|
||||||
|
line := line.Substring(6);
|
||||||
|
PicSize.Items.AddStrings(line.Split(','));
|
||||||
|
end;
|
||||||
if line.StartsWith('locations:') then
|
if line.StartsWith('locations:') then
|
||||||
begin
|
begin
|
||||||
line := line.Substring(10);
|
line := line.Substring(10);
|
||||||
@@ -264,13 +300,20 @@ begin
|
|||||||
BaseFolder.Caption := BaseFolderDialog.FileName;
|
BaseFolder.Caption := BaseFolderDialog.FileName;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TScanForm.DropButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DeleteFile(DropButton.Hint);
|
||||||
|
Preview.Picture:=nil;
|
||||||
|
DropButton.Enabled:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TScanForm.UpdateFolder();
|
procedure TScanForm.UpdateFolder();
|
||||||
var
|
var
|
||||||
tx: string;
|
tx: string;
|
||||||
begin
|
begin
|
||||||
tx := FormatDateTime('YYYY', date) + '/' + FormatDateTime('YYYY-MM-DD', date) + ' - ';
|
tx := FormatDateTime('YYYY', date) + '/' + FormatDateTime('YYYY-MM-DD', date) + ' - ';
|
||||||
if (Product.Enabled and (Product.Tag > 0)) then
|
if (Product.Enabled and (Product.Tag > 0) and not( Product.Text = '') and not (Product.Text = 'Produkt')) then
|
||||||
tx := tx + Product.Text + ' von ';
|
tx := tx + Product.Text + ' von ';
|
||||||
if (TypeSelector.Tag > 0) then
|
if (TypeSelector.Tag > 0) then
|
||||||
tx := tx + TypeSelector.Text;
|
tx := tx + TypeSelector.Text;
|
||||||
|
|||||||
Reference in New Issue
Block a user