Skip to content

Commit

Permalink
now with filter template...
Browse files Browse the repository at this point in the history
  • Loading branch information
braunms committed Jul 21, 2024
1 parent 168de5e commit a750bca
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<Compile Include="Data\GenericDataStructure.cs" />
<Compile Include="Data\GenericMetaData.cs" />
<Compile Include="Filtering\RowSelectionFilter.cs" />
<None Include="Filtering\Filter.cs.template" />
<Compile Include="Filtering\Filter.cs" />
<Compile Include="Filtering\TransposeFilter.cs" />
<Compile Include="Filtering\FilterManager.cs" />
<Compile Include="GUI\LoadingProgressBar.cs">
Expand Down
117 changes: 84 additions & 33 deletions Core/Filtering/Filter.cs.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,106 @@ see https://github.com/IntCDC/VisuAlFroG/blob/main/docs/developer-guide.md
*/
namespace Core
{
namespace Filter
{
public class CustomFilter : AbstractFilter
{
/* ------------------------------------------------------------------*/
#region public classes

/// <summary>
/// Class defining the configuration required for restoring content.
/// </summary>
/*
namespace Filter
{
public class CustomFilter : AbstractFilter
{
/* ------------------------------------------------------------------*/
#region public classes

/// <summary>
/// Class defining the configuration required for restoring content.
/// </summary>
/*
public class Configuration : AbstractFilter.Configuration
{
/// XXX TODO Add additional information required to restore the filter
}
* */

#endregion
#endregion

/* ------------------------------------------------------------------*/
#region public functions
/* ------------------------------------------------------------------*/
#region public functions

public CustomFilter()
{
_Name = "Filter Name";
/// TODO Uncomment if filter should only be applied to one content at once:
//_UniqueContent = true;
}

#endregion
#endregion

/* ------------------------------------------------------------------*/
#region protected functions
/* ------------------------------------------------------------------*/
#region protected functions

protected override UIElement create_update_ui(in GenericDataStructure in_data)
{
_Name = "Transpose";
protected override UIElement create_update_ui(in GenericDataStructure in_data)
{
if (_ui_element == null)
{
_ui_element = new Grid();
}
_ui_element.Children.Clear();

var ui = new TextBlock();
ui.Text = "Filter description ...";
/// TODO Uncomment if filter should only be applied to one content at once:
/*if (in_data == null)
{
var info = new TextBlock();
info.Text = "Select content to retrieve required filter information";
info.SetResourceReference(TextBlock.ForegroundProperty, "Brush_LogMessageWarn");
info.FontWeight = FontWeights.Bold;
info.Margin = new Thickness(_Margin);

_ui_element.Children.Add(info);
return _ui_element;
}
else
{*/
var info = new TextBlock();
info.Text = "TODO Add description";
info.FontWeight = FontWeights.Bold;
info.Margin = new Thickness(_Margin);

// Call when value has changed and filter should be applied with changes
// set_apply_dirty();

return ui;
}
/// TODO Create the filter UI and add it to the ui_element

protected override void apply_filter(GenericDataStructure out_data)
{
// Change in_out_data accordingly...

}
return _ui_element;
}
//}

protected override void apply_filter(GenericDataStructure out_data)
{
/// TODO Modify out_data accordingly:
/*for (int i = 0; i < out_data._Branches.Count; i++)
{
/// Use this loop if you modify the branches
}
foreach (var branch in out_data._Branches)
{
for (int i = 0; i < branch._Entries.Count; i++)
{
/// Use this loop if you modify the entries
}
}*/
}

#endregion

/* ------------------------------------------------------------------*/
#region private functions



#endregion

/* ------------------------------------------------------------------*/
#region private variables

private Grid _ui_element = null;

#endregion
}
}
#endregion
}
}
}
2 changes: 1 addition & 1 deletion Core/Filtering/RowSelectionFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected override UIElement create_update_ui(in GenericDataStructure in_data)
if (in_data == null)
{
var info = new TextBlock();
info.Text = "Select content to retrieve row information";
info.Text = "Select content to retrieve required filter information";
info.SetResourceReference(TextBlock.ForegroundProperty, "Brush_LogMessageWarn");
info.FontWeight = FontWeights.Bold;
info.Margin = new Thickness(_Margin);
Expand Down

0 comments on commit a750bca

Please sign in to comment.