/
sa_node.go
executable file
·915 lines (757 loc) · 17.2 KB
/
sa_node.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
/*
Copyright 2023 Milan Suk
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this db except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"os"
"sort"
"strings"
"github.com/go-audio/audio"
)
const (
SANode_STATE_WAITING = 0
SANode_STATE_RUNNING = 1
SANode_STATE_DONE = 2
)
type SANode struct {
app *SAApp
parent *SANode
Pos OsV2f
pos_start OsV2f
Name string
Exe string
Selected bool `json:",omitempty"`
Code SANodeCode
selected_cover bool
selected_canvas OsV4
Attrs map[string]interface{} `json:",omitempty"` //only for Skyalt
//sub-layout
Cols []*SANodeColRow `json:",omitempty"`
Rows []*SANodeColRow `json:",omitempty"`
Subs []*SANode `json:",omitempty"`
listSubs []*SANode
errExe error
z_depth float64
temp_mic_data audio.IntBuffer
db_time DiskDbTime
}
func NewSANode(app *SAApp, parent *SANode, name string, exe string, grid OsV4, pos OsV2f) *SANode {
node := &SANode{}
node.parent = parent
node.app = app
node.Name = name
node.Exe = exe
node.Pos = pos
node.Attrs = make(map[string]interface{})
if node.CanBeRenderOnCanvas() {
node.SetGrid(grid)
}
node.Code = InitSANodeCode(node)
return node
}
func NewSANodeRoot(path string, app *SAApp) (*SANode, *SANode, error) {
node := NewSANode(app, nil, "root", "layout", OsV4{}, OsV2f{})
node.Exe = "layout"
//load
if path != "" {
js, err := os.ReadFile(path)
if err == nil {
err = json.Unmarshal([]byte(js), node)
if err != nil {
fmt.Printf("Unmarshal(%s) failed: %v\n", path, err)
}
}
node.updateLinks(nil, app)
node.updateCodeLinks()
}
exe := node.FindNode("exe")
if exe == nil {
exe = node.AddNode(OsV4{}, OsV2f{}, "exe", "exe")
}
return node, exe, nil
}
func (node *SANode) SetError(err error) {
node.errExe = err
}
func (node *SANode) SetChange(exe_prms []SANodeCodeExePrm) {
list, pos := node.FindSubListInfo()
if list != nil {
for i := range exe_prms {
exe_prms[i].ListNode = list.Name
exe_prms[i].ListPos = pos
exe_prms[i].Node = node.Name
}
node = list //set exe_prms into List
}
node = node.GetSubRootNode()
for _, nd := range node.app.exe.Subs {
if nd.IsTypeCode() && !nd.IsBypassed() && nd != node {
if nd.Code.findFuncDepend(node) != nil {
nd.Code.AddExe(exe_prms)
}
}
}
}
func (node *SANode) SetStructChange() {
node.SetChange(nil) //exe depending
for node != nil {
node.Code.AddExe(nil) //exe this and parents
node = node.parent
}
}
func (node *SANode) FindCopyPos(find *SANode) int {
for i, nd := range node.listSubs {
if nd == find {
return i
}
}
return -1
}
func (node *SANode) ResetDbs() {
node.db_time = DiskDbTime{}
for _, nd := range node.Subs {
nd.ResetDbs()
}
}
func (node *SANode) SetPosStart() {
node.pos_start = node.Pos
for _, nd := range node.Subs {
nd.SetPosStart()
}
}
func (node *SANode) AddPos(r OsV2f) {
node.Pos = node.pos_start.Add(r)
if node.HasNodeSubs() {
for _, nd := range node.Subs {
nd.AddPos(r)
}
}
}
func (node *SANode) IsAttrDBValue() bool {
_, found := node.Attrs["db_value"]
if found {
return node.GetAttrBool("db_value", false)
}
return false
}
func (node *SANode) IsTypeWhispercpp() bool {
return node.Exe == "whispercpp"
}
func (node *SANode) IsTypeLLamacpp() bool {
return node.Exe == "llamacpp"
}
func (node *SANode) IsTypeOpenAI() bool {
return node.Exe == "openai"
}
func (node *SANode) IsTypeNet() bool {
return node.Exe == "net"
}
func (node *SANode) IsTypeButton() bool {
return strings.EqualFold(node.Exe, "button")
}
func (node *SANode) IsTypeDbFile() bool {
return strings.EqualFold(node.Exe, "db_file")
}
func (node *SANode) IsTypeList() bool {
return strings.EqualFold(node.Exe, "list")
}
func (node *SANode) IsTypeLayout() bool {
return strings.EqualFold(node.Exe, "layout")
}
func (node *SANode) IsTypeMenu() bool {
return strings.EqualFold(node.Exe, "menu")
}
func (node *SANode) IsTypeChart() bool {
return strings.EqualFold(node.Exe, "chart")
}
func (node *SANode) IsTypeCode() bool {
return strings.EqualFold(node.Exe, "code")
}
func (node *SANode) IsTypeExe() bool {
return strings.EqualFold(node.Exe, "exe")
}
func (node *SANode) IsTypeWithSubLayoutNodes() bool {
return node.IsTypeList() || node.IsTypeLayout() || node.IsTypeMenu()
}
func (node *SANode) HasNodeSubs() bool {
return node.IsTypeWithSubLayoutNodes() || node.IsTypeExe()
}
func (node *SANode) HasAttrNode() bool {
return node.Exe == "whispercpp" || node.Exe == "llamacpp" || node.Exe == "openai" || node.Exe == "net"
}
func (node *SANode) IsBypassed() bool {
return node.IsTypeCode() && node.GetAttrBool("bypass", false)
}
func (node *SANode) SetBypass() {
if node.IsTypeCode() {
node.Attrs["bypass"] = !node.GetAttrBool("bypass", false)
}
}
func (node *SANode) MakeGridSpace(colStart, rowStart, colMove, rowMove int) {
for _, it := range node.Subs {
grid := it.GetGrid()
changed := false
if grid.Start.X >= colStart {
grid.Start.X += colMove
if colMove != 0 {
changed = true
}
}
if grid.Start.Y >= rowStart {
grid.Start.Y += rowMove
if rowMove != 0 {
changed = true
}
}
if changed {
it.SetGrid(grid)
}
}
}
func (node *SANode) RemoveGridSpace(colPos, rowPos int) {
//move items afer pos
for _, it := range node.Subs {
grid := it.GetGrid()
end := grid.End()
changed := false
if colPos >= 0 {
if grid.Size.X > 1 && grid.Start.X < colPos && end.X > colPos {
grid.Size.X--
changed = true
}
if grid.Start.X >= colPos {
grid.Start.X--
changed = true
}
}
if rowPos >= 0 {
if grid.Size.Y > 1 && grid.Start.Y < rowPos && end.Y > colPos {
grid.Size.Y--
changed = true
}
if grid.Start.Y >= rowPos {
grid.Start.Y--
changed = true
}
}
if changed {
it.SetGrid(grid)
}
}
}
func (node *SANode) Save(path string) error {
if path == "" {
return nil
}
js, err := json.MarshalIndent(node, "", "")
if err != nil {
return fmt.Errorf("MarshalIndent() failed: %w", err)
}
err = os.WriteFile(path, js, 0644)
if err != nil {
return fmt.Errorf("WriteFile() failed: %w", err)
}
return nil
}
func (a *SANode) CmpAttrs(attrs map[string]interface{}) bool {
if len(a.Attrs) != len(attrs) {
return false
}
for key, itA := range a.Attrs {
if strings.HasPrefix(key, "grid_") {
continue
}
//if !reflect.DeepEqual(itA, itB) {
if fmt.Sprintf("%v", itA) != fmt.Sprintf("%v", attrs[key]) {
return false
}
}
return true
}
func (a *SANode) CmpListSub(b *SANode) bool {
if a.Name != b.Name || a.Exe != b.Exe {
return false
}
if !a.CmpAttrs(b.Attrs) {
return false
}
/*if len(a.Attrs) != len(b.Attrs) {
return false
}
for key, itA := range a.Attrs {
if strings.HasPrefix(key, "grid_") {
continue
}
//if !reflect.DeepEqual(itA, itB) {
if fmt.Sprintf("%v", itA) != fmt.Sprintf("%v", b.Attrs[key]) {
return false
}
}*/
if len(a.Subs) != len(b.Subs) {
return false
}
for i, itA := range a.Subs {
if !itA.CmpListSub(b.Subs[i]) {
return false
}
}
return true
}
/*func (a *SANode) Cmp(b *SANode) bool {
if a.Name != b.Name || a.Exe != b.Exe {
return false
}
if a.Selected != b.Selected {
*historyDiff = true //no return!
}
if !a.Pos.Cmp(b.Pos) {
*historyDiff = true //no return!
}
if len(a.Attrs) != len(b.Attrs) {
return false
}
for i, itA := range a.Attrs {
itB := b.Attrs[i]
if !reflect.DeepEqual(itA, itB) {
//if !itA.Cmp(itB) {
return false
}
}
if len(a.Cols) == len(b.Cols) {
for i, itA := range a.Cols {
if !itA.Cmp(b.Cols[i]) {
*historyDiff = true //no return!
}
}
} else {
*historyDiff = true //no return!
}
if len(a.Rows) == len(b.Rows) {
for i, itA := range a.Rows {
if !itA.Cmp(b.Rows[i]) {
*historyDiff = true //no return!
}
}
} else {
*historyDiff = true //no return!
}
if len(a.Subs) != len(b.Subs) {
return false
}
for i, itA := range a.Subs {
if !itA.Cmp(b.Subs[i]) {
return false
}
}
return true
}*/
func (node *SANode) HasError() bool {
if node.errExe != nil {
return true
}
if node.IsTypeCode() {
if node.Code.file_err != nil || node.Code.exe_err != nil {
return true
}
}
return false
}
func (node *SANode) CanBeRenderOnCanvas() bool {
if node.GetGridShow() {
gr := node.app.base.node_groups.FindNode(node.Exe)
return gr != nil && gr.render != nil
}
return false
}
func (node *SANode) FindNodeOrig(name string) *SANode {
for _, it := range node.Subs {
if it.Name == name {
return it
}
}
//parent only, never deeper
if node.parent != nil {
return node.parent.FindNodeOrig(name)
}
return nil
}
func (node *SANode) FindNode(name string) *SANode {
if node.Name == name {
return node
}
//subs
for _, it := range node.Subs {
nd := it.FindNode(name)
if nd != nil {
return nd
}
}
return nil
}
func (node *SANode) FindParent(parent *SANode) bool {
for node != nil {
if node == parent {
return true
}
node = node.parent
}
return false
}
func (node *SANode) updateLinks(parent *SANode, app *SAApp) {
node.parent = parent
node.app = app
if node.Attrs == nil {
node.Attrs = make(map[string]interface{})
}
for _, it := range node.Subs {
it.updateLinks(node, app)
}
}
func (node *SANode) updateCodeLinks() {
node.Code.UpdateLinks(node)
for _, it := range node.Subs {
it.updateCodeLinks()
}
}
func (node *SANode) Copy(updateCode bool) (*SANode, error) {
js, err := json.Marshal(node)
if err != nil {
return nil, err
}
dst := NewSANode(node.app, nil, "", "", OsV4{}, OsV2f{})
err = json.Unmarshal(js, dst)
if err != nil {
return nil, err
}
dst.updateLinks(nil, node.app)
if updateCode {
dst.updateCodeLinks()
}
return dst, nil
}
func (dst *SANode) CopyPoses(src *SANode) {
dst.Pos = src.Pos
dst.Cols = src.Cols
dst.Rows = src.Rows
dst.Selected = src.Selected
for _, dstIt := range dst.Subs {
srcIt := src.FindNode(dstIt.Name)
if srcIt != nil {
dstIt.CopyPoses(srcIt)
}
}
}
func (node *SANode) SelectOnlyThis() {
node.GetRoot().DeselectAll()
node.Selected = true
}
func (node *SANode) SelectAll() {
node.Selected = true
for _, n := range node.Subs {
n.SelectAll()
}
}
func (node *SANode) NumSelected() int {
sum := OsTrn(node.Selected, 1, 0)
for _, nd := range node.Subs {
sum += nd.NumSelected()
}
return sum
}
func (node *SANode) DeselectAll() {
for _, n := range node.Subs {
n.Selected = false
n.DeselectAll()
}
}
func (node *SANode) isParentSelected() bool {
node = node.parent
for node != nil {
if node.Selected {
return true
}
node = node.parent
}
return false
}
func (node *SANode) _buildListOfSelected(list *[]*SANode) {
for _, n := range node.Subs {
if n.Selected && !n.isParentSelected() {
*list = append(*list, n)
}
n._buildListOfSelected(list)
}
}
func (node *SANode) BuildListOfSelected() []*SANode {
var list []*SANode
node._buildListOfSelected(&list)
return list
}
func (node *SANode) FindListSubNodePos(lay *SANode) int {
for i, nd := range node.listSubs {
if nd == lay {
return i
}
}
return -1
}
func (node *SANode) FindSubListInfo() (*SANode, int) {
if node == nil {
return nil, -1
}
if node.IsTypeList() {
return node, -1
}
list, pos := node.parent.FindSubListInfo()
if list != nil && pos < 0 {
pos = list.FindListSubNodePos(node)
}
return list, pos
}
func (node *SANode) FindSubMenu() *SANode {
if node == nil {
return nil
}
if node.IsTypeMenu() {
return node
}
return node.parent.FindSubMenu()
}
func (node *SANode) FindSubLayout() *SANode {
if node == nil {
return nil
}
if node.IsTypeLayout() {
return node
}
return node.parent.FindSubLayout()
}
func (node *SANode) FindSubList() *SANode {
if node == nil {
return nil
}
if node.IsTypeList() {
return node
}
return node.parent.FindSubList()
}
func (node *SANode) FindSelected() *SANode {
for _, it := range node.Subs {
if it.Selected {
return it
}
}
for _, nd := range node.Subs {
//if nd.IsGuiLayout() {
fd := nd.FindSelected()
if fd != nil {
return fd
}
//}
}
return nil
}
func (node *SANode) RemoveSelectedNodes() {
for _, n := range node.Subs {
n.RemoveSelectedNodes()
}
for i := len(node.Subs) - 1; i >= 0; i-- {
if node.Subs[i].Selected {
node.Subs = append(node.Subs[:i], node.Subs[i+1:]...) //remove
} else {
node.Subs[i].RemoveSelectedNodes() //go deeper
}
}
}
func (node *SANode) BypassSelectedCodeNodes() {
if node.IsTypeCode() && node.Selected {
node.SetBypass()
}
for _, n := range node.Subs {
n.BypassSelectedCodeNodes()
}
}
func (node *SANode) NumAttrNames(name string) int {
n := 0
for nm := range node.Attrs {
if nm == name {
n++
}
}
return n
}
func (node *SANode) NumSubNames(name string) int {
n := 0
for _, nd := range node.Subs {
if nd.Name == name {
n++
}
n += nd.NumSubNames(name)
}
return n
}
func (node *SANode) GetRoot() *SANode {
for node.parent != nil {
node = node.parent
}
return node
}
func (node *SANode) GetSubRootNode() *SANode {
for node.parent != nil && node.parent.parent != nil {
node = node.parent
}
return node
}
func (node *SANode) CheckUniqueName() {
if node.Name == "" {
node.Name = "node"
}
//clean name
node.Name = strings.ToLower(node.Name)
node.Name = strings.ReplaceAll(node.Name, ".", "_")
//set unique
for node.GetRoot().NumSubNames(node.Name) >= 2 {
node.Name += "1"
}
//check subs as well
for _, nd := range node.Subs {
nd.CheckUniqueName()
}
}
func (node *SANode) AddNode(grid OsV4, pos OsV2f, name string, exe string) *SANode {
nw := NewSANode(node.app, node, name, exe, grid, pos)
node.Subs = append(node.Subs, nw)
nw.CheckUniqueName()
return nw
}
func (node *SANode) AddNodeCopy(src *SANode) *SANode { // note: 'w' can be root graph
nw, _ := src.Copy(true) //err ...
nw.updateLinks(node, node.app)
nw.updateCodeLinks()
//move Pos
nw.Pos = nw.Pos.Add(OsV2f{1, 1})
for _, nd := range nw.Subs {
nd.Pos = nd.Pos.Add(OsV2f{1, 1})
}
node.Subs = append(node.Subs, nw)
nw.CheckUniqueName()
return nw
}
func (node *SANode) Remove() bool {
if node.parent != nil {
for i, it := range node.parent.Subs {
if it == node {
node.parent.Subs = append(node.parent.Subs[:i], node.parent.Subs[i+1:]...)
return true
}
}
}
return false
}
func (node *SANode) RenderCanvas() {
ui := node.app.base.ui
node.z_depth = 1
if node.CanBeRenderOnCanvas() {
gnd := node.app.base.node_groups.FindNode(node.Exe)
if gnd != nil && gnd.render != nil {
gnd.render(node)
}
}
if node.app.IDE && node.CanBeRenderOnCanvas() {
grid := node.GetGrid()
grid.Size.Y = OsMax(grid.Size.Y, 1)
//draw Select rectangle
if node.HasError() { //|| w.HasExpError() {
pl := ui.win.io.GetPalette()
//rect
div := ui.Div_startName(grid.Start.X, grid.Start.Y, grid.Size.X, grid.Size.Y, ".err.")
div.touch_enabled = false
ui.Paint_rect(0, 0, 1, 1, 0.06, pl.E, 0.06)
ui.Div_end()
}
if node.Selected {
cd := SAApp_getYellow()
//rect
div := ui.Div_startName(grid.Start.X, grid.Start.Y, grid.Size.X, grid.Size.Y, ".sel.")
div.touch_enabled = false
ui.Paint_rect(0, 0, 1, 1, 0, cd, 0.06)
ui.Div_end()
//resizer
s := ui.CellWidth(0.3)
en := InitOsV4Mid(div.canvas.End(), OsV2{s, s})
if en.Inside(ui.win.io.touch.pos) && ui.win.io.keys.alt {
pl := ui.win.io.GetPalette()
cd = pl.P
}
ui.buff.AddRect(en, cd, 0)
node.selected_canvas = div.canvas //copy coord size
}
}
}
func (node *SANode) GetResizerCoord() OsV4 {
s := node.app.base.ui.CellWidth(0.3)
return InitOsV4Mid(node.selected_canvas.End(), OsV2{s, s})
}
func (node *SANode) renderLayoutCols() {
SANodeColRow_Check(&node.Cols)
ui := node.app.base.ui
for _, it := range node.Cols {
ui.Div_col(it.Pos, it.Min)
ui.Div_colMax(it.Pos, it.Max)
if it.ResizeName != "" {
active, v := ui.Div_colResize(it.Pos, it.ResizeName, it.Resize, true)
if active {
it.Resize = v
}
}
}
}
func (node *SANode) renderLayoutRows() {
SANodeColRow_Check(&node.Rows)
ui := node.app.base.ui
for _, it := range node.Rows {
ui.Div_row(it.Pos, it.Min)
ui.Div_rowMax(it.Pos, it.Max)
if it.ResizeName != "" {
active, v := ui.Div_rowResize(it.Pos, it.ResizeName, it.Resize, true)
if active {
it.Resize = v
}
}
}
}
func (node *SANode) renderLayout() {
//cols/rows
node.renderLayoutCols()
node.renderLayoutRows()
//sort z-depth
sort.Slice(node.Subs, func(i, j int) bool {
return node.Subs[i].z_depth < node.Subs[j].z_depth
})
//other items
for _, it := range node.Subs {
it.RenderCanvas()
}
}
func (node *SANode) RenameCodeDepends(oldName SANodePath, newName SANodePath, replaceStructName bool) {
node.Code.RenameNode(oldName, newName, replaceStructName)
}
func (node *SANode) RenameCodeSubDepends(oldName SANodePath, newName SANodePath, replaceStructName bool) {
for _, it := range node.Subs {
it.RenameCodeDepends(oldName, newName, replaceStructName)
}
for _, it := range node.Subs {
it.RenameCodeSubDepends(oldName, newName, replaceStructName)
}
}