| The centralized control of 4000 optical fiber positioners on the focal panel is an important task in the LAMOST system.The design and development of optical fiber positioning positioner control software are one of the solutions to this problem.The software needs to regulate and monitor the operating state of the optical fiber positioner and be responsible for all the business related to the optical fiber positioner.In-orderto facilitate the setting of operation parameters,the control software needs to design a graphical user interface for human-computer interaction,and also needs to support the functions of interference processing,position detection,star observation,and other complex logic operations.These functions call each other and are logically coupled,which makes the interlaced and complex call relationship between modules during software development,which is not conducive to business modification and supplement,and greatly increases the cost of control software management and troubleshooting.In order to solve the problem of controlling software development,this paper mainly studies the technical scheme of developing optical fiber positioner positioning control software based on the MVC mode on the Qt development platform.MVC mode is introduced to divide the control software into three modules,namely the interface module,master control module,and communication module.According to the design requirements,the interface module is designed as an independent process,and the main control module and communication module are designed in a process.The main control module is responsible for coordinating the data interaction between the interface module and the communication module.The process uses shared memory,socket communication,and other communication methods to transmit data between processes,while the process uses Qt signal and slot mechanism,global configuration file,and other means to transmit data.These three modules are studied and realized in sequence:(1)Master control module:this module is not only responsible for interaction with other modules,but also responsible for realizing the algorithm logic of interference processing,running-in,zeroing,and other methods in the control software.The main control module is equipped with a server,which listens to socket requests of other modules and starts new running tasks by establishing HTTP connections.(2)Interface module:the interface module designs the display interface of unit operation,parameter selection control board,information editing dialog box,and other parts,and realizes the simulation operation and the operation of connecting the lower computer.The control software has three unit control modes,working mode,simulation mode,and debugging mode,which is realized in the interface module respectively.(3)Communication module:in the communication module,CAN,serial port,file transfer,and socket communication are implemented to interact with the lower computer,and the corresponding operation data construction mode is realized for each communication method.The proxy mode is introduced to encapsulate the data transmission between the communication module and the master control module.After the communication module interacts with the lower computer according to different communication methods,the data transmission format is the same for the master control module.The collision of fiber positioner is the positioner operation the important factors influencing the location accuracy and mechanical properties,for solving the problem of collision between the units from the software level,to introduce the concept of security Angle,a step-by-step collision algorithm was designed,and the realization of the algorithm on Qt development platform,the simulation experiments.The algorithm is added to the optical fiber unit control software,and the path is planned for the unit before the operation,to realize the anti-collision processing function of the software and solve the collision problem. |