Index: trunk/webapp/abscontrol/models.py =================================================================== diff --git a/trunk/webapp/abscontrol/models.py b/trunk/webapp/abscontrol/models.py --- a/trunk/webapp/abscontrol/models.py (revision 152) +++ b/trunk/webapp/abscontrol/models.py (revision 153) @@ -53,9 +53,10 @@ pattern = models.ForeignKey(Pattern) value = models.TextField() - tx = models.TextField() - rx = models.TextField() - ues = models.CharField(max_length=120) + tx = models.TextField(null=True) + rx = models.TextField(null=True) + ues = models.CharField(max_length=120, null=True) + only_rx = models.PositiveSmallIntegerField(default=0) date_create = models.DateTimeField() date_modified = models.DateTimeField(null=True) hits = models.PositiveIntegerField() @@ -81,9 +82,10 @@ pattern = models.ForeignKey(Pattern) value = models.TextField() - tx = models.TextField() - rx = models.TextField() - ues = models.CharField(max_length=120) + tx = models.TextField(null=True) + rx = models.TextField(null=True) + ues = models.CharField(max_length=120, null=True) + only_rx = models.PositiveSmallIntegerField(default=0) date_create = models.DateTimeField() date_modified = models.DateTimeField(null=True) hits = models.PositiveIntegerField() Index: trunk/webapp/abscontrol/views.py =================================================================== diff --git a/trunk/webapp/abscontrol/views.py b/trunk/webapp/abscontrol/views.py --- a/trunk/webapp/abscontrol/views.py (revision 152) +++ b/trunk/webapp/abscontrol/views.py (revision 153) @@ -252,23 +252,6 @@ filename = '/tmp/'+txtFilename.name readFile = readABSFile(filename) expName, num_patterns, patterns = readFile.getMetadata() - - ''' - f = open('/tmp/'+txtFilename.name, 'r') - newContent = f.readlines() - f.close() - content = "" - for i,line in enumerate(newContent): - if i == 0: - newLine = line.replace("'","") - pos = newLine.find("=") - expName = newLine[pos+1:].strip() - elif i == 2: - pos = line.find("=") - num_patterns = line[pos+1:].strip() - else: - content += line - ''' else: txtFilename = "Error" #content = "Error" Index: trunk/webapp/static/css/style.css =================================================================== diff --git a/trunk/webapp/static/css/style.css b/trunk/webapp/static/css/style.css --- a/trunk/webapp/static/css/style.css (revision 152) +++ b/trunk/webapp/static/css/style.css (revision 153) @@ -6,7 +6,7 @@ * font-family: 'Roboto Condensed', sans-serif; */ -body { font-size: 11px; } +body { font-size: 12px; } header {border: 1px solid #fcc; font-size: 2em; height: 50px; text-align: center; line-height: 50px} #schema {margin: 0 auto; width: 980px; border: 1px solid #f00; padding: 10px 10px 10px 10px} #content {border: 1px solid #1cc; margin-top: 5px; margin-bottom: 5px} @@ -44,19 +44,19 @@ /****************************************************************************************/ #divProfile { border: 0px solid #dff; margin: 10px 0px; padding: 10px 10px; width: 500px } .flsAntenna { margin: 10px 0px; width: 750px; padding: 10px 10px } -#divPattern textarea,input[type=text],label{ font-family: Monaco; font-size: inherit; } +#divPattern textarea,input[type=text],label{ font-family: "Open Sans"; font-size: inherit; } #divPattern textarea {resize: none; overflow: hidden} .divAntenna { float: left; margin: 10px; height: 160px; border: 0px solid #fcc !important; width: 260px } .divAntenna label{ display: block } -.txtAntenna { max-width: 250px; max-height: 125px; width: 250px; height: 125px } -.divAntenna p{ max-width: 250px; max-height: 125px; width: 250px; height: 125px } +.txtAntenna { width: 250px; max-width: 250px; height: 135px; max-height: 140px; } +.divAntenna p{ width: 250px; max-width: 250px; height: 130px; max-height: 130px; border: 1px solid #eee !important} .divTx { display: block; float: left; margin: 10px; height: 150px } .divTx label{ display: block } -.divTx textarea{ width: 135px; max-width: 135px; height: 125px; max-height: 125px; text-align: justify } -.divTx p{ width: 135px; max-width: 135px; height: 125px; max-height: 125px; text-align: justify } +.divTx textarea{ width: 135px; max-width: 135px; height: 135px; max-height: 140px; text-align: justify } +.divTx p{ width: 135px; max-width: 135px; height: 130px; max-height: 130px; text-align: justify } .divUes { display: block; margin: 10px} .divUes input[type=text] { width: 240px; max-width: 240px;} @@ -79,3 +79,7 @@ #navPatternList a{ width: 50px; border: 0px solid #1cc !important; display: block; text-align: center; line-height: 25px} .lnkPattern{ background-color: #ccc !important; color: #eee;} .lnkPatternSelected{ background-color: #2cc !important; color: #fff;} + +.divListofPatterns{ width: 650px; display: block; border: 1px solid #1cc !important; margin: 0 auto} +.divPattern{ width: 600px; display: block; border: 1px solid #f00 !important; margin: 2px auto; } + Index: trunk/webapp/templates/abscontrol/upload.html =================================================================== diff --git a/trunk/webapp/templates/abscontrol/upload.html b/trunk/webapp/templates/abscontrol/upload.html --- a/trunk/webapp/templates/abscontrol/upload.html (revision 152) +++ b/trunk/webapp/templates/abscontrol/upload.html (revision 153) @@ -5,29 +5,30 @@
- - +
- -

{{ expName }}

- -

{{ num_patterns }}

+
+
{% if patterns %} -
+
{% for element in patterns %} -
- +
+
+ +
+
+ +

{{ element.up }}

+
+
+ +

{{ element.down }}

+
+
-
- -

{{ element.up }}

-
-
- -

{{ element.down }}

-
+
{% endfor %}
{% endif %} Index: trunk/webapp/util/readABSFile.py =================================================================== diff --git a/trunk/webapp/util/readABSFile.py b/trunk/webapp/util/readABSFile.py --- a/trunk/webapp/util/readABSFile.py (revision 152) +++ b/trunk/webapp/util/readABSFile.py (revision 153) @@ -37,14 +37,34 @@ def getPatterns(self, content): lsPattern = [] - index = 8 + patterns = self.getValueofPattern(content) + for element in patterns: + if element != "": + strValue = element.replace("=","/") + pattern = strValue.split("/") + dicPattern = {"number" : pattern[0], "up" : pattern[1], "down" : pattern[2]} + lsPattern.append(dicPattern) - for i in range(0, self.number_patterns): - first = i+index - second = first+index - antennaUp = content[i:first] - antennaDown = content[first+1:second] - dicPattern = {"number" : content[i], "up" : antennaUp, "down" : antennaDown} - lsPattern.append(dicPattern) + return lsPattern + + def getValueofPattern(self, content): + strValue = "".join(element.replace("\n","+").strip() for element in content) + strValue = strValue.replace("\r","+") + strValue = strValue.replace("$","") + strValue = strValue.replace("]]+++[[","]]/[[") + strValue = strValue.replace("]]++[[","]]/[[") + strValue = strValue.replace("]]+[[","]]/[[") + strValue = strValue.replace("],++[","],[") + strValue = strValue.replace("],+[","],[") + strValue = strValue.replace("]]+++","]]|") + strValue = strValue.replace("]]++","]]|") + strValue = strValue.replace("]]+","]]|") + strValue = strValue.replace(" =++[[","=[[") + strValue = strValue.replace("=++[[","=[[") + strValue = strValue.replace(" =+[[","=[[") + strValue = strValue.replace("=+[[","=[[") + strValue = strValue.replace("+","").strip() + #print strValue + lsPatterns = strValue.split("|") - return lsPattern \ No newline at end of file + return lsPatterns \ No newline at end of file