А теперь приступаем к написанию морды для настройки, и стыковка с PowerSDR

v2.8.0.134
Alex Paraskeva 2019-10-06 01:14:55 +03:00
parent d84e258801
commit e6ac6a9dbb
1 changed files with 44 additions and 2 deletions

View File

@ -229,8 +229,8 @@ namespace OmniRigBus
Rig = OmniRigEngine.Rig2;
break;
}
// ShowRigStatus();
// ShowRigParams();
ShowRigStatus();
ShowRigParams();
}
private void ShowRigStatus()
@ -278,6 +278,13 @@ namespace OmniRigBus
if (OmniRigEngine != null)
OmniRigEngine.DialogVisible = true;
}
private void BtnSetFrequency_Click(object sender, RoutedEventArgs e)
{
int freq = Convert.ToInt32(Frequency);
Rig.SetSimplexMode(freq);
}
// Event raised when property changed
public event PropertyChangedEventHandler PropertyChanged;
@ -288,5 +295,40 @@ namespace OmniRigBus
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(pPropertyName));
}
private void SubscribeToEvents()
{
if (!EventsSubscribed)
{
EventsSubscribed = true;
OmniRigEngine.StatusChange += OmniRigEngine_StatusChange;
OmniRigEngine.ParamsChange += OmniRigEngine_ParamsChange;
}
}
//OmniRig ParamsChange events
private void OmniRigEngine_ParamsChange(int RigNumber, int Params)
{
if (RigNumber == CurrentRigNo)
{
thread1 = new Thread(new ThreadStart(ShowRigParams));
thread1.Name = "RigParams";
//Start first thread
thread1.Start();
}
}
//OmniRig StatusChange events
private void OmniRigEngine_StatusChange(int RigNumber)
{
if (RigNumber == CurrentRigNo)
{
thread2 = new Thread(new ThreadStart(ShowRigStatus));
thread2.Name = "RigStatus";
//Start second thread
thread2.Start();
}
}
}
}