forked from Lucky-spirit/Financial-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodbiver.cpp
More file actions
62 lines (52 loc) · 2.28 KB
/
modbiver.cpp
File metadata and controls
62 lines (52 loc) · 2.28 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "modbiver.h"
modBiver::modBiver(QWidget *parent) :
EvgBasicModel(CountBiver,
parent,
tr("qrc:/models/biver"),
tr("Модель Бівера"),
tr("Система коефіцієнтів У.Бівера"))
{
pLabelResult->setText(tr(""));
}
float modBiver::getResult() const
{
return pCoefficientRows[0]->getValue();
}
void modBiver::setRowsDefinitions()
{
pCoefficientRows[0]->setTextDefinition(tr("– коефіцієнт Бівера"));
pCoefficientRows[1]->setTextDefinition(tr("– рентабельність активів"));
pCoefficientRows[2]->setTextDefinition(tr("– коефіцієнт фінансового левериджу"));
pCoefficientRows[3]->setTextDefinition(tr("– коефіцієнт покриття активів обіговим капіталом"));
pCoefficientRows[4]->setTextDefinition(tr("– коефіцієнт загальної ліквідності"));
}
void modBiver::setResultValue()
{
pLabelResult->setText(tr(""));
}
void modBiver::calculate(EvgBasicModel *pInputData)
{
// (13+14)/(7+8)
if (pInputData->getValue(6) + pInputData->getValue(7))
pCoefficientRows[0]->setValue((pInputData->getValue(12) + pInputData->getValue(13))/(pInputData->getValue(6) + pInputData->getValue(7)));
// (11/9)*100
if (pInputData->getValue(8))
pCoefficientRows[1]->setValue(pInputData->getValue(10)/pInputData->getValue(8) * 100.0f);
// (7+8)/(9-7-8)
if (pInputData->getValue(8) - pInputData->getValue(6) - pInputData->getValue(7))
pCoefficientRows[2]->setValue((pInputData->getValue(6) + pInputData->getValue(7))\
/ (pInputData->getValue(8) - pInputData->getValue(6) - pInputData->getValue(7)));
// 2/9
if (pInputData->getValue(8))
pCoefficientRows[3]->setValue(pInputData->getValue(1)/pInputData->getValue(8));
// 2/8
if (pInputData->getValue(7))
pCoefficientRows[4]->setValue(pInputData->getValue(1)/pInputData->getValue(7));
result = pCoefficientRows[0]->getValue();
if (result > 0.4)
_state = TypeStateStable;
else if (result <= 0.4 && result > 0.17)
_state = TypeStateMiddle;
else
_state = TypeStateUnstable;
}