]> rtime.felk.cvut.cz Git - mf6xx.git/commitdiff
ADCs setting implemented.
authorRostislav Lisovy <lisovy@gmail.com>
Wed, 13 Apr 2011 23:33:46 +0000 (01:33 +0200)
committerRostislav Lisovy <lisovy@gmail.com>
Wed, 13 Apr 2011 23:33:55 +0000 (01:33 +0200)
src/qemu/mf624_interface/untitled/mainwindow.cpp
src/qemu/mf624_interface/untitled/mainwindow.h
src/qemu/mf624_interface/untitled/socket_thread.cpp

index ac35e723e5a95d605c0e2e77abf88e3292182314..5c360a23f94a13580e0574f1c30e0d034f7f2a92 100644 (file)
@@ -81,3 +81,38 @@ void MainWindow::on_horizontalSlider_valueChanged(int value)
 {
        s_thread->socket_send("ADC0=%d\n", value);
 }
+
+void MainWindow::on_horizontalSlider_2_valueChanged(int value)
+{
+       s_thread->socket_send("ADC1=%d\n", value);
+}
+
+void MainWindow::on_horizontalSlider_3_valueChanged(int value)
+{
+       s_thread->socket_send("ADC2=%d\n", value);
+}
+
+void MainWindow::on_horizontalSlider_4_valueChanged(int value)
+{
+       s_thread->socket_send("ADC3=%d\n", value);
+}
+
+void MainWindow::on_horizontalSlider_5_valueChanged(int value)
+{
+       s_thread->socket_send("ADC4=%d\n", value);
+}
+
+void MainWindow::on_horizontalSlider_6_valueChanged(int value)
+{
+       s_thread->socket_send("ADC5=%d\n", value);
+}
+
+void MainWindow::on_horizontalSlider_7_valueChanged(int value)
+{
+       s_thread->socket_send("ADC6=%d\n", value);
+}
+
+void MainWindow::on_horizontalSlider_8_valueChanged(int value)
+{
+       s_thread->socket_send("ADC7=%d\n", value);
+}
index 504063e77e276fae353d0982ff5966ddb2719590..f68fb41c2fc3575602e8467414339c6a924c5d71 100644 (file)
@@ -31,6 +31,20 @@ private slots:
 
        void on_horizontalSlider_valueChanged(int value);
 
+       void on_horizontalSlider_2_valueChanged(int value);
+
+       void on_horizontalSlider_3_valueChanged(int value);
+
+       void on_horizontalSlider_4_valueChanged(int value);
+
+       void on_horizontalSlider_5_valueChanged(int value);
+
+       void on_horizontalSlider_6_valueChanged(int value);
+
+       void on_horizontalSlider_7_valueChanged(int value);
+
+       void on_horizontalSlider_8_valueChanged(int value);
+
 private:
        int DIN; //DIN register
 
index d10e8cc26d9bf7f8ad6fa06dea094996a44d5a13..a37e2732bad91ef8a88e00fb140426d1bdaa09fe 100644 (file)
@@ -48,7 +48,6 @@ void socket_thread::run()
        char read_buffer[STRING_BUFF_SIZE];
        char reg[STRING_BUFF_SIZE+1];
        int val;
-       char buffer[256];
 
 
 
@@ -79,14 +78,14 @@ void socket_thread::run()
 
 
        while(1) {
-               memset(buffer, '\0', 256);
-               n = read(sockfd, buffer, 255);
+               memset(read_buffer, '\0', 256);
+               n = read(sockfd, read_buffer, 255);
                if (n < 0) {
                        perror("read()");
                        sleep(1);
                }
 
-               status = sscanf(buffer, "%[A-Z0-9]=%u", reg, &val);
+               status = sscanf(read_buffer, "%[A-Z0-9]=%i", reg, &val);
                if (status == 2) {
                        if(!strcmp(reg, "DOUT")) {
                                mf624_io_status.DOUT = val;