update bay prefix
This commit is contained in:
parent
8c1b772f50
commit
c3c73e2153
|
|
@ -34,7 +34,7 @@ public:
|
|||
QStringList getZones(const QString& grid = "") const;
|
||||
QStringList getStations(const QString& grid = "", const QString& zone = "") const;
|
||||
private:
|
||||
QString removeSuffix(const QString& str); //移除最后一个下划线后的内容 (处理各种tag后缀)
|
||||
QString removeSuffix(const QString& str,QChar symbol = '_'); //移除最后一个下划线后的内容 (处理各种tag后缀)
|
||||
private:
|
||||
QMap<QString, ExtraProperty> m_props; // 内存缓存
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ bool ExtraPropertyManager::loadAll() {
|
|||
|
||||
QList<ExtraProperty> lstPro = DataBase::GetInstance()->getAllExtraProperty();
|
||||
for(auto& pro:lstPro){
|
||||
pro.bay_tag = removeSuffix(pro.bay_tag);
|
||||
pro.bay_tag = removeSuffix(pro.bay_tag,'-');
|
||||
m_props[pro.code] = pro;
|
||||
count++;
|
||||
}
|
||||
|
|
@ -68,9 +68,9 @@ QStringList ExtraPropertyManager::getGrids() const {
|
|||
return QStringList(grids.begin(), grids.end());
|
||||
}
|
||||
|
||||
QString ExtraPropertyManager::removeSuffix(const QString& str)
|
||||
QString ExtraPropertyManager::removeSuffix(const QString& str,QChar symbol)
|
||||
{
|
||||
int lastUnderscore = str.lastIndexOf('_');
|
||||
int lastUnderscore = str.lastIndexOf(symbol);
|
||||
if (lastUnderscore == -1) return str; // 没有下划线
|
||||
|
||||
return str.left(lastUnderscore);
|
||||
|
|
|
|||
|
|
@ -780,7 +780,7 @@ void FixedPortsModel::loadNodeDataFromDataBase()
|
|||
QMap<QString,MeasurementInfo> mapMeasure;
|
||||
for(auto& info:lstMeasure)
|
||||
{
|
||||
info.tag = removeSuffix(info.tag);
|
||||
info.tag = removeSuffix(info.tag,'-');
|
||||
mapMeasure.insert(info.name,info);
|
||||
}
|
||||
assignMeasureSymmetry(mapMeasure);
|
||||
|
|
@ -799,7 +799,7 @@ void FixedPortsModel::loadNodeDataFromDataBase()
|
|||
QList<BayInfo> lstBay = DataBase::GetInstance()->getAllBay();
|
||||
for(auto& bay:lstBay)
|
||||
{
|
||||
QString showTag = removeSuffix(bay.tag);
|
||||
QString showTag = removeSuffix(bay.tag,'-');
|
||||
BayProperty* pBay = addBayData(bay.uuid);
|
||||
pBay->setName(bay.name);
|
||||
pBay->setTag(showTag);
|
||||
|
|
@ -1039,7 +1039,7 @@ void FixedPortsModel::saveNode(int nPageId)
|
|||
for(auto& info:lstTemp){
|
||||
if(info.component_uuid != QUuid("11111111-1111-1111-1111-111111111111")) //只判断设备外量测
|
||||
continue;
|
||||
info.bay_tag = removeSuffix(info.bay_tag);
|
||||
info.bay_tag = removeSuffix(info.bay_tag,'-');
|
||||
lstExtra.append(info);
|
||||
}
|
||||
|
||||
|
|
@ -1102,7 +1102,7 @@ void FixedPortsModel::saveNode(int nPageId)
|
|||
objBinding[info.sWindType] = objWind;
|
||||
}
|
||||
|
||||
QString tempMeasure = info.tag+"_"+_pageName; //tag后加工程名,保持全局唯一
|
||||
QString tempMeasure = info.tag+"-"+_pageName; //tag后加工程名,保持全局唯一
|
||||
|
||||
bool val = DataBase::GetInstance()->ifBayMeasureExist(info.name,pBay->uuid());
|
||||
if(val){
|
||||
|
|
@ -1362,7 +1362,7 @@ void FixedPortsModel::saveNode(int nPageId)
|
|||
for(auto& info:lstTemp){
|
||||
if(info.group_tag != "bay") //只对量测判断
|
||||
continue;
|
||||
info.bay_tag = removeSuffix(info.bay_tag);
|
||||
info.bay_tag = removeSuffix(info.bay_tag,'-');
|
||||
lstExtra.append(info);
|
||||
}
|
||||
|
||||
|
|
@ -1418,7 +1418,7 @@ void FixedPortsModel::saveNode(int nPageId)
|
|||
objBinding[info.sWindType] = objWind;
|
||||
}
|
||||
|
||||
QString tempMeasure = info.tag+"_"+_pageName; //tag后加工程名,保持全局唯一
|
||||
QString tempMeasure = info.tag+"-"+_pageName; //tag后加工程名,保持全局唯一
|
||||
|
||||
bool val = DataBase::GetInstance()->ifMeasureExist(info.name,pData->uuid());
|
||||
if(val){
|
||||
|
|
|
|||
Loading…
Reference in New Issue