forked from xLightsSequencer/xLights
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Keith Westley
committed
Jan 27, 2018
1 parent
8a55d5f
commit a2553f2
Showing
97 changed files
with
9,659 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#include "EventARTNetPanel.h" | ||
#include "events/EventARTNet.h" | ||
|
||
//(*InternalHeaders(EventARTNetPanel) | ||
#include <wx/intl.h> | ||
#include <wx/string.h> | ||
//*) | ||
|
||
//(*IdInit(EventARTNetPanel) | ||
const long EventARTNetPanel::ID_STATICTEXT1 = wxNewId(); | ||
const long EventARTNetPanel::ID_SPINCTRL1 = wxNewId(); | ||
const long EventARTNetPanel::ID_STATICTEXT2 = wxNewId(); | ||
const long EventARTNetPanel::ID_SPINCTRL2 = wxNewId(); | ||
const long EventARTNetPanel::ID_STATICTEXT4 = wxNewId(); | ||
const long EventARTNetPanel::ID_CHOICE2 = wxNewId(); | ||
const long EventARTNetPanel::ID_STATICTEXT3 = wxNewId(); | ||
const long EventARTNetPanel::ID_SPINCTRL3 = wxNewId(); | ||
//*) | ||
|
||
BEGIN_EVENT_TABLE(EventARTNetPanel,wxPanel) | ||
//(*EventTable(EventARTNetPanel) | ||
//*) | ||
END_EVENT_TABLE() | ||
|
||
EventARTNetPanel::EventARTNetPanel(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size) | ||
{ | ||
//(*Initialize(EventARTNetPanel) | ||
wxFlexGridSizer* FlexGridSizer1; | ||
|
||
Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id")); | ||
FlexGridSizer1 = new wxFlexGridSizer(0, 2, 0, 0); | ||
FlexGridSizer1->AddGrowableCol(1); | ||
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Universe:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1")); | ||
FlexGridSizer1->Add(StaticText1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | ||
SpinCtrl_Universe = new wxSpinCtrl(this, ID_SPINCTRL1, _T("1"), wxDefaultPosition, wxDefaultSize, 0, 1, 64000, 1, _T("ID_SPINCTRL1")); | ||
SpinCtrl_Universe->SetValue(_T("1")); | ||
FlexGridSizer1->Add(SpinCtrl_Universe, 1, wxALL|wxEXPAND, 5); | ||
StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Channel:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2")); | ||
FlexGridSizer1->Add(StaticText2, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | ||
SpinCtrl_Channel = new wxSpinCtrl(this, ID_SPINCTRL2, _T("1"), wxDefaultPosition, wxDefaultSize, 0, 1, 512, 1, _T("ID_SPINCTRL2")); | ||
SpinCtrl_Channel->SetValue(_T("1")); | ||
FlexGridSizer1->Add(SpinCtrl_Channel, 1, wxALL|wxEXPAND, 5); | ||
StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("Test:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4")); | ||
FlexGridSizer1->Add(StaticText4, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | ||
Choice_Test = new wxChoice(this, ID_CHOICE2, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE2")); | ||
Choice_Test->SetSelection( Choice_Test->Append(_("Equals")) ); | ||
Choice_Test->Append(_("Less Than")); | ||
Choice_Test->Append(_("Less Than or Equals")); | ||
Choice_Test->Append(_("Greater Than")); | ||
Choice_Test->Append(_("Greater Than or Equals")); | ||
Choice_Test->Append(_("Not Equals")); | ||
Choice_Test->Append(_("Continuous")); | ||
Choice_Test->Append(_("On Change")); | ||
FlexGridSizer1->Add(Choice_Test, 1, wxALL|wxEXPAND, 5); | ||
StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("Value:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3")); | ||
FlexGridSizer1->Add(StaticText3, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | ||
SpinCtrl_Value = new wxSpinCtrl(this, ID_SPINCTRL3, _T("255"), wxDefaultPosition, wxDefaultSize, 0, 0, 255, 255, _T("ID_SPINCTRL3")); | ||
SpinCtrl_Value->SetValue(_T("255")); | ||
FlexGridSizer1->Add(SpinCtrl_Value, 1, wxALL|wxEXPAND, 5); | ||
SetSizer(FlexGridSizer1); | ||
FlexGridSizer1->Fit(this); | ||
FlexGridSizer1->SetSizeHints(this); | ||
//*) | ||
} | ||
|
||
EventARTNetPanel::~EventARTNetPanel() | ||
{ | ||
//(*Destroy(EventARTNetPanel) | ||
//*) | ||
} | ||
|
||
bool EventARTNetPanel::ValidateWindow() | ||
{ | ||
return true; | ||
} | ||
|
||
void EventARTNetPanel::Save(EventBase* event) | ||
{ | ||
EventARTNet* e = (EventARTNet*)event; | ||
e->SetUniverse(SpinCtrl_Universe->GetValue()); | ||
e->SetChannel(SpinCtrl_Channel->GetValue()); | ||
e->SetCondition(Choice_Test->GetStringSelection().ToStdString()); | ||
e->SetThreshold(SpinCtrl_Value->GetValue()); | ||
} | ||
|
||
void EventARTNetPanel::Load(EventBase* event) | ||
{ | ||
EventARTNet* e = (EventARTNet*)event; | ||
SpinCtrl_Universe->SetValue(e->GetUniverse()); | ||
SpinCtrl_Channel->SetValue(e->GetChannel()); | ||
Choice_Test->SetStringSelection(e->GetCondition()); | ||
SpinCtrl_Value->SetValue(e->GetThreshold()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#ifndef EVENTARTNETPANEL_H | ||
#define EVENTARTNETPANEL_H | ||
|
||
#include "EventPanel.h" | ||
|
||
//(*Headers(EventARTNetPanel) | ||
#include <wx/sizer.h> | ||
#include <wx/stattext.h> | ||
#include <wx/spinctrl.h> | ||
#include <wx/panel.h> | ||
#include <wx/choice.h> | ||
//*) | ||
|
||
class EventARTNetPanel: public EventPanel | ||
{ | ||
public: | ||
|
||
EventARTNetPanel(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize); | ||
virtual ~EventARTNetPanel(); | ||
virtual bool ValidateWindow() override; | ||
virtual void Save(EventBase* event) override; | ||
virtual void Load(EventBase* event) override; | ||
|
||
//(*Declarations(EventARTNetPanel) | ||
wxChoice* Choice_Test; | ||
wxSpinCtrl* SpinCtrl_Channel; | ||
wxStaticText* StaticText2; | ||
wxSpinCtrl* SpinCtrl_Universe; | ||
wxStaticText* StaticText1; | ||
wxStaticText* StaticText3; | ||
wxSpinCtrl* SpinCtrl_Value; | ||
wxStaticText* StaticText4; | ||
//*) | ||
|
||
protected: | ||
|
||
//(*Identifiers(EventARTNetPanel) | ||
static const long ID_STATICTEXT1; | ||
static const long ID_SPINCTRL1; | ||
static const long ID_STATICTEXT2; | ||
static const long ID_SPINCTRL2; | ||
static const long ID_STATICTEXT4; | ||
static const long ID_CHOICE2; | ||
static const long ID_STATICTEXT3; | ||
static const long ID_SPINCTRL3; | ||
//*) | ||
|
||
private: | ||
|
||
//(*Handlers(EventARTNetPanel) | ||
//*) | ||
|
||
DECLARE_EVENT_TABLE() | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
#include "EventDataPanel.h" | ||
#include "EventDialog.h" | ||
#include "events/EventData.h" | ||
#include "xScheduleMain.h" | ||
#include "ScheduleManager.h" | ||
#include "../xLights/outputs/OutputManager.h" | ||
|
||
//(*InternalHeaders(EventDataPanel) | ||
#include <wx/intl.h> | ||
#include <wx/string.h> | ||
//*) | ||
|
||
//(*IdInit(EventDataPanel) | ||
const long EventDataPanel::ID_STATICTEXT1 = wxNewId(); | ||
const long EventDataPanel::ID_TEXTCTRL1 = wxNewId(); | ||
const long EventDataPanel::ID_STATICTEXT4 = wxNewId(); | ||
const long EventDataPanel::ID_STATICTEXT2 = wxNewId(); | ||
const long EventDataPanel::ID_CHOICE2 = wxNewId(); | ||
const long EventDataPanel::ID_STATICTEXT3 = wxNewId(); | ||
const long EventDataPanel::ID_SPINCTRL3 = wxNewId(); | ||
//*) | ||
|
||
BEGIN_EVENT_TABLE(EventDataPanel,wxPanel) | ||
//(*EventTable(EventDataPanel) | ||
//*) | ||
END_EVENT_TABLE() | ||
|
||
EventDataPanel::EventDataPanel(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size) | ||
{ | ||
//(*Initialize(EventDataPanel) | ||
wxFlexGridSizer* FlexGridSizer2; | ||
wxFlexGridSizer* FlexGridSizer1; | ||
|
||
Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id")); | ||
FlexGridSizer1 = new wxFlexGridSizer(0, 2, 0, 0); | ||
FlexGridSizer1->AddGrowableCol(1); | ||
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Channel:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1")); | ||
FlexGridSizer1->Add(StaticText1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | ||
FlexGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0); | ||
FlexGridSizer2->AddGrowableCol(0); | ||
TextCtrl_Channel = new wxTextCtrl(this, ID_TEXTCTRL1, _("1"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL1")); | ||
FlexGridSizer2->Add(TextCtrl_Channel, 1, wxALL|wxEXPAND, 5); | ||
StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("1"), wxDefaultPosition, wxSize(60,-1), 0, _T("ID_STATICTEXT4")); | ||
FlexGridSizer2->Add(StaticText4, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | ||
FlexGridSizer1->Add(FlexGridSizer2, 1, wxALL|wxEXPAND, 5); | ||
StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Test:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2")); | ||
FlexGridSizer1->Add(StaticText2, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | ||
Choice_Test = new wxChoice(this, ID_CHOICE2, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE2")); | ||
Choice_Test->SetSelection( Choice_Test->Append(_("Equals")) ); | ||
Choice_Test->Append(_("Less Than")); | ||
Choice_Test->Append(_("Less Than or Equals")); | ||
Choice_Test->Append(_("Greater Than")); | ||
Choice_Test->Append(_("Greater Than or Equals")); | ||
Choice_Test->Append(_("Not Equals")); | ||
Choice_Test->Append(_("Continuous")); | ||
Choice_Test->Append(_("On Change")); | ||
FlexGridSizer1->Add(Choice_Test, 1, wxALL|wxEXPAND, 5); | ||
StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("Value:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3")); | ||
FlexGridSizer1->Add(StaticText3, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | ||
SpinCtrl_Value = new wxSpinCtrl(this, ID_SPINCTRL3, _T("255"), wxDefaultPosition, wxDefaultSize, 0, 0, 255, 255, _T("ID_SPINCTRL3")); | ||
SpinCtrl_Value->SetValue(_T("255")); | ||
FlexGridSizer1->Add(SpinCtrl_Value, 1, wxALL|wxEXPAND, 5); | ||
SetSizer(FlexGridSizer1); | ||
FlexGridSizer1->Fit(this); | ||
FlexGridSizer1->SetSizeHints(this); | ||
|
||
Connect(ID_TEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&EventDataPanel::OnTextCtrl_ChannelText); | ||
//*) | ||
} | ||
|
||
EventDataPanel::~EventDataPanel() | ||
{ | ||
//(*Destroy(EventDataPanel) | ||
//*) | ||
} | ||
|
||
bool EventDataPanel::ValidateWindow() | ||
{ | ||
if (Choice_Test->GetStringSelection() == "Continuous" || Choice_Test->GetStringSelection() == "On Change") | ||
{ | ||
SpinCtrl_Value->Enable(false); | ||
} | ||
else | ||
{ | ||
SpinCtrl_Value->Enable(); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
void EventDataPanel::Save(EventBase* event) | ||
{ | ||
EventData* e = (EventData*)event; | ||
e->SetChannel(TextCtrl_Channel->GetValue().ToStdString()); | ||
e->SetCondition(Choice_Test->GetStringSelection().ToStdString()); | ||
e->SetThreshold(SpinCtrl_Value->GetValue()); | ||
} | ||
|
||
void EventDataPanel::Load(EventBase* event) | ||
{ | ||
EventData* e = (EventData*)event; | ||
TextCtrl_Channel->SetValue(e->GetChannel()); | ||
Choice_Test->SetStringSelection(e->GetCondition()); | ||
SpinCtrl_Value->SetValue(e->GetThreshold()); | ||
} | ||
|
||
|
||
void EventDataPanel::OnTextCtrl_ChannelText(wxCommandEvent& event) | ||
{ | ||
OutputManager* outputManager = xScheduleFrame::GetScheduleManager()->GetOutputManager(); | ||
long sc = outputManager->DecodeStartChannel(TextCtrl_Channel->GetValue().ToStdString()); | ||
if (sc == 0 || sc > xScheduleFrame::GetScheduleManager()->GetTotalChannels()) | ||
{ | ||
StaticText4->SetLabel("Invalid"); | ||
} | ||
else | ||
{ | ||
StaticText4->SetLabel(wxString::Format("%ld", (long)sc)); | ||
} | ||
((EventDialog*)GetParent()->GetParent()->GetParent()->GetParent())->ValidateWindow(); | ||
} |
Oops, something went wrong.