mirror of
https://github.com/rene-dev/stmbl.git
synced 2026-09-23 07:43:59 +08:00
term width fix, autoconnect
This commit is contained in:
+3
-10
@@ -55,7 +55,7 @@ void BasicDrawPane::paintEvent(wxPaintEvent & evt)
|
||||
gc->SetPen(pen[i]);
|
||||
x = 0;
|
||||
y = h/2;
|
||||
xstep = w/(data[i].size()-1);
|
||||
xstep = (double)w/(double)(data[i].size()-1);
|
||||
path.MoveToPoint(x, y);
|
||||
for(auto point : data[i]){
|
||||
y = h/2-point*h/2;
|
||||
@@ -80,16 +80,9 @@ void BasicDrawPane::paintEvent(wxPaintEvent & evt)
|
||||
|
||||
void BasicDrawPane::plotvalue(float values[])
|
||||
{
|
||||
//std::cout << "data:" << value << std::endl;
|
||||
//data.at(xpos) += 0.1;
|
||||
for (int i = 0; i<channels; i++) {
|
||||
data[i].at(xpos) = (float)values[i];
|
||||
}
|
||||
xpos = (xpos+1)%data[0].size();
|
||||
//if(wxGetUTCTimeMillis()-time > 50){
|
||||
Refresh();
|
||||
// time = wxGetUTCTimeMillis();
|
||||
//}
|
||||
//oder
|
||||
//Update();
|
||||
xpos = ((int)xpos+1)%data[0].size();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
@@ -27,5 +27,5 @@ public:
|
||||
private:
|
||||
wxLongLong time;
|
||||
std::vector<std::vector<float>> data;
|
||||
int x,y,xpos,xstep;
|
||||
double x,y,xpos,xstep;
|
||||
};
|
||||
|
||||
+2
-3
@@ -173,6 +173,8 @@ void ServoFrame::OnChannelChange(wxCommandEvent& event){
|
||||
}
|
||||
|
||||
int ServoFrame::send(const string& s,bool h){
|
||||
if(!connected)
|
||||
connect();
|
||||
if(connected){
|
||||
if(h){//history
|
||||
if((history.size()==0 || history.back() != s) && !s.empty()){
|
||||
@@ -181,9 +183,6 @@ int ServoFrame::send(const string& s,bool h){
|
||||
histpos = history.size();
|
||||
}
|
||||
txqueue.push(s);
|
||||
}else{
|
||||
wxMessageBox( wxT("Not connected"), wxT("Error"), wxICON_EXCLAMATION);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user