#pragma once #include #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(const std::string& s,bool h = false); private: wxButton *connectbutton; wxButton *refresh; wxButton *clear; wxButton *reset; wxRadioButton *uhu; wxRadioButton *stmbl; wxTimer * timer; 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 OnReset(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]; std::queue txqueue; };