Commit f1418d2b authored by David Košenina's avatar David Košenina

digital 12

parent 7f199704
......@@ -2292,6 +2292,11 @@ void OsciloskopOsciloskop::m_choiceInputOutputOnChoice(wxCommandEvent& event)
int version = pOsciloscope->thread.getVersion();
if(m_choiceInputOutput->GetSelection() == 1)
{
if (version == HARDWARE_VERSION_2)
{
m_choiceBit6->Disable();
m_choiceBit7->Disable();
}
m_choiceBit8->Disable();
m_choiceBit9->Disable();
m_choiceBit10->Disable();
......@@ -2306,6 +2311,11 @@ void OsciloskopOsciloskop::m_choiceInputOutputOnChoice(wxCommandEvent& event)
}
else
{
if (version == HARDWARE_VERSION_2)
{
m_choiceBit6->Enable();
m_choiceBit7->Enable();
}
m_choiceBit8->Enable();
m_choiceBit9->Enable();
m_choiceBit10->Enable();
......@@ -2326,6 +2336,7 @@ void OsciloskopOsciloskop::m_choiceInputOutput1OnChoice(wxCommandEvent& event)
pOsciloscope->control.setDigitalInputOutput(pOsciloscope->window.digitalSetup.inputOutput15, pOsciloscope->window.digitalSetup.inputOutput7);
pOsciloscope->control.transferData();
pOsciloscope->window.hardwareGenerator.uploadDigital();
int version = pOsciloscope->thread.getVersion();
if(m_choiceInputOutput1->GetSelection() == 1)
{
m_choiceBit0->Disable();
......@@ -2334,8 +2345,11 @@ void OsciloskopOsciloskop::m_choiceInputOutput1OnChoice(wxCommandEvent& event)
m_choiceBit3->Disable();
m_choiceBit4->Disable();
m_choiceBit5->Disable();
m_choiceBit6->Disable();
m_choiceBit7->Disable();
if (version == HARDWARE_VERSION_1)
{
m_choiceBit6->Disable();
m_choiceBit7->Disable();
}
}
else
{
......@@ -2345,8 +2359,11 @@ void OsciloskopOsciloskop::m_choiceInputOutput1OnChoice(wxCommandEvent& event)
m_choiceBit3->Enable();
m_choiceBit4->Enable();
m_choiceBit5->Enable();
m_choiceBit6->Enable();
m_choiceBit7->Enable();
if (version == HARDWARE_VERSION_1)
{
m_choiceBit6->Enable();
m_choiceBit7->Enable();
}
}
}
......@@ -2552,11 +2569,17 @@ void OsciloskopOsciloskop::m_choiceBit70OnChoice(wxCommandEvent& event)
void OsciloskopOsciloskop::m_choiceDS815OnChoice(wxCommandEvent& event)
{
int version = pOsciloscope->thread.getVersion();
switch(m_choiceDS815->GetSelection())
{
case 0:
break;
case 1:
if (version == HARDWARE_VERSION_2)
{
m_choiceBit6->SetSelection(0);
m_choiceBit7->SetSelection(0);
}
m_choiceBit8->SetSelection(0);
m_choiceBit9->SetSelection(0);
m_choiceBit10->SetSelection(0);
......@@ -2567,6 +2590,11 @@ void OsciloskopOsciloskop::m_choiceDS815OnChoice(wxCommandEvent& event)
m_choiceBit15->SetSelection(0);
break;
case 2:
if (version == HARDWARE_VERSION_2)
{
m_choiceBit6->SetSelection(1);
m_choiceBit7->SetSelection(1);
}
m_choiceBit8->SetSelection(1);
m_choiceBit9->SetSelection(1);
m_choiceBit10->SetSelection(1);
......@@ -2577,6 +2605,11 @@ void OsciloskopOsciloskop::m_choiceDS815OnChoice(wxCommandEvent& event)
m_choiceBit15->SetSelection(1);
break;
};
if (version == HARDWARE_VERSION_2)
{
pOsciloscope->control.setDigitalOutputBit(6, m_choiceBit6->GetSelection());
pOsciloscope->control.setDigitalOutputBit(7, m_choiceBit7->GetSelection());
}
pOsciloscope->control.setDigitalOutputBit(8, m_choiceBit8->GetSelection());
pOsciloscope->control.setDigitalOutputBit(9, m_choiceBit9->GetSelection());
pOsciloscope->control.setDigitalOutputBit(10, m_choiceBit10->GetSelection());
......@@ -2590,19 +2623,23 @@ void OsciloskopOsciloskop::m_choiceDS815OnChoice(wxCommandEvent& event)
void OsciloskopOsciloskop::m_choiceDS70OnChoice(wxCommandEvent& event)
{
int version = pOsciloscope->thread.getVersion();
switch(m_choiceDS70->GetSelection())
{
case 0:
break;
case 1:
m_choiceBit9->SetSelection(0);
m_choiceBit0->SetSelection(0);
m_choiceBit1->SetSelection(0);
m_choiceBit2->SetSelection(0);
m_choiceBit3->SetSelection(0);
m_choiceBit4->SetSelection(0);
m_choiceBit5->SetSelection(0);
m_choiceBit6->SetSelection(0);
m_choiceBit7->SetSelection(0);
if(version==HARDWARE_VERSION_1)
{
m_choiceBit6->SetSelection(0);
m_choiceBit7->SetSelection(0);
}
break;
case 2:
m_choiceBit0->SetSelection(1);
......@@ -2611,8 +2648,11 @@ void OsciloskopOsciloskop::m_choiceDS70OnChoice(wxCommandEvent& event)
m_choiceBit3->SetSelection(1);
m_choiceBit4->SetSelection(1);
m_choiceBit5->SetSelection(1);
m_choiceBit6->SetSelection(1);
m_choiceBit7->SetSelection(1);
if (version == HARDWARE_VERSION_1)
{
m_choiceBit6->SetSelection(1);
m_choiceBit7->SetSelection(1);
}
break;
};
pOsciloscope->control.setDigitalOutputBit(0, m_choiceBit0->GetSelection());
......@@ -2621,13 +2661,17 @@ void OsciloskopOsciloskop::m_choiceDS70OnChoice(wxCommandEvent& event)
pOsciloscope->control.setDigitalOutputBit(3, m_choiceBit3->GetSelection());
pOsciloscope->control.setDigitalOutputBit(4, m_choiceBit4->GetSelection());
pOsciloscope->control.setDigitalOutputBit(5, m_choiceBit5->GetSelection());
pOsciloscope->control.setDigitalOutputBit(6, m_choiceBit6->GetSelection());
pOsciloscope->control.setDigitalOutputBit(7, m_choiceBit7->GetSelection());
if (version == HARDWARE_VERSION_1)
{
pOsciloscope->control.setDigitalOutputBit(6, m_choiceBit6->GetSelection());
pOsciloscope->control.setDigitalOutputBit(7, m_choiceBit7->GetSelection());
}
pOsciloscope->control.transferData();
}
void OsciloskopOsciloskop::m_choiceDOnOff815OnChoice(wxCommandEvent& event)
{
int version = pOsciloscope->thread.getVersion();
switch(m_choiceDOnOff815->GetSelection())
{
case 0:
......@@ -2665,7 +2709,8 @@ void OsciloskopOsciloskop::m_choiceDOnOff815OnChoice(wxCommandEvent& event)
void OsciloskopOsciloskop::m_choiceDOnOff70OnChoice(wxCommandEvent& event)
{
switch(m_choiceDOnOff70->GetSelection())
int version = pOsciloscope->thread.getVersion();
switch(m_choiceDOnOff70->GetSelection())
{
case 0:
break;
......
......@@ -408,7 +408,7 @@ Osciloskop::Osciloskop( wxWindow* parent, wxWindowID id, const wxString& title,
wxString m_comboBoxCh0CaptureChoices[] = { _("2V"), _("1V"), _("500mV"), _("200mV"), _("100mV"), _("50mV"), _("20mV"), _("10mV") };
int m_comboBoxCh0CaptureNChoices = sizeof( m_comboBoxCh0CaptureChoices ) / sizeof( wxString );
m_comboBoxCh0Capture = new wxChoice( m_panel15, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_comboBoxCh0CaptureNChoices, m_comboBoxCh0CaptureChoices, 0 );
m_comboBoxCh0Capture->SetSelection( 0 );
m_comboBoxCh0Capture->SetSelection( 1 );
bSizer15->Add( m_comboBoxCh0Capture, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
......@@ -508,7 +508,7 @@ Osciloskop::Osciloskop( wxWindow* parent, wxWindowID id, const wxString& title,
m_panel15->SetSizer( bSizer14 );
m_panel15->Layout();
bSizer14->Fit( m_panel15 );
m_notebook4->AddPage( m_panel15, _("Channel 1"), false );
m_notebook4->AddPage( m_panel15, _("Channel 1"), true );
m_panel16 = new wxPanel( m_notebook4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer141;
bSizer141 = new wxBoxSizer( wxVERTICAL );
......@@ -623,7 +623,7 @@ Osciloskop::Osciloskop( wxWindow* parent, wxWindowID id, const wxString& title,
m_panel16->SetSizer( bSizer141 );
m_panel16->Layout();
bSizer141->Fit( m_panel16 );
m_notebook4->AddPage( m_panel16, _("Channel 2"), true );
m_notebook4->AddPage( m_panel16, _("Channel 2"), false );
m_panel161 = new wxPanel( m_notebook4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer1411;
bSizer1411 = new wxBoxSizer( wxVERTICAL );
......@@ -746,9 +746,6 @@ Osciloskop::Osciloskop( wxWindow* parent, wxWindowID id, const wxString& title,
bSizer1111->Add( bSizer1482, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_staticline16 = new wxStaticLine( m_panel9, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
bSizer1111->Add( m_staticline16, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* bSizer1492;
bSizer1492 = new wxBoxSizer( wxVERTICAL );
......@@ -985,9 +982,6 @@ Osciloskop::Osciloskop( wxWindow* parent, wxWindowID id, const wxString& title,
bSizer164->Add( bSizer166, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_staticline35 = new wxStaticLine( m_panel91, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
bSizer164->Add( m_staticline35, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer* bSizer167;
bSizer167 = new wxBoxSizer( wxVERTICAL );
......@@ -1506,9 +1500,6 @@ Osciloskop::Osciloskop( wxWindow* parent, wxWindowID id, const wxString& title,
bSizer811->Add( bSizer1502, 1, wxEXPAND, 5 );
m_staticline13 = new wxStaticLine( m_panel13, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
bSizer811->Add( m_staticline13, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer* bSizer1513;
bSizer1513 = new wxBoxSizer( wxVERTICAL );
......
......@@ -153,7 +153,6 @@ class Osciloskop : public wxFrame
wxCheckBox* m_checkBox13;
wxCheckBox* m_checkBox11;
wxCheckBox* m_checkBox9;
wxStaticLine* m_staticline16;
wxChoice* m_choiceDOnOff70;
wxCheckBox* m_checkBox8;
wxCheckBox* m_checkBox6;
......@@ -184,7 +183,6 @@ class Osciloskop : public wxFrame
wxChoice* m_choiceDS815;
wxStaticText* m_staticText1341;
wxChoice* m_choiceInputOutput;
wxStaticLine* m_staticline35;
wxStaticText* m_staticText971;
wxChoice* m_choiceBit7;
wxStaticText* m_staticText98;
......@@ -263,7 +261,6 @@ class Osciloskop : public wxFrame
wxChoice* m_comboBoxBit12;
wxChoice* m_comboBoxBit10;
wxChoice* m_comboBoxBit8;
wxStaticLine* m_staticline13;
wxChoice* m_choiceBit70;
wxChoice* m_comboBoxBit7;
wxChoice* m_comboBoxBit5;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment