Compare commits

...

1 Commits

2 changed files with 76 additions and 60 deletions

View File

@@ -411,19 +411,28 @@ namespace PepperDash.Essentials.DM
public void SetVolumeScaled(ushort level)
{
Debug.Console(2, Debug.ErrorLogLevel.None, "Scaling DMPS volume:{0} level:{1} min:{2} max:{3}", Output.Name, level.ToString(), MinLevel.ToString(), MaxLevel.ToString());
if (ushort.MaxValue + MinLevel != 0)
{
VolumeLevelInput = (ushort)(level * (MaxLevel - MinLevel) / ushort.MaxValue + MinLevel);
if (EnableVolumeSend == true)
{
Level.UShortValue = VolumeLevelInput;
}
}
}
public ushort ScaleVolumeFeedback(ushort level)
{
short signedLevel = (short)level;
Debug.Console(2, Debug.ErrorLogLevel.None, "Scaling DMPS volume:{0} feedback:{1} min:{2} max:{3}", Output.Name, signedLevel.ToString(), MinLevel.ToString(), MaxLevel.ToString());
if (MaxLevel - MinLevel != 0)
{
return (ushort)((signedLevel - MinLevel) * ushort.MaxValue / (MaxLevel - MinLevel));
}
else
return (ushort)MinLevel;
}
public void SendScaledVolume(bool pressRelease)
{

View File

@@ -480,6 +480,8 @@ namespace PepperDash.Essentials.DM
void SetupOutputCards()
{
foreach (var card in Dmps.SwitcherOutputs)
{
try
{
Debug.Console(1, this, "Output Card Type: {0}", card.CardInputOutputType);
@@ -545,6 +547,11 @@ namespace PepperDash.Essentials.DM
AddOutputCard(outputCard.Number, outputCard);
}
catch (Exception ex)
{
Debug.LogError(Debug.ErrorLogLevel.Error, string.Format("DMPS Controller exception creating output card: {0}", ex));
}
}
}
/// <summary>