##// END OF EJS Templates
GUI: Bug fixed when *Read from header* is selected...
Miguel Valdez -
r655:9d147099e1e8
parent child
Show More
@@ -844,6 +844,7 class BasicWindow(QMainWindow, Ui_BasicWindow):
844
844
845 if self.volOpCebDecodification.isChecked():
845 if self.volOpCebDecodification.isChecked():
846 name_operation = 'Decoder'
846 name_operation = 'Decoder'
847 opObj = puObj.addOperation(name=name_operation, optype='other')
847
848
848 #User defined
849 #User defined
849 nBaud = None
850 nBaud = None
@@ -855,47 +856,43 class BasicWindow(QMainWindow, Ui_BasicWindow):
855 except:
856 except:
856 code_tmp = []
857 code_tmp = []
857
858
858 if len(code_tmp) < 1:
859 if len(code_tmp) > 0:
859 self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])")
860 return 0
861
860
862 if type(code_tmp) not in (tuple, list):
861 if type(code_tmp) not in (tuple, list):
863 self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])")
862 self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])")
864 return 0
863 return 0
865
864
866 if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ]
865 if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ]
867 nBaud = len(code_tmp[0])
866 nBaud = len(code_tmp[0])
868 nCode = len(code_tmp)
867 nCode = len(code_tmp)
869 elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ]
868 elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ]
870 nBaud = len(code_tmp[0])
869 nBaud = len(code_tmp[0])
871 nCode = 1
870 nCode = 1
872 elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1)
871 elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1)
873 nBaud = len(code_tmp)
872 nBaud = len(code_tmp)
874 nCode = 1
873 nCode = 1
875 else:
874 else:
876 self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])")
875 self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])")
877 return 0
876 return 0
878
877
879 if not nBaud or not nCode:
878 if not nBaud or not nCode:
880 self.console.append("Please write a right value for Code")
879 self.console.append("Please write a right value for Code")
881 return 0
880 return 0
882
883 opObj = puObj.addOperation(name='Decoder', optype='other')
884
881
885 code = code.replace("(", "")
882 code = code.replace("(", "")
886 code = code.replace(")", "")
883 code = code.replace(")", "")
887 code = code.replace("[", "")
884 code = code.replace("[", "")
888 code = code.replace("]", "")
885 code = code.replace("]", "")
889
886
890 if not opObj.addParameter(name='code', value=code, format='intlist'):
887 if not opObj.addParameter(name='code', value=code, format='intlist'):
891 self.console.append("Please write a right value for Code")
888 self.console.append("Please write a right value for Code")
892 return 0
889 return 0
893 if not opObj.addParameter(name='nCode', value=nCode, format='int'):
890 if not opObj.addParameter(name='nCode', value=nCode, format='int'):
894 self.console.append("Please write a right value for Code")
891 self.console.append("Please write a right value for Code")
895 return 0
892 return 0
896 if not opObj.addParameter(name='nBaud', value=nBaud, format='int'):
893 if not opObj.addParameter(name='nBaud', value=nBaud, format='int'):
897 self.console.append("Please write a right value for Code")
894 self.console.append("Please write a right value for Code")
898 return 0
895 return 0
899
896
900 name_parameter = 'mode'
897 name_parameter = 'mode'
901 format = 'int'
898 format = 'int'
@@ -4158,6 +4155,8 class BasicWindow(QMainWindow, Ui_BasicWindow):
4158 if projectParms.expLabel:
4155 if projectParms.expLabel:
4159 readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel)
4156 readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel)
4160
4157
4158 readUnitConfObj.addOperation(name="printInfo")
4159
4161 if projectParms.datatype == "USRP":
4160 if projectParms.datatype == "USRP":
4162 readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype,
4161 readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype,
4163 path=projectParms.dpath,
4162 path=projectParms.dpath,
@@ -4203,7 +4202,9 class BasicWindow(QMainWindow, Ui_BasicWindow):
4203
4202
4204 if projectParms.expLabel:
4203 if projectParms.expLabel:
4205 readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel)
4204 readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel)
4206
4205
4206 readUnitConfObj.addOperation(name="printInfo")
4207
4207 if projectParms.datatype == "USRP":
4208 if projectParms.datatype == "USRP":
4208 readUnitConfObj.update(datatype=projectParms.datatype,
4209 readUnitConfObj.update(datatype=projectParms.datatype,
4209 path=projectParms.dpath,
4210 path=projectParms.dpath,
@@ -594,7 +594,7 class JRODataReader(JRODataIO):
594 datetimeList.append(thisDatetime)
594 datetimeList.append(thisDatetime)
595
595
596 if not(filenameList):
596 if not(filenameList):
597 print "[Reading] Any file was found int time range %s - %s" %(startTime.ctime(), endTime.ctime())
597 print "[Reading] Any file was found int time range %s - %s" %(datetime.datetime.combine(startDate,startTime).ctime(), datetime.datetime.combine(endDate,endTime).ctime())
598 return None, None
598 return None, None
599
599
600 print "[Reading] %d file(s) was(were) found in time range: %s - %s" %(len(filenameList), startTime, endTime)
600 print "[Reading] %d file(s) was(were) found in time range: %s - %s" %(len(filenameList), startTime, endTime)
@@ -562,6 +562,10 class Decoder(Operation):
562 self.__nProfiles = dataOut.nProfiles
562 self.__nProfiles = dataOut.nProfiles
563 self.__nHeis = dataOut.nHeights
563 self.__nHeis = dataOut.nHeights
564
564
565 if self.__nHeis < self.nBaud:
566 print 'IOError: Number of heights (%d) should be greater than number of bauds (%d)' %(self.__nHeis, self.nBaud)
567 raise IOError, 'Number of heights (%d) should be greater than number of bauds (%d)' %(self.__nHeis, self.nBaud)
568
565 if dataOut.flagDataAsBlock:
569 if dataOut.flagDataAsBlock:
566
570
567 self.ndatadec = self.__nHeis #- self.nBaud + 1
571 self.ndatadec = self.__nHeis #- self.nBaud + 1
General Comments 0
You need to be logged in to leave comments. Login now