mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	csv-convert: Tweak output column order.
To better fit into customer's visualization tool. Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
		| @@ -46,7 +46,7 @@ class CSVParcer(): | |||||||
|                 cni += 1 |                 cni += 1 | ||||||
|  |  | ||||||
|             # Write out out header for the new file. |             # Write out out header for the new file. | ||||||
|             fpo.write("Step Index,Attenuation [dB],Position [Deg],Traffic Pair 1 Throughput [Mbps]\n") |             fpo.write("Step Index,Position [Deg],Attenuation [dB],Traffic Pair 1 Throughput [Mbps]\n") | ||||||
|  |  | ||||||
|             # Read rest of the input lines, processing one at a time.  Covert the columns as |             # Read rest of the input lines, processing one at a time.  Covert the columns as | ||||||
|             # needed, and write out new data to the output file. |             # needed, and write out new data to the output file. | ||||||
| @@ -65,11 +65,11 @@ class CSVParcer(): | |||||||
|                 if (mbps_array[1] == "bps"): |                 if (mbps_array[1] == "bps"): | ||||||
|                     mbps_val /= 1000000 |                     mbps_val /= 1000000 | ||||||
|  |  | ||||||
|                 attenv = int(x[i_atten]) |                 attenv = float(x[i_atten]) | ||||||
|                 if ddb: |                 if ddb: | ||||||
|                     attenv /= 10 |                     attenv /= 10 | ||||||
|                      |                      | ||||||
|                 fpo.write("%s,%s,%s,%s\n" % (step_i, attenv, x[i_rotation], mbps_val)) |                 fpo.write("%s,%s,%s,%s\n" % (step_i, x[i_rotation], attenv, mbps_val)) | ||||||
|                 line = fp.readline() |                 line = fp.readline() | ||||||
|                 step_i += 1 |                 step_i += 1 | ||||||
|  |  | ||||||
| @@ -104,6 +104,8 @@ csv_convert.py: | |||||||
|     if args.outfile: |     if args.outfile: | ||||||
|         csv_outfile_name = args.outfile |         csv_outfile_name = args.outfile | ||||||
|  |  | ||||||
|  |     print("infile: %s  outfile: %s  convert-ddb: %s"%(csv_infile_name, csv_outfile_name, args.ddb)) | ||||||
|  |  | ||||||
|     CSVParcer(csv_infile_name, csv_outfile_name, args.ddb) |     CSVParcer(csv_infile_name, csv_outfile_name, args.ddb) | ||||||
|  |  | ||||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ben Greear
					Ben Greear