| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- #include "pch.h"
- #include "ElectricEqpmt_Station400VLoad.h"
- #include "YD_Public_OCC.h"
- Station400VLoadItem::Station400VLoadItem() : m_nButtonID(-1), m_strEqpmtID(""),m_strInputStrID("")
- {
- }
- Station400VLoadItem::~Station400VLoadItem()
- {
- }
- // ElectricEqpmt_Station400VLoadUnit 定义开始
- ElectricEqpmt_Station400VLoadUnit::ElectricEqpmt_Station400VLoadUnit(): m_nButtonID(-1), m_nCutMark(1),m_strRelationBolt("")
- {
- }
- ElectricEqpmt_Station400VLoadUnit::~ElectricEqpmt_Station400VLoadUnit()
- {
- }
- void ElectricEqpmt_Station400VLoadUnit::UpdateCutStatus( int nCutMark )
- {
- m_nCutMark = nCutMark;
- }
- void ElectricEqpmt_Station400VLoadUnit::Add400VLoadData( const string& strEqpmtID, const string& strInputStrID, int nButtonID )
- {
- Station400VLoadItem station400VLoadItem;
- station400VLoadItem.m_nButtonID = nButtonID;
- station400VLoadItem.m_strEqpmtID = strEqpmtID;
- station400VLoadItem.m_strInputStrID = strInputStrID;
- m_mapStation400VLoadItem.insert( make_pair(strInputStrID, station400VLoadItem) );
- }
- void ElectricEqpmt_Station400VLoadUnit::CheckInputEqpmt(ELEEQPMTMAP* ElectricEqpmtMap, const string& strInputStrID )
- {
- // 先判断备自投是否投入
- ELEEQPMTMAP::iterator iterBolt = ElectricEqpmtMap->find( m_strRelationBolt );
- if ( iterBolt == ElectricEqpmtMap->end() )
- {
- return;
- }
- if ( ! iterBolt->second->GetStatus() )
- {
- return;
- }
- // 车站400V三级负荷逻辑
- map<string,Station400VLoadItem>::iterator iterInput = m_mapStation400VLoadItem.find( strInputStrID );
- if ( iterInput == m_mapStation400VLoadItem.end() )
- {
- return;
- }
- ELEEQPMTMAP::iterator iterInputEqpmt = ElectricEqpmtMap->find(strInputStrID);
- if ( iterInputEqpmt == ElectricEqpmtMap->end() )
- {
- return;
- }
- int nStatus = iterInputEqpmt->second->GetStatus();
- if ( Electric_Eqpmt_Status_OFF == nStatus )
- {
- CheckInputEqpmt_Off(ElectricEqpmtMap,strInputStrID);
- }
- else if ( Electric_Eqpmt_Status_ON == nStatus )
- {
- CheckInputEqpmt_On(ElectricEqpmtMap,strInputStrID);
- }
- }
- void ElectricEqpmt_Station400VLoadUnit::CheckInputEqpmt_Off(ELEEQPMTMAP* ElectricEqpmtMap, const string& strInputStrID )
- {
- if ( m_nCutMark )
- {
- // 投入: 断开三级负荷开关
- CutAllSwitch(ElectricEqpmtMap,strInputStrID);
- }
- else
- {
- // 退出
- }
- }
- void ElectricEqpmt_Station400VLoadUnit::CheckInputEqpmt_On(ELEEQPMTMAP* ElectricEqpmtMap, const string& strInputStrID )
- {
- if ( m_nCutMark )
- {
- // 投入
- OnAllSwitch(ElectricEqpmtMap,strInputStrID);
- }
- else
- {
- // 退出
- }
- }
- void ElectricEqpmt_Station400VLoadUnit::CutAllSwitch( ELEEQPMTMAP* ElectricEqpmtMap, const string& strInputStrID )
- {
- map<string,Station400VLoadItem>::iterator iter = m_mapStation400VLoadItem.begin();
- for ( ; iter != m_mapStation400VLoadItem.end(); iter++ )
- {
- CutAllSwitchEqpmt(ElectricEqpmtMap, iter->second.m_strEqpmtID, strInputStrID);
- }
- }
- void ElectricEqpmt_Station400VLoadUnit::CutAllSwitchEqpmt( ELEEQPMTMAP* ElectricEqpmtMap, const string& strEqpmtID, const string& strInputStrID )
- {
- ELEEQPMTMAP::iterator iterEqpmt = ElectricEqpmtMap->find(strEqpmtID);
- if ( iterEqpmt == ElectricEqpmtMap->end() )
- {
- return;
- }
- if ( iterEqpmt->second->GetStatus() )
- {
- //mod by yangs
- //iterEqpmt->second->EqpmtCtrl( Electric_Eqpmt_Status_OFF, *ElectricEqpmtMap,"系统", CTRLTYPE_STATUS );
- DelayTimeInfo delay;
- delay.type=Auto_DelayTime_InitCtrl;
- delay.delaydur=5;
- delay.occartime = GetNumTime_Second_2();
- delay.srcid = strInputStrID;
- delay.srcstatus = Electric_Eqpmt_Status_OFF;
- delay.desid =strEqpmtID;
- delay.destatus = Electric_Eqpmt_Status_OFF;
- p_DelayTimeMap->insert(make_pair(strEqpmtID,delay));
- }
- }
- void ElectricEqpmt_Station400VLoadUnit::OnAllSwitch( ELEEQPMTMAP* ElectricEqpmtMap, const string& strInputStrID )
- {
- map<string,Station400VLoadItem>::iterator iter = m_mapStation400VLoadItem.begin();
- for ( ; iter != m_mapStation400VLoadItem.end(); iter++ )
- {
- OnAllSwitchEqpmt(ElectricEqpmtMap, iter->second.m_strEqpmtID, strInputStrID);
- }
- }
- void ElectricEqpmt_Station400VLoadUnit::OnAllSwitchEqpmt( ELEEQPMTMAP* ElectricEqpmtMap, const string& strEqpmtID, const string& strInputStrID )
- {
- ELEEQPMTMAP::iterator iterEqpmt = ElectricEqpmtMap->find(strEqpmtID);
- if ( iterEqpmt == ElectricEqpmtMap->end() )
- {
- return;
- }
- if ( !iterEqpmt->second->GetStatus() )
- {
- //mod by yangs
- //iterEqpmt->second->EqpmtCtrl( Electric_Eqpmt_Status_ON, *ElectricEqpmtMap,"系统", CTRLTYPE_STATUS );
- DelayTimeInfo delay;
- delay.type=Auto_DelayTime_InitCtrl;
- delay.delaydur=5;
- delay.occartime = GetNumTime_Second_2();
- delay.srcid = strInputStrID;
- delay.srcstatus = Electric_Eqpmt_Status_ON;
- delay.desid =strEqpmtID;
- delay.destatus = Electric_Eqpmt_Status_ON;
- p_DelayTimeMap->insert(make_pair(strEqpmtID,delay));
- }
- }
- // ElectricEqpmt_Station400VLoadUnit定义结束
- // ElectricEqpmt_Station400VLoad定义开始
- ElectricEqpmt_Station400VLoad::ElectricEqpmt_Station400VLoad() : m_nStationID(0)
- {
- }
- ElectricEqpmt_Station400VLoad::~ElectricEqpmt_Station400VLoad()
- {
- }
- void ElectricEqpmt_Station400VLoad::Update400VLoadCut( int nThreeLoadUnitID, int nCutMark )
- {
- map<int, ElectricEqpmt_Station400VLoadUnit>::iterator iter = m_mapStation400VLoadUnit.find(nThreeLoadUnitID);
- if ( iter != m_mapStation400VLoadUnit.end() )
- {
- iter->second.UpdateCutStatus(nCutMark);
- }
- }
- void ElectricEqpmt_Station400VLoad::Add400VLoadData( const string& strEqpmtID, const string& strInputStrID, int nButtonID, const string& strRelationBoltID )
- {
- map<int, ElectricEqpmt_Station400VLoadUnit>::iterator iter = m_mapStation400VLoadUnit.find( nButtonID );
- if ( iter == m_mapStation400VLoadUnit.end() )
- {
- ElectricEqpmt_Station400VLoadUnit station400VLoadUnit;
- station400VLoadUnit.m_nButtonID = nButtonID;
- station400VLoadUnit.m_strRelationBolt = strRelationBoltID;
- station400VLoadUnit.Add400VLoadData(strEqpmtID, strInputStrID, nButtonID );
- m_mapStation400VLoadUnit.insert( make_pair( nButtonID, station400VLoadUnit) );
- }
- else
- {
- iter->second.Add400VLoadData( strEqpmtID, strInputStrID, nButtonID );
- }
- }
- void ElectricEqpmt_Station400VLoad::CheckInputEqpmt(ELEEQPMTMAP* ElectricEqpmtMap, const string& strInputStrID, int nButtonID )
- {
- map<int, ElectricEqpmt_Station400VLoadUnit>::iterator iterLoadUnit = m_mapStation400VLoadUnit.find( nButtonID );
- if ( iterLoadUnit != m_mapStation400VLoadUnit.end() )
- {
- iterLoadUnit->second.CheckInputEqpmt(ElectricEqpmtMap, strInputStrID );
- }
- }
- void ElectricEqpmt_Station400VLoad::SetDelayMap(DELAYMAP* delaymap)
- {
- map<int, ElectricEqpmt_Station400VLoadUnit>::iterator iterLoadUnit = m_mapStation400VLoadUnit.begin();
- if ( iterLoadUnit != m_mapStation400VLoadUnit.end() )
- {
- iterLoadUnit->second.SetDelayMap(delaymap);
- }
- }
|