mrDarker
2025-10-22 e8a27bb203fe2aff70390a5eca002d7438da9b0f
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) {