I am now concentrated in ASP.NET to get our resident database reports ready this year. I haven't be happy with MS Access reports and I am now investigating Crystal Reports for Visual Studio and Visual Studio's own report tool. I hope I can use the flexibility of LINQ. I used Crystal Reports ten years ago.
It was a time consuming work to figure out, how to transfer MM Access database to SQL Express. I didn't get the conversion tool to work. I transferred the data table by table by converting them first to text. I am naturally overdoing our database, but I want to learn.
Basically the database front end is now designed with the Web Forms. I was planning to go the ASP.NET MVC, but it was too much learning at this point. Eventually I have to do that later.
Front End- design is not so easy with ASP.NET than with MS Access and Visual Studio Windows Forms. I made a lot of googling, but I couldn't find proper solutions. Then I started to make that with the old way. It means start to think:) All controls on ASP- pages actually create a HTML code. It took a lot of time to profoundly understand it! I can now combine data controls with regular controls by editing the source HTML file.
Monday, December 28, 2015
Tuesday, December 22, 2015
Eddie's First Steps
Eddie is now moving!! The serial port problem was actually my simple program bug. I didn't clear one variable. It is actually seen in my last post in the C# code. My big audience didn't find it:)
My analysis was totally wrong, but I still have problems with receiving data.
I found a good article about serial ports on .NET:
http://www.innovatic.dk/knowledg/SerialCOM/SerialCOM.htm
The picture is from the screen capture from Eddies eyes and brains, Dell laptop.
My analysis was totally wrong, but I still have problems with receiving data.
I found a good article about serial ports on .NET:
http://www.innovatic.dk/knowledg/SerialCOM/SerialCOM.htm
The picture is from the screen capture from Eddies eyes and brains, Dell laptop.
Sunday, December 20, 2015
Eddie Obeys but won't Give Good Feedback
Eddie is now moving from the dashboard. Sending commands appeared to be easy, but receiving data is another story. I have tried to read sensors and update form controls and I had only partial success.
I got finally all working by reading serial data byte by byte. Trying to read receive data line by line or the whole buffer didn't work for me. It can be a driver issue or I haven't get the full idea of threading.
Now I cannot clear the receiving buffer. That means I cannot update form fields properly without tricks. All worked very well with VB5&6 in good old times.
I am using now timer to send commands like with VB5.
Anyway, here is the code:
private void SerialPortDataReceived(object sender, SerialDataReceivedEventArgs e)
{
byte[] buff = new byte[sp.BytesToRead];
int result = sp.Read(buff, 0, sp.BytesToRead);
/*
foreach (byte b in buff)
*/
foreach (byte b in buff)
{
RecASCII += b.ToString();
}
//string aa = sp.ReadLine();
//string aaa = sp.ReadExisting();
Thread.Sleep(100);
sp.DiscardInBuffer(); // clear buffer
RecHEX = ASCIITOHex(RecASCII);
this.Invoke((MethodInvoker)delegate
{
RightPing.Text = RecHEX;
LeftPing.Text = RecHEX;
});
}
I got finally all working by reading serial data byte by byte. Trying to read receive data line by line or the whole buffer didn't work for me. It can be a driver issue or I haven't get the full idea of threading.
Now I cannot clear the receiving buffer. That means I cannot update form fields properly without tricks. All worked very well with VB5&6 in good old times.
I am using now timer to send commands like with VB5.
Anyway, here is the code:
private void SerialPortDataReceived(object sender, SerialDataReceivedEventArgs e)
{
byte[] buff = new byte[sp.BytesToRead];
int result = sp.Read(buff, 0, sp.BytesToRead);
/*
foreach (byte b in buff)
*/
foreach (byte b in buff)
{
RecASCII += b.ToString();
}
//string aa = sp.ReadLine();
//string aaa = sp.ReadExisting();
Thread.Sleep(100);
sp.DiscardInBuffer(); // clear buffer
RecHEX = ASCIITOHex(RecASCII);
this.Invoke((MethodInvoker)delegate
{
RightPing.Text = RecHEX;
LeftPing.Text = RecHEX;
});
}
Wednesday, December 16, 2015
Geodesy
I have now studied LINQ (Language Integrated Query) in the ASP project. It is more flexible than normal query language, because I can make queries in the code level. I created our resident database with MS Access and I had difficulties to create complicated queries for reports. This should work
I have tried to check the "Chart Channel" geodesy part. At this point it is overwhelming to me. Unfortunately I never studied geodesy profoundly and I never knew, what the code is exactly doing. So get a new study project. Typically things are clearing up and I don't need to know all. Just persistent work.
I have tried to check the "Chart Channel" geodesy part. At this point it is overwhelming to me. Unfortunately I never studied geodesy profoundly and I never knew, what the code is exactly doing. So get a new study project. Typically things are clearing up and I don't need to know all. Just persistent work.
Sunday, December 13, 2015
Pinging
I haven't been lazy this weekend. I am still fighting with threads. It appears to be very fundamental and new to the old Visual Basic - programmer like me. Some progress anyway.
The code below reads Eddie's ping (sonar) sensors and update the form text controls.
Text controls updates happen in the different thread. I had a lot of googling to make this happen. The other option I have check is the Backgroundworker-class.
Things are going slowly now, but I know based on my experience, all will accelerate later.
I have also worked with ASP-study and the VB6 "Charts Channel" with Artinsoft tool. Unfortunately it's free version allows only 10000 lines. So I have to divide the code. The "Charts Channel" is about 23000 lines. Naturally I can remove some code. Artinsoft tool isn't the perfect solution, but it gives some foundation how to do the conversion.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
namespace SimpleEddie
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
serialPort1.PortName = "COM3";
serialPort1.BaudRate = 115200;
serialPort1.DataBits = 8;
serialPort1.Parity = Parity.None;
serialPort1.StopBits = StopBits.One;
serialPort1.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
serialPort1.Open();
string msg = "PING \r";
serialPort1.Write(msg);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
string data = serialPort1.ReadExisting();
if (data != "")
{
string data1 = data.Substring(0, 3);
string data2 = data.Substring(4, 3);
this.Invoke((MethodInvoker)delegate {
LeftPing.Text = data1; // runs on UI thread
RightPing.Text = data2;
});
}
}
}
}
The code below reads Eddie's ping (sonar) sensors and update the form text controls.
Text controls updates happen in the different thread. I had a lot of googling to make this happen. The other option I have check is the Backgroundworker-class.
Things are going slowly now, but I know based on my experience, all will accelerate later.
I have also worked with ASP-study and the VB6 "Charts Channel" with Artinsoft tool. Unfortunately it's free version allows only 10000 lines. So I have to divide the code. The "Charts Channel" is about 23000 lines. Naturally I can remove some code. Artinsoft tool isn't the perfect solution, but it gives some foundation how to do the conversion.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
namespace SimpleEddie
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
serialPort1.PortName = "COM3";
serialPort1.BaudRate = 115200;
serialPort1.DataBits = 8;
serialPort1.Parity = Parity.None;
serialPort1.StopBits = StopBits.One;
serialPort1.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
serialPort1.Open();
string msg = "PING \r";
serialPort1.Write(msg);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
string data = serialPort1.ReadExisting();
if (data != "")
{
string data1 = data.Substring(0, 3);
string data2 = data.Substring(4, 3);
this.Invoke((MethodInvoker)delegate {
LeftPing.Text = data1; // runs on UI thread
RightPing.Text = data2;
});
}
}
}
}
Tuesday, December 8, 2015
Upgraded Plans and the Goal
My ASP.NET project is still in learning mode. I have basically reread the things I have known earlier. Just now I am studying database controls that I never used with my old database application, the Open Door Mission Master Database. I used an existing application that I modified. I am going to the new area now.
I have designed a simple resident database for my organization St. Francis Charities based on Microsoft Access. The goal is turn that to the Internet based ASP.NET/SQL Server application. Then I will but that to the cloud using Microsoft Azure.
I have also studied the VB6 "Charts Channel" software. I am feeling more comfortable with it. It needs only perseverance to convert that to .NET. I can clean some unnecessary parts of it to make conversion simpler. VB6 and the Object Oriented .NET are different and I cannot estimate the exact conversion time just now. My optimistic schedule is three months.
Eddie is the way to learn C# and the real Object Oriented Program design.
Three things are now going on and they support the goal to make a telepresence, position and navigation software for Eddie robot. The estimated time to do it is six months. It is a kind of graduation work after what I have learned during past forty years. I pray and hope I will get a chance to make it happen.
I have designed a simple resident database for my organization St. Francis Charities based on Microsoft Access. The goal is turn that to the Internet based ASP.NET/SQL Server application. Then I will but that to the cloud using Microsoft Azure.
I have also studied the VB6 "Charts Channel" software. I am feeling more comfortable with it. It needs only perseverance to convert that to .NET. I can clean some unnecessary parts of it to make conversion simpler. VB6 and the Object Oriented .NET are different and I cannot estimate the exact conversion time just now. My optimistic schedule is three months.
Eddie is the way to learn C# and the real Object Oriented Program design.
Three things are now going on and they support the goal to make a telepresence, position and navigation software for Eddie robot. The estimated time to do it is six months. It is a kind of graduation work after what I have learned during past forty years. I pray and hope I will get a chance to make it happen.
Sunday, December 6, 2015
Troubles
Eddie caused lot of troubles this weekend and then I found that battery level was too low! It was a shame and also a relief, because I thought that the control board is faulty again. Then the charger unit was broke and I built a temporary one using a LCD monitor power source. These were the engineering incidents.
I built a new serial port application. Now the serial interface is as a control in a form. That's way it used to be in old VB6. Then I got a problem when I tried to update fields on the form. I got error messages that controls cannot be updated from the different thread. I never had that kind of issue with VB6. Now I have to worry about threads. Threads are naturally basic stuff with multitasking, but I miss the old VB6. Anyway, after Googling I found a workaround. Basically a new thread must be created.
I was studying also ASP.NET databases. The new SQL Server Express 2014 has a new graphical interface for creating queries like MS Access has. In the old SQL Server 2008 the only way is you have type queries with the query language.
The battle continues.
I was studying also ASP.NET databases. The new SQL Server Express 2014 has a new graphical interface for creating queries like MS Access has. In the old SQL Server 2008 the only way is you have type queries with the query language.
The battle continues.
Thursday, December 3, 2015
WPF
I started to code my small robot control software, but it wasn't so easy I thought. I have learned to update form fields straight from the program module, but it won't work easy way. The reason is Windows Presentation Foundation (WPF). I have to possibly go back to "school" and study more or find a workaround. Perhaps back to normal Windows forms.
The good news is I got the old Visual Basic 6 based "Charts Channel" program work under Windows XP. I miss the old times when all was easier...
I have finally start to study Internet databases with ASP.NET.
The good news is I got the old Visual Basic 6 based "Charts Channel" program work under Windows XP. I miss the old times when all was easier...
I have finally start to study Internet databases with ASP.NET.
Subscribe to:
Posts (Atom)