Skip to content

Commit

Permalink
Miglioramento GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
gpicchiarelli committed Oct 29, 2023
1 parent 21bde25 commit b7103b9
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions AccordaGUItar/AccordaGUItar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ private void SelezionaCorda_SelectionChanged(object sender, SelectionChangedEven
string cordaInfo = cordaSelezionata.Content.ToString();
if (cordaInfo is not null)
{
double targetFrequency = GetTargetFrequency(); // Ottieni la frequenza target in base alla corda selezionata dal ComboBox
gauge.FromValue = 0;
gauge.ToValue = targetFrequency * 2;

// Avvia l'accordatura con la nuova soglia
AvviaAccordatura();
}
Expand All @@ -81,16 +85,10 @@ private void AvviaAccordatura()
if (FrequenzaAttuale.Text.Trim() != String.Empty)
{
double targetFrequency = GetTargetFrequency(); // Ottieni la frequenza target in base alla corda selezionata dal ComboBox
gauge.ToValue = targetFrequency;
gauge.FromValue = 0;
gauge.ToValue = targetFrequency * 2;
double currentFrequency = double.Parse(FrequenzaAttuale.Text);

double frequencyDifference = currentFrequency - targetFrequency;
double differencePercentage = (frequencyDifference / (targetFrequency / 2)) * 100.0;

const int MaxValue = 100;
int progressValue = MaxValue - (int)differencePercentage;
progressValue = Math.Max(0, Math.Min(MaxValue, progressValue));
gauge.Value = progressValue;
gauge.Value = currentFrequency;
}
}

Expand Down
Binary file modified AccordaGUItar/bin/Debug/net7.0-windows/AccordaGUItar.dll
Binary file not shown.
Binary file modified AccordaGUItar/bin/Debug/net7.0-windows/AccordaGUItar.pdb
Binary file not shown.
Binary file modified AccordaGUItar/obj/Debug/net7.0-windows/AccordaGUItar.dll
Binary file not shown.
Binary file modified AccordaGUItar/obj/Debug/net7.0-windows/AccordaGUItar.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified accorda.net/.vs/Accorda/v17/.suo
Binary file not shown.

0 comments on commit b7103b9

Please sign in to comment.