Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Commit

Permalink
Bug Fix and Internal Test Program
Browse files Browse the repository at this point in the history
Bug Fix - You could hear other radio users if you had no radio selected
Added internal test program
  • Loading branch information
Ciaran Fisher committed Sep 18, 2015
1 parent d6a4332 commit 3b6f8dd
Show file tree
Hide file tree
Showing 21 changed files with 800 additions and 56 deletions.
27 changes: 27 additions & 0 deletions DCS-SimpleRadio.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,58 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RadioGui", "RadioGui\RadioG
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6919702D-C41C-49AF-8261-F36300694834}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RadioTester", "RadioTester\RadioTester.csproj", "{570F5657-1E40-4B2A-A8F6-54453C99C6F3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{68EB53DF-3AA3-478A-B2D1-CB93CF4CD9B4}"
ProjectSection(SolutionItems) = preProject
Scripts\DCS-SimpleRadio\SimpleRadioInit.lua = Scripts\DCS-SimpleRadio\SimpleRadioInit.lua
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Debug|x64.ActiveCfg = Debug|x64
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Debug|x64.Build.0 = Debug|x64
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Debug|x86.ActiveCfg = Debug|Win32
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Debug|x86.Build.0 = Debug|Win32
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Release|Any CPU.ActiveCfg = Release|Win32
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Release|x64.ActiveCfg = Release|x64
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Release|x64.Build.0 = Release|x64
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Release|x86.ActiveCfg = Release|Win32
{A48593C7-7CC3-4C46-9705-9BD264A8E95A}.Release|x86.Build.0 = Release|Win32
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Debug|x64.ActiveCfg = Debug|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Debug|x64.Build.0 = Debug|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Debug|x86.ActiveCfg = Debug|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Debug|x86.Build.0 = Debug|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Release|Any CPU.Build.0 = Release|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Release|x64.ActiveCfg = Release|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Release|x64.Build.0 = Release|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Release|x86.ActiveCfg = Release|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Release|x86.Build.0 = Release|Any CPU
{3FA37CBC-5BE2-4945-802D-9CDD464AC476}.Release|x86.Deploy.0 = Release|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Debug|x64.ActiveCfg = Debug|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Debug|x64.Build.0 = Debug|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Debug|x86.ActiveCfg = Debug|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Debug|x86.Build.0 = Debug|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Release|Any CPU.Build.0 = Release|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Release|x64.ActiveCfg = Release|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Release|x64.Build.0 = Release|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Release|x86.ActiveCfg = Release|Any CPU
{570F5657-1E40-4B2A-A8F6-54453C99C6F3}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
83 changes: 44 additions & 39 deletions Plugin/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static SimpleRadio::Plugin plugin;
namespace SimpleRadio
{
const char* Plugin::NAME = "DCS-SimpleRadio";
const char* Plugin::VERSION = "1.1.3";
const char* Plugin::VERSION = "1.1.4";
const char* Plugin::AUTHOR = "Ciribob - GitHub.com/ciribob";
const char* Plugin::DESCRIPTION = "DCS-SimpleRadio ";
const char* Plugin::COMMAND_KEYWORD = "sr";
Expand Down Expand Up @@ -623,53 +623,58 @@ namespace SimpleRadio
}

//check both updates are valid
if (this->myClientData.isCurrent()
&& talkingClient.isCurrent()
&& talkingClient.selected >= 0 && talkingClient.selected < 3)
if (this->myClientData.isCurrent() && talkingClient.isCurrent())
{


RadioInformation &sendingRadio = talkingClient.radio[talkingClient.selected];

for (int i = 0; i < 3; i++)
if (talkingClient.selected >= 0 && talkingClient.selected < 3)
{
RadioInformation myRadio = this->myClientData.radio[i];
RadioInformation &sendingRadio = talkingClient.radio[talkingClient.selected];

// std::ostringstream oss;
//oss << "Receiving On: " <<myRadio.frequency << " From "<<sendingRadio.frequency;
for (int i = 0; i < 3; i++)
{
RadioInformation myRadio = this->myClientData.radio[i];

// this->teamspeak.printMessageToCurrentTab(oss.str().c_str());
// std::ostringstream oss;
//oss << "Receiving On: " <<myRadio.frequency << " From "<<sendingRadio.frequency;

if (myRadio.frequency == sendingRadio.frequency
&& myRadio.modulation == sendingRadio.modulation
&& myRadio.frequency > 1)
{
// this->teamspeak.printMessageToCurrentTab(oss.str().c_str());

//if (isTalking)
//{
// RadioInformation currentRadio = this->myClientData.radio[myClientData.selected];

// if (currentRadio.frequency == sendingRadio.frequency && currentRadio.modulation == sendingRadio.modulation)
// {
// //comment in for testing
// canReceive = true;
// }
// else
// {
// canReceive = true;
// break;
// }

//}
//else
//{
//not talking on the same radio as we're receving on
canReceive = true;
recievingRadio = i;
break;
//}
if (myRadio.frequency == sendingRadio.frequency
&& myRadio.modulation == sendingRadio.modulation
&& myRadio.frequency > 1)
{

//if (isTalking)
//{
// RadioInformation currentRadio = this->myClientData.radio[myClientData.selected];

// if (currentRadio.frequency == sendingRadio.frequency && currentRadio.modulation == sendingRadio.modulation)
// {
// //comment in for testing
// canReceive = true;
// }
// else
// {
// canReceive = true;
// break;
// }

//}
//else
//{
//not talking on the same radio as we're receving on
canReceive = true;
recievingRadio = i;
break;
//}
}
}
}
else
{
//Client has NO radio selected so we cant hear their broadcast
canReceive = false;
}
}
else
{
Expand Down
Binary file modified Plugin/Plugin.rc
Binary file not shown.
15 changes: 1 addition & 14 deletions RadioGui/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,20 @@
mc:Ignorable="d"
ResizeMode="CanMinimize"
Topmost="True"



Title="DCS-SimpleRadio" Height="325" Width="120">

<WrapPanel Name="containerPanel">

<local:RadioControlGroup x:Name="radio1" />

<local:RadioControlGroup x:Name="radio2"/>

<local:RadioControlGroup x:Name="radio3"/>





<Ellipse x:Name="statusIndicator" Fill="#FF9900" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Center" Width="12" Margin="2" />
<Label x:Name="statusLabel" Content="Not in Game" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="10" Width="90" Margin="2" Height="20" Padding="2"/>

<Ellipse x:Name="allowNonPlayersIndicator" Fill="#FF9900" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Center" Width="12" Margin="2" />
<Label x:Name="allowNonPlayers" Content="Not in Game" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="10" Width="90" Margin="2" Height="20" Padding="2"/>


<Grid/>

</WrapPanel>



</Window>
4 changes: 2 additions & 2 deletions RadioGui/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,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.1.3.0")]
[assembly: AssemblyFileVersion("1.1.3.0")]
[assembly: AssemblyVersion("1.1.4.0")]
[assembly: AssemblyFileVersion("1.1.4.0")]
6 changes: 6 additions & 0 deletions RadioTester/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions RadioTester/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="RadioTester.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:RadioTester"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions RadioTester/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace RadioTester
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
27 changes: 27 additions & 0 deletions RadioTester/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Window x:Class="RadioTester.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:RadioTester"
mc:Ignorable="d"
ResizeMode="CanMinimize"
Topmost="True"


Title="DCS-RadioTester" Height="325" Width="120">

<WrapPanel Name="containerPanel">

<local:RadioControlGroup x:Name="radio1" />

<local:RadioControlGroup x:Name="radio2"/>

<local:RadioControlGroup x:Name="radio3"/>
<Button x:Name="select1" Content="1" Width="30" Click="select1_Click" />
<Button x:Name="select2" Content="2" Width="30" Click="select2_Click"/>
<Button x:Name="select3" Content="3" Width="30" Click="select3_Click" />
<Button x:Name="select4" Content="None" Width="50" Click="select4_Click" />

</WrapPanel>
</Window>
Loading

0 comments on commit 3b6f8dd

Please sign in to comment.