Smart DB User Manual
Smart DB User Manual
Smart DB
User Manual
TABLE OF CONTENTS
1 Introduction ·······································································································7
1.1 System Requirements ·················································································· 7
1.2 Program Structure ······················································································· 7
2 Program Start·····································································································9
2.1 Execute Program ························································································ 9
2.2 Create New Project ···················································································· 10
2.3 Input Data ································································································ 12
2.4 Edit Data ································································································· 15
2.5 Print ······································································································· 16
3 Main Function ·································································································· 18
3.1 Create New Project ···················································································· 18
3.2 Create / Modify Database ············································································ 19
3.2.1 Auto Create Database···································································· 19
3.2.2 Manual Create Database ································································ 19
3.3 Connect ODBC ························································································· 23
3.4 Save Project····························································································· 26
3.5 Open Project ···························································································· 26
3.6 Input Data ································································································ 26
3.7 Edit Image ······························································································· 27
3.8 Select Data ······························································································ 31
3.9 Print ······································································································· 32
3.10 Change Printed Data ·················································································· 34
3.11 Use the Conditional Formula ········································································ 34
4 Ribbon bar ······································································································ 36
4.1 Home tab································································································· 36
4.1.1 Project ························································································ 36
4.1.2 Print ··························································································· 36
4.1.3 Mark ·························································································· 36
4.1.4 Display ······················································································· 37
4.1.5 Search························································································ 37
4.1.6 Card··························································································· 38
4.1.7 Design ························································································ 39
4.2 File tab ···································································································· 39
4.2.1 New ··························································································· 39
4.2.2 Save ·························································································· 39
4.2.3 Open ·························································································· 39
4.2.4 Close ························································································· 39
4.2.5 Print ··························································································· 39
4.2.6 DataBase ···················································································· 40
4.2.7 Print History ················································································· 44
4.2.8 Exit ···························································································· 44
4.3 Database Tap ··························································································· 45
4.3.1 Connection ·················································································· 45
4.3.2 Setting ························································································ 45
4.3.3 DB Security ················································································· 46
4.3.4 Card··························································································· 46
4.4 Options tab ······························································································ 47
4.4.1 Language ···················································································· 47
4.4.2 Plugins ······················································································· 47
4.5 Help tab ·································································································· 51
4.5.1 Manual ······················································································· 51
4.5.2 About ························································································· 51
APPENDIX
1 Plugin············································································································· 52
1.1 Plugin Registration ···················································································· 52
1.2 Plugin Development ··················································································· 53
1.2.1 Plugin Functions ··········································································· 53
1.2.2 Plugin Structure ············································································ 55
1.2.3 Plugin Class ················································································ 58
1.3 Usage of RF_ Plugin_Mifare1k.dll ································································· 64
1.3.1 SmartDB Configuraion ··································································· 64
1.3.2 INI File Configuration ····································································· 65
1.3.3 Data Encoding ············································································· 67
Figure
7
Field
C Field
Smart Smart Data
S :
Design DB Base
D
Field
Field
8
2 Program Start
Usage of this program will be introduced in this chapter briefly.
9
It shows data which is connected to CSD field and DB field.
④ Preview
It shows preview image. If a document has single side, it shows only front side. If a
document has both sides, it shows another tap for the back of the document.
When select the tap, it will present preview image of back side.
⑤ CSD fields / DB fields
When you select a CSD field tap, it shows field information of the CSD file opened.
When you select DB field tap, it shows recorded information of Database.
③ Click upper “…” button and open the saved CSD file. When you select a CSD file,
Project Name will be changed as the CSD file name.
④ Click lower "..." button and select the path where the new project is saved in.
⑤ “Auto Create Database” is the function which creates and connects database
automatically according to CSD fields when you make new project.
Select CSD file and mark Auto Create Database Check box. Click OK.
10
Figure 4 Connect Fields
⑥ Above image shows how CSD fields and Database(DB) are connected. Database
is created and connected automatically according to CSD fields because “Auto
Create Database” is activated.
In “CSD Fields” column, the blue color section is “Field Name” of the CSD file. Pink
color section is print record fields, and these sections are used in SmartDB. Yellow
color section is Image field. In case there are connected CSD field images, it will
be created automatically.
When “Do you want to connect fields?” window appears, select Yes to connect
CSD fields with DB fields.
After CSD fields are connected to DB fields, the program will be changed as Fig. 5.
11
Figure 5 After DB connection
CSD preview will be shown on the right side and CSD fields and DB fields will be
displayed.
⑦ From now on, you can input and edit data.
SmartDB manages projects as the unit of directories. So a directory is created as
“Project Name” on appointed “Project Location” and all files will be copied in the
folder.
12
Figure 6 Add Data
If you click Image Field when USB Camera is connected to PC, Capture button will be
activated on the right side. Click activated Capture button, and then camera view
window appears like Fig. 7.
Click Capture button in the window, then program will save the image as Fig. 8.
If Plugin is installed in SmartDB program folder, the buttons will be displayed as plugin
names like figure 9. Click a button and execute plugin so that you can import an image.
Please refer to Appendix – Plugin part.
13
To print the data in Add Card window, Click Print & Continue button.
To save data and keep the current window, click Save & Close button.
To save data and close the current window, click Save & Continue button.
To clear whole data in current window, click Clear button.
To close the window without save, click Close button.
14
Figure 12 After Adding Data
If you add a card, the new data is updated on the screen as Figure 12.
Selected data is updated through data field and it is displayed in preview section.
Click Edit in Home tab or Database tab. Then it will be displayed as Fig. 13.
Double-click the column to edit. Then input data directly to the column as Fig. 14.
15
Figure 14 Direct Input in Column
2.5 Print
Connect a card printer to PC before printing.
① To print, select the data as Fig.15 and click Print button in Home tab or File tab.
16
② Figure 16 shows available printer which is connected PC or network
The printers which have a word “USB” on the lists are connected to PC directly.
The printers which names start with IP address are connected to network.
Choose a printer and click Confirm button.
Figure 18 Printing
The white background means the data which is ready to print. The green color
means under printing. After finish the printing, the color will be changed to yellow. If
there is an error during the printing, it will be changed to red color. Even though it
is under printing, you can add more data to print.
17
Figure 19 After Printing
3 Main Function
The main function will be explained in this chapter.
⑩ Click upper “…” button and open the saved CSD file. When you select a CSD file,
Project Name will be changed as the CSD file name.
⑪ Click lower "..." button and select the path where the new project is saved in.
18
⑫ “Auto Create Database” is the function which creates and connects database
automatically according to CSD fields when you make new project.
If it is connected with the existing database, you have to remove the mark in this
section.
⑬ Project file will be generated as *.csp in the folder under the directory which set on
“Project Location”.
In “CSD Fields” column, the blue color section is field name of the CSD file.
Pink color section is the print record field, and these are used in SmartDB.
Yellow color section is Image field. If there is connected image in SmartDB, it
will add “_CONFIG” in the last part of the field name and will be created.
If “Do you want to connect field?” box appears, click Yes to connect
CSD field name and DB field name automatically.
19
create database manually or connect to current ODBC.
Click Database tab and Connect MDB button. Then “MDB Management”
window will be displayed as Fig. 22.
“MDB Name” means that created MDB file name and you can change it.
“Table Name” means that created table name in MDB file and you can also
change it.
DB table structure will be created according to CSD file field structure.
② Click Create button, DB will be created as setting. It will be connected with
CSD file’s fields automatically as below.
20
Figure 24 Connect Fields
③ Click Yes, then CSD file fields and DB fields will be linked.
Click No, then fields will not be synchronized.
② Input MDB name and click OK button, “MDB Table Management” window will
displayed as Fig. 26.
21
Figure 26 MDB Table Management
Selected table structure of MDB file will be displayed on the left list and you
can create, edit and remove the table.
22
When you click Create button, a question message will pop up.
To create it, click OK.
23
① Click Database tab and Connect ODBC button. Then “Select ODBC Data
Source” window will be displayed as Fig. 31.
On the left side, you can see the data format which is available to connect.
If you click ODBC Manager button, then “ODBC Data Source Administrator” window
will be displayed as Fig. 32.
If you click Select Table button after select one source, you can see the different
window as per each source.
SMART Test data source is created from ODBC original administrator. Click Select
Table button, then “Available Tables and Views” window will be displayed and you can
select table or view.
24
Figure 33 Select ODBC Data Source
Click Connect Fields button after selecting a table, then Fig. 34 will be displayed.
If select a MDB file and click OK button then table or window will be displayed.
25
Thereafter it will run through same process as described before.
26
Figure 37 Add Data
If you click Capture button, you can use the images which are in USB Camera
connected to PC.
To save data and keep the current window, click Save & Close button.
To save data and close the current window, click Save & Continue button.
To clear whole data in current window, click Clear button.
To close the window without save, click Close button.
27
Double-click a point of indicated field in preview screen on the right side, then “Image
Edit” window will be displayed. Or double-clicking image field on “CSD fields” on the
bottom will be the same.
In “Image Edit” window, there are many simple and useful tools for editing images.
Brightness, Contrast, Zoom and Rotate functions are included from the top
Drag
28
Figure 41 Edit Brightness
If contrast value is close to “0” then image will be more blur, on the contrary, if it is
close to “100” then the image will be shaper.
Image can be rotated by 90, 180, 270, 360 degrees through Rotate function.
29
Figure 44 Image Rotation
Auto Portrait is the function to find the face in the Image automatically.
Click Auto Portrait check box, then the image is focused on the face and adjusts the
size and position properly.
Auto Effect is the function to adjust the brightness and contrast in a picture
automatically. Click Auto Effect check box, then brightness and contrast is adjusted
properly.
30
If click Apply or Apply All button, you can see modified image on preview.
When you modify the image, modified value will be set as Fig. 48.
31
Figure 49 Select data
3.9 Print
① Select data to print edited cards.
② Click Print button in File tab or Home tab.
③ You can see the printer lists which are connected to PC or Network – Fig. 50
The printers which have a word “USB” on the lists are connected to PC directly.
The printers which names start with IP address are connected to network.
Select a printer on the list, and click Confirm button.
32
Figure 51 Print Standby
⑤ Figure 51 shows printer spooler window.
If there is several print data, you can click Use Printer Spool check box, so that
continually you can print several data to save time.
Click Print button, then all data on the lists will be printed.
The white background means the data which is ready to print. The green color
means under printing. After finish the printing, the color will be changed to yellow. If
there is an error during the printing, it will be changed to red color. Even though it
is under printing, you can add more data to print.
⑥ If you click Stop button, it will stop all procedure after current printing data is done.
If you click Close button, it will close the window after current printing data is done.
SmartDB will stay “Standby” mode if there are the data which are spooling or
printing.
If you click Remove Printed Card button, Yellow color data that means printing is
done will be removed.
If you click Reset failed Card button, it will retry to print Red color data that means
33
there was an error during printing.
Figure 53 Results
First section defines the connecting method of conditional option, if there are more
than two conditions, it will define the relations of two conditions.
34
The earlier condition and new input
AND
condition are satisfied both of them.
The earlier condition or new input condition
OR
is satisfied.
For example, If you want to find data which includes “Der”, you can find it as Fig. 55.
35
4 Ribbon bar
The top of the program, at the bottom of the ribbon tab, ribbon bar is located.
4.1.1 Project
4.1.1.1 New
4.1.1.2 Open
4.1.1.3 Save
4.1.2 Print
4.1.2.1 Print
4.1.3 Mark
4.1.3.1 Printed
36
4.1.3.2 Unprinted
This button set selected data as unprinted data so that you can print the data
again.
4.1.4 Display
4.1.5 Search
4.1.5.1 Printed
4.1.5.2 Unprinted
4.1.5.3 Text
37
Figure 57 find matched card
To find specified data, click Find button after filling text box.
4.1.5.4 Position
To find specified position, click Find button after filling data position.
4.1.6 Card
4.1.6.1 Add
4.1.6.2 Edit
38
Figure 59 Editing Data
4.1.6.3 Delete
This button deletes the selected cards. If you removed data once, it could not
be recovered. So please be careful to use this button.
4.1.7 Design
4.1.7.1 Edit
This button executes SmartDesign program to modify the used CSD file in the
program.
4.2.1 New
After close existed project, create new project from designed CSD file.
4.2.2 Save
Save current project setting.
4.2.3 Open
After close existed project, load the saved project file.
4.2.4 Close
Close the opened project.
4.2.5 Print
39
4.2.5.1 Print
Print a selected card. Please refer to Chapter 3.9
4.2.6 DataBase
4.2.6.1 Import data from ODBC
Through ODBC, you can input data from the other DB
When execute menu, the window like Fig. 60 “Select ODBC Data
source” will be displayed.
40
Structure of selected data source on the left of screen is displayed.
Connect ODBC field item to DB field.
If the connecting is done, click Import button.
You can check the bottom of screen and there will be descriptions of
analyzed contents of excel file.
First line is field name. In fact, data will be imported from second line.
The field name and selected data from list of bottom will be
displayed on the right side of screen.
On the left side of screen, you can check DB field name and you can
41
select excel file in “Excel fields” topic on the right side.
To Connect DB fields and excel fields, click Import button.
All of data fields and data in the project will be displayed at the
42
bottom of the screen and selected data from list will be displayed
with field name on the upper right.
DB field name and created MDB field name will be displayed on the
upper left.
If you double-click “MDB Fields”, you can modify contents.
Image data will be saved to MDB from the OLE object type.
The number of all data will be shown on the upper screen. All fields
will be created.
“Table” sets the name of created table on MDB. Basically current
project name is determined.
Click Export button, and specify location of MDB file and name. If
you specify MDB file name, project data will be recorded immediately.
All of data fields and data from project will be shown at the bottom of
the screen. You can check selected data on the upper right of the
screen. Also you can check DB field name and field name in excel
file on the upper left side. If you double-click “Excel Fields”, you can
edit contents.
43
“Total records” and “Extra Fields” will be shown on the upper screen.
When “Extra Fields” is activated, hided fields (print results field, print
history field, image field, modify history field) will be recorded in an
excel file.
“Image directory” column defines the directory which is recorded
image file in. It will create the specified excel file name which is
saved to sub-directory.
If you click Export button, it will set the location and name of
exported excel file. If you set an excel file name, project data will be
record in an excel file.
Print history will be recorded print time, date, used printer ID, results of
printer, and simple information of error, error code and information of
used data.
4.2.8 Exit
Exit the program. If you change the structure of project to exit the
program, you have to save before you exit the program.
44
4.3 Database Tap
4.3.1 Connection
4.3.1.1 Connect MDB
You can connect MDB file. Please refer to Chapter 3.2.2
4.3.1.3 Disconnect
This function is to disconnect database.
If the database is disconnected, data and information will be disappeared.
4.3.2 Setting
4.3.2.1 Field Setting
When it is connected to database, a connection is composed between CSD
field and database.
DB field which connects with CSD field appears on the left side and you can
change DB field, on the right side, also you can check data in current DB
Fields.
45
increased more and more. At that time, “Compact and Recovery” function is
able to use and through this function useless space can be removed.
4.3.3 DB Security
4.3.3.1 Password
You can set a password in MDB of project.
Click Password button, “Password Configuration” window is displayed.
Click OK button after input the same password that you want in the “New
Password” and “Confirm Password”, then password is set.
4.3.4 Card
4.3.4.1 Add
This button adds new data. Please refer to Chapter 2.3.
46
Figure 71 Add Card
4.3.4.2 Edit
This button edits selected data. Please refer to Chapter 2.4.
4.3.4.3 Delete
This button deletes the selected cards. If you removed data once, it could not
be recovered. So please be careful to use this button.
4.4.2 Plugins
47
Figure 73 Select Capture Plugins
If you select plugin and click, “Set Contact Card Encoding” window is
displayed.
To use contact card encoding, click Use Contact Card Plugin Encoding
check box. Click Encoding check box in field to encode.
If you click Setup button, “Contact_Plugin_Sample.ini” file is open.
You can configure options of contact card encoding field. Now only sample is
provided in contact card encoding, so field is empty. For further information,
please refer to Appendix.1
48
Figure 75 Contact Plugins Option
If you select plugin and click, “Set Contactless Card Encoding” window is
displayed.
You can configure options of contactless card encoding field. Now only Mifare
49
1K is provided in contactless card encoding. For further information, please
refer to Appendix.1
50
4.5 Help tab
4.5.1 Manual
4.5.1.1 Manual
This SmartDB user manual will be open.
4.5.2 About
4.5.2.1 About
Introduce program version, information etc.
51
APPENDIX
1 Plugin
Other functions besides basic functions in SmartDB are supported as Plugin type.
If you make a file according to SmartDB plugin regulation, the plugin can be used in
SmartDB.
Figure 81 No plugin.dll
After copying plugin files like Figure 75 and restart SmartDB, the plugins are registered
automatically and plugin buttons are activated.
52
Figure 83 Plugin Auto-Registration
① GetPluginInfo()
This function gets plugin information.
Parameter * pInfo
Structure pointer for the information of plugin.
Please see the explanation of SPI_INFO below.
Return 0 : Success
Others : Fail
② StartPlugin()
This function begins plugin action.
53
int WINAPI StartPlugin(HANDLE hDone, SPI_VDATA* pInput, int
nSize)
Parameter hDone
An event handler for alarming to SmartDB after image
capture is done.
If bUseEvent of SPI_INFO is false, hDone will be NULL and
there is no event after capture is done.
But all the capture process should be done in SPI_Start
function.
If bUseEvent of SPI_INFO is true and Plugin action is done,
you should generate an event using hDone handle.
generate an event like below code.
::SetEvent( hDone );
nSize
Size of structure of SPI_VDATA to get from SmartDB
Return 0 : Success
Others : Fail
③ EndPlugin()
This function finishes plugin action.
Parameter *pOutput
A pointer of SPI_VDATA to send to SmartDB when plugin
action is finished.
54
nSize
Size of structure of SPI_VDATA to send to SmartDB
Return 0 : Success
Others : Fail
① SPI_INFO
This structure shows the information of plugin.
typedef struct
{
WCHAR szName[64]; // The name of plugin
WCHAR szDesc[256]; // The description of plugin
int nClassId; // Class information of plugin
BOOL bUseEvent; // Check if event handle use or not
int nTimeOut; // Timeout of plugin
BYTE reserved[56];
} SPI_INFO;
55
#define SPI_CLASS_CONTACT_CARD 0x00000010
#define SPI_CLASS_CONTACTLESS_CARD 0x00000100
bUseEvent sets whether event handler to alarm that plugin action is done
is used or not. If the value is TRUE, StartPlugin() can get event
handler. If it is FALSE, plugin action should be done in StartPlugin
function.
② SPI_VDATA
SPI_VDATA is the variable size structure that plugin function and
SmartDB sends and gets. The input/output data of this structure
depends on the class of plugin.
Please see the explanation of class of plugin below.
typedef struct
{
int nVersion; // Version of SPI_VDATA
int nTotalSize; // Total size of structure includes header and data
int nFields; // number of fields
SPI_VDATA_VFIELD field[nFields];
} SPI_VDATA;
56
nVersion is the version of SPI_VDATA. Now version is 1.
typedef struct
{
WCHAR szName[32]; // Name of Field
int nType; // Type of Field
int nSize; // size of Field
BYTE value[nSize]; // Field Data to input
} SPI_VDATA_VFIELD;
nType nSize
SPI_FIELD_DATATYPE_INT 4
57
SPI_FIELD_DATATYPE_STRING Size of string including
2Byte NULL
① SPI_CLASS_IMAGEACQUISITION
If nClassId is SPI_CLASS_IMAGEACQUISITION, the pointer *pInput
and *pOutput is defined as below.
[*pInput]
There is no field data to get from SmartDB in SPI_CLASS_IMAGE
ACQUISITION. The value is NULL in StartPlugin() function.
[*pOutput]
EndPlugin() function send the path of captured image to SmartDB.
You should input the path and data of captured image in *pOutput.
SPI_VDATA *pOutput
nVersion 1
nFields 1
nType SPI_FIELD_DATATYPE_STRING
58
Input the total size of SPI_DATA including version information.
Input 1 in nFields because the path of captured image is used as
one field.
Input Wide String L”ImageCap” including NULL in field[0].szName.
Input SPI_FIELD_DATATYPE_STRING in field[0].nType because the path
of captured image is string type.
Input the size of value including NULL(2Byte).
SPI_VDATA *pOutput
nVersion 1
nTotalSize 110
nFields 1
nType SPI_FIELD_DATATYPE_STRING
nSize 26
value L”C:\\image.bmp”
[Pseudocode]
int WINAPI GetPluginInfo(SPI_INFO* pInfo)
{
//Input the information of Plugin
pInfo->szName = L”Capture plugin”;
pInfo->nClassid = SPI_CLASS_IMAGEACQUISITION;
pInfo->nTimeOut = 0;
pInfo->bUseEvent = false;
return nres;
}
59
int WINAPI StartPlugin(HANDLE evtDone, SPI_VDATA* pInput, int nSize)
{
//Capture Image and Save the path of image
GetCaptureImage();
SaveImagePath();
return nres;
}
② SPI_CLASS_CONTACT_CARD,
SPI_CLASS_CONTACTLESS_CARD
If nClassId is SPI_CLASS_CONTACT_CARD / SPI_CLASS_CONT
ACTLESS_CARD, the pointer *pInput and *pOutput is defined as below.
[*pInput]
You can get the data about Smart Card encoding in SmartDB through
*pInput.
SPI_VDATA *pInput
nVersion 1
60
nFields 1+k
nType SPI_FIELD_DATATYPE_RAW
nSize 4
…… ……
//Definition
typedef int (*PFN)(int , DWORD , BYTE* , DWORD* , BYTE* );
61
The field data to get from SmartDB begins field[1].
Input the name of 1st field in field[1].szName.
Input the type of 1st field in field[1].nType.
Input the size of 1st field in field[1].nSize.
Input the field data to get from SmartDB in field[1].value.
If there are more than 2 fields from SmartDB, 2nd field data is
entered in field[2]. In this way, k numbers of fields are entered and
send to plugin function through *pInput pointer.
SPI_VDATA *pInput
nVersion 1
nTotalSize 170
nFields 2
nType SPI_FIELD_DATATYPE_RAWDATA
nSize 4
nType SPI_FIELD_DATATYPE_STRING
nSize 10
value “John”
[*pOutput]
There is no field data to send to SmartDB in Contact/Contactless card
encoding. The value is NULL in EndPlugin() function.
62
[Pseudocode]
63
1.3 Usage of RF_ Plugin_Mifare1k.dll
SmartDB provides plugin DLL of SPI_CLASS_CONTACTLESS_CARD for encoding
Mifare1K of contactless card encoding. Please set the fields to encode in SmartDB
and input the information of encoding Mifare.
To use contactless card encoding, click Use Contactless Card Plugin Encoding
check box. Click Encoding check box in field to encode.
In above Figure, NAME and ID fields are checked, so *pInput data of SPI_VDATA
is as below.
SPI_VDATA *pInput
64
nVersion 1
nTotalSize 256
nFields 3
nType SPI_FIELD_DATATYPE_RAWDATA
nSize 4
nType SPI_FIELD_DATATYPE_STRING
nSize 10
value “John”
nType SPI_FIELD_DATATYPE_STRING
nSize 14
value L”201302”
65
Basically, Contactless_Plugin_Mifare1k.ini file is defined as below.
Contactless_Plugin_Mifare1K.ini
[Information]
PlugIn=RF_Plugin_Mifare1k.dll
CardType=Mifare1k
[Field1]
Field=NAME
Area=block25.0-block25.15
KeyAB=A
Key=FF FF FF FF FF FF
Configuration value for encoding in DLL. You can edit it for your purposes.
66
KeyAB defines Key Side whether to use A of Key or B of Key.
Key means the value of Key to load Key Side defined KeyAB. 6 Byte, Hex
String.
block 25 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Data J o h n
In above table, the size of real encoded data is 10 Bytes because it is Unicode
and includes NULL. It is encoded from 0th Byte to 9th Byte of 25th block.
However user defined Area to 15th Byte, NULL is filled from 10th Byte to 15th
Byte.
And data of field[2] in *pInput of SPI_VDATA is not encoded because only
[Field1] section is defined in INI file.
67