on site edits
This commit is contained in:
parent
b32ca1d092
commit
d6eabfe3ac
|
@ -4,7 +4,7 @@ layers_count: 3;
|
||||||
blocks_count: 4;
|
blocks_count: 4;
|
||||||
playable_range:{
|
playable_range:{
|
||||||
min: 0;
|
min: 0;
|
||||||
max: 2000;
|
max: 10000;
|
||||||
};
|
};
|
||||||
layers:{
|
layers:{
|
||||||
layer:{
|
layer:{
|
||||||
|
@ -24,7 +24,7 @@ blocks:{
|
||||||
block:{
|
block:{
|
||||||
frame_range:{
|
frame_range:{
|
||||||
min: 0;
|
min: 0;
|
||||||
max: 2000;
|
max: 19;
|
||||||
};
|
};
|
||||||
layer_index: 0;
|
layer_index: 0;
|
||||||
animation_name: "Pattern_BulbMask";
|
animation_name: "Pattern_BulbMask";
|
||||||
|
@ -32,7 +32,7 @@ blocks:{
|
||||||
block:{
|
block:{
|
||||||
frame_range:{
|
frame_range:{
|
||||||
min: 0;
|
min: 0;
|
||||||
max: 2000;
|
max: 10000;
|
||||||
};
|
};
|
||||||
layer_index: 1;
|
layer_index: 1;
|
||||||
animation_name: "Pattern_Leafy";
|
animation_name: "Pattern_Leafy";
|
||||||
|
@ -40,15 +40,15 @@ blocks:{
|
||||||
block:{
|
block:{
|
||||||
frame_range:{
|
frame_range:{
|
||||||
min: 0;
|
min: 0;
|
||||||
max: 1032;
|
max: 5156;
|
||||||
};
|
};
|
||||||
layer_index: 2;
|
layer_index: 2;
|
||||||
animation_name: "Pattern_Rainbow";
|
animation_name: "Pattern_Rainbow";
|
||||||
};
|
};
|
||||||
block:{
|
block:{
|
||||||
frame_range:{
|
frame_range:{
|
||||||
min: 959;
|
min: 5040;
|
||||||
max: 2000;
|
max: 10000;
|
||||||
};
|
};
|
||||||
layer_index: 2;
|
layer_index: 2;
|
||||||
animation_name: "Pattern_Wavy";
|
animation_name: "Pattern_Wavy";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
lumenarium_animation_file;
|
lumenarium_animation_file;
|
||||||
animation_name: "wavy_0";
|
animation_name: "wavy_0";
|
||||||
layers_count: 2;
|
layers_count: 2;
|
||||||
blocks_count: 1;
|
blocks_count: 2;
|
||||||
playable_range:{
|
playable_range:{
|
||||||
min: 0;
|
min: 0;
|
||||||
max: 7200;
|
max: 7200;
|
||||||
|
@ -9,11 +9,11 @@ playable_range:{
|
||||||
layers:{
|
layers:{
|
||||||
layer:{
|
layer:{
|
||||||
name: "[New Layer]";
|
name: "[New Layer]";
|
||||||
blend: "Add";
|
blend: "Overwrite";
|
||||||
};
|
};
|
||||||
layer:{
|
layer:{
|
||||||
name: "Color";
|
name: "Color";
|
||||||
blend: "Add";
|
blend: "Multiply";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
blocks:{
|
blocks:{
|
||||||
|
@ -25,4 +25,12 @@ blocks:{
|
||||||
layer_index: 1;
|
layer_index: 1;
|
||||||
animation_name: "Pattern_Wavy";
|
animation_name: "Pattern_Wavy";
|
||||||
};
|
};
|
||||||
|
block:{
|
||||||
|
frame_range:{
|
||||||
|
min: 78;
|
||||||
|
max: 3571;
|
||||||
|
};
|
||||||
|
layer_index: 0;
|
||||||
|
animation_name: "Pattern_Leafy";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,132 +0,0 @@
|
||||||
lumenarium_animation_file;
|
|
||||||
animation_name: "demo_anim";
|
|
||||||
layers_count: 2;
|
|
||||||
blocks_count: 14;
|
|
||||||
playable_range:{
|
|
||||||
min: 0;
|
|
||||||
max: 10000;
|
|
||||||
};
|
|
||||||
layers:{
|
|
||||||
layer:{
|
|
||||||
name: "main";
|
|
||||||
blend: "Add";
|
|
||||||
};
|
|
||||||
layer:{
|
|
||||||
name: "color";
|
|
||||||
blend: "Multiply";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
blocks:{
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 2428;
|
|
||||||
max: 3017;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_HueShift";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 1711;
|
|
||||||
max: 2487;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_Rainbow";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 0;
|
|
||||||
max: 603;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_VerticalLines";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 2945;
|
|
||||||
max: 3656;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_Wavy";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 3592;
|
|
||||||
max: 4296;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_Patchy";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 520;
|
|
||||||
max: 1225;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_Rotary";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 4218;
|
|
||||||
max: 4939;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_LeafyPatchy";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 4849;
|
|
||||||
max: 5431;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_HueShift";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 1149;
|
|
||||||
max: 1819;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_Leafy";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 5529;
|
|
||||||
max: 7782;
|
|
||||||
};
|
|
||||||
layer_index: 1;
|
|
||||||
animation_name: "Pattern_Wavy";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 5529;
|
|
||||||
max: 5979;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_Leafy";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 5912;
|
|
||||||
max: 6328;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_VerticalLines";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 6281;
|
|
||||||
max: 6581;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_Rotary";
|
|
||||||
};
|
|
||||||
block:{
|
|
||||||
frame_range:{
|
|
||||||
min: 6524;
|
|
||||||
max: 7025;
|
|
||||||
};
|
|
||||||
layer_index: 0;
|
|
||||||
animation_name: "Pattern_HueShift";
|
|
||||||
};
|
|
||||||
};
|
|
|
@ -328,7 +328,7 @@ Pattern_Leafy(led_buffer* Leds, led_buffer_range Range, assembly Assembly, r32 T
|
||||||
{
|
{
|
||||||
DEBUG_TRACK_FUNCTION;
|
DEBUG_TRACK_FUNCTION;
|
||||||
blumen_lumen_state* BLState = (blumen_lumen_state*)UserData;
|
blumen_lumen_state* BLState = (blumen_lumen_state*)UserData;
|
||||||
Time = Time * BLState->PatternSpeed;
|
Time = Time * BLState->PatternSpeed * .3f;
|
||||||
|
|
||||||
phrase_hue Hue = BlumenLumen_GetCurrentHue(BLState, Assembly);
|
phrase_hue Hue = BlumenLumen_GetCurrentHue(BLState, Assembly);
|
||||||
v4 C0 = RGBFromPhraseHue(Hue.Hue0);
|
v4 C0 = RGBFromPhraseHue(Hue.Hue0);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -574,6 +574,8 @@ BlumenLumen_CustomUpdate(gs_data UserData, app_state* State, context* Context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (BLState->InPhraseReceptionMode)
|
if (BLState->InPhraseReceptionMode)
|
||||||
{
|
{
|
||||||
r32 SecondsSincePhraseBegan = SecondsElapsed(BLState->TimePhraseReceptionBegan, Context->SystemTime_Current);
|
r32 SecondsSincePhraseBegan = SecondsElapsed(BLState->TimePhraseReceptionBegan, Context->SystemTime_Current);
|
||||||
|
@ -759,7 +761,7 @@ BlumenLumen_CustomUpdate(gs_data UserData, app_state* State, context* Context)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dim the leds based on temp data
|
// Dim the leds based on temp data
|
||||||
if (!BLState->DEBUG_IgnoreWeatherDimmingLeds)
|
if (false && !BLState->DEBUG_IgnoreWeatherDimmingLeds)
|
||||||
{
|
{
|
||||||
for (u32 i = 0; i < State->LedSystem.BuffersCount; i++)
|
for (u32 i = 0; i < State->LedSystem.BuffersCount; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@ global time_range LedOnTimes[] = {
|
||||||
{ 00, 00, 06, 30 },
|
{ 00, 00, 06, 30 },
|
||||||
};
|
};
|
||||||
global u32 LedOnTimesCount = CArrayLength(LedOnTimes); // do not edit
|
global u32 LedOnTimesCount = CArrayLength(LedOnTimes); // do not edit
|
||||||
global b8 DEBUGIgnoreLedOnTimeRange = true;
|
global b8 DEBUGIgnoreLedOnTimeRange = false;
|
||||||
|
|
||||||
// How long it takes to fade from the default pattern to the
|
// How long it takes to fade from the default pattern to the
|
||||||
// voice activated pattern
|
// voice activated pattern
|
||||||
|
|
|
@ -22,163 +22,163 @@ global log_buffer* GlobalLogBuffer;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
v3 CenterStart;
|
v3 CenterStart;
|
||||||
v3 CenterEnd;
|
v3 CenterEnd;
|
||||||
r32 Radius;
|
r32 Radius;
|
||||||
u32 SegmentsCount;
|
u32 SegmentsCount;
|
||||||
u32 SubsegmentsCount;
|
u32 SubsegmentsCount;
|
||||||
u32 SubsegmentLeds;
|
u32 SubsegmentLeds;
|
||||||
|
|
||||||
// SACN
|
// SACN
|
||||||
u32 SACNUniverseStart;
|
u32 SACNUniverseStart;
|
||||||
u32 SACNChannelStart;
|
u32 SACNChannelStart;
|
||||||
|
|
||||||
// UART
|
// UART
|
||||||
// Only one of these two values is needed.
|
// Only one of these two values is needed.
|
||||||
// If ChannelsArray != 0, then it will be used, and assumed to
|
// If ChannelsArray != 0, then it will be used, and assumed to
|
||||||
// have SegmentsCount values
|
// have SegmentsCount values
|
||||||
// Otherwise, each segment will increment from ChannelStart
|
// Otherwise, each segment will increment from ChannelStart
|
||||||
u32 ChannelStart;
|
u32 ChannelStart;
|
||||||
u32* ChannelsArray;
|
u32* ChannelsArray;
|
||||||
|
|
||||||
char* ComPort;
|
char* ComPort;
|
||||||
char* SectionTagValue;
|
char* SectionTagValue;
|
||||||
char* FlowerTagValue;
|
char* FlowerTagValue;
|
||||||
} loop_desc;
|
} loop_desc;
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
BuildLoop(gs_string* OutputBuffer, loop_desc Desc)
|
BuildLoop(gs_string* OutputBuffer, loop_desc Desc)
|
||||||
{
|
{
|
||||||
r32 SegmentsArc = TauR32 / Desc.SegmentsCount;
|
r32 SegmentsArc = TauR32 / Desc.SegmentsCount;
|
||||||
r32 SubsegmentsArc = SegmentsArc / Desc.SubsegmentsCount;
|
r32 SubsegmentsArc = SegmentsArc / Desc.SubsegmentsCount;
|
||||||
|
|
||||||
for (u32 i = 0; i < Desc.SegmentsCount; i++)
|
|
||||||
{
|
|
||||||
r32 ArcBase = SegmentsArc * i;
|
|
||||||
|
|
||||||
u32 Channel = 0;
|
for (u32 i = 0; i < Desc.SegmentsCount; i++)
|
||||||
if (Desc.ChannelsArray != 0)
|
|
||||||
{
|
{
|
||||||
Channel = Desc.ChannelsArray[i];
|
r32 ArcBase = SegmentsArc * i;
|
||||||
}
|
|
||||||
else
|
u32 Channel = 0;
|
||||||
{
|
if (Desc.ChannelsArray != 0)
|
||||||
Channel = Desc.ChannelStart + i;
|
{
|
||||||
|
Channel = Desc.ChannelsArray[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Channel = Desc.ChannelStart + i;
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteLedStripOpen(OutputBuffer, Channel, Desc.ComPort,
|
||||||
|
Desc.SACNUniverseStart, Desc.SACNChannelStart);
|
||||||
|
WriteSegmentSequenceOpen(OutputBuffer, Desc.SubsegmentsCount);
|
||||||
|
|
||||||
|
for (u32 j = 0; j < Desc.SubsegmentsCount; j++)
|
||||||
|
{
|
||||||
|
r32 Arc = ArcBase + (SubsegmentsArc * j);
|
||||||
|
v3 Offset = v3{ SinR32(Arc), 0, CosR32(Arc) } * Desc.Radius;
|
||||||
|
v3 P0 = Desc.CenterStart + Offset;
|
||||||
|
v3 P1 = Desc.CenterEnd + Offset;
|
||||||
|
|
||||||
|
// Swap directions on the middle strip
|
||||||
|
if (j%2 != 0)
|
||||||
|
{
|
||||||
|
v3 Temp = P0;
|
||||||
|
P0 = P1;
|
||||||
|
P1 = Temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteSegmentSequenceSegment(OutputBuffer, P0, P1, Desc.SubsegmentLeds);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteSegmentSequenceClose(OutputBuffer);
|
||||||
|
WriteSegmentTagsOpen(OutputBuffer, 2);
|
||||||
|
WriteSegmentTag(OutputBuffer, "section", Desc.SectionTagValue);
|
||||||
|
WriteSegmentTag(OutputBuffer, "flower", Desc.FlowerTagValue);
|
||||||
|
WriteSegmentTagsClose(OutputBuffer);
|
||||||
|
WriteLedStripClose(OutputBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteLedStripOpen(OutputBuffer, Channel, Desc.ComPort,
|
|
||||||
Desc.SACNUniverseStart, Desc.SACNChannelStart);
|
|
||||||
WriteSegmentSequenceOpen(OutputBuffer, Desc.SubsegmentsCount);
|
|
||||||
|
|
||||||
for (u32 j = 0; j < Desc.SubsegmentsCount; j++)
|
|
||||||
{
|
|
||||||
r32 Arc = ArcBase + (SubsegmentsArc * j);
|
|
||||||
v3 Offset = v3{ SinR32(Arc), 0, CosR32(Arc) } * Desc.Radius;
|
|
||||||
v3 P0 = Desc.CenterStart + Offset;
|
|
||||||
v3 P1 = Desc.CenterEnd + Offset;
|
|
||||||
|
|
||||||
// Swap directions on the middle strip
|
|
||||||
if (j%2 != 0)
|
|
||||||
{
|
|
||||||
v3 Temp = P0;
|
|
||||||
P0 = P1;
|
|
||||||
P1 = Temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteSegmentSequenceSegment(OutputBuffer, P0, P1, Desc.SubsegmentLeds);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteSegmentSequenceClose(OutputBuffer);
|
|
||||||
WriteSegmentTagsOpen(OutputBuffer, 2);
|
|
||||||
WriteSegmentTag(OutputBuffer, "section", Desc.SectionTagValue);
|
|
||||||
WriteSegmentTag(OutputBuffer, "flower", Desc.FlowerTagValue);
|
|
||||||
WriteSegmentTagsClose(OutputBuffer);
|
|
||||||
WriteLedStripClose(OutputBuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
v3 Pos;
|
v3 Pos;
|
||||||
char* ComPort;
|
char* ComPort;
|
||||||
char* FlowerTagValue;
|
char* FlowerTagValue;
|
||||||
|
|
||||||
// SACN
|
// SACN
|
||||||
u32 SACNStemInnerStartUniverse;
|
u32 SACNStemInnerStartUniverse;
|
||||||
u32 SACNStemOuterStartUniverse;
|
u32 SACNStemOuterStartUniverse;
|
||||||
u32 SACNFlowerStemStartUniverse;
|
u32 SACNFlowerStemStartUniverse;
|
||||||
|
|
||||||
// UART
|
// UART
|
||||||
u32* StemChannels;
|
u32* StemChannels;
|
||||||
u32* BloomOuterChannels;
|
u32* BloomOuterChannels;
|
||||||
u32* BloomInnerChannels;
|
u32* BloomInnerChannels;
|
||||||
} flower_desc;
|
} flower_desc;
|
||||||
|
|
||||||
internal u32
|
internal u32
|
||||||
BuildFlower(gs_string* OutputBuffer, flower_desc Desc)
|
BuildFlower(gs_string* OutputBuffer, flower_desc Desc)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// the bloom stem inner
|
// the bloom stem inner
|
||||||
loop_desc BloomStemInner = {};
|
loop_desc BloomStemInner = {};
|
||||||
BloomStemInner.CenterStart = v3{0, 1.4f, 0};
|
BloomStemInner.CenterStart = v3{0, 1.4f, 0};
|
||||||
BloomStemInner.CenterEnd = v3{0, .9f, 0};
|
BloomStemInner.CenterEnd = v3{0, .9f, 0};
|
||||||
BloomStemInner.Radius = .05f;
|
BloomStemInner.Radius = .05f;
|
||||||
//BloomStemInner.SegmentsCount = 6;
|
//BloomStemInner.SegmentsCount = 6;
|
||||||
BloomStemInner.SegmentsCount = 1;
|
BloomStemInner.SegmentsCount = 1;
|
||||||
BloomStemInner.SubsegmentsCount = 3;
|
BloomStemInner.SubsegmentsCount = 3;
|
||||||
BloomStemInner.SubsegmentLeds = 35;
|
BloomStemInner.SubsegmentLeds = 35;
|
||||||
BloomStemInner.SACNUniverseStart = Desc.SACNStemInnerStartUniverse;
|
BloomStemInner.SACNUniverseStart = Desc.SACNStemInnerStartUniverse;
|
||||||
BloomStemInner.SACNChannelStart = 1;
|
BloomStemInner.SACNChannelStart = 1;
|
||||||
BloomStemInner.ChannelsArray = Desc.BloomInnerChannels;
|
BloomStemInner.ChannelsArray = Desc.BloomInnerChannels;
|
||||||
BloomStemInner.ComPort = Desc.ComPort;
|
BloomStemInner.ComPort = Desc.ComPort;
|
||||||
BloomStemInner.SectionTagValue = "inner_bloom";
|
BloomStemInner.SectionTagValue = "inner_bloom";
|
||||||
BloomStemInner.FlowerTagValue = Desc.FlowerTagValue;
|
BloomStemInner.FlowerTagValue = Desc.FlowerTagValue;
|
||||||
BuildLoop(OutputBuffer, BloomStemInner);
|
BuildLoop(OutputBuffer, BloomStemInner);
|
||||||
|
|
||||||
// the bloom stem outer
|
// the bloom stem outer
|
||||||
loop_desc BloomStemOuter = {};
|
loop_desc BloomStemOuter = {};
|
||||||
BloomStemOuter.CenterStart = v3{0, .5f, 0};
|
BloomStemOuter.CenterStart = v3{0, .5f, 0};
|
||||||
BloomStemOuter.CenterEnd = v3{0, .9f, 0};
|
BloomStemOuter.CenterEnd = v3{0, .9f, 0};
|
||||||
BloomStemOuter.Radius = .07f;
|
BloomStemOuter.Radius = .07f;
|
||||||
//BloomStemOuter.SegmentsCount = 9;
|
//BloomStemOuter.SegmentsCount = 9;
|
||||||
BloomStemOuter.SegmentsCount = 1;
|
BloomStemOuter.SegmentsCount = 1;
|
||||||
BloomStemOuter.SubsegmentsCount = 3;
|
BloomStemOuter.SubsegmentsCount = 3;
|
||||||
BloomStemOuter.SubsegmentLeds = 41;
|
BloomStemOuter.SubsegmentLeds = 41;
|
||||||
BloomStemOuter.SACNUniverseStart = Desc.SACNStemOuterStartUniverse;
|
BloomStemOuter.SACNUniverseStart = Desc.SACNStemOuterStartUniverse;
|
||||||
BloomStemOuter.SACNChannelStart = 1;
|
BloomStemOuter.SACNChannelStart = 1;
|
||||||
BloomStemOuter.ChannelsArray = Desc.BloomOuterChannels;
|
BloomStemOuter.ChannelsArray = Desc.BloomOuterChannels;
|
||||||
BloomStemOuter.ComPort = Desc.ComPort;
|
BloomStemOuter.ComPort = Desc.ComPort;
|
||||||
BloomStemOuter.SectionTagValue = "outer_bloom";
|
BloomStemOuter.SectionTagValue = "outer_bloom";
|
||||||
BloomStemOuter.FlowerTagValue = Desc.FlowerTagValue;
|
BloomStemOuter.FlowerTagValue = Desc.FlowerTagValue;
|
||||||
BuildLoop(OutputBuffer, BloomStemOuter);
|
BuildLoop(OutputBuffer, BloomStemOuter);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// the flower stem
|
// the flower stem
|
||||||
loop_desc FlowerStem = {};
|
loop_desc FlowerStem = {};
|
||||||
FlowerStem.CenterStart = v3{0, -1.5f, 0};
|
FlowerStem.CenterStart = v3{0, .5f, 0};
|
||||||
FlowerStem.CenterEnd = v3{0, .5f, 0};
|
FlowerStem.CenterEnd = v3{0, -1.5f, 0};
|
||||||
FlowerStem.Radius = .05f;
|
FlowerStem.Radius = .05f;
|
||||||
//FlowerStem.SegmentsCount = 6;
|
//FlowerStem.SegmentsCount = 6;
|
||||||
FlowerStem.SegmentsCount = 1;
|
FlowerStem.SegmentsCount = 1;
|
||||||
FlowerStem.SubsegmentsCount = 1;
|
FlowerStem.SubsegmentsCount = 1;
|
||||||
FlowerStem.SubsegmentLeds = 300;
|
FlowerStem.SubsegmentLeds = 300;
|
||||||
FlowerStem.SACNUniverseStart = Desc.SACNFlowerStemStartUniverse;
|
FlowerStem.SACNUniverseStart = Desc.SACNFlowerStemStartUniverse;
|
||||||
FlowerStem.SACNChannelStart = 1;
|
FlowerStem.SACNChannelStart = 1;
|
||||||
FlowerStem.ChannelsArray = Desc.StemChannels;
|
FlowerStem.ChannelsArray = Desc.StemChannels;
|
||||||
FlowerStem.ComPort = Desc.ComPort;
|
FlowerStem.ComPort = Desc.ComPort;
|
||||||
FlowerStem.SectionTagValue = "stem";
|
FlowerStem.SectionTagValue = "stem";
|
||||||
FlowerStem.FlowerTagValue = Desc.FlowerTagValue;
|
FlowerStem.FlowerTagValue = Desc.FlowerTagValue;
|
||||||
BuildLoop(OutputBuffer, FlowerStem);
|
BuildLoop(OutputBuffer, FlowerStem);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
u32 StripsCount = BloomStemInner.SegmentsCount;
|
u32 StripsCount = BloomStemInner.SegmentsCount;
|
||||||
StripsCount += BloomStemOuter.SegmentsCount;
|
StripsCount += BloomStemOuter.SegmentsCount;
|
||||||
StripsCount += FlowerStem.SegmentsCount;
|
StripsCount += FlowerStem.SegmentsCount;
|
||||||
|
|
||||||
return StripsCount;
|
return StripsCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Just for brevity, no real function provided
|
// Just for brevity, no real function provided
|
||||||
|
@ -186,116 +186,116 @@ BuildFlower(gs_string* OutputBuffer, flower_desc Desc)
|
||||||
internal u8
|
internal u8
|
||||||
FlowerStripToChannel(u8 Flower, u8 Channel)
|
FlowerStripToChannel(u8 Flower, u8 Channel)
|
||||||
{
|
{
|
||||||
Assert(Flower < 3);
|
Assert(Flower < 3);
|
||||||
Assert(Channel < 8);
|
Assert(Channel < 8);
|
||||||
|
|
||||||
u8 Result = 0;
|
u8 Result = 0;
|
||||||
Result |= (Flower & 0x03) << 3;
|
Result |= (Flower & 0x03) << 3;
|
||||||
Result |= (Channel & 0x07);
|
Result |= (Channel & 0x07);
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int ArgCount, char** Args)
|
int main(int ArgCount, char** Args)
|
||||||
{
|
{
|
||||||
gs_thread_context Ctx = Win32CreateThreadContext();
|
gs_thread_context Ctx = Win32CreateThreadContext();
|
||||||
GlobalLogBuffer = PushStruct(Ctx.Transient, log_buffer);
|
GlobalLogBuffer = PushStruct(Ctx.Transient, log_buffer);
|
||||||
*GlobalLogBuffer = Log_Init(Ctx.Transient, 32);
|
*GlobalLogBuffer = Log_Init(Ctx.Transient, 32);
|
||||||
|
|
||||||
gs_string OutputBuffer0 = PushString(Ctx.Transient, MB(4));
|
gs_string OutputBuffer0 = PushString(Ctx.Transient, MB(4));
|
||||||
gs_string OutputBuffer1 = PushString(Ctx.Transient, MB(4));
|
gs_string OutputBuffer1 = PushString(Ctx.Transient, MB(4));
|
||||||
gs_string OutputBuffer2 = PushString(Ctx.Transient, MB(4));
|
gs_string OutputBuffer2 = PushString(Ctx.Transient, MB(4));
|
||||||
|
|
||||||
u32 StripCount = 3; // used to be 21
|
u32 StripCount = 3; // used to be 21
|
||||||
#if 0
|
#if 0
|
||||||
WriteAssemblyUARTOpen(&OutputBuffer0,
|
WriteAssemblyUARTOpen(&OutputBuffer0,
|
||||||
"Blumen Lumen - Silver Spring - 00",
|
"Blumen Lumen - Silver Spring - 00",
|
||||||
100,
|
100,
|
||||||
v3{-1, 0, 0},
|
v3{-1, 0, 0},
|
||||||
StripCount,
|
StripCount,
|
||||||
"");
|
"");
|
||||||
WriteAssemblyUARTOpen(&OutputBuffer1,
|
WriteAssemblyUARTOpen(&OutputBuffer1,
|
||||||
"Blumen Lumen - Silver Spring - 01",
|
"Blumen Lumen - Silver Spring - 01",
|
||||||
100,
|
100,
|
||||||
v3{0, 0, 0},
|
v3{0, 0, 0},
|
||||||
StripCount,
|
StripCount,
|
||||||
"");
|
"");
|
||||||
WriteAssemblyUARTOpen(&OutputBuffer2,
|
WriteAssemblyUARTOpen(&OutputBuffer2,
|
||||||
"Blumen Lumen - Silver Spring - 02",
|
"Blumen Lumen - Silver Spring - 02",
|
||||||
100,
|
100,
|
||||||
v3{1, 0, 0},
|
v3{1, 0, 0},
|
||||||
StripCount,
|
StripCount,
|
||||||
"");
|
"");
|
||||||
#else
|
#else
|
||||||
WriteAssemblySACNOpen(&OutputBuffer0,
|
WriteAssemblySACNOpen(&OutputBuffer0,
|
||||||
"Blumen Lumen - Silver Spring - 00",
|
"Blumen Lumen - Silver Spring - 00",
|
||||||
100,
|
100,
|
||||||
v3{-1, 0, 0},
|
v3{-1, 0, 0},
|
||||||
StripCount);
|
StripCount);
|
||||||
WriteAssemblySACNOpen(&OutputBuffer1,
|
WriteAssemblySACNOpen(&OutputBuffer1,
|
||||||
"Blumen Lumen - Silver Spring - 01",
|
"Blumen Lumen - Silver Spring - 01",
|
||||||
100,
|
100,
|
||||||
v3{0, 0, 0},
|
v3{0, 0, 0},
|
||||||
StripCount);
|
StripCount);
|
||||||
WriteAssemblySACNOpen(&OutputBuffer2,
|
WriteAssemblySACNOpen(&OutputBuffer2,
|
||||||
"Blumen Lumen - Silver Spring - 02",
|
"Blumen Lumen - Silver Spring - 02",
|
||||||
100,
|
100,
|
||||||
v3{1, 0, 0},
|
v3{1, 0, 0},
|
||||||
StripCount);
|
StripCount);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
u32 StripCountOut = 0;
|
u32 StripCountOut = 0;
|
||||||
|
|
||||||
u32 StemChannels[] = { FSC(2, 1), FSC(2, 2), FSC(2, 3), FSC(2, 4), FSC(2, 5), FSC(2, 6) };
|
u32 StemChannels[] = { FSC(2, 1), FSC(2, 2), FSC(2, 3), FSC(2, 4), FSC(2, 5), FSC(2, 6) };
|
||||||
u32 BloomOuterChannels[] = { FSC(1, 0), FSC(1, 1), FSC(1, 2), FSC(1, 3), FSC(1, 4), FSC(1, 5), FSC(1, 6), FSC(1, 7), FSC(2, 0) };
|
u32 BloomOuterChannels[] = { FSC(1, 0), FSC(1, 1), FSC(1, 2), FSC(1, 3), FSC(1, 4), FSC(1, 5), FSC(1, 6), FSC(1, 7), FSC(2, 0) };
|
||||||
u32 BloomInnerChannels[] = { FSC(0, 0), FSC(0, 1), FSC(0, 2), FSC(0, 3), FSC(0, 4), FSC(0, 5) };
|
u32 BloomInnerChannels[] = { FSC(0, 0), FSC(0, 1), FSC(0, 2), FSC(0, 3), FSC(0, 4), FSC(0, 5) };
|
||||||
flower_desc F0 = {};
|
flower_desc F0 = {};
|
||||||
F0.Pos = v3{0, 0, 0};
|
F0.Pos = v3{0, 0, 0};
|
||||||
F0.ComPort = "\\\\.\\COM11";
|
F0.ComPort = "\\\\.\\COM11";
|
||||||
F0.FlowerTagValue = "left";
|
F0.FlowerTagValue = "left";
|
||||||
F0.SACNStemInnerStartUniverse = 4;
|
F0.SACNStemInnerStartUniverse = 4;
|
||||||
F0.SACNStemOuterStartUniverse = 3;
|
F0.SACNStemOuterStartUniverse = 3;
|
||||||
F0.SACNFlowerStemStartUniverse = 1;
|
F0.SACNFlowerStemStartUniverse = 1;
|
||||||
F0.StemChannels = StemChannels;
|
F0.StemChannels = StemChannels;
|
||||||
F0.BloomOuterChannels = BloomOuterChannels;
|
F0.BloomOuterChannels = BloomOuterChannels;
|
||||||
F0.BloomInnerChannels = BloomInnerChannels;
|
F0.BloomInnerChannels = BloomInnerChannels;
|
||||||
StripCountOut += BuildFlower(&OutputBuffer0, F0);
|
StripCountOut += BuildFlower(&OutputBuffer0, F0);
|
||||||
|
|
||||||
flower_desc F1 = {};
|
flower_desc F1 = {};
|
||||||
F1.Pos = v3{0, 0, 0};
|
F1.Pos = v3{0, 0, 0};
|
||||||
F1.ComPort = "\\\\.\\COM12";
|
F1.ComPort = "\\\\.\\COM12";
|
||||||
F1.FlowerTagValue = "center";
|
F1.FlowerTagValue = "center";
|
||||||
F1.SACNStemInnerStartUniverse = 9;
|
F1.SACNStemInnerStartUniverse = 9;
|
||||||
F1.SACNStemOuterStartUniverse = 8;
|
F1.SACNStemOuterStartUniverse = 8;
|
||||||
F1.SACNFlowerStemStartUniverse = 6;
|
F1.SACNFlowerStemStartUniverse = 6;
|
||||||
F1.StemChannels = StemChannels;
|
F1.StemChannels = StemChannels;
|
||||||
F1.BloomInnerChannels = BloomInnerChannels;
|
F1.BloomInnerChannels = BloomInnerChannels;
|
||||||
F1.BloomOuterChannels = BloomOuterChannels;
|
F1.BloomOuterChannels = BloomOuterChannels;
|
||||||
StripCountOut += BuildFlower(&OutputBuffer1, F1);
|
StripCountOut += BuildFlower(&OutputBuffer1, F1);
|
||||||
|
|
||||||
flower_desc F2 = {};
|
flower_desc F2 = {};
|
||||||
F2.Pos = v3{0, 0, 0};
|
F2.Pos = v3{0, 0, 0};
|
||||||
F2.ComPort = "\\\\.\\COM6";
|
F2.ComPort = "\\\\.\\COM6";
|
||||||
F2.FlowerTagValue = "right";
|
F2.FlowerTagValue = "right";
|
||||||
F2.SACNStemInnerStartUniverse = 14;
|
F2.SACNStemInnerStartUniverse = 14;
|
||||||
F2.SACNStemOuterStartUniverse = 13;
|
F2.SACNStemOuterStartUniverse = 13;
|
||||||
F2.SACNFlowerStemStartUniverse = 11;
|
F2.SACNFlowerStemStartUniverse = 11;
|
||||||
F2.StemChannels = StemChannels;
|
F2.StemChannels = StemChannels;
|
||||||
F2.BloomInnerChannels = BloomInnerChannels;
|
F2.BloomInnerChannels = BloomInnerChannels;
|
||||||
F2.BloomOuterChannels = BloomOuterChannels;
|
F2.BloomOuterChannels = BloomOuterChannels;
|
||||||
StripCountOut += BuildFlower(&OutputBuffer2, F2);
|
StripCountOut += BuildFlower(&OutputBuffer2, F2);
|
||||||
|
|
||||||
WriteEntireFile(Ctx.FileHandler, ConstString("data/ss_blumen_one.fold"), StringToData(OutputBuffer0));
|
WriteEntireFile(Ctx.FileHandler, ConstString("data/ss_blumen_one.fold"), StringToData(OutputBuffer0));
|
||||||
WriteEntireFile(Ctx.FileHandler, ConstString("data/ss_blumen_two.fold"), StringToData(OutputBuffer1));
|
WriteEntireFile(Ctx.FileHandler, ConstString("data/ss_blumen_two.fold"), StringToData(OutputBuffer1));
|
||||||
WriteEntireFile(Ctx.FileHandler, ConstString("data/ss_blumen_three.fold"), StringToData(OutputBuffer2));
|
WriteEntireFile(Ctx.FileHandler, ConstString("data/ss_blumen_three.fold"), StringToData(OutputBuffer2));
|
||||||
|
|
||||||
//printf("%.*s\n", (u32)OutputBuffer.Length, OutputBuffer.Str);
|
//printf("%.*s\n", (u32)OutputBuffer.Length, OutputBuffer.Str);
|
||||||
//printf("%d\n", StripCount);
|
//printf("%d\n", StripCount);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue