diff --git a/fio.go b/fio.go index d65211b..2bdcc21 100644 --- a/fio.go +++ b/fio.go @@ -280,9 +280,11 @@ type ElastoDyn struct { type HydroDyn struct { FileBase - WaveMod Integer `json:"WaveMod"` - ExctnMod Integer `json:"ExctnMod"` - PotFile Path `json:"PotFile" ftype:"Misc"` + WaveMod Integer `json:"WaveMod"` + WvDiffQTF Bool `json:"WvDiffQTF"` + WvSumQTF Bool `json:"WvSumQTF"` + ExctnMod Integer `json:"ExctnMod"` + PotFile Path `json:"PotFile" ftype:"Misc"` } func (h *HydroDyn) PostParse() error { diff --git a/frontend/src/components/Model.vue b/frontend/src/components/Model.vue index 319e2ec..ef9c4d8 100644 --- a/frontend/src/components/Model.vue +++ b/frontend/src/components/Model.vue @@ -58,6 +58,14 @@ function setDefaults() { files.AeroDyn[0].SkewMod.Value = 0 } + // Set HydroDyn file linearization defaults + if (files.HydroDyn.length > 0) { + files.HydroDyn[0].WaveMod.Value = 0 + files.HydroDyn[0].WvDiffQTF.Value = false + files.HydroDyn[0].WvSumQTF.Value = false + files.HydroDyn[0].ExctnMod.Value = 0 + } + // Save changes to model project.updateModel() } diff --git a/frontend/wailsjs/go/models.ts b/frontend/wailsjs/go/models.ts index 38d1e93..ff4e8ce 100755 --- a/frontend/wailsjs/go/models.ts +++ b/frontend/wailsjs/go/models.ts @@ -982,6 +982,10 @@ export namespace main { Name: string; Type: string; Lines: string[]; + WaveMod: Integer; + WvDiffQTF: Bool; + WvSumQTF: Bool; + ExctnMod: Integer; PotFile: Path; static createFrom(source: any = {}) { @@ -993,6 +997,10 @@ export namespace main { this.Name = source["Name"]; this.Type = source["Type"]; this.Lines = source["Lines"]; + this.WaveMod = this.convertValues(source["WaveMod"], Integer); + this.WvDiffQTF = this.convertValues(source["WvDiffQTF"], Bool); + this.WvSumQTF = this.convertValues(source["WvSumQTF"], Bool); + this.ExctnMod = this.convertValues(source["ExctnMod"], Integer); this.PotFile = this.convertValues(source["PotFile"], Path); } @@ -1014,6 +1022,44 @@ export namespace main { return a; } } + export class SubDyn { + Name: string; + Type: string; + Lines: string[]; + CBMod: Bool; + Nmodes: Integer; + + static createFrom(source: any = {}) { + return new SubDyn(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.Name = source["Name"]; + this.Type = source["Type"]; + this.Lines = source["Lines"]; + this.CBMod = this.convertValues(source["CBMod"], Bool); + this.Nmodes = this.convertValues(source["Nmodes"], Integer); + } + + convertValues(a: any, classs: any, asMap: boolean = false): any { + if (!a) { + return a; + } + if (a.slice && a.map) { + return (a as any[]).map(elem => this.convertValues(elem, classs)); + } else if ("object" === typeof a) { + if (asMap) { + for (const key of Object.keys(a)) { + a[key] = new classs(a[key]); + } + return a; + } + return new classs(a); + } + return a; + } + } export class Reals { Name: string; Type: string; @@ -1176,6 +1222,7 @@ export namespace main { Main: Main[]; ElastoDyn: ElastoDyn[]; BeamDyn: BeamDyn[]; + SubDyn: SubDyn[]; AeroDyn: AeroDyn[]; AeroDyn14: AeroDyn14[]; HydroDyn: HydroDyn[]; @@ -1195,6 +1242,7 @@ export namespace main { this.Main = this.convertValues(source["Main"], Main); this.ElastoDyn = this.convertValues(source["ElastoDyn"], ElastoDyn); this.BeamDyn = this.convertValues(source["BeamDyn"], BeamDyn); + this.SubDyn = this.convertValues(source["SubDyn"], SubDyn); this.AeroDyn = this.convertValues(source["AeroDyn"], AeroDyn); this.AeroDyn14 = this.convertValues(source["AeroDyn14"], AeroDyn14); this.HydroDyn = this.convertValues(source["HydroDyn"], HydroDyn); @@ -1417,6 +1465,7 @@ export namespace main { + }