Model | C:\Model\WheelOfFortune_EmbeddedEngineer.eap |
Embedded Engineer | 2.0.13047.30 |
Enterprise Architect | 1210 |
Date | 19.10.2015 09:59 |
Operation IdleSlowBlink{D32AEE44-B8EB-4bce-A4B5-41481DCD8CBD} | Differences Model <=> Code | New Value in Model |
---|---|---|
Changed: Both Model::WheelOfFortune::Implementation::WheelOfFortune::IdleSlowBlink C:\Code\WheelOfFortune.c | #define HUE_FILTER_COUNT 100
static float hueFilter[HUE_FILTER_COUNT] = {0};
static int hueFilterIdx;
float h = 0;
int idx = 0;
float distance;
int animationDuration = | <<<<<<< .model
#define HUE_FILTER_COUNT 100
static float hueFilter[HUE_FILTER_COUNT] = {0};
static int hueFilterIdx;
float h = 0;
int idx = 0;
float distance;
int animationDuration = 900;
me->lst.brightness = 1.0f;
distance = (float)abs((FSM_getTime() % animationDuration) - (animationDuration / 2)) / (float)(animationDuration / 2);
me->variableWaitTime = 10 + (1 - distance) * 10;
hueFilter[hueFilterIdx++ % HUE_FILTER_COUNT] = me->acc.angle;
// filter the hue values
for(idx = 0; idx < HUE_FILTER_COUNT; idx++) {
h += hueFilter[idx];
}
h /= HUE_FILTER_COUNT;
for(idx = 0; idx < me->lst.lightCount; idx++) {
LightStrip_SetColorHSV(&me->lst, idx, h, 1, distance);
}
if(distance < 0.01) {
me->animationSwitchable = true;
}
else {
me->animationSwitchable = false;
}
LightStrip_UpdateLights(&me->lst);
=======
#define HUE_FILTER_COUNT 100
static float hueFilter[HUE_FILTER_COUNT] = {0};
static int hueFilterIdx;
float h = 0;
int idx = 0;
float distance;
int animationDuration = 5000;
me->lst.brightness = 1.0f;
distance = (float)abs((FSM_getTime() % animationDuration) -
(animationDuration / 2)) /
(float)(animationDuration / 2);
me->variableWaitTime = 10 + (1 - distance) * 10;
hueFilter[hueFilterIdx++ % HUE_FILTER_COUNT] = me->acc.angle;
// filter the hue values
for (idx = 0; idx < HUE_FILTER_COUNT; idx++)
{
h += hueFilter[idx];
}
h /= HUE_FILTER_COUNT;
for (idx = 0; idx < me->lst.lightCount; idx++)
{
LightStrip_SetColorHSV(&me->lst, idx, h, 1, distance);
}
if (distance < 0.01)
{
me->animationSwitchable = true;
}
else
{
me->animationSwitchable = false;
}
LightStrip_UpdateLights(&me->lst);
>>>>>>> .code |
Operation FirstPrize{2EA025D2-7EC9-4bd6-959B-6E2CCD320EE3} | Differences Model <=> Code | New Value in Model |
Changed: Code Model::WheelOfFortune::Implementation::WheelOfFortune::FirstPrize C:\Code\WheelOfFortune.c | static const int sektorSize = 34;
static int sektorStart = 0;
static const float hue1 = 0.0f * APP_PI / 180.0f;
static const float hue2 = 120.0f * APP_PI / 180.0f;
static const float hue3 = 240.0f * APP_PI / 180.0f;
static uint32_t animationCount = 0;
me->lst.brightness = 1.0f;
uint8_t ledCount = me->lst.lightCount;
int idx = 0;
int cnt = 0;
me->variableWaitTime = | static const int sektorSize = 34;
static int sektorStart = 0;
static const float hue1 = 0.0f * APP_PI / 180.0f;
static const float hue2 = 120.0f * APP_PI / 180.0f;
static const float hue3 = 240.0f * APP_PI / 180.0f;
static uint32_t animationCount = 0;
me->lst.brightness = 1.0f;
uint8_t ledCount = me->lst.lightCount;
int idx = 0;
int cnt = 0;
me->variableWaitTime = 20;
// draw the sectors
for (cnt = 0; cnt < ledCount; cnt++)
{
idx = (sektorStart + cnt) % ledCount;
if (cnt < sektorSize * 1)
{
LightStrip_SetColorHSV(&me->lst, idx, hue1, 1.0f, 1.0f);
}
else if (cnt < sektorSize * 2)
{
LightStrip_SetColorHSV(&me->lst, idx, hue2, 1.0f, 1.0f);
}
else
{
LightStrip_SetColorHSV(&me->lst, idx, hue3, 1.0f, 1.0f);
}
}
if (animationCount >= 1000 && sektorStart == 0)
{
me->animationSwitchable = true;
animationCount = 0;
sektorStart = 0;
}
else
{
me->animationSwitchable = false;
animationCount++;
sektorStart = (sektorStart + 1) % ledCount;
}
LightStrip_UpdateLights(&me->lst); |
Operation SecondPrize{3198B5A9-B0F6-4ea8-8550-74990771E11A} | Differences Model <=> Code | New Value in Model |
Changed: Model Model::WheelOfFortune::Implementation::WheelOfFortune::SecondPrize C:\Code\WheelOfFortune.c | static const float hue1 = 0.0f * APP_PI / 180.0f;
static const float hue2 = 120.0f * APP_PI / 180.0f;
static uint32_t cycle = 0;
int idx;
uint8_t ledCount = me->lst.lightCount;
me->variableWaitTime = | static const float hue1 = 0.0f * APP_PI / 180.0f;
static const float hue2 = 120.0f * APP_PI / 180.0f;
static uint32_t cycle = 0;
int idx;
uint8_t ledCount = me->lst.lightCount;
me->variableWaitTime = 500;
me->lst.brightness = 1.0f;
uint32_t cycleMod = cycle % 4;
for(idx = 0; idx < ledCount; idx++)
{
if(idx % 4 == cycleMod || (idx + 1) % 4 == cycleMod)
{
LightStrip_SetColorHSV(&me->lst, idx, hue1, 1.0f, 1.0f);
}
else
{
LightStrip_SetColorHSV(&me->lst, idx, hue2, 1.0f, 1.0f);
}
}
if(cycle > 80)
{
me->animationSwitchable = true;
cycle = 0;
}
else
{
me->animationSwitchable = false;
cycle++;
}
LightStrip_UpdateLights(&me->lst); |
Operation ConsolationPrize{C2FF5DD4-D0C7-43df-8386-3D4C826E17E5} | Differences Model <=> Code | New Value in Model |
Changed: Model Model::WheelOfFortune::Implementation::WheelOfFortune::ConsolationPrize C:\Code\WheelOfFortune.c | static const float h = 24.0f * APP_PI / 180.0f;
int idx = 0;
float distance;
int animationDuration = 1 | static const float h = 24.0f * APP_PI / 180.0f;
int idx = 0;
float distance;
int animationDuration = 1600;
int lightCount = me->lst.lightCount;
static float decliningValue = 1.0f;
static uint32_t animationCount = 0;
float peak = 0.5f;
float sharpness = 0.1f;
int currentCycle = FSM_getTime() % animationDuration;
me->lst.brightness = 1.0f;
me->variableWaitTime = 10;
distance = (float)currentCycle / (float)animationDuration;
float valuePeak = fminf(1, 0.5f + fmaxf(0, exp(-((distance - peak) * (distance - peak)) / (2 * sharpness * sharpness))));
float value = valuePeak * decliningValue;
for(idx = 0; idx < lightCount; idx++)
{
LightStrip_SetColorHSV(&me->lst, idx, h, 1.0f, value);
}
if(animationCount > 500)
{
me->animationSwitchable = true;
animationCount = 0;
decliningValue = 1.0f;
}
else
{
me->animationSwitchable = false;
animationCount++;
decliningValue -= (500.0f - animationCount) / 120000.0f;
}
LightStrip_UpdateLights(&me->lst); |
Generated by LieberLieber Embedded Engineer