Skip to content

Commit

Permalink
Clone BIP bug fixed, some small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdahlblom committed Nov 24, 2018
1 parent d08f590 commit 4d6b7e7
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Source/ClassLibraryCommon/Properties/AssemblyInfo.cs
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.105.6600")]
[assembly: AssemblyFileVersion("1.0.105.6600")]
[assembly: AssemblyVersion("1.0.107.5606")]
[assembly: AssemblyFileVersion("1.0.107.5606")]
47 changes: 47 additions & 0 deletions Source/DCS-BIOS/DCSBIOSOutput.cs
Expand Up @@ -71,6 +71,53 @@ private int Evaluate(uint data)
}
}
*/

public static DCSBIOSOutput CreateCopy(DCSBIOSOutput dcsbiosOutput)
{
var tmp = new DCSBIOSOutput();
tmp.DCSBiosOutputType = dcsbiosOutput.DCSBiosOutputType;
tmp.ControlId = dcsbiosOutput.ControlId;
tmp.Address = dcsbiosOutput.Address;
tmp.ControlDescription = dcsbiosOutput.ControlDescription;
tmp.ControlType = dcsbiosOutput.ControlType;
tmp.DCSBiosOutputComparison = dcsbiosOutput.DCSBiosOutputComparison;
tmp.Mask = dcsbiosOutput.Mask;
tmp.MaxLength = dcsbiosOutput.MaxLength;
tmp.MaxValue = dcsbiosOutput.MaxValue;
tmp.Shiftvalue = dcsbiosOutput.Shiftvalue;
if (tmp.DCSBiosOutputType == DCSBiosOutputType.INTEGER_TYPE)
{
tmp.SpecifiedValueInt = dcsbiosOutput.SpecifiedValueInt;
}
if (tmp.DCSBiosOutputType == DCSBiosOutputType.STRING_TYPE)
{
tmp.SpecifiedValueString = dcsbiosOutput.SpecifiedValueString;
}
return tmp;
}

public void Copy(DCSBIOSOutput dcsbiosOutput)
{
DCSBiosOutputType = dcsbiosOutput.DCSBiosOutputType;
ControlId = dcsbiosOutput.ControlId;
Address = dcsbiosOutput.Address;
ControlDescription = dcsbiosOutput.ControlDescription;
ControlType = dcsbiosOutput.ControlType;
DCSBiosOutputComparison = dcsbiosOutput.DCSBiosOutputComparison;
Mask = dcsbiosOutput.Mask;
MaxLength = dcsbiosOutput.MaxLength;
MaxValue = dcsbiosOutput.MaxValue;
Shiftvalue = dcsbiosOutput.Shiftvalue;
if (DCSBiosOutputType == DCSBiosOutputType.INTEGER_TYPE)
{
SpecifiedValueInt = dcsbiosOutput.SpecifiedValueInt;
}
if (DCSBiosOutputType == DCSBiosOutputType.STRING_TYPE)
{
SpecifiedValueString = dcsbiosOutput.SpecifiedValueString;
}
}

public bool CheckForValueMatchAndChange(object data)
{
//todo change not processed
Expand Down
4 changes: 2 additions & 2 deletions Source/DCS-BIOS/Properties/AssemblyInfo.cs
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.492.6600")]
[assembly: AssemblyFileVersion("2.1.492.6600")]
[assembly: AssemblyVersion("2.1.494.5606")]
[assembly: AssemblyFileVersion("2.1.494.5606")]
14 changes: 7 additions & 7 deletions Source/DCSFlightpanels/LEDConfigsWindow.xaml.cs
Expand Up @@ -4,6 +4,7 @@
using System.Windows.Controls;
using System.Windows.Input;
using ClassLibraryCommon;
using DCS_BIOS;
using NonVisuals;

namespace DCSFlightpanels
Expand Down Expand Up @@ -124,9 +125,7 @@ private void EditButton_OnClick(object sender, RoutedEventArgs e)
var dcsBiosOutputTriggerWindow = new DCSBiosOutputTriggerWindow(_dcsAirframe, "Set hook for color " + dcsOutputAndColorBinding.LEDColor, dcsOutputAndColorBinding.DCSBiosOutputLED);
if (dcsBiosOutputTriggerWindow.ShowDialog() == true)
{
_colorOutputBindings.Remove(dcsOutputAndColorBinding);
_colorOutputBindings.Add(_callingPanel.CreateDcsOutputAndColorBinding(_saitekPanelLEDPosition, dcsOutputAndColorBinding.LEDColor, dcsBiosOutputTriggerWindow.DCSBiosOutput));
ShowItems();
((DcsOutputAndColorBinding) DataGridValues.SelectedItem).DCSBiosOutputLED.Copy(dcsBiosOutputTriggerWindow.DCSBiosOutput);
}
ShowItems();
SetFormState();
Expand Down Expand Up @@ -213,7 +212,7 @@ private void ContextMenuColors_OnClick(object sender, RoutedEventArgs e)
return;
}

PanelLEDColor color = PanelLEDColor.DARK;
var color = PanelLEDColor.DARK;
var menu = (MenuItem)sender;

if (menu.Name.Contains("Dark"))
Expand Down Expand Up @@ -264,10 +263,11 @@ private void CloneButton_OnClick(object sender, RoutedEventArgs e)
{
e.Handled = true;
}
for (var i = 0; i < DataGridValues.SelectedItems.Count; i++)
foreach (var t in DataGridValues.SelectedItems)
{
var binding = (DcsOutputAndColorBinding)DataGridValues.SelectedItems[i];
_colorOutputBindings.Add(_callingPanel.CreateDcsOutputAndColorBinding(_saitekPanelLEDPosition, binding.LEDColor, binding.DCSBiosOutputLED));
var binding = (DcsOutputAndColorBinding) t;
var tmp = DCSBIOSOutput.CreateCopy(binding.DCSBiosOutputLED);
_colorOutputBindings.Add(_callingPanel.CreateDcsOutputAndColorBinding(_saitekPanelLEDPosition, binding.LEDColor, tmp));
ShowItems();
}
SetFormState();
Expand Down
4 changes: 2 additions & 2 deletions Source/DCSFlightpanels/Properties/AssemblyInfo.cs
Expand Up @@ -49,5 +49,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.7.9.6600")]
[assembly: AssemblyFileVersion("2.7.9.6600")]
[assembly: AssemblyVersion("2.7.11.5606")]
[assembly: AssemblyFileVersion("2.7.11.5606")]
4 changes: 2 additions & 2 deletions Source/NonVisuals/Properties/AssemblyInfo.cs
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.878.6600")]
[assembly: AssemblyFileVersion("2.1.878.6600")]
[assembly: AssemblyVersion("2.1.880.5606")]
[assembly: AssemblyFileVersion("2.1.880.5606")]

0 comments on commit 4d6b7e7

Please sign in to comment.