Skip to content

Commit 8c9b598

Browse files
committed
data: merge 'Data_*.gd' into 'Types.gd'
1 parent 08eb6d4 commit 8c9b598

File tree

8 files changed

+93
-87
lines changed

8 files changed

+93
-87
lines changed

data/Data.gd

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
extends Node
22

33

4-
const Project = preload('res://data/Data_Project.gd')
4+
const Types = preload('res://data/Types.gd')
5+
const Project = Types.Project
6+
const Source = Types.Source
57

68
const icons = {
79
'check': preload('res://data/btn/check.svg'),
@@ -72,9 +74,9 @@ func _init():
7274
'architectures': {}
7375
}
7476
projects.append(Project.new('Example project', [
75-
Project.Source.new('/t/neorv32', Project.source_types.GLOB),
76-
Project.Source.new('/t/vunit/vunit', Project.source_types.GLOB),
77-
Project.Source.new('/t/vunit/osvb/AXI4Stream', Project.source_types.PYCAPI)
77+
Source.new('/t/neorv32', Types.source_types.GLOB),
78+
Source.new('/t/vunit/vunit', Types.source_types.GLOB),
79+
Source.new('/t/vunit/osvb/AXI4Stream', Types.source_types.PYCAPI)
7880
]));
7981

8082

data/Data_Architecture.gd

Lines changed: 0 additions & 5 deletions
This file was deleted.

data/Data_Entity.gd

Lines changed: 0 additions & 7 deletions
This file was deleted.

data/Data_Project.gd

Lines changed: 0 additions & 32 deletions
This file was deleted.

data/Data_Repository.gd

Lines changed: 0 additions & 4 deletions
This file was deleted.

data/Types.gd

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#
2+
# Project
3+
#
4+
5+
class Project extends Object:
6+
7+
var Name : String;
8+
var Sources : Array;
9+
10+
func _init(
11+
name : String,
12+
sources : Array
13+
):
14+
Name = name
15+
Sources = sources
16+
17+
#
18+
# Source
19+
#
20+
21+
enum source_types {
22+
GLOB
23+
PYCAPI
24+
FUSESOC
25+
}
26+
27+
const source_types_str = 'glob,pyCAPI,FuseSoC';
28+
29+
class Source extends Object:
30+
var Location : String;
31+
var Type : int;
32+
#var entities
33+
#var architectures
34+
35+
func _init(
36+
path : String,
37+
type : int
38+
):
39+
Location = path;
40+
Type = type;
41+
42+
#
43+
# Design
44+
#
45+
46+
class Design extends Object:
47+
var Name : String
48+
49+
#
50+
# Target
51+
#
52+
53+
class Target extends Object:
54+
var Board : String
55+
56+
#
57+
# Entity
58+
#
59+
60+
class Entity extends Object:
61+
62+
#var name
63+
var Context
64+
var Generics
65+
var Ports
66+
var Types
67+
68+
#
69+
# Architecture
70+
#
71+
72+
class Architecture extends Object:
73+
74+
#var name
75+
var Entity
76+
var Type

hud/HUD_Repositories.gd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func _Projects_init_Project(
8282
item = prj_tree.create_item(root);
8383
item.set_text(0, 'New source location');
8484
item.set_editable(0, true);
85-
_add_Range_Cell(Data.Project.source_types_str, item, 1);
85+
_add_Range_Cell(Data.Types.source_types_str, item, 1);
8686
_add_Buttons([
8787
{
8888
'text': 'Check',
@@ -99,12 +99,12 @@ func _Projects_init_Project(
9999

100100
func _Projects_init_Source(
101101
root : TreeItem,
102-
src : Data.Project.Source
102+
src : Data.Source
103103
) -> void:
104104
root.set_metadata(0, {"Location": src});
105105
root.set_text(0, src.Location);
106106
root.add_button(0, Data.icons.pencil, project_buttons.EDIT, false, 'Edit');
107-
_add_Range_Cell(Data.Project.source_types_str, root, 1, src.Type);
107+
_add_Range_Cell(Data.Types.source_types_str, root, 1, src.Type);
108108
_add_Buttons([
109109
{
110110
'text': 'Check',
@@ -285,7 +285,7 @@ func _get_last(item):
285285

286286

287287
func _Projects_set_Project(
288-
prj : Project,
288+
prj : Data.Types.Project,
289289
item : TreeItem
290290
) -> void:
291291
var name = item.get_text(0);
@@ -294,7 +294,7 @@ func _Projects_set_Project(
294294

295295

296296
func _Projects_set_Source(
297-
_prj : Project,
297+
_prj : Data.Types.Project,
298298
item : TreeItem
299299
) -> void:
300300
var path = item.get_text(0);
@@ -322,15 +322,15 @@ func _Projects_add_Project(
322322

323323

324324
func _Projects_add_Source(
325-
prj : Project,
325+
prj : Data.Types.Project,
326326
item : TreeItem
327327
) -> void:
328328
var path = item.get_text(0);
329329
var type = item.get_range(1);
330330
item.set_text(0, 'New source location');
331-
item.set_range(1, Data.Project.source_types.GLOB);
331+
item.set_range(1, Data.Types.source_types.GLOB);
332332

333-
var src = Data.Project.Source.new(path, type);
333+
var src = Data.Source.new(path, type);
334334
prj.Sources.append(src);
335335

336336
var parent = item.get_parent();
@@ -340,15 +340,15 @@ func _Projects_add_Source(
340340

341341

342342
func _Projects_remove_Project(
343-
prj : Project,
343+
prj : Data.Types.Project,
344344
item : TreeItem
345345
) -> void:
346346
prj.free();
347347
item.free();
348348

349349

350350
func _Projects_remove_Source(
351-
prj : Project,
351+
prj : Data.Types.Project,
352352
item : TreeItem
353353
) -> void:
354354
prj.Sources.erase(item.get_metadata(0)["Location"]);

project.godot

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@
99
config_version=4
1010

1111
_global_script_classes=[ {
12-
"base": "Reference",
13-
"class": "Architecture",
14-
"language": "GDScript",
15-
"path": "res://data/Data_Architecture.gd"
16-
}, {
17-
"base": "Reference",
18-
"class": "Entity",
19-
"language": "GDScript",
20-
"path": "res://data/Data_Entity.gd"
21-
}, {
2212
"base": "GNode",
2313
"class": "GBlock",
2414
"language": "GDScript",
@@ -38,26 +28,12 @@ _global_script_classes=[ {
3828
"class": "GSlice",
3929
"language": "GDScript",
4030
"path": "res://mode/graph/GSlice.gd"
41-
}, {
42-
"base": "Object",
43-
"class": "Project",
44-
"language": "GDScript",
45-
"path": "res://data/Data_Project.gd"
46-
}, {
47-
"base": "Reference",
48-
"class": "Repository",
49-
"language": "GDScript",
50-
"path": "res://data/Data_Repository.gd"
5131
} ]
5232
_global_script_class_icons={
53-
"Architecture": "",
54-
"Entity": "",
5533
"GBlock": "",
5634
"GLabel": "",
5735
"GNode": "",
58-
"GSlice": "",
59-
"Project": "",
60-
"Repository": ""
36+
"GSlice": ""
6137
}
6238

6339
[application]

0 commit comments

Comments
 (0)