Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Applications/relax2/Relax2_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ def __init__(self, parent=None):
self.RX1_radioButton.toggled.connect(self.update_params)
self.RX2_radioButton.toggled.connect(self.update_params)

self.RF_Rec_Carrier_radioButton.toggled.connect(self.update_params)
self.RF_Rec_Carrier_radioButton.setToolTip('Sets the RF carrier waveform from sine wave to rectengular. This is an experimental implementation.')

def frequency_center(self):
params.frequency = params.centerfrequency
self.Frequency_doubleSpinBox.setValue(params.frequency)
Expand Down Expand Up @@ -583,6 +586,8 @@ def load_params(self):
if params.rx1 == 1: self.RX1_radioButton.setChecked(True)
if params.rx2 == 1: self.RX2_radioButton.setChecked(True)

if params.RFreccarrier == 1: self.RF_Rec_Carrier_radioButton.setChecked(True)

def update_flippulselength(self):
params.flipangletime = self.Flipangle_Time_spinBox.value()

Expand Down Expand Up @@ -856,7 +861,10 @@ def update_params(self):
params.rxmode = 3
print('\033[1m' + 'Please select RX1 or RX2!' + '\033[0m')

print('RX mode: ',params.rxmode)
#print('RX mode: ',params.rxmode)

if self.RF_Rec_Carrier_radioButton.isChecked(): params.RFreccarrier = 1
else: params.RFreccarrier = 0

params.saveFileParameter()

Expand Down
3 changes: 3 additions & 0 deletions Applications/relax2/parameter_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def var_init(self):
self.sequencefile = ''
self.datapath = ''
self.frequency = 11.3
self.RFreccarrier = 0
self.autorecenter = 0
self.frequencyoffset = 0
self.frequencyoffsetsign = 0
Expand Down Expand Up @@ -185,6 +186,7 @@ def saveFileParameter(self):
self.sequencefile, \
self.datapath, \
self.frequency, \
self.RFreccarrier, \
self.autorecenter, \
self.frequencyoffset, \
self.frequencyoffsetsign, \
Expand Down Expand Up @@ -342,6 +344,7 @@ def loadParam(self):
self.sequencefile, \
self.datapath, \
self.frequency, \
self.RFreccarrier, \
self.autorecenter, \
self.frequencyoffset, \
self.frequencyoffsetsign, \
Expand Down
8 changes: 8 additions & 0 deletions Applications/relax2/sequence_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__(self):
def sequence_upload(self):

self.RXconfig_upload()
self.TXconfig_upload()
self.Gradients_upload()
self.Frequency_upload()
self.RFattenuation_upload()
Expand Down Expand Up @@ -373,12 +374,19 @@ def initVariables(self):
self.freq_old = 0
self.att_old = 0
self.rxmode_old = 1
self.RFreccarrier_old = 0

def RXconfig_upload(self):
if params.rxmode != self.rxmode_old:
socket.write(struct.pack('<IIIIIIIIII', 1, 0, 0, 0, 0, 0, 0, 0, 0, int(params.rxmode)))
print('Set RX port!')
self.rxmode_old = params.rxmode

def TXconfig_upload(self):
if params.RFreccarrier != self.RFreccarrier_old:
socket.write(struct.pack('<IIIIIIIIII', 6, 0, 0, 0, 0, 0, 0, 0, 0, int(params.RFreccarrier)))
print('Set RX port!')
self.RFreccarrier_old = params.RFreccarrier

def Frequency_upload(self):
if params.frequency != self.freq_old:
Expand Down
14 changes: 13 additions & 1 deletion Applications/relax2/server/relax_server_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -8177,7 +8177,7 @@ int main(int argc)
int rxmode = (int)command[36];
printf("RX mode: %d \n", rxmode);
// 1 = RX1, 2 = RX2, 0, 3 = RX1 and RX2
//*rx_switch = rxmode & (0x0003);
//*rx_switch = rxmode & (0x0003);
continue;
}

Expand Down Expand Up @@ -8285,6 +8285,18 @@ int main(int argc)
continue;
}

//------------------------------------------------------------------------
// Change RF carrier waveform
//------------------------------------------------------------------------
if ( trig == 6 ) {
printf("Set RF carrier waveform.\n");
int RFcarriermode = (int)command[36];
printf("Waveform: %d \n", RFcarriermode);
// 0 = Sine, 1 = Rectengular

continue;
}

//------------------------------------------------------------------------
// Acquire 2D GRE
//------------------------------------------------------------------------
Expand Down
Loading