Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FMVip_LXJ
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
FMVip_LXJ
Commits
c2e00688
Commit
c2e00688
authored
Jan 10, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善读实体卡功能。
parent
4c845058
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
30 deletions
+55
-30
FMVip_LXJ/fmvipdispatcher.cpp
+3
-0
FMVip_LXJ/reader.h
+52
-29
FMVip_LXJ/windows/fmviplogin.cpp
+0
-1
No files found.
FMVip_LXJ/fmvipdispatcher.cpp
View file @
c2e00688
...
...
@@ -116,6 +116,9 @@ void FMVipDispatcher::createSysIcon()
void
FMVipDispatcher
::
onQuit
()
{
if
(
fmTask
!=
nullptr
)
{
fmTask
->
stopTask
();
}
qDebug
()
<<
__FUNCTION__
;
LPSTR
data
=
QuitCMD
;
unsigned
int
a
;
...
...
FMVip_LXJ/reader.h
View file @
c2e00688
...
...
@@ -15,6 +15,8 @@ class Reader : public QObject
public
:
Reader
()
{
s_end
=
true
;
r_end
=
false
;
s_initsuc
=
false
;
s_reader
=
NULL
;
this
->
moveToThread
(
&
m_thread
);
...
...
@@ -22,51 +24,70 @@ public:
}
public
slots
:
bool
connectReader
(
QString
&
error
)
{
QVariantMap
map
;
if
(
!
ReadCfg
::
readvalueforheadlist
(
CFG_FILENAME
,
CFG_SECTION_READER
,
map
))
return
false
;
s_initsuc
=
ConnectDevice
(
map
.
value
(
CFG_READER_PORT
).
toInt
(),
map
.
value
(
CFG_READER_BAUD
).
toInt
(),
map
.
value
(
CFG_READER_SECTION
).
toInt
(),
map
.
value
(
CFG_READER_PWD
).
toString
(),
s_reader
,
error
);
return
s_initsuc
;
}
bool
readVipNO
()
{
QString
vipNo
;
QString
error
;
bool
sign
=
false
;
//HANDLE s_reader = NULL;
r_end
=
true
;
qDebug
()
<<
"son:"
<<
QThread
::
currentThreadId
();
qDebug
()
<<
"son:"
<<
QThread
::
currentThreadId
()
<<
"s_initsuc:"
<<
s_initsuc
;
if
(
!
s_initsuc
)
if
(
s_end
&&
!
s_initsuc
)
{
while
(
!
connectReader
(
error
))
do
{
QVariantMap
map
;
sign
=
ReadCfg
::
readvalueforheadlist
(
CFG_FILENAME
,
CFG_SECTION_READER
,
map
);
//qDebug() << map;
if
(
sign
)
sign
=
ConnectDevice
(
map
.
value
(
CFG_READER_PORT
).
toInt
(),
map
.
value
(
CFG_READER_BAUD
).
toInt
(),
map
.
value
(
CFG_READER_SECTION
).
toInt
(),
map
.
value
(
CFG_READER_PWD
).
toString
(),
s_reader
,
error
);
if
(
!
sign
)
s_reader
=
NULL
;
else
s_initsuc
=
sign
;
Sleep
(
500
);
s_initsuc
=
true
;
}
while
(
s_end
&&
!
sign
);
}
qDebug
()
<<
"HANDLE"
<<
s_reader
;
while
(
!
ReadCard
(
s_reader
,
1
,
vipNo
,
error
))
qDebug
()
<<
"s_reader"
<<
s_reader
;
while
(
s_end
&&
!
ReadCard
(
s_reader
,
1
,
vipNo
,
error
))
Sleep
(
500
);
emit
getVipNO
(
vipNo
);
if
(
!
s_end
)
{
r_end
=
false
;
return
false
;
}
emit
getVipNO
(
vipNo
);
r_end
=
false
;
}
bool
disconnectReader
()
void
disconnectReader
()
{
if
(
s_reader
!=
NULL
)
{
DisConnectDevice
(
s_reader
);
}
s_end
=
false
;
while
(
r_end
)
Sleep
(
500
);
if
(
s_initsuc
||
s_reader
>
0
)
{
DisConnectDevice
(
s_reader
);
s_reader
=
NULL
;
s_initsuc
=
false
;
}
}
signals
:
...
...
@@ -74,6 +95,8 @@ signals:
void
getVipNO
(
QString
VipNO
);
private
:
bool
s_end
;
bool
r_end
;
bool
s_initsuc
;
HANDLE
s_reader
;
QThread
m_thread
;
...
...
FMVip_LXJ/windows/fmviplogin.cpp
View file @
c2e00688
...
...
@@ -32,7 +32,6 @@ FMVipLogin::~FMVipLogin()
void
FMVipLogin
::
onstartreader
()
{
qDebug
()
<<
"#####################################111111"
;
emit
startreader
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment