128 lines
3.0 KiB
C++
Executable File
128 lines
3.0 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ParticipantManagement - ParticipantSetInjury
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Patric Karwat, SLSE, 2020-05-13
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
//Lts
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
#include <LtsSession/lts_session.h>
|
|
|
|
//ParticipantManagement
|
|
#include <ParticipantManagement/logger.h>
|
|
//ProjektDataManagement
|
|
#include <ProjectDataManagement/pdm_dtc.h>
|
|
#include <Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
|
|
|
//DDS
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
#include <ParticipantManagement/ppm_dtc.h>
|
|
#include <ParticipantManagement/ppm_ftc.h>
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
|
|
//Qt
|
|
#include <QWidget>
|
|
#include <QButtonGroup>
|
|
|
|
namespace Ui
|
|
{
|
|
class ParticipantSetInjuryDialog;
|
|
}
|
|
|
|
namespace ParticipantManagement
|
|
{
|
|
|
|
class ParticipantSetInjuryDialog : public LtsWidgets::LtsDialog
|
|
, protected ParticipantManagement::Interface::Ftc::ModifyStateReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum Injuries
|
|
{
|
|
Hit = 1,
|
|
Splitter = 2,
|
|
Explosion = 3,
|
|
Fracture = 4,
|
|
Burn = 5,
|
|
Amputation = 6
|
|
};
|
|
|
|
enum BodyParts
|
|
{
|
|
Head = 1,
|
|
Arm = 2,
|
|
Leg = 3,
|
|
Shoulder = 4,
|
|
Thorax = 5,
|
|
Abdomen = 6,
|
|
Torso = 7,
|
|
Hand = 8,
|
|
Forearm = 9,
|
|
Foot = 10,
|
|
Shank = 11
|
|
};
|
|
enum Sides
|
|
{
|
|
Left = 1,
|
|
Right = 2
|
|
};
|
|
|
|
explicit ParticipantSetInjuryDialog(int participantId, QWidget *parent = nullptr);
|
|
|
|
bool init(LtsSession::LtsSession *session,
|
|
const std::shared_ptr<Interface::Dtc> &dtc,
|
|
const std::shared_ptr<Interface::Ftc> &ftc,
|
|
const std::shared_ptr<ProjectDataManagement::Interface::Dtc> &dtcPdm);
|
|
|
|
~ParticipantSetInjuryDialog();
|
|
|
|
private:
|
|
void onModifyStateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
|
void retranslate() override;
|
|
|
|
void createButtonGroups();
|
|
|
|
void setOldData(const DynamicParticipantData &data);
|
|
uint32_t getInjuryBit();
|
|
|
|
private slots:
|
|
void checkRadioStatesBody();
|
|
void checkRadioStatesSides();
|
|
void checkState();
|
|
void resetRadioStates(bool onlySides = false);
|
|
|
|
private:
|
|
bool apply() override final;
|
|
|
|
private:
|
|
int m_participantId;
|
|
int m_eqId;
|
|
LtsSession::LtsSession *m_session;
|
|
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
|
|
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftc;
|
|
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_dtcPdm;
|
|
std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> m_ppmCbxIfc;
|
|
|
|
LtsUtils::RequestHelper *m_requestHelper;
|
|
|
|
QButtonGroup *m_bgInjury;
|
|
QButtonGroup *m_bgBodypart;
|
|
QButtonGroup *m_bgSide;
|
|
Ui::ParticipantSetInjuryDialog *m_ui;
|
|
QMap<int, ProjectDataManagement::SanitationInjury> m_injuries;
|
|
QMap<int, ProjectDataManagement::SanitationInjuryKind> m_injuryKind;
|
|
QMap<int, ProjectDataManagement::SanitationInjuryPlace1> m_injuryPlace1;
|
|
QMap<int, ProjectDataManagement::SanitationInjuryPlace2> m_injuryPlace2;
|
|
|
|
LOGGER_T m_logger;
|
|
|
|
};
|
|
}
|