Computer-controlled Flat knitting Machine is a kind of high-technology electro-mechanical knitting equipment. It can be used to weave various parts of the products and design types by programming through a Computer Pattern Preparation System. The article has explained the main research and development trend, which can better realize the design of Computer Pattern Preparation System, on the basis of providing the relevant concepts.The Computer Pattern Preparation System includes two sub-systems, graphics import & edit and knitting machine programming design. In the sub-system of graphics import & edit, the application of the command design pattern and color quaintization algorithm are mainly discussed in the article. In the other sub-system of knitting machine programming design, the basic craft of the knitting machine and how to realize the programming sub-system will be discussed in detail. The essentials of the article are following:The "median-cut algorithm" is chose to realize color quaintization. So it has the features of light graphic distortion, fast computational speed, and so on.The command design pattern which provides undo-redo operation, is applied to the whole class frame design and several sub-classes design of graphics edit operation. It records every single or multiple operations and unifies undo-redo function inteface, which facilitates program and system extension.Many knitting machine techniques are concerned, including many kinds of fixed organizational needle method and settlement of every craft parameter during the design of plan of weave. This system has established the organization library of every kind of needle method, and set up the corresponding organization library files. Organizations needed can be selected in the course of the operation design. The workload of the operators can be greatly decreased while the craft requirement of the operators is reduced, so working efficiency can be improved.The sub-system of programming design offers kinds of auxiliary functions, whichcan make operations more convenient, such as copy, paste or merge the plan of weave, and so on. |