Skip to content

Commit

Permalink
Merge pull request #2481 from JoePfeiffer/fix-2479
Browse files Browse the repository at this point in the history
Cleanups to component database directories; more robust manufacturer search
  • Loading branch information
JoePfeiffer committed May 12, 2024
2 parents a60e0b1 + 98a9311 commit 7a9bb43
Show file tree
Hide file tree
Showing 46 changed files with 11 additions and 63,530 deletions.
6 changes: 5 additions & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ tasks.register('copyReadmeMain', Copy) {
}
}

def externalComponentsPath = './src/main/resources/datafiles/components'
def externalComponentsPath = './src/main/resources/datafiles/components/database'
def externalResourceComponents = './resources-src/datafiles/openrocket-database'

// Initializes the submodules in Git.
Expand Down Expand Up @@ -167,6 +167,10 @@ tasks.register('externalComponentsCopy', Copy) {
from(externalResourceComponents + '/orc') {
include '**/*'
}
from(externalResourceComponents) {
include 'LICENSE'
include 'README.md'
}
into externalComponentsPath
exclude '**/*.bak'
includeEmptyDirs = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public List<ComponentPreset> listForTypes(List<ComponentPreset.Type> types) {
public List<ComponentPreset> find(String manufacturer, String partNo) {
List<ComponentPreset> presets = new ArrayList<ComponentPreset>();
for (ComponentPreset preset : list) {
if (preset.getManufacturer().getSimpleName().equals(manufacturer) && preset.getPartNo().equals(partNo)) {
if (preset.getManufacturer().matches(manufacturer) && preset.getPartNo().equals(partNo)) {
presets.add(preset);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/**
*
* Loader that gets all component preset from the database in directory datafiles/preset
* Loader that gets all component preset from the database in subdirectories of datafiles/components
*
*/
public class ComponentPresetDatabaseLoader extends AsynchronousDatabaseLoader {
Expand Down Expand Up @@ -84,7 +84,7 @@ private void loadUserComponents() {

/**
* loads the default preset components into the database
* uses the file directory from "datafiles/presets"
* uses the file directory from "datafiles/components"
*/
private void loadPresetComponents() {
log.info("Loading component presets from " + SYSTEM_PRESET_DIR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ void add(Manufacturer m) {
manufacturers.add(new Manufacturer("Kosdon by AeroTech", "Kosdon by AeroTech", Motor.Type.RELOAD,
"K", "KBA", "K-AT", "KOS", "KOSDON", "KOSDON/AT", "KOSDON/AEROTECH"));

manufacturers.add(new Manufacturer("LOC/Precision", "LOC/Precision", Motor.Type.UNKNOWN,
"LOC"));

manufacturers.add(new Manufacturer("Loki Research", "Loki Research", Motor.Type.RELOAD,
"LOKI", "LR"));

Expand Down

0 comments on commit 7a9bb43

Please sign in to comment.