41 #include "../mnertclient.h"
43 #include "ui_mnertclientsquidcontroldgl.h"
50 using namespace MneRtClientPlugin;
57 mnertclientSQUIDControlDgl::mnertclientSQUIDControlDgl(
MneRtClient* p_pMneRtClient,QWidget *parent) :
60 m_pMneRtClient(p_pMneRtClient)
66 connect(ui->m_Qbn_retune, &QPushButton::released,
this, &mnertclientSQUIDControlDgl::SendRetune);
67 connect(ui->m_Qbn_Cancel, &QPushButton::released,
this, &mnertclientSQUIDControlDgl::Cancel);
68 connect(ui->m_Qbn_SyncGUI,&QPushButton::released,
this, &mnertclientSQUIDControlDgl::SyncGUI);
74 mnertclientSQUIDControlDgl::~mnertclientSQUIDControlDgl()
78 void mnertclientSQUIDControlDgl::Init()
85 void mnertclientSQUIDControlDgl::SendRetune()
89 void mnertclientSQUIDControlDgl::Cancel()
95 void mnertclientSQUIDControlDgl::SyncGUI()
100 void mnertclientSQUIDControlDgl::SendCMD(QString CMDSTR)
103 if(m_pMneRtClient->m_bCmdClientIsConnected)
106 (*m_pMneRtClient->m_pRtCmdClient)[
"FLL"].pValues()[0].setValue(CMDSTR);
107 (*m_pMneRtClient->m_pRtCmdClient)[
"FLL"].send();
109 this->ui->m_tx_info->setText(CMDSTR);
111 QString t_sReply = m_pMneRtClient->m_pRtCmdClient->readAvailableData();
113 this->ui->m_tx_info->setText(QString(
"Reply:")+t_sReply);
115 ReplyCmdProc(t_sReply);
119 void mnertclientSQUIDControlDgl::ReplyCmdProc(QString sReply)
122 QString cmd = sReply.left(4);
125 QList < QString > tmp;
127 if (cmd ==
"INIT") fcmd = 1;
128 else if(cmd==
"INIC") fcmd = 2;
129 else if(cmd==
"SYNC") fcmd = 3;
135 tmp = sReply.split(
"#");
138 tmp[1] = GenChnInfo(tmp[1]);
139 InitChannels(tmp[1]);
141 InitGUIConfig(tmp[0]);
146 InitChannels(sReply);
149 InitGUIConfig(tmp[0]);
156 QString mnertclientSQUIDControlDgl::GenChnInfo(QString nChan)
159 for (
int i=0;i<nChan.toInt();i++){
160 chaninfo +=
"MEG_"+tr(
"%1").arg(i+1)+
"|";
165 void mnertclientSQUIDControlDgl::InitChannels(QString sReply)
167 QList < QString > tmp = sReply.split(
"|");
168 ui->m_Qcb_channel->addItems(tmp);
172 void mnertclientSQUIDControlDgl::UpdateGUI()
178 switch (m_GUISM.CommType){
186 curindex = m_GUISM.CommType - 130;
190 ui->m_Qcb_commtype->setCurrentIndex( curindex );
193 ui->m_Qcb_channel->setCurrentIndex( m_GUISM.ChannelSel );
194 if (m_GUISM.ChannelStat == 0)
195 ui->m_Qcb_channel->setEnabled(
true);
197 ui->m_Qcb_channel->setDisabled(
true);
200 ui->m_Qcb_opermode->setCurrentIndex( m_GUISM.OperMode-1 );
203 if(m_GUISM.Retune == 0)
204 ui->m_Qbn_retune->setEnabled(
true);
206 ui->m_Qbn_retune->setDisabled(
true);
208 if(m_GUISM.HeatThis == 0)
209 ui->m_Qbn_heat->setEnabled(
true);
211 ui->m_Qbn_heat->setDisabled(
true);
214 if(m_GUISM.Atune == 0)
215 ui->m_Qbn_atune->setEnabled(
true);
217 ui->m_Qbn_atune->setDisabled(
true);
220 if(m_GUISM.Reset == 0)
221 ui->m_Qbn_reset->setEnabled(
true);
223 ui->m_Qbn_reset->setDisabled(
true);
225 if(m_GUISM.HeatAndTune == 0)
226 ui->m_Qbn_heatTune->setEnabled(
true);
228 ui->m_Qbn_heatTune->setDisabled(
true);
231 if(m_GUISM.Save == 0)
232 ui->m_Qbn_save->setEnabled(
true);
234 ui->m_Qbn_save->setDisabled(
true);
237 if(m_GUISM._Save == 0)
238 ui->m_Qbn_save1->setEnabled(
true);
240 ui->m_Qbn_save1->setDisabled(
true);
243 if(m_GUISM.GroupHeat == 0)
244 ui->m_Qbn_groupheat->setEnabled(
true);
246 ui->m_Qbn_groupheat->setDisabled(
true);
249 if(m_GUISM.Last == 0)
250 ui->m_Qbn_last->setEnabled(
true);
252 ui->m_Qbn_last->setDisabled(
true);
255 if(m_GUISM.Default == 0)
256 ui->m_Qbn_default->setEnabled(
true);
258 ui->m_Qbn_default->setDisabled(
true);
261 ui->m_Qcb_hp->setCurrentIndex( m_GUISM.HighPass );
263 ui->m_Qcb_lp->setCurrentIndex( m_GUISM.LowPass );
265 ui->m_Qcb_pregain->setCurrentIndex( m_GUISM.PreGain-1 );
267 ui->m_Qcb_postgain->setCurrentIndex( m_GUISM.PostGain-1 );
269 ui->m_Qcb_slew->setCurrentIndex( m_GUISM.Slew-1);
272 ui->m_Qsb_heattime->setValue(m_GUISM.HeatTime);
274 ui->m_Qsb_cooltime->setValue(m_GUISM.CoolTime);
276 ui->m_Qdsb_offset->setValue(m_GUISM.offset);
278 ui->m_Qdsb_bias->setValue(m_GUISM.bias);
280 ui->m_Qdsb_mod->setValue(m_GUISM.modulation);
282 ui->m_Qcb_auto_reset->setCurrentIndex(m_GUISM.AutoRest);
284 ui->m_Qcb_reset_lock->setCurrentIndex(m_GUISM.ResetLock);
287 if(m_GUISM.TuneCheck == 0)
288 ui->m_Qbn_tunecheck->setEnabled(
true);
290 ui->m_Qbn_tunecheck->setDisabled(
true);
293 ui->m_Qbn_amp->setEnabled(
true);
295 ui->m_Qbn_amp->setDisabled(
true);
297 if(m_GUISM.IntegratorReset == 0)
298 ui->m_Qbn_int_reset->setEnabled(
true);
300 ui->m_Qbn_int_reset->setDisabled(
true);
302 if(m_GUISM.MicroReset == 0)
303 ui->m_Qbn_mirco_reset->setEnabled(
true);
305 ui->m_Qbn_mirco_reset->setDisabled(
true);
307 void mnertclientSQUIDControlDgl::InitGUIConfig(QString sReply)
309 QList < QString > tmp = sReply.split(
"|");
335 m_GUISM.CommType = tmp[ind].toInt();
336 m_GUISM.ChannelSel = tmp[ind+1].toInt();
337 m_GUISM.ChannelStat = tmp[ind+2].toInt();
338 m_GUISM.OperMode = tmp[ind+3].toInt();
340 m_GUISM.Retune = tmp[ind+4].toInt();
341 m_GUISM.HeatThis = tmp[ind+5].toInt();
342 m_GUISM.Atune = tmp[ind+6].toInt();
343 m_GUISM.Reset = tmp[ind+7].toInt();
344 m_GUISM.HeatAndTune = tmp[ind+8].toInt();
345 m_GUISM.GroupHeat = tmp[ind+9].toInt();
346 m_GUISM.Last = tmp[ind+10].toInt();
347 m_GUISM.Default = tmp[ind+11].toInt();
348 m_GUISM.Save = tmp[ind+12].toInt();
349 m_GUISM._Save = tmp[ind+13].toInt();
352 m_GUISM.HighPass = tmp[ind+14].toInt();
353 m_GUISM.LowPass = tmp[ind+15].toInt();
354 m_GUISM.Slew = tmp[ind+16].toInt();
355 m_GUISM.PreGain = tmp[ind+17].toInt();
356 m_GUISM.PostGain= tmp[ind+18].toInt();
357 m_GUISM.AutoRest= tmp[ind+19].toInt();
358 m_GUISM.ResetLock=tmp[ind+20].toInt();
360 m_GUISM.offset = tmp[ind+21].toFloat();
361 m_GUISM.bias = tmp[ind+22].toFloat();
362 m_GUISM.modulation = tmp[ind+23].toFloat();
363 m_GUISM.HeatTime = tmp[ind+24].toFloat();
364 m_GUISM.CoolTime = tmp[ind+25].toFloat();
366 m_GUISM.TuneCheck = tmp[ind+26].toInt();
367 m_GUISM.Amp = tmp[ind+27].toInt();
368 m_GUISM.IntegratorReset = tmp[ind+28].toInt();
369 m_GUISM.MicroReset = tmp[ind+29].toInt();
Contains the declaration of the MneRtClientSQUIDControlDGL class.
The MneRtClient class provides a RT server connection.
The mnertclientSQUIDControlDgl class provides the SQUID control dialog.