|
|
@@ -25,7 +25,11 @@ class ScannerServerSession: public ScannerService_ServerSessionBase
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
- ScannerServerSession(CScannerEntity *pEntity):m_pEntity(pEntity){}
|
|
|
+ ScannerServerSession(CScannerEntity *pEntity):m_pEntity(pEntity){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
virtual ~ScannerServerSession(){}
|
|
|
|
|
|
virtual void Handle_StartPreview(SpReqAnsContext<ScannerService_StartPreview_Req,
|
|
|
@@ -70,7 +74,10 @@ public:
|
|
|
class CScannerEntity : public CEntityBase, public IEntityStateListener
|
|
|
{
|
|
|
public:
|
|
|
- CScannerEntity() {}
|
|
|
+ CScannerEntity() {
|
|
|
+ ResetLastSetWinPosParam();
|
|
|
+ }
|
|
|
+
|
|
|
virtual ~CScannerEntity()
|
|
|
{
|
|
|
if(GetFunction()->HasPrivilege()) {
|
|
|
@@ -114,15 +121,6 @@ public:
|
|
|
virtual void OnPrePause(CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
-
|
|
|
-#ifdef TWINKLE_LOCAL_DEBUG
|
|
|
-
|
|
|
- const UINT result = UniTest(this);
|
|
|
- if(result != 0) {
|
|
|
- LogError(Severity_High, Error_Unexpect, result, CSimpleStringA::Format("line: %u", result));
|
|
|
- }
|
|
|
-
|
|
|
-#endif
|
|
|
SpReqAnsContext<ScannerService_StartPreview_Req,
|
|
|
ScannerService_StartPreview_Ans>::Pointer ctx =
|
|
|
new SpReqAnsContext<ScannerService_StartPreview_Req,
|
|
|
@@ -145,6 +143,15 @@ public:
|
|
|
pTransactionContext->SendAnswer(erroCode);
|
|
|
}
|
|
|
|
|
|
+ void ResetLastSetWinPosParam()
|
|
|
+ {
|
|
|
+ mLastSetWinReqParam.type = -1;
|
|
|
+ mLastSetWinReqParam.pointX = -1;
|
|
|
+ mLastSetWinReqParam.pointY = -1;
|
|
|
+ mLastSetWinReqParam.nWidth = -1;
|
|
|
+ mLastSetWinReqParam.reserved4 = -1;
|
|
|
+ }
|
|
|
+
|
|
|
void Preview(SpReqAnsContext<ScannerService_StartPreview_Req,
|
|
|
ScannerService_StartPreview_Ans>::Pointer ctx)
|
|
|
{
|
|
|
@@ -184,19 +191,19 @@ public:
|
|
|
void SetWinPos(SpReqAnsContext<ScannerService_SetWindowPos_Req,
|
|
|
ScannerService_SetWindowPos_Ans>::Pointer ctx)
|
|
|
{
|
|
|
- static ScannerService_SetWindowPos_Req lastReq = {-1, -1, -1, -1, -1};
|
|
|
+ if (m_fsm.GetResetFlag()) { ResetLastSetWinPosParam(); }
|
|
|
|
|
|
- if((ctx->Req.type != lastReq.type
|
|
|
- || ctx->Req.pointX != lastReq.pointX
|
|
|
- || ctx->Req.pointY != lastReq.pointY
|
|
|
- || ctx->Req.nWidth != lastReq.nWidth
|
|
|
+ if((ctx->Req.type != mLastSetWinReqParam.type
|
|
|
+ || ctx->Req.pointX != mLastSetWinReqParam.pointX
|
|
|
+ || ctx->Req.pointY != mLastSetWinReqParam.pointY
|
|
|
+ || ctx->Req.nWidth != mLastSetWinReqParam.nWidth
|
|
|
/*|| ctx->Req.reserved4 != lastReq.reserved4*/)) {
|
|
|
|
|
|
- lastReq.type = ctx->Req.type;
|
|
|
- lastReq.pointX = ctx->Req.pointX;
|
|
|
- lastReq.pointY = ctx->Req.pointY;
|
|
|
- lastReq.nWidth = ctx->Req.nWidth;
|
|
|
- lastReq.reserved4 = ctx->Req.reserved4;
|
|
|
+ mLastSetWinReqParam.type = ctx->Req.type;
|
|
|
+ mLastSetWinReqParam.pointX = ctx->Req.pointX;
|
|
|
+ mLastSetWinReqParam.pointY = ctx->Req.pointY;
|
|
|
+ mLastSetWinReqParam.nWidth = ctx->Req.nWidth;
|
|
|
+ mLastSetWinReqParam.reserved4 = ctx->Req.reserved4;
|
|
|
|
|
|
PendingTask* pTask = new PendingTask(&m_fsm);
|
|
|
pTask->SetContext(ctx);
|
|
|
@@ -279,6 +286,8 @@ public:
|
|
|
|
|
|
private:
|
|
|
CScannerFSM m_fsm;
|
|
|
+
|
|
|
+ ScannerService_SetWindowPos_Req mLastSetWinReqParam;
|
|
|
};
|
|
|
|
|
|
HSPScannerClient::HSPScannerClient(CScannerEntity *pEntity)
|