Skip to content

Commit

Permalink
Hyd lift sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
farmerbriantee committed Nov 4, 2021
1 parent 8987a2c commit 0c71366
Show file tree
Hide file tree
Showing 15 changed files with 1,170 additions and 951 deletions.
3 changes: 3 additions & 0 deletions SourceCode/GPS/AgOpenGPS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,9 @@
<ItemGroup>
<Content Include="AOG.ico" />
<Content Include="aChangeLog.txt" />
<None Include="btnImages\Config\ConF_HydLiftSound.png" />
<None Include="btnImages\Config\ConF_TurnSound.png" />
<None Include="btnImages\Config\ConF_SteerSound.png" />
<None Include="Resources\SteerOn.wav" />
<None Include="Resources\SteerOff.wav" />
<None Include="btnImages\Trash.png" />
Expand Down
10 changes: 10 additions & 0 deletions SourceCode/GPS/Classes/CHead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ public void SetHydPosition()
if (isToolInHeadland)
{
mf.p_239.pgn[mf.p_239.hydLift] = 2;
if (mf.sounds.isHydLiftChange != isToolInHeadland)
{
if (mf.sounds.isHydLiftSoundOn) CSound.sndHydLiftUp.Play();
mf.sounds.isHydLiftChange = isToolInHeadland;
}
}
else
{
mf.p_239.pgn[mf.p_239.hydLift] = 1;
if (mf.sounds.isHydLiftChange != isToolInHeadland)
{
if (mf.sounds.isHydLiftSoundOn) CSound.sndHydLiftDn.Play();
mf.sounds.isHydLiftChange = isToolInHeadland;
}
}
}
}
Expand Down
17 changes: 14 additions & 3 deletions SourceCode/GPS/Classes/CSound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@ namespace AgOpenGPS
{
public class CSound
{
public static SoundPlayer sndBoundaryAlarm, autoSteerOn, autoSteerOff;
public static SoundPlayer sndBoundaryAlarm, sndAutoSteerOn, sndAutoSteerOff, sndHydLiftUp, sndHydLiftDn;
public bool isBoundAlarming;

public bool isSteerSoundOn, isTurnSoundOn, isHydLiftSoundOn;

public bool isHydLiftChange;

public CSound()
{
sndBoundaryAlarm = new SoundPlayer(Properties.Resources.Alarm10);
autoSteerOn = new SoundPlayer(Properties.Resources.SteerOn);
autoSteerOff = new SoundPlayer(Properties.Resources.SteerOff);
sndAutoSteerOn = new SoundPlayer(Properties.Resources.SteerOn);
sndAutoSteerOff = new SoundPlayer(Properties.Resources.SteerOff);
sndHydLiftUp = new SoundPlayer(Properties.Resources.HydUp);
sndHydLiftDn = new SoundPlayer(Properties.Resources.HydDown);


isSteerSoundOn = Properties.Settings.Default.setSound_isAutoSteerOn;
isHydLiftSoundOn = Properties.Settings.Default.setSound_isHydLiftOn;
isTurnSoundOn = Properties.Settings.Default.setSound_isUturnOn;
}
}
}
4 changes: 2 additions & 2 deletions SourceCode/GPS/Forms/Controls.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion SourceCode/GPS/Forms/Position.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion SourceCode/GPS/Forms/Settings/ConfigData.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0c71366

Please sign in to comment.