kopia lustrzana https://gitlab.com/Teuniz/DSRemote
Fixed a bug related to the "Auto" command.
rodzic
51e670ea19
commit
89b730593b
2
global.h
2
global.h
|
@ -35,7 +35,7 @@
|
|||
|
||||
|
||||
#define PROGRAM_NAME "DSRemote"
|
||||
#define PROGRAM_VERSION "0.34_1702041507"
|
||||
#define PROGRAM_VERSION "0.34_1702162027"
|
||||
|
||||
#define MAX_PATHLEN 4096
|
||||
|
||||
|
|
|
@ -3077,15 +3077,7 @@ void UI_Mainwindow::autoButtonClicked()
|
|||
|
||||
tmc_write(":AUT");
|
||||
|
||||
qApp->processEvents();
|
||||
|
||||
usleep(20000);
|
||||
|
||||
qApp->processEvents();
|
||||
|
||||
sleep(2);
|
||||
|
||||
get_device_settings();
|
||||
get_device_settings(7);
|
||||
|
||||
scrn_timer->start(devparms.screentimerival);
|
||||
}
|
||||
|
|
|
@ -568,7 +568,7 @@ void UI_Mainwindow::closeEvent(QCloseEvent *cl_event)
|
|||
}
|
||||
|
||||
|
||||
int UI_Mainwindow::get_device_settings()
|
||||
int UI_Mainwindow::get_device_settings(int delay)
|
||||
{
|
||||
int chn;
|
||||
|
||||
|
@ -578,6 +578,7 @@ int UI_Mainwindow::get_device_settings()
|
|||
|
||||
read_settings_thread rd_set_thrd;
|
||||
rd_set_thrd.set_device(device);
|
||||
rd_set_thrd.set_delay(delay);
|
||||
rd_set_thrd.set_devparm_ptr(&devparms);
|
||||
rd_set_thrd.start();
|
||||
|
||||
|
|
|
@ -242,6 +242,7 @@ private:
|
|||
double get_stepsize_divide_by_1000(double);
|
||||
inline unsigned char reverse_bitorder_8(unsigned char);
|
||||
inline unsigned int reverse_bitorder_32(unsigned int);
|
||||
int get_device_settings(int delay=0);
|
||||
|
||||
private slots:
|
||||
|
||||
|
@ -261,7 +262,6 @@ private slots:
|
|||
void open_connection();
|
||||
void close_connection();
|
||||
void open_settings_dialog();
|
||||
int get_device_settings();
|
||||
void save_screen_waveform();
|
||||
void get_deep_memory_waveform();
|
||||
void save_screenshot();
|
||||
|
|
|
@ -38,6 +38,14 @@ read_settings_thread::read_settings_thread()
|
|||
err_num = -1;
|
||||
|
||||
devparms = NULL;
|
||||
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
|
||||
void read_settings_thread::set_delay(int val)
|
||||
{
|
||||
delay = val;
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,6 +87,11 @@ void read_settings_thread::run()
|
|||
|
||||
devparms->activechannel = -1;
|
||||
|
||||
if(delay > 0)
|
||||
{
|
||||
sleep(delay);
|
||||
}
|
||||
|
||||
for(chn=0; chn<devparms->channel_cnt; chn++)
|
||||
{
|
||||
sprintf(str, ":CHAN%i:BWL?", chn + 1);
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
void set_devparm_ptr(struct device_settings *);
|
||||
int get_error_num(void);
|
||||
void get_error_str(char *);
|
||||
void set_delay(int);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -65,7 +66,7 @@ private:
|
|||
|
||||
char err_str[4096];
|
||||
|
||||
int err_num;
|
||||
int err_num, delay;
|
||||
|
||||
void run();
|
||||
};
|
||||
|
|
|
@ -147,7 +147,10 @@ int tmcdev_write(struct tmcdev *dev, const char *cmd)
|
|||
printf("tmc_dev write: %s", buf);
|
||||
}
|
||||
|
||||
if(!strncmp(buf, "*RST", 4)) qry = 1;
|
||||
if((!strncmp(buf, "*RST", 4)) || (!strncmp(buf, ":AUT", 4)))
|
||||
{
|
||||
qry = 1;
|
||||
}
|
||||
|
||||
n = write(dev->fd, buf, strlen(buf));
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue