-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add PanguX for deepin-devicemanager
add PanguX for deepin-devicemanager Log: add PanguX for deepin-devicemanager
- Loading branch information
1 parent
379f3ef
commit 98c45e9
Showing
7 changed files
with
112 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
deepin-devicemanager/src/GenerateDevice/PanguxGenerator.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
// 项目自身文件 | ||
#include "PanguxGenerator.h" | ||
|
||
// 其它头文件 | ||
|
||
#include "../DeviceManager/DeviceAudio.h" | ||
#include "../DeviceManager/DeviceBluetooth.h" | ||
|
||
|
||
PanguXGenerator::PanguXGenerator() | ||
{ | ||
|
||
} | ||
|
||
void PanguXGenerator::getAudioInfoFromCatAudio() | ||
{ | ||
QMap<QString, QString> tempMap; | ||
tempMap["Name"] = "OnBoard Audio"; | ||
tempMap["Vendor"]= "HUAWEI"; | ||
DeviceAudio *device = new DeviceAudio(); | ||
device->setCanEnale(false); | ||
device->setCanUninstall(false); | ||
device->setForcedDisplay(true); | ||
device->setInfoFromCatAudio(tempMap); | ||
DeviceManager::instance()->addAudioDevice(device); | ||
|
||
getAudioInfoFromHwinfo(); | ||
} | ||
|
||
void PanguXGenerator::generatorBluetoothDevice() | ||
{ | ||
DeviceBluetooth *device0 = new DeviceBluetooth(); | ||
QMap<QString, QString> tempMap; | ||
tempMap["Vendor"] = "HISILICON"; | ||
tempMap["Name"] = "Hi1105C"; | ||
tempMap["Model"] = "Hi1105C"; | ||
device0->setCanEnale(false); | ||
device0->setForcedDisplay(true); | ||
device0->setInfoFromTomlOneByOne(tempMap); | ||
DeviceManager::instance()->addBluetoothDevice(device0); | ||
|
||
const QList<QMap<QString, QString> > lstMap = DeviceManager::instance()->cmdInfo("hwinfo_usb"); | ||
QList<QMap<QString, QString> >::const_iterator it = lstMap.begin(); | ||
for (; it != lstMap.end(); ++it) { | ||
if ((*it).size() < 1) { | ||
continue; | ||
} | ||
if ((*it)["Hardware Class"] == "hub" || (*it)["Hardware Class"] == "mouse" || (*it)["Hardware Class"] == "keyboard") { | ||
continue; | ||
} | ||
if ((*it)["Hardware Class"] == "bluetooth" || (*it)["Driver"] == "btusb" || (*it)["Device"] == "BCM20702A0"|| (*it)["Device"].contains("bluetooth", Qt::CaseInsensitive)) { | ||
DeviceBluetooth *device = new DeviceBluetooth(); | ||
device->setCanEnale(false); | ||
device->setForcedDisplay(true); | ||
device->setInfoFromHwinfo(*it); | ||
DeviceManager::instance()->addBluetoothDevice(device); | ||
|
||
addBusIDFromHwinfo((*it)["SysFS BusID"]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2019 ~ 2024 Uniontech Software Technology Co.,Ltd. | ||
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#ifndef PANGUXGENERATOR_H | ||
#define PANGUXGENERATOR_H | ||
|
||
#include "HWGenerator.h" | ||
|
||
/** | ||
* @brief The PanguXGenerator class | ||
* 将获取的设备信息生成设备对象,panguX下的生成器 | ||
*/ | ||
|
||
class PanguXGenerator : public HWGenerator | ||
{ | ||
public: | ||
PanguXGenerator(); | ||
|
||
protected: | ||
/** | ||
* @brief generatorAudioDevice:生成音频适配器 | ||
*/ | ||
virtual void getAudioInfoFromCatAudio() override; | ||
/** | ||
* @brief generatorBluetoothDevice:生成蓝牙设备 | ||
*/ | ||
virtual void generatorBluetoothDevice() override; | ||
}; | ||
|
||
#endif // PANGUXGENERATOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,8 @@ class Common | |
PGUW, | ||
KLVV, | ||
KLVU, | ||
PGUV | ||
PGUV, | ||
PGUX | ||
}; | ||
static QString getArch(); | ||
|
||
|