08/03/2016 – Tips of Tolerance Checker– 公差查询器备忘

(English version follows Chinese Part)

之前就有说过实验室板块一共打算同时进行两个项目,天文部分是晴天钟,机械部分是公差查询器。这篇文章打算记录一下公差查询器的思考内容以作备忘。

I was talking about plans of the lab before, Web Forecast for astronomy block and Tolerance Checker for mechanical block. This is the memorandum of what I have thought about building the tolerance checker.

一开始先检索了一下“检索器+数据库”结构的实现方式,包括asp+excel, php+myaql, php+excel等等等等。我根据我的客观条件,打算采用php+excel的方式来实现网页查表式的公差查询器。

The basic structure of online checker is “checker+database”, which have kinds of  method including asp+excel, php+myaql, php+excel and etc. Considering of objective conditions I have, I will go by php+excel solution.

选择php+html作为前端和服务器端的检索器是因为我已经有了一个支持php的虚拟主机,直接提供了在线调试环境,而且流量够、速度够,就不打算再倒腾一番搭建本地测试环境了。所以没有采用asp。

It is no necessary that set up another local testing environment when I have already got virtual host with php supporting. That’s why I chose php instead asp for my checker and I can test it online.

至于数据库,使用excel,是因为我完全不打算再学mysql,另一个原因是极限偏差表的数据量有点大,而且目前取得的数据必须要依靠我手工输入,所以选择excel在创建数据库的时候会比较便捷。另外,php有开源的excel读取工具可以直接调用,这对我这样一个php小白来说,实在是方便不过。

As for database, learn to use mysql may take too much time. But the core problem is that entering data of tolerance would be a huge project when I have to type it myself by hand. So, excel will be easier for me to setup database files. Luckily, php has open source of excel reader that I can use for my checker directly.

目前,参考网络上已有的php+excel查询器例子,思考了几天,打算按照如图1的结构创建查询器,不过也有可能需要更多的php文件在服务器端进行检索、查表操作。

After searching examples of php+excel checkers online, I make the structure graph as Fig.1. It is a prophase plan and there might be more php files for the checking function at server side.

20160308-tolerance_checker (2)

图1(Fig.1)

主页客户端的表单和服务器端检索的逻辑如图2,我目前最好的打算是表单和结果显示能够在同一页面展现且不断复用,这样才是“查询器”,而不是“查询页”。

The form on front page has its appearance as Fig.2 and the checking logic of server-side files have been shown as well. My better plan of the front page is that exhibiting the radio buttons and the return result on the same page which can be reused without refreshing the page.

20160308-tolerance_checker-1

图2(Fig.2)

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注