将串行端口中的传感器数据保存到SQLite数据库中 [英] SAVING INCOMING SENSOR DATA FROM SERIAL PORT INTO SQLite DATABASE

查看:339
本文介绍了将串行端口中的传感器数据保存到SQLite数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

Hello All,

我正在使用VISUAL STUDIO 2015& .NET framework 4.6

I'm using VISUAL STUDIO 2015 & .NET framework 4.6

我正在开发一个Windows应用程序 其中我需要记录传入的传感器数据 在我的SQLite数据库中。我还需要在需要时检索它。

I'm developing a windows application  wherein I need to log incoming sensor data  in to my SQLite database.Also I need to retrieve it when required.

我能够创建表格&将用户输入数据插入我的数据库,如下面的表格所示

I'am able to create table & insert user input data into my database as shown below in my form

我还有另一种形式,其输入数据如下图所示绘制

I have another form in which incoming data is getting plotted as shown below

我想在点击"记录按钮"后存储数据(记录数据,比方说15分钟)。以及Sqlite数据库的最后插入行中的时间戳。如果我选择保存数据的特定行,我也想要将其检索回来。

I want to store the data(record data for lets say 15 mins) after I click "Record Button" along with the time stamp in last inserted row of the Sqlite Database. Also I want to retrieve it back if I select that particular row in which data was saved.

正弦波中的干扰对我来说也是一个问题但这可以在以后处理。

That disturbance in the sine wave is also a concern for me but that can be taken care of later.

任何帮助都将受到赞赏!!

Any help would be appreciated!!

推荐答案

大多数文档将在C ++或C#中首先通过查看C#示例来理解例如

this一个
你应该知道如何使用数据库。这里的大多数开发人员都使用SQL-Server或MS-Access,因此请记住这一点,因为它们更健壮,并且有更多可用的文档,然后是SqlLite。

Most documentation is going to be in either C++ or C# is the first thing to understand yet by reviewing C# examples such as this one you should get an idea how to use the database. Most developers here use either SQL-Server or MS-Access so keep this in mind too as they are more robust and have much more documentation available then SqlLite.

核心对象是连接和命令对象(如上面的链接所示)并注意它们使用参数而不是创建任何语句而不使用字符串连接,这在处理字符串时尤为重要。

The core objects are the connection and command objects (as shown in the link above) and note they use parameters rather than creating any statements without using string concatenation which is important especially when dealing with strings.


这篇关于将串行端口中的传感器数据保存到SQLite数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆