north2012
Member level 3
- Joined
- Apr 1, 2013
- Messages
- 63
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,813
Hello,
I am working with small WSN with coordinator and 3 nodes. Coordinator ("Hall") collects all data (measured temperature, relative humidity and light intensity) from nodes ("Bedroom", "Lounge", "Bathroom") and through serial interface send it to PC where I have PC application for data acquisition and presentation.
First step:
After package is received and parsing one of charts is updated
The problem is that nodes can join in network in different moments, but new graph is always started from zero position even it is different time.
"Hall" joins first and that graph is started. For example, after 4-5 seconds new node is added but that graph starts from zero and so on... How to add offset to X value to?
I am working with small WSN with coordinator and 3 nodes. Coordinator ("Hall") collects all data (measured temperature, relative humidity and light intensity) from nodes ("Bedroom", "Lounge", "Bathroom") and through serial interface send it to PC where I have PC application for data acquisition and presentation.
First step:
Code:
chart1.Series["Hall"].ChartType = SeriesChartType.FastLine;
chart1.Series["Hall"].Color = Color.Red;
chart1.Series["Bedroom"].ChartType = SeriesChartType.FastLine;
chart1.Series["Bedroom"].Color = Color.Blue;
chart1.Series["Lounge"].ChartType = SeriesChartType.FastLine;
chart1.Series["Lounge"].Color = Color.Brown;
chart1.Series["Bathroom"].ChartType = SeriesChartType.FastLine;
chart1.Series["Bathroom"].Color = Color.Green;
chart1.Legends["Legend1"].Docking = Docking.Top;
After package is received and parsing one of charts is updated
Code:
DateTime now = DateTime.Now;
date = now.ToString("dd/MM/yy");
chart1.Series["Hall"].Points.AddXY(time, halltemperature);
chart1.Series["Bedroom"].Points.AddXY(time, bedroomtemperature);
chart1.Series["Lounge"].Points.AddXY(time, loungetemperature);
chart1.Series["Bathroom"].Points.AddXY(time, bathroomtemperature);
The problem is that nodes can join in network in different moments, but new graph is always started from zero position even it is different time.
"Hall" joins first and that graph is started. For example, after 4-5 seconds new node is added but that graph starts from zero and so on... How to add offset to X value to?