Subversion Repositories Code-Repo

Rev

Rev 362 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 362 Rev 364
Line 53... Line 53...
53
    connect(serialHelper, SIGNAL(UpdateParameters(QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)),
53
    connect(serialHelper, SIGNAL(UpdateParameters(QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)),
54
            this, SLOT(UpdateParameters(QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)));
54
            this, SLOT(UpdateParameters(QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)));
55
 
55
 
56
    connect(this, SIGNAL(Connect(QString,QString,QString,QString,QString,QString)),
56
    connect(this, SIGNAL(Connect(QString,QString,QString,QString,QString,QString)),
57
            serialHelper, SLOT(Connect(QString,QString,QString,QString,QString,QString)));
57
            serialHelper, SLOT(Connect(QString,QString,QString,QString,QString,QString)));
58
    connect(serialHelper, SIGNAL(Connected()), this, SIGNAL(Connected()));
58
    connect(serialHelper, SIGNAL(Connected(bool)), this, SIGNAL(Connected(bool)));
59
    connect(serialHelper, SIGNAL(Connected()), this, SLOT(LocalConnected()));
59
    connect(serialHelper, SIGNAL(Connected(bool)), this, SLOT(LocalConnected(bool)));
60
 
60
 
61
    connect(this, SIGNAL(Disconnect()), serialHelper, SLOT(Disconnect()));
61
    connect(this, SIGNAL(Disconnect()), serialHelper, SLOT(Disconnect()));
62
    connect(serialHelper, SIGNAL(Disconnected()), this, SIGNAL(Disconnected()));
-
 
63
    connect(serialHelper, SIGNAL(Disconnected()), this, SLOT(LocalDisconnected()));
-
 
64
 
62
 
65
    connect(this, SIGNAL(TransmitByteArray(QByteArray)), serialHelper, SLOT(TransmitByteArray(QByteArray)));
63
    connect(this, SIGNAL(TransmitByteArray(QByteArray)), serialHelper, SLOT(TransmitByteArray(QByteArray)));
66
 
64
 
67
    connect(serialHelper, SIGNAL(ReceivedByte(QByteArray)), this, SIGNAL(ReceivedByte(QByteArray)));
65
    connect(serialHelper, SIGNAL(ReceivedByte(QByteArray)), this, SIGNAL(ReceivedByte(QByteArray)));
68
 
66
 
Line 71... Line 69...
71
 
69
 
72
    connect(btnConnect, SIGNAL(clicked()), this, SLOT(ConnectToggleBtn()));
70
    connect(btnConnect, SIGNAL(clicked()), this, SLOT(ConnectToggleBtn()));
73
    connect(btnRefresh, SIGNAL(clicked()), this, SIGNAL(QueryParameters()));
71
    connect(btnRefresh, SIGNAL(clicked()), this, SIGNAL(QueryParameters()));
74
 
72
 
75
    emit QueryParameters();
73
    emit QueryParameters();
76
    LocalDisconnected();
74
    LocalConnected(false);
77
}
75
}
78
 
76
 
79
SerialWidget::~SerialWidget()
77
SerialWidget::~SerialWidget()
80
{
78
{
81
    serialThread->quit();
79
    serialThread->quit();
Line 114... Line 112...
114
    cboxFlowControl->clear();
112
    cboxFlowControl->clear();
115
    cboxFlowControl->addItems(flowControl);
113
    cboxFlowControl->addItems(flowControl);
116
    if (currFlow >= 0) cboxFlowControl->setCurrentIndex(currFlow);
114
    if (currFlow >= 0) cboxFlowControl->setCurrentIndex(currFlow);
117
}
115
}
118
 
116
 
119
void SerialWidget::LocalConnected()
117
void SerialWidget::LocalConnected(bool connected)
120
{
118
{
121
    btnConnect->setText("&Disconnect");
119
    if (connected) {
122
//    cboxSerialPort->setEnabled(false);
120
        btnConnect->setText("&Disconnect");
123
//    cboxSerialSpeed->setEnabled(false);
-
 
124
//    cboxSerialDataBits->setEnabled(false);
-
 
125
//    cboxSerialStopBits->setEnabled(false);
-
 
126
//    cboxSerialParity->setEnabled(false);
-
 
127
//    cboxSerialFlowControl->setEnabled(false);
-
 
128
//    btnSerialRefresh->setEnabled(false);
-
 
129
    btnRefresh->hide();
121
        btnRefresh->hide();
130
    labelPort->hide();
122
        labelPort->hide();
131
    labelSpeed->hide();
123
        labelSpeed->hide();
132
    labelDataBits->hide();
124
        labelDataBits->hide();
133
    labelStopBits->hide();
125
        labelStopBits->hide();
134
    labelParity->hide();
126
        labelParity->hide();
135
    labelFlowControl->hide();
127
        labelFlowControl->hide();
136
    cboxPort->hide();
128
        cboxPort->hide();
137
    cboxSpeed->hide();
129
        cboxSpeed->hide();
138
    cboxDataBits->hide();
130
        cboxDataBits->hide();
139
    cboxStopBits->hide();
131
        cboxStopBits->hide();
140
    cboxParity->hide();
132
        cboxParity->hide();
141
    cboxFlowControl->hide();
133
        cboxFlowControl->hide();
142
}
-
 
143
 
-
 
144
void SerialWidget::LocalDisconnected()
134
    } else {
145
{
-
 
146
    btnConnect->setText("&Connect");
135
        btnConnect->setText("&Connect");
147
//    cboxSerialPort->setEnabled(true);
-
 
148
//    cboxSerialSpeed->setEnabled(true);
-
 
149
//    cboxSerialDataBits->setEnabled(true);
-
 
150
//    cboxSerialStopBits->setEnabled(true);
-
 
151
//    cboxSerialParity->setEnabled(true);
-
 
152
//    cboxSerialFlowControl->setEnabled(true);
-
 
153
//    btnSerialRefresh->setEnabled(true);
-
 
154
    btnRefresh->show();
136
        btnRefresh->show();
155
    labelPort->show();
137
        labelPort->show();
156
    labelSpeed->show();
138
        labelSpeed->show();
157
    labelDataBits->show();
139
        labelDataBits->show();
158
    labelStopBits->show();
140
        labelStopBits->show();
159
    labelParity->show();
141
        labelParity->show();
160
    labelFlowControl->show();
142
        labelFlowControl->show();
161
    cboxPort->show();
143
        cboxPort->show();
162
    cboxSpeed->show();
144
        cboxSpeed->show();
163
    cboxDataBits->show();
145
        cboxDataBits->show();
164
    cboxStopBits->show();
146
        cboxStopBits->show();
165
    cboxParity->show();
147
        cboxParity->show();
166
    cboxFlowControl->show();
148
        cboxFlowControl->show();
-
 
149
    }
167
}
150
}
168
 
151
 
169
void SerialWidget::ConnectToggleBtn()
152
void SerialWidget::ConnectToggleBtn()
170
{
153
{
171
    if (serialHelper->connected) {
154
    if (serialHelper->connected) {