Make Viatom loader MT_OXIMETER and remove MT_MULTI.

There's way too much logic throughout the code that makes assumptions
based on MT_OXIMETER.
This commit is contained in:
sawinglogz 2020-01-23 15:03:23 -05:00
parent 66f13f3143
commit 3fbc1777c5
3 changed files with 19 additions and 5 deletions

View File

@ -21,7 +21,7 @@ const int viatom_data_version = 1;
class ViatomLoader : public MachineLoader
{
public:
ViatomLoader() { m_type = MT_MULTI; }
ViatomLoader() { m_type = MT_OXIMETER; }
virtual ~ViatomLoader() { }
virtual bool Detect(const QString & path);
@ -35,7 +35,7 @@ class ViatomLoader : public MachineLoader
virtual const QString &loaderName() { return viatom_class_name; }
virtual MachineInfo newInfo() {
return MachineInfo(MT_POSITION, 0, viatom_class_name, QObject::tr("Viatom"), QString(), QString(), QString(), QObject::tr("Viatom Software"), QDateTime::currentDateTime(), viatom_data_version);
return MachineInfo(MT_OXIMETER, 0, viatom_class_name, QObject::tr("Viatom"), QString(), QString(), QString(), QObject::tr("Viatom Software"), QDateTime::currentDateTime(), viatom_data_version);
}
//Machine *CreateMachine();

View File

@ -50,7 +50,22 @@ enum SummaryType { ST_CNT, ST_SUM, ST_AVG, ST_WAVG, ST_PERC, ST_90P, ST_MIN, ST_
\brief Generalized type of a machine. MT_CPAP is any type of xPAP machine, MT_OXIMETER any type of Oximeter
\brief MT_SLEEPSTAGE stage of sleep detector (ZEO importer), MT_JOURNAL for optional notes, MT_POSITION for sleep position detector (Somnopose)
*/
enum MachineType { MT_UNKNOWN = 0, MT_CPAP, MT_OXIMETER, MT_SLEEPSTAGE, MT_JOURNAL, MT_POSITION, MT_MULTI, MT_UNCATEGORIZED = 99};
// TODO: This really needs to be a bitmask, since there are increasing numbers of machines that provide
// multiple kinds of data, such as oximetry + motion/position, or sleep stage + oximetry, etc.
//
// Machine/loader classes will use the bitmask to identify which data they are capable of importing.
// It may be that we ultimately prefer to have each machine identify a primary type instead or in addition.
//
// The channel schema's use of these is probably fine.
//
// Days/Sessions/etc. that currently search for data based on the machines they contain will instead
// need to search for channels with data of that MT type. And anywhere else the code makes decisions
// based on MT.
//
// Unfortunately, this also includes previously imported data, as Session encodes the machine's type in
// each file on disk. We might be partially saved by the fact that MT_CPAP and MT_OXIMETER were originally
// 1 and 2, which would only break MT_SLEEPSTAGE and higher.
enum MachineType { MT_UNKNOWN = 0, MT_CPAP, MT_OXIMETER, MT_SLEEPSTAGE, MT_JOURNAL, MT_POSITION, MT_UNCATEGORIZED = 99};
//void InitMapsWithoutAwesomeInitializerLists();
/***** NEVER USED --- 8/2019

View File

@ -41,9 +41,8 @@ void Welcome::refreshPage()
QList<Machine *> oximachines = p_profile->GetMachines(MT_OXIMETER);
QList<Machine *> posmachines = p_profile->GetMachines(MT_POSITION);
QList<Machine *> stgmachines = p_profile->GetMachines(MT_SLEEPSTAGE);
QList<Machine *> mltmachines = p_profile->GetMachines(MT_MULTI);
bool noMachines = mlist.isEmpty() && posmachines.isEmpty() && oximachines.isEmpty() && stgmachines.isEmpty() && mltmachines.isEmpty();
bool noMachines = mlist.isEmpty() && posmachines.isEmpty() && oximachines.isEmpty() && stgmachines.isEmpty();
bool showCardWarning = noMachines;