{"id":13607974,"url":"https://github.com/doctormin/Hangzhou-Metro-Data-Visualizer","last_synced_at":"2025-04-12T14:31:41.367Z","repository":{"id":103507555,"uuid":"227865221","full_name":"doctormin/Hangzhou-Metro-Data-Visualizer","owner":"doctormin","description":"🚊 GUI implemented with Qt Creator","archived":true,"fork":false,"pushed_at":"2020-04-02T03:24:34.000Z","size":1522,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-07T13:38:45.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doctormin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-13T15:10:01.000Z","updated_at":"2023-01-28T15:13:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"12a160d8-044e-48ae-bd2a-b141c996afc9","html_url":"https://github.com/doctormin/Hangzhou-Metro-Data-Visualizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctormin%2FHangzhou-Metro-Data-Visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctormin%2FHangzhou-Metro-Data-Visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctormin%2FHangzhou-Metro-Data-Visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctormin%2FHangzhou-Metro-Data-Visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doctormin","download_url":"https://codeload.github.com/doctormin/Hangzhou-Metro-Data-Visualizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248581193,"owners_count":21128119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:23.263Z","updated_at":"2025-04-12T14:31:39.358Z","avatar_url":"https://github.com/doctormin.png","language":"C++","funding_links":[],"categories":["资源清单"],"sub_categories":["CS2309 (原 CS241) - 问题求解与实践"],"readme":"# 🚉 Hangzhou Metro Data Visualization\n***Environment: Windows 10***---\n***Inplemented with Qt Creator***\n\n## Introduction\n\n----\n\n![image-20200402111627661](https://i.loli.net/2020/04/02/k6QAJ9nwyDP48jS.png)\n\n**\"Metro Insider\"*** handles files with **SQLite in-memory database** with high efficiency,  the following modules are implemented:\n\n-\u003e Loading Files with a Selector and Filter\n\n-\u003e SQLite Runner\n\n-\u003e Plotting \u0026 Analyzing\n\n-\u003e Route Planning\n\n## Functions \u0026 Implementations Details\n\n----\n\n### Module 1 *-\u003e Loading Files with a Selector and Filters*\n\n#### Select Files and Set Filters\n\n\"choose a folder\" button is expected to be pushed to start the whole process. It will open a dialogue to let users to **select the \"dataset\" folder**. It is implemented with `QFileDialog::getExistingDirectory()`.\n\n![image-20200402110928691](https://i.loli.net/2020/04/02/6DShV9b3yzJ7pgA.png)\n\nThen a tree widget is created to let users choose files and filters implemented with `QTreeWidegetsItem`.\n\n##### -\u003e Files Tree\n\n**The files tree can synchronize the child node with the parent node all the time**, with `Qt::Checked; Qt::PartlyChecked; Qt:Unchecked;` which means that \n\n- parent `Partlychecked` $\\Leftrightarrow$ some children `Checked`\n- parent `Checked`  $\\Leftrightarrow$ all children `Checked `\n- parent `Unchecked` $\\Leftrightarrow$ all children `Unchecked`\n- *It's implemented recursively.*\n\nAnd names of all the chosen files is maintained in `QStringList chosen_files_names` timely **before**\n\nthe \"load chosen files\" bottom being pushed. (So the program won't have any problems when users change the checked items during the loading process.)\n\n##### -\u003e Filters Tree\n\nIt is designed for choosing the fields to be loaded into the **SQLite** database. But \"time\" \u0026 \"stationID\" \u0026 \"status\" can **not** be unchecked since our mandatory task requires a plot on \"Inflow \u0026 Outflow of a station\".\n\n#### Loading Selected Files \n\nOnly selected fields of selected files will be loaded into  the datatbase. The database would create a table whose columns are those fields. And this module has the following characteristics:\n\n##### **-\u003e High  efficiency**\n\nLoading the dataset of one day takes averagely  50s in my surface-Laptop (2017, 13.5'), it's relatively fast due to the insertion of data to SQLite can't be done by multicore.\n\n##### **-\u003e Multithreading**\n\nWith `\u003cQtConcurrent\u003e` , the loading process is being done in another thread so the ui-thread will never be frozen.\n\n##### **-\u003e Status Bar**\n\nThe status bar is well designed to respond quickly to any situation\n\n![image-20191228185428567](https://i.loli.net/2020/04/02/47sSipIzyUtXjOv.png)\n\n![image-20191228185746754](https://i.loli.net/2020/04/02/WdPwh2aovfGTpRQ.png)\n\n![image-20191228185843719](https://i.loli.net/2020/04/02/p5dFbqVU8ZDMlE1.png)\n\nIf users change filters or files selections after a loading, the status bar will suggest a renew.\n\n![image-20191228190716316](https://i.loli.net/2020/04/02/s5VmPJHtchfRQei.png) \n\n##### **-\u003e Robustness**\n\n- Loading process is based on a file list maintained **before** \"pressing the load button\", so even if users change the file selection box or filters during the load, they won't have a problem.\n- Reloading is well supported since the database will drop and create a new table newly designed for the chosen column and ensure there will not be a leak of memory.\n- Before the loading process have been done, all the buttons and combo boxes relied to chosen files and filters will be disabled to avoid possible errors.\n\n---\n\n### Module 2 *-\u003e SQLite Runner*\n\n![img](https://i.loli.net/2020/04/02/QxjoAkR7mtwFVqT.png)\n*SQLite Runner* is designed for any explore of raw data by users. It is implemented by `QTextEdit` `QSqlQueryModel` `QTableView` , it has following characteristics:\n\n##### **-\u003e Fast Speed**\n\n- The database is in-memory and has a carefully designed **composite index**. So almost all the `SELECT` operation can be done in 0.x seconds.\n- `QTableView` with `QSqlQuerymodel`makes it possible for **dynamic loading**, which means that the ui will not show all the results from e.g. `SELECT * FROM TABLE` at once so the ui will not freeze at any time. When users scrolls the table view, new query results will constantly be loaded\n\n##### **-\u003e Syntax Error \u0026 Running Error Information**\n\nThis function is implemented by \n\n`ui-\u003estatusbar-\u003eshowMessage(model-\u003elastError().databaseText(), 100000);`\n\nIt will show any error message in the status bar.\n\n---\n\n### Module3 -\u003e Plotting \u0026 Analyzing\n\n![1585796701251](https://i.loli.net/2020/04/02/oGhCH2MexNWLZKi.jpg)\n\n![1585796708357](https://i.loli.net/2020/04/02/9GSg1oCmdzKtB3V.jpg)\n\n![1585796715361](https://i.loli.net/2020/04/02/FYUP4sbg5cLKB8y.jpg)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctormin%2FHangzhou-Metro-Data-Visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoctormin%2FHangzhou-Metro-Data-Visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctormin%2FHangzhou-Metro-Data-Visualizer/lists"}