Weighbridge fees automation

Weighing Automation "project"
began to write the first chapter microblogging today, the first to write weighing automation "project" just finished it. By Party (father) commissioned achieve weighing charges fully automated, without human intervention, the project cost is zero. Some may not understand, I will first introduce the "Project" background, right.
Dad retired boring, weighing charges in the unit, pass the time of old age. The so-called weighing is this, as shown, Weighbridge fees automationload up the goods on the truck scales, and then note the heavy charges to a few cars a day, a few years, are random, especially in the early morning car more middle of the night (the night search vehicles less), so wait 24 hours, the father too much, gave me the task is to weigh automation, I dare not neglect, immediately began the research and development process.
Hardware ready to do first. According to the survey, Taobao sell the automated weighing machines to thirteen thousand, combined with tight budget reality, to develop a set of economic program, which I wrote a program to achieve weighing and charging, so you buy a second-hand computers and monitors, then connect weighbridge serial receive data ok, so the hardware is weighbridge serial a sub wire and connected to the computer lines (total of 50), used Dell (selected from it because it can be a long-term power is stable) and a display (of 170 million) , because the computer platform can interfere with the electrostatic count, he bought serial electrostatic separator (30 million), the cable connection to the router (0 million), which is basically the necessary hardware.
The following is a highlight of the software development language chosen python, because rich modules that can perform various functions. Anterior code to the flowchart.Weighbridge fees automation

The following describes in detail each of the individual modules and code modules present a program used in FIG
Weighbridge fees automation
main module is used python threading, pyautogui, pytesseract, serial, matplotlib the like,

One. Initialization module
This module is initialized global variables, the main program path, weighing open thread, 2 codes in FIG Weighbridge fees automation
effect weighing of the child process is to receive data from the platform, and generates a platform according to the state of weight: car, no car, car stable.

two. Ready wait
state in this state weighbridge before the car is located. It has been cycle, a longer time interval is 10 seconds. Once the state is changed to a car, to 1 second intervals, when the car state becomes stable, the next state into the network through the network has turned weighed, weighing no network into the network nowhere. Code 3 Weighbridge fees automation
III with a mesh weighing
functions to be implemented this module
1, the cost is calculated according to the weight, and costs dimensional code display
2, the cost of generating the thread detection, detecting arrival cost micro-channel case, the language inform arrival.
3, monitoring costs threads survival, if not survival ready state is returned, otherwise a timeout return.
4, the money is received status bit is 1, the weight of the display, the car left out or disappears page, return to Ready.
In doing this the cost of monitoring the micro-channel function of time, just started going to study micro-channel interfaces, after consultation found registered to upload data must first become a merchant and so on, but also the key to the micro-channel flow 0.38% (or concessions), think about the distressed, I Bank deposit three months to a year on a regular basis to do so much interest, it would wind of what I take away so much, no, I put this python image recognition and micro-channel payment assistant combine these two functions, through image recognition whether receipt of payment (the amount need not be concerned, because the two-dimensional code program fee amount is fixed), the effect is very good, no mistakes too (ha ha, but also save a sum of money). The codes, as shown in Weighbridge fees automation
IV. No network load
in the absence of the network, the micro-channel can not receive payment information, you can only offer a fixed fee price two-dimensional code and voice prompts allow customers to pay their own conscious (how much to pay uncontrollable), after fees ( here the use of third party billing platform) delivers an activation line of SMS, the display shows the weight off automatically after 60 seconds. Code 5Weighbridge fees automation

The above is to introduce the main module, other code modules are around these services, not one goes up, there is a problem please leave a message.

Guess you like

Origin blog.51cto.com/14459794/2422086