Files
Aaru/Aaru.Database/Models/Device.cs

79 lines
3.3 KiB
C#
Raw Normal View History

2018-12-29 15:26:00 +00:00
// /***************************************************************************
2020-02-27 12:31:25 +00:00
// Aaru Data Preservation Suite
2018-12-29 15:26:00 +00:00
// ----------------------------------------------------------------------------
//
// Filename : Device.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Database.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing processed device reports in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2022-02-18 10:27:13 +00:00
// Copyright © 2011-2022 Natalia Portillo
2018-12-29 15:26:00 +00:00
// ****************************************************************************/
2018-12-31 13:17:27 +00:00
2018-08-05 19:37:39 +01:00
using System;
using System.ComponentModel;
2021-08-17 17:36:39 +01:00
using System.Diagnostics.CodeAnalysis;
2020-02-27 00:33:26 +00:00
using Aaru.CommonTypes.Metadata;
2018-08-05 19:37:39 +01:00
2020-02-27 00:33:26 +00:00
namespace Aaru.Database.Models
2018-08-05 19:37:39 +01:00
{
2021-08-17 21:23:10 +01:00
/// <summary>Known device</summary>
public class Device : DeviceReportV2
2018-08-05 19:37:39 +01:00
{
2021-08-17 21:23:10 +01:00
/// <summary>Builds an empty device</summary>
2020-02-29 18:03:35 +00:00
public Device() => LastSynchronized = DateTime.UtcNow;
2018-11-27 00:23:05 +00:00
2021-08-17 21:23:10 +01:00
/// <summary>Builds a device from a device report</summary>
2021-08-17 13:56:05 +01:00
/// <param name="report">Device report</param>
2021-08-17 17:36:39 +01:00
[SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
public Device(DeviceReportV2 report)
{
ATA = report.ATA;
ATAPI = report.ATAPI;
CompactFlash = report.CompactFlash;
FireWire = report.FireWire;
LastSynchronized = DateTime.UtcNow;
MultiMediaCard = report.MultiMediaCard;
PCMCIA = report.PCMCIA;
SCSI = report.SCSI;
SecureDigital = report.SecureDigital;
USB = report.USB;
Manufacturer = report.Manufacturer;
Model = report.Model;
Revision = report.Revision;
Type = report.Type;
GdRomSwapDiscCapabilities = report.GdRomSwapDiscCapabilities;
}
2021-08-17 21:23:10 +01:00
/// <summary>When this known device was last synchronized with the server</summary>
public DateTime LastSynchronized { get; set; }
2021-08-17 21:23:10 +01:00
/// <summary>Optimal number of blocks to read at once</summary>
[DefaultValue(0)]
public int OptimalMultipleSectorsRead { get; set; }
2021-08-17 21:23:10 +01:00
/// <summary>Can read GD-ROM using swap trick?</summary>
[DefaultValue(null)]
public bool? CanReadGdRomUsingSwapDisc { get; set; }
2018-08-05 19:37:39 +01:00
}
}