Fixed a bug related to the "Auto" command.

merge-requests/1/head
Teuniz 2017-02-16 20:31:35 +01:00
rodzic 51e670ea19
commit 89b730593b
7 zmienionych plików z 24 dodań i 14 usunięć

Wyświetl plik

@ -35,7 +35,7 @@
#define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.34_1702041507"
#define PROGRAM_VERSION "0.34_1702162027"
#define MAX_PATHLEN 4096

Wyświetl plik

@ -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);
}

Wyświetl plik

@ -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();

Wyświetl plik

@ -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();

Wyświetl plik

@ -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);

Wyświetl plik

@ -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();
};

Wyświetl plik

@ -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));