From e8a27bb203fe2aff70390a5eca002d7438da9b0f Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期三, 22 十月 2025 14:24:34 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang

---
 SourceCode/Bond/BondEq/Model.cpp |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/BondEq/Model.cpp b/SourceCode/Bond/BondEq/Model.cpp
index b50691f..a6f979f 100644
--- a/SourceCode/Bond/BondEq/Model.cpp
+++ b/SourceCode/Bond/BondEq/Model.cpp
@@ -155,10 +155,16 @@
 			notifyObj(RX_CODE_PANEL_COMPLATE, pPanel);
 			pPanel->release();
 		}
-		else if (code == BC_CODE_ALARM_EVENT) {
+		else if (code == BC_CODE_ALARM_ON) {
 			CAlarm* pAlarm = (CAlarm*)pIntent->getContext();
 			pAlarm->addRef();
-			notifyObjAndPtr(RX_CODE_ALARM_EVENT, pAlarm, pSender);
+			notifyObjAndPtr(RX_CODE_ALARM_ON, pAlarm, pSender);
+			pAlarm->release();
+		}
+		else if (code == BC_CODE_ALARM_OFF) {
+			CAlarm* pAlarm = (CAlarm*)pIntent->getContext();
+			pAlarm->addRef();
+			notifyObjAndPtr(RX_CODE_ALARM_OFF, pAlarm, pSender);
 			pAlarm->release();
 		}
 		else if (code == BC_CODE_EQSTATE_EVENT) {
@@ -169,7 +175,13 @@
 		}
 	};
 	m_bonder.setListener(bonderListener);
+	m_bonder.setModel(this);
 	m_bonder.init();
+
+
+	CString strBonderDataFile;
+	strBonderDataFile.Format(_T("%s\\Bonder.dat"), (LPTSTR)(LPCTSTR)m_strWorkDir);
+	m_bonder.read((LPTSTR)(LPCTSTR)strBonderDataFile);
 
 
 	return 0;
@@ -177,6 +189,10 @@
 
 int CModel::term()
 {
+	m_bonder.save();
+	m_bonder.term();
+	m_sqlite.term();
+
 	CLog::GetLog()->SetOnLogCallback(nullptr);
 	return 0;
 }
@@ -275,6 +291,39 @@
 	return 0;
 }
 
+int CModel::notifyInt2(int code, int exCode, int exCode2)
+{
+	if (m_pObservableEmitter != NULL) {
+		IAny* pAny = RX_AllocaAny();
+		if (pAny != NULL) {
+			pAny->addRef();
+			pAny->setCode(code);
+			pAny->setIntValue("exCode", exCode);
+			pAny->setIntValue("exCode2", exCode2);
+			m_pObservableEmitter->onNext(pAny);
+			pAny->release();
+		}
+	}
+
+	return 0;
+}
+
+int CModel::notifyDouble(int code, double dValue)
+{
+	if (m_pObservableEmitter != NULL) {
+		IAny* pAny = RX_AllocaAny();
+		if (pAny != NULL) {
+			pAny->addRef();
+			pAny->setCode(code);
+			pAny->setDoubleValue("value", dValue);
+			m_pObservableEmitter->onNext(pAny);
+			pAny->release();
+		}
+	}
+
+	return 0;
+}
+
 int CModel::notifyObjAndInt(int code, IRxObject* pObj1, IRxObject* pObj2, int exCode)
 {
 	if (m_pObservableEmitter != NULL) {

--
Gitblit v1.9.3