summaryrefslogtreecommitdiff
path: root/src/plugins/mcusupport/mcusupportdevice.cpp
blob: 9cc780a6534a426c9d2cc2ec2ad22a75e88955e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#include "mcusupportdevice.h"
#include "mcusupportconstants.h"

using namespace ProjectExplorer;
using namespace Utils;

namespace McuSupport {
namespace Internal {

McuSupportDevice::McuSupportDevice()
{
    setupId(IDevice::AutoDetected, Constants::DEVICE_ID);
    setType(Constants::DEVICE_TYPE);
    const QString displayNameAndType = tr("MCU Device");
    setDefaultDisplayName(displayNameAndType);
    setDisplayType(displayNameAndType);
    setDeviceState(IDevice::DeviceStateUnknown);
    setMachineType(IDevice::Hardware);
    setOsType(Utils::OsTypeOther);
}

ProjectExplorer::IDevice::Ptr McuSupportDevice::create()
{
    auto device = new McuSupportDevice;
    return ProjectExplorer::IDevice::Ptr(device);
}

McuSupportDeviceFactory::McuSupportDeviceFactory()
    : ProjectExplorer::IDeviceFactory(Constants::DEVICE_TYPE)
{
    setDisplayName(McuSupportDevice::tr("MCU Device"));
    setCombinedIcon(":/mcusupport/images/mcusupportdevicesmall.png",
                    ":/mcusupport/images/mcusupportdevice.png");
    setConstructionFunction(&McuSupportDevice::create);
    setCreator(&McuSupportDevice::create);
}

} // namespace Internal
} // namespace McuSupport