Some refactoring in the new Wizard

This commit is contained in:
bsongis
2014-03-14 14:54:45 +01:00
parent 13e998ec2d
commit e0582cd398
8 changed files with 72 additions and 48 deletions
+40 -16
View File
@@ -15,34 +15,58 @@
#ifndef WIZARDDATA_H
#define WIZARDDATA_H
#include "eeprominterface.h"
#define WIZ_MAX_CHANNELS 8
// TODO use a constant common to the whole companion
// TODO when in the wizard use the getCapacity(...) to know how long the name can be
#define WIZ_MODEL_NAME_LENGTH 12
enum Input {NOINPUT, THROTTLE, RUDDER, ELEVATOR, AILERON, FLAP, AIRBREAK};
enum Vehicle {NOVEHICLE, PLANE, MULTICOPTER, HELICOPTER };
enum Input {
NOINPUT,
THROTTLE,
RUDDER,
ELEVATOR,
AILERON,
FLAP,
AIRBREAK
};
enum Vehicle {
NOVEHICLE,
PLANE,
MULTICOPTER,
HELICOPTER
};
class Channel
{
public:
int sourceDlg; // Originating dialog, only of interest for producer
Input input1;
Input input2;
int weight1;
int weight2;
public:
int sourceDlg; // Originating dialog, only of interest for producer
Input input1;
Input input2;
int weight1;
int weight2;
Channel();
void clear();
Channel();
void clear();
};
class WizMix
{
public:
bool complete;
char name[WIZ_MODEL_NAME_LENGTH + 1];
Vehicle vehicle;
Channel channel[WIZ_MAX_CHANNELS];
public:
bool complete;
char name[WIZ_MODEL_NAME_LENGTH + 1];
unsigned int modelId;
Vehicle vehicle;
Channel channel[WIZ_MAX_CHANNELS];
WizMix();
explicit WizMix(const unsigned int modelId);
operator ModelData();
private:
WizMix();
};
#endif // WIZARDDATA_H