Graph and Table implementation

2005-01-21 Thread Jan Rienyer Gadil
could anyone please help me!

what and how is the best implementation of creating a table based on
data coming from the serial port ? and also how would i be able to
create graphs (2D) based on these data?

opinions and suggestion are most highly welcome. thanks.

jr
-- 
http://mail.python.org/mailman/listinfo/python-list


How to assign

2005-01-25 Thread Jan Rienyer Gadil
Sort of a newbie question:
How am i going to assign to a variable anything the user inputs on a wxTxtCtrl?
-- 
http://mail.python.org/mailman/listinfo/python-list


graphing

2005-02-13 Thread Jan Rienyer Gadil
i'm currently using python 2.3(enthought edition) on win 2000/xp.
i'm using boa constructor on the GUI part and matplotlib 0.71 on
plotting the graph.

i am using an MDIParentFrame. one of the child frame (MDIChildFrame1)
will be used for
the table part. then another child frame (MDIChildFrame2) will be used
to show the
graph, how am i going to do this? will i just import the child frame
(say on MDIChildFrame2, import MDIChildFrame1)
containing the tables and then i'll be able to just get the data from
the table and use it to plot a graph?

how am i going to assign to a variable each input to the table? Should
I use array or list?
since the data will be coming from serial port, how would i save each
data on each read from serial port, should i just append to the list
or array on each serial read?

i'm a little lost since i'm a bit new to python.

also, how am i going to assign to a variable anything that a user
inputs to a wxTxtCtrl?

any help would greatly be appreciated. thanks and more power
-- 
http://mail.python.org/mailman/listinfo/python-list


saving a text file

2005-02-14 Thread Jan Rienyer Gadil
any idea how to automatically save to a text file?
here's what the program do:

first, data is read from the serial port every fixed lenght of time
the data will then be put to a table,
now, every serial read, a table will be created for the data that will
be gathered (one window for each table)
to avoid showing in too many windows, each table will be automatically
saved as a txt file after every 5 tables created.
the txt file will be named after the time it was taken (say from the
system clock)

thanks for your help and more power...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-13 Thread Jan Rienyer Gadil
@ sir Peter
so you mean that it is correct (at least on the unpack() part) 

when i run this program on IDLE , Python 2.3 (enthought edition),
nothing is outputted on the shell, until i decide to close the shell,
wherein it tells me if i would like to kill a process...

import serial
import string
import time
from struct import *

ser = serial.Serial()

ser.baudrate = 9600
ser.port = 0
ser
ser.close()
ser.open()

command = 67
message_no = 1
total_data = 2

item = 1

for item in range(1, 30001, 250):
   data_hi, data_lo = divmod(item, 0x100)
   checksum = -(data_hi + data_lo + 0x46) & 0xff
   ser.write(pack('6B', command, message_no, total_data, data_lo,
data_hi, checksum))

   rx_data1=0
   while (rx_data1 != 0x46):
   rx_data1 = ser.read(1)
   (rx_command) = unpack('1B', rx_data1)

rx_data2=ser.read(9)
(rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, pyra2, voltage,
 current, rx_checksum) = unpack('9B', data)
 print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1,
 pyra2, voltage, current, rx_checksum

ser.close()
-- 
http://mail.python.org/mailman/listinfo/python-list