浏览代码

#IQRV #comment 高拍仪功能集部分代码删除和增加接口注释

80374374 1 年之前
父节点
当前提交
56ad92f71f

+ 3 - 2
Module/mod_HSPScanner/HSPScanner.xml

@@ -28,10 +28,10 @@
 			</req>
 			<res>
 			</res>
-		</twoway>			
+		</twoway>
+    <!--接口名称和功能:请求拍照。拍照成功后会调用硬件适配器隐藏窗口-->
 		<twoway name="ScanImage" overlap="true">
 			<req>
-				<!-- rsd1 = 1 时,拍摄成功暂时则隐藏窗口 -->
 				<param name="reserved1" type="int"/>
 				<param name="reserved2" type="int"/>
 			</req>
@@ -88,6 +88,7 @@
 			</res>
 		</twoway>
 		<twoway name="ShowProperty" overlap="true">
+      <!--直接调用厂商硬件适配器接口-->
 			<req>
 			</req>
 			<res>

+ 30 - 7
Module/mod_ScannerSet/ScannerSet.xml

@@ -1,12 +1,17 @@
 <?xml version="1.0" encoding="gb2312" ?>
 <entity name="ScannerSet">
 	<class name="ScannerService" overlap="true" exclusive="false">
+    <!--接口名称和功能:打开预览-->
 		<twoway name="StartPreview" overlap="true">
 			<req>
+        <!--参数透传,由硬件实体处理-->
+        <!--0:跳过设置;1:不旋转角度;2:顺时针旋转90;3:顺时针旋转180;4:顺时针旋转270-->
 				<!--0:skip; 1:top turns to positive, 2: left turns to positive, 3:bottom turns to positive, 4:right turns to positive  -->
 				<param name="rotateType" type="short" />
+        <!--0:跳过设置;1:全画幅;2:A4画幅;3:身份证大小画幅-->
 				<!--0:skip; 1:full size, 2: A4 size, 3: IDCard size  -->
 				<param name="scanType" type="short"/>
+        <!--0:跳过设置;1:彩色;2:黑白-->
 				<!--0:skip; 1:default model, 2: gray model  -->
 				<param name="colorType" type="short" />
 				<param name="reserved1" type="short"/>
@@ -15,22 +20,25 @@
 				<param name="reserved4" type="short"/>
 			</req>
 			<res>
-				<!--failed bit: 1, 2, 4, 8 ... 预览成功通过上下文返回,retCode用于各项参数的设置结果-->
+				<!--预览成功通过上下文返回。retCode用于各项参数的设置结果,非0说明参数设置有错误,或的关系:1色彩;2:角度;4:画幅-->
 				<param name="retCode" type="int" />
 				<param name="reserved1" type="int" />
 				<param name="reserved2" type="array_int" />
 			</res>
 		</twoway>
+    <!--接口名称和功能:关闭预览-->
 		<twoway name="CancelPreview" overlap="true">
 			<req>
+        <!--功能集:不等于0,告诉硬件实体仅仅是隐藏;等于0:关闭预览-->
 				<param name="reserved1" type="int"/>
 			</req>
 			<res>
 			</res>
-		</twoway>	
+		</twoway>
+    <!--接口名称和功能:请求拍照-->
 		<twoway name="ScanImage" overlap="true">
 			<req>
-				<!--reserved1:0 normal way(ScanImage), 1: ex way.(ScanImageEx) 两种拍摄方式,但返回的内容都一致-->
+				<!--两种拍摄方式,但返回的内容都一致:0:调用硬件实体ScanImage接口;1:调用ScanImageEx接口-->
 				<param name="nWay" type="int"/>
 				<param name="reserved1" type="int"/>
 				<param name="reserved2" type="int"/>
@@ -42,21 +50,28 @@
 				<param name="reserved2" type="string"/>
 			</res>
 		</twoway>
+    <!--接口名称和功能:设置窗口坐标和尺寸-->
 		<twoway name="SetWindowPos" overlap="true">
 			<req>
-				<!--0:hide 1:show 2:custom -->
+        <!--参数透传,由硬件实体处理-->
+				<!--0:隐藏预览界面 1:显示预览界面 2:自定义,这时下面的参数才有效-->
 				<param name="type" type="int"/>
 				<!--默认比例16:9 reserved4保留使用,注意在 type = 2 时以下值有效-->
+        <!--预览窗口将要显示的X坐标-->
 				<param name="pointX" type="int"/>
+        <!--预览窗口将要显示的Y坐标-->
 				<param name="pointY" type="int"/>
+        <!--预览窗口的宽,高由16:9的比例控制,自然得出-->
 				<param name="nWidth" type="int"/>
 				<param name="reserved4" type="int"/>
 			</req>
 			<res>
 			</res>
 		</twoway>
+    <!--接口名称和功能:属性设置-->
 		<twoway name="SetProperty" overlap="true">
 			<req>
+        <!--参数透传,由硬件实体处理,见上面StartPreview的参数说明,这里只是把它单独区分出来了,或者说把这个功能集成到预览中了-->
 				<!--0:skip; 1:top turns to positive, 2: left turns to positive, 3:bottom turns to positive, 4:right turns to positive  -->
 				<param name="rotateType" type="short" />
 				<!--0:skip; 1:full size, 2: A4 size, 3: IDCard size  -->
@@ -75,17 +90,22 @@
 				<param name="reserved2" type="array_int" />
 			</res>
 		</twoway>
+    <!--接口名称和功能:显示属性窗口,无使用场景!!!!-->
 		<twoway name="ShowProperty" overlap="true">
+      <!--参数透传,由硬件实体处理-->
 			<req>
 			</req>
 			<res>
 			</res>
 		</twoway>
+    <!--接口名称和功能:获取硬件状态-->
 		<twoway name="GetDevStatus" overlap="true">
 			<req>
 			</req>
 			<res>
+        <!--硬件是否连接:true:连接;false:未连接(这个单词写错了,Invalid是无效的意思,反了)-->
 				<param name="bInvalid" type="bool" />
+        <!--是否处于预览状态:true:预览;false:未预览-->
 				<param name="bPreview" type="bool"/>
 				<param name="reserved1" type="int"/>
 				<param name="reserved2" type="int"/>
@@ -94,7 +114,8 @@
 			</res>
 		</twoway>
 		<oneway name="Exit" overlap="true">			
-		</oneway>	
+		</oneway>
+    <!--下线,低柜使用-->
 		<twoway name="GetOnlineCameras" overlap="true">
 			<req>
 				<param name="reserved1" type="int"/>
@@ -108,6 +129,7 @@
      		<param name="reserved2" type="array_string"/>
 			</res>
 		</twoway>
+    <!--下线,简版使用-->
 		<oneway name="CrossTermInvokeInfo" overlap="true">
 				<param name="type" type="int"/>
 				<param name="result" type="int"/>
@@ -123,6 +145,7 @@
 				<param name="reserved2" type="array_string"/>
 				<param name="reservedX" type="array_blob"/>	
 		</oneway>
+    <!--下线,简版使用-->
 		<twoway name="CrossTermCall" overlap="true">
 			<req>
 				<param name="type" type="int"/>
@@ -150,7 +173,7 @@
 				<param name="reservedX" type="array_blob"/>
 			</res>				
 		</twoway>
-		
+    <!--接口名称和功能:获取硬件属性(硬件通有接口),厂商适配器接口透传返回-->
 		<twoway name="GetDevInfo" overlap="true" method_id="65535">
 			<req>
 			</req>
@@ -163,8 +186,8 @@
 				<param name="reserved2" type="string"/>
 			</res>
 		</twoway>													
-								
 	</class>
+  <!--无使用场景-->
 		<message name="EventMsg">
 			<param name="eventType" type="int"/>
 			<param name="reserved1" type="int"/>

+ 7 - 78
Module/mod_ScannerSet/ScannerSetFSM.cpp

@@ -82,8 +82,6 @@ static bool MapErrorCode2Level(ErrorCodeEnum ec)
 
 CScannerFSM::CScannerFSM(void)
 	:
-	m_csMachineType(true),
-	m_csSite(true),
 	m_bStand2SMachine(false),
 	m_pHSPSClient(NULL),
 	m_ecSelfTest(Error_Succeed),
@@ -106,10 +104,7 @@ ErrorCodeEnum CScannerFSM::OnInit()
 	CSmartPointer<IConfigInfo> spConfig;
 	CSystemStaticInfo sysInfo;
 	GetEntityBase()->GetFunction()->GetSystemStaticInfo(sysInfo);
-	m_csMachineType = sysInfo.strMachineType;
-	m_csSite = sysInfo.strSite;
-	m_strTerminalNo = sysInfo.strTerminalID;
-	m_bStand2SMachine = !m_csMachineType.Compare("RVC.Stand2S", true);
+	m_bStand2SMachine = !sysInfo.strMachineType.Compare("RVC.Stand2S", true);
 	return erroCode;
 }
 
@@ -237,32 +232,6 @@ unsigned int CScannerFSM::s0_on_event(FSMEvent* e)
 	return uRet;
 }
 
-/** No use for now [80374374@2022615]*/
-void CScannerFSM::s1_on_entry()
-{
-	LOG_FUNCTION();
-	FSMEvent* evt = new FSMEvent(USER_EVT_ESTIMATE_FINISHED);
-	evt->param1 = evt->param2 = 0;
-	PostEventFIFO(evt);
-	m_nFatalTimes = 0;
-}
-
-/** No use for now [80374374@2022615]*/
-void CScannerFSM::s1_on_exit()
-{
-
-}
-
-/** No use for now [80374374@2022615]*/
-unsigned int CScannerFSM::s1_on_event(FSMEvent* e)
-{
-	unsigned int uRet = 0;
-	if(e->iEvt == USER_EVT_ESTIMATE_FINISHED) {
-		e->SetHandled();
-	}
-	return uRet;
-}
-
 void CScannerFSM::s2_on_entry()
 {
 
@@ -350,57 +319,13 @@ unsigned int CScannerFSM::s2_on_event(FSMEvent* e)
 			}
 		}
 		break;
-	}
-	return uRet;
-}
-
-
-#pragma region Useless for current
-//2016-11-18
-
-void CScannerFSM::s3_on_entry()
-{
-	LOG_FUNCTION();
-	m_ecSelfTest = Error_Hardware;
-}
-
-void CScannerFSM::s3_on_exit()
-{
-	m_ecSelfTest = Error_Succeed;
-	m_nFatalTimes = 0;
-}
-
-unsigned int CScannerFSM::s3_on_event(FSMEvent* e)
-{
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("s3_on_event: %s(%d), %d.", EvtTypeToString(e->iEvt), e->iEvt, e->param1);
-	unsigned int uRet = 0;
-	switch(e->iEvt)
-	{
-	case USER_EVT_GETSTATUS:
-		{
-			GetDevStatusTask* pTask = new GetDevStatusTask(this);
-			GetDevStatusEvent* pEvt = dynamic_cast<GetDevStatusEvent*>(e);
-			pTask->SetContext(pEvt->m_ctx);
-			GetEntityBase()->GetFunction()->PostThreadPoolTask(pTask);
-		}
-		e->SetHandled();
-		break;
-	case USER_EVT_GETINFO:
-		{
-			GetDevInfoTask* pTask = new GetDevInfoTask(this);
-			GetDevInfoEvent* pEvt = dynamic_cast<GetDevInfoEvent*>(e);
-			pTask->SetContext(pEvt->m_ctx);
-			GetEntityBase()->GetFunction()->PostThreadPoolTask(pTask);
-		}
-		e->SetHandled();
+	default:
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("unknown event id: %d", e->iEvt);
 		break;
 	}
 	return uRet;
 }
 
-
-#pragma endregion Useless for current
-
 void CScannerFSM::s4_on_entry()
 {
 	if(m_bStand2SMachine)
@@ -607,6 +532,10 @@ int CScannerFSM::ScanImage(SpReqAnsContext<ScannerService_ScanImage_Req,
 			erroCode = Error_NotSupport;
 		}
 	}
+	else {
+		erroCode = Error_Param;
+		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__).setLogCode(ScannerService_LogCode_ScanImage).setResultCode("RTA2O01")("Invalid Param: Way:%d", ctx->Req.nWay);
+	}
 	ctx->Answer(erroCode, dwUserCode);
 	return nRes;
 }

+ 1 - 17
Module/mod_ScannerSet/ScannerSetFSM.h

@@ -223,13 +223,11 @@ public:
 
 	void SelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext);
 
-	enum {s0, s1, s2, s3, s4};
+	enum {s0, s2, s4};
 
 	BEGIN_FSM_STATE(CScannerFSM)
 		FSM_STATE_ENTRY(s0, "Idle", s0_on_entry, s0_on_exit, s0_on_event)
-		FSM_STATE_ENTRY(s1, "Estimate", s1_on_entry, s1_on_exit, s1_on_event) //no used now!!!
 		FSM_STATE_ENTRY(s2, "Operating", s2_on_entry, s2_on_exit, s2_on_event)
-		FSM_STATE_ENTRY(s3, "Failed", s3_on_entry, s3_on_exit, s3_on_event)
 		FSM_STATE_ENTRY(s4, "Invalid", s4_on_entry, s4_on_exit, s4_on_event)
 	END_FSM_STATE()
 
@@ -254,18 +252,10 @@ public:
 	virtual void s0_on_exit();
 	virtual unsigned int s0_on_event(FSMEvent* e);
 
-	virtual void s1_on_entry();
-	virtual void s1_on_exit();
-	virtual unsigned int s1_on_event(FSMEvent* e);
-
 	virtual void s2_on_entry();
 	virtual void s2_on_exit();
 	virtual unsigned int s2_on_event(FSMEvent* e);
 
-	virtual void s3_on_entry();
-	virtual void s3_on_exit();
-	virtual unsigned int s3_on_event(FSMEvent* e);
-
 	virtual void s4_on_entry();
 	virtual void s4_on_exit();
 	virtual unsigned int s4_on_event(FSMEvent* e);
@@ -312,21 +302,15 @@ public:
 
 private:
 
-	CSimpleStringA m_csMachineType;
-	CSimpleStringA m_csSite;
 	bool m_bStand2SMachine;
-
 	CHSPSInnerClient* m_pHSPSClient;
 
 	ErrorCodeEnum m_ecSelfTest;
 	DWORD m_dwErroCode;
 	int m_nFatalTimes;
 	int m_nSrcState;
-	CSimpleStringA m_strTerminalNo;
 
 	int m_iEvt;
-
-	std::mutex mMtx;
 public:
 	DWORD GetCustLastErrorCode() { return m_dwErroCode; }
 	void SetCustLastErrorCode(DWORD dwVal = 0) { m_dwErroCode = dwVal; }