#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "basicdrawpane.hpp" class ServoFrame : public wxFrame { public: ServoFrame(const wxString& title); int send(std::string& s,bool h = false); private: wxButton *connectbutton; wxButton *refresh; wxButton *clear; wxRadioButton *uhu; wxRadioButton *stmbl; wxTimer * timer; wxConfig *config; struct sp_port **ports; struct sp_port *port; wxChoice *choose_port; std::vector channelchoice; std::vector channelpos; std::vector channelgain; bool connected; void OnConnect(wxCommandEvent& WXUNUSED(event)); void OnRefresh(wxCommandEvent& WXUNUSED(event)); void OnClear(wxCommandEvent& WXUNUSED(event)); void OnInput(wxCommandEvent& event); void OnColorChange(wxMouseEvent& event); void OnChannelChange(wxCommandEvent& event); void OnPosChange(wxCommandEvent& event); void OnGainChange(wxCommandEvent& event); void OnKeyDown(wxKeyEvent& event); void OnTimer(wxTimerEvent& evt); void connect(); void disconnect(); void listports(); static const int bufsize = 20000; unsigned char buf[ServoFrame::bufsize+1]; wxTextCtrl *text; wxTextCtrl *textinput; wxWindowID currentID; wxWindowID channelstartID;//StartID of channel config BasicDrawPane *drawpanel; std::vector history; int histpos; int addr; float values[16]; };