CARTAvis / carta-archived

CARTA stands for Cube Analysis and Rendering Tool for Astronomy, a new visualization tool designed for the ALMA, the JVLA and the SKA.
https://cartavis.github.io/
GNU General Public License v3.0
2 stars 0 forks source link

Cjhsu/new arch grid control #245

Closed appolloford closed 6 years ago

appolloford commented 6 years ago

This PR discard the original design of gridcontrol, and use the controller to receive the commands from the front-end, and then call stack to deal with the requests. The purpose is to solve the previous sync problem. We don't need to sync the datagrid belonging to the gridcontrol and another one belonging to the layerdata. The front-end will directly get the state of the datagrid in the layerdate to set the props of the UI elements. Details:

  1. There are some commands still not be transferred (related to the color setting) so the definition of gridcontrol is left as a reference.
  2. The transferred commands can be found in the commit description. The left commands also can be found in the comment of controller.
  3. The related part in the python interface is disabled/commented.
  4. Most of the 'set' function in the datagrid are replaces by the '_setState()', the function will directly set the state value of the datagrid and return the updated state string. Something noticeable is that the setState won't check the value. The check should be done in the front-end. Besides, the '_setState' function doesn't handle exception, which should be added in the future. The original 'set' functions are also left as references.
  5. In the PR, the setDataGridState method in LayerGroup will change the datagrid states of all the LayerData members and return the datagrid state of the current layerdata. The behavior should be discussed further.