添加了部分界面

This commit is contained in:
CortexCore 2023-07-08 00:02:32 +08:00
parent f4e85d4f9b
commit a2da9039f8
23 changed files with 768 additions and 48 deletions

View File

@ -1,7 +0,0 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bs26uhhpwxcoy"]
[ext_resource type="Script" path="res://Artists/Scripts/Resource/StringResource.cs" id="1_yt3o3"]
[resource]
script = ExtResource("1_yt3o3")
value = ""

View File

@ -0,0 +1,7 @@
[gd_resource type="Resource" script_class="StringResource" load_steps=2 format=3 uid="uid://cok584x4q8wn0"]
[ext_resource type="Script" path="res://BITKit/Scripts/Resource/StringResource.cs" id="1_4lqjc"]
[resource]
script = ExtResource("1_4lqjc")
value = "It's worked!"

View File

@ -33,6 +33,16 @@ layout_mode = 2
theme_type_variation = &"Flat"
text = "按钮"
[node name="ItemList" type="ItemList" parent="HBoxContainer/VBoxContainer"]
layout_mode = 2
auto_height = true
item_count = 5
item_0/text = "item 1"
item_1/text = "item 2"
item_2/text = "item 3"
item_3/text = "item 4"
item_4/text = "item 5"
[node name="VBoxContainer2" type="VBoxContainer" parent="HBoxContainer"]
custom_minimum_size = Vector2(512, 0)
layout_mode = 2
@ -64,3 +74,31 @@ bbcode_enabled = true
text = "[b]ErrorBox[/b]
a error happened"
fit_content = true
[node name="VBoxContainer3" type="VBoxContainer" parent="HBoxContainer"]
layout_mode = 2
[node name="TabBar" type="TabBar" parent="HBoxContainer/VBoxContainer3"]
layout_mode = 2
tab_count = 3
tab_0/title = "Tab1"
tab_1/title = "Tab2"
tab_2/title = "Tab3"
[node name="TabContainer" type="TabContainer" parent="HBoxContainer/VBoxContainer3"]
custom_minimum_size = Vector2(512, 256)
layout_mode = 2
[node name="Window 1" type="Label" parent="HBoxContainer/VBoxContainer3/TabContainer"]
layout_mode = 2
text = "Window 1"
[node name="Window 2" type="Label" parent="HBoxContainer/VBoxContainer3/TabContainer"]
visible = false
layout_mode = 2
text = "Window 2"
[node name="Window 3" type="Label" parent="HBoxContainer/VBoxContainer3/TabContainer"]
visible = false
layout_mode = 2
text = "Window 3"

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ public partial class BITAppForGodot : Node
{
public static readonly ValidHandle AllowCursor = new();
public static float DeltaTime { get; private set; }
/// <summary>
/// 在构造函数中注册Logger
/// </summary>

View File

@ -27,4 +27,12 @@ public static partial class MathNode
}
return nodes.Distinct();
}
public static void RemoveAllChild(Node self)
{
foreach (var x in self.GetChildren())
{
x.QueueFree();
}
}
}

View File

@ -1,2 +0,0 @@
extends Godot.Resource
var Value;

View File

@ -2,6 +2,7 @@ using Godot;
namespace BITKit;
[GlobalClass]
public partial class StringResource : Resource
{
[Export]

View File

@ -0,0 +1,8 @@
using Godot;
using System;
using BITKit;
public partial class StringResourceTester : Node
{
[Export] private StringResource resource;
}

View File

@ -1,5 +1,6 @@
using System.Diagnostics;
using Godot;
using Godot.Collections;
namespace BITKit;
@ -22,10 +23,14 @@ public partial class UXContainer:Control,IUXContainer
[Export] public Label updateTimeLabel;
[Export] public Label createTimeLabel;
[Export] public Label headerLabel;
[Export] public Array<Label> labels;
[ExportCategory("Button")]
[Export] public Button mainButton;
[Export] public Button secButton;
[Export] public Button thirdButton;
[ExportCategory("Text Edit")]
[Export] public LineEdit lineEdit;
[Export] public Array<LineEdit> lineEdits;
public string Text
{

View File

@ -0,0 +1,35 @@
using Godot;
using System;
using Godot.Collections;
namespace BITKit;
[Tool]
public partial class UXWindowService : Control
{
[Export] private Array<Button> tabs;
[Export] private Array<Control> windows;
public override void _Ready()
{
if (Engine.IsEditorHint()) return;
if(tabs.Count != windows.Count) throw new Exception("tabs.Count != windows.Count");
ButtonGroup buttonGroup = new();
for (var i = 0; i < tabs.Count; i++)
{
var tab = tabs[i];
var window = windows[i];
tab.Pressed += () =>
{
ShowWindow(window);
};
}
}
private void ShowWindow(CanvasItem window)
{
foreach (var x in windows)
{
//if(window.Visible is true && window != x)
x.Hide();
}
window.Show();
}
}

View File

@ -0,0 +1,3 @@
[gd_resource type="ButtonGroup" format=3 uid="uid://cwiiipy56pktn"]
[resource]

View File

@ -0,0 +1,67 @@
using Godot;
using System;
using BITKit;
namespace BITFactory;
public partial class IDIS_RegisterService : Node
{
[Export] private IDIS_Service service;
[Export] private IDIS_TemplateService templateService;
[Export] private ItemList templateList;
[Export] private LineEdit handleEdit;
[Export] private Button generateHandleButton;
[Export] private Control container;
[Export] private Button registerButton;
[Export] private Label hints;
public override void _Ready()
{
templateList.Clear();
foreach (var x in templateService.templates)
{
templateList.AddItem(x.TemplateName);
}
var lineEdit = new LineEdit();
lineEdit.PlaceholderText = "请输入标识名称";
templateList.ItemClicked += OnItemClicked;
registerButton.Pressed += Register;
generateHandleButton.Pressed += () =>
{
handleEdit.Text = $"88.123.99/{Mathf.Abs(Guid.NewGuid().GetHashCode())}";
};
}
private void OnItemClicked(long index, Vector2 atPosition, long mouseButtonIndex)
{
MathNode.RemoveAllChild(container);
var template = templateService.templates[(int) index];
var grid = new GridContainer();
grid.Columns = 2;
grid.AddThemeConstantOverride("h_separation", 64);
container.AddChild(grid);
foreach (var x in template.Formats)
{
var label = new Label();
var lineEdit = new LineEdit();
label.Text = x.format;
lineEdit.PlaceholderText = x.hint;
lineEdit.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
grid.AddChild(label);
grid.AddChild(lineEdit);
}
}
private void Register()
{
}
}

View File

@ -163,6 +163,37 @@ public class IDIS_DBContext:DbContext
return queries.Any();
}
public bool Register(string handle)
{
var handleExists = Values.Any(x => x.Handle == handle);
if (handleExists)
{
return false;
}
var value = new IDIS_Value()
{
Handle = handle
};
Values.Add(value);
SaveChanges();
return true;
}
public void Register(string handle,string format, string value)
{
var handleExists = Values.Any(x => x.Handle == handle);
if (!handleExists)
{
Register(handle);
}
var data = new IDIS_Data()
{
Handle = handle,
Format = format,
Value = value
};
Datas.Add(data);
SaveChanges();
}
}
// ReSharper disable once IdentifierTypo
/// <summary>
@ -177,4 +208,7 @@ public partial class IDIS_Service:Node
BIT4Log.Log<IDIS_Service>("已创建标识数据库");
Context.Database.EnsureCreated();
}
public bool Register(string handle) => Context.Register(handle);
public void Register(string handle, string format, string value) => Context.Register(handle, format, value);
}

View File

@ -0,0 +1,158 @@
using Godot;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using BITKit;
using BITKit.IO;
using RosSharp.RosBridgeClient.MessageTypes.Moveit;
namespace BITFactory;
[Serializable]
public class IDIS_Template
{
public string TemplateName="标识注册模板";
public string TemplateDescription="该模板通常用于xxx用途";
public string IconPath="Register";
public List<(string format,string hint)> Formats=new();
}
public partial class IDIS_TemplateService : Node
{
private static string assetPath => PathHelper.GetPath("标识注册模板.zip");
private const string templateName = $"{nameof(IDIS_Template)}.json";
public readonly List<IDIS_Template> templates=new();
private readonly Queue<IDIS_Template> selectedQueue = new();
[ExportCategory("Quick Start")]
[Export] private Button createButton;
[Export] private Button newFormatButton;
[Export] private ItemList itemList;
[Export] private LineEdit templateNameEdit;
[Export] private LineEdit templateDescriptionEdit;
[Export] private Control container;
[ExportCategory("Template")]
[Export] private PackedScene templateContainer;
private bool isDirty;
private IDIS_Template _selectedTemplate=>_selectedIndex==-1?null:templates[_selectedIndex];
private int _selectedIndex=-1;
public override void _Ready()
{
if (File.Exists(assetPath) is false)
{
BIT4Log.Log<IDIS_TemplateService>($"未找到配置文件:{assetPath}");
}
var temp = BITAssets.Read<List<IDIS_Template>>(assetPath, templateName);
templates.AddRange(temp);
BIT4Log.Log<IDIS_TemplateService>($"已加载配置文件:{assetPath}");
createButton.Pressed += CreateTemplate;
newFormatButton.Pressed += CreateFormat;
itemList.ItemSelected += OnItemSelected;
itemList.ItemClicked += OnItemClicked;
templateNameEdit.TextChanged += OnTemplateNameChanged;
templateDescriptionEdit.TextChanged += OnTemplateDescriptionChanged;
MathNode.RemoveAllChild(container);
EnsureConfigure();
}
private void CreateFormat()
{
if (_selectedTemplate is null) return;
_selectedTemplate.Formats ??= new();
_selectedTemplate.Formats.Add(("新的数据格式","格式类型"));
EnsureConfigure();
}
public override void _ExitTree()
{
BITAssets.Build(assetPath,new IAsset[]
{
new BITAsset(templateName,JsonHelper.Get(templates))
});
BIT4Log.Log<IDIS_TemplateService>($"已创建配置文件:{assetPath}");
}
private void CreateTemplate()
{
templates.Add(new IDIS_Template()
{
TemplateName = "新的标识注册模板"
});
EnsureConfigure();
}
private void OnTemplateNameChanged(string text)
{
if (_selectedTemplate is null) return;
_selectedTemplate.TemplateName = text;
}
private void OnTemplateDescriptionChanged(string text)
{
if (_selectedTemplate is null) return;
_selectedTemplate.TemplateDescription = text;
}
private void EnsureConfigure()
{
itemList.Clear();
MathNode.RemoveAllChild(container);
foreach (var x in templates)
{
itemList.AddItem(x.TemplateName);
}
if (_selectedTemplate is null) return;
{
templateNameEdit.Text=_selectedTemplate.TemplateName;
templateDescriptionEdit.Text=_selectedTemplate.TemplateDescription;
for (var i = 0; i < _selectedTemplate.Formats.Count; i++)
{
var x = _selectedTemplate.Formats[i];
var _container = templateContainer.Instantiate<UXContainer>();
_container.lineEdits[0].Text = x.format;
_container.lineEdits[1].Text = x.hint;
var index = i;
_container.lineEdits[0].TextChanged += (s) =>
{
var current = _selectedTemplate.Formats[index];
current.format = s;
_selectedTemplate.Formats[index] = current;
};
_container.lineEdits[1].TextChanged += s =>
{
var current = _selectedTemplate.Formats[index];
current.hint = s;
_selectedTemplate.Formats[index] = current;
};
_container.button.Pressed += () =>
{
_selectedTemplate.Formats.RemoveAt(index);
EnsureConfigure();
};
container.AddChild(_container);
}
}
}
private void OnItemSelected(long id)
{
}
private void OnItemClicked(long index, Vector2 atPosition, long mouseButtonIndex)
{
// var currentItem = _templates[(int)index];
// templateNameEdit.Text = currentItem.TemplateName;
_selectedIndex = (int)index;
EnsureConfigure();
}
}

View File

@ -0,0 +1,41 @@
[gd_scene load_steps=2 format=3 uid="uid://b2chp3rw7ib00"]
[ext_resource type="Script" path="res://BITKit/Scripts/UX/UXContainer.cs" id="1_dre1u"]
[node name="标识模板格式" type="VBoxContainer" node_paths=PackedStringArray("button", "labels", "lineEdits")]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_dre1u")
button = NodePath("HBoxContainer/delete-button")
labels = []
lineEdits = [NodePath("HBoxContainer/name-edit"), NodePath("HBoxContainer/hint-edit")]
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="name-label" type="Label" parent="HBoxContainer"]
visible = false
layout_mode = 2
text = "数据名称:"
[node name="name-edit" type="LineEdit" parent="HBoxContainer"]
custom_minimum_size = Vector2(128, 0)
layout_mode = 2
size_flags_horizontal = 3
[node name="hint-label" type="Label" parent="HBoxContainer"]
visible = false
layout_mode = 2
text = "提示:"
[node name="hint-edit" type="LineEdit" parent="HBoxContainer"]
custom_minimum_size = Vector2(128, 0)
layout_mode = 2
size_flags_horizontal = 3
[node name="delete-button" type="Button" parent="HBoxContainer"]
layout_mode = 2
text = "删除"

View File

@ -1,8 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://cngf2h2a5ne4a"]
[gd_scene load_steps=10 format=3 uid="uid://cngf2h2a5ne4a"]
[ext_resource type="Script" path="res://BITKit/Scripts/UX/UXPanel.cs" id="1_c78kh"]
[ext_resource type="PackedScene" uid="uid://d1po2qljd0jh2" path="res://Mods/教育平台/教程header.tscn" id="2_mn1rn"]
[ext_resource type="PackedScene" uid="uid://b2chp3rw7ib00" path="res://Mods/工业数据采集与分析应用分享/Templates/标识模板格式.tscn" id="3_gmthc"]
[ext_resource type="Script" path="res://BITKit/Scripts/UX/UXWindowService.cs" id="3_sfip0"]
[ext_resource type="ButtonGroup" uid="uid://cwiiipy56pktn" path="res://Mods/工业数据采集与分析应用分享/Resource/工业互联网标识解析与注册导航.tres" id="3_wv1s6"]
[ext_resource type="Script" path="res://Mods/工业数据采集与分析应用分享/Scripts/IDIS_Service.cs" id="3_xbtmk"]
[ext_resource type="Script" path="res://Mods/工业数据采集与分析应用分享/Scripts/IDIS_TemplateService.cs" id="4_oj8cs"]
[ext_resource type="Script" path="res://Mods/工业数据采集与分析应用分享/Scripts/IDIS_RegisterService.cs" id="8_6uwr0"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_clkje"]
[node name="标识注册与解析" type="VBoxContainer"]
anchors_preset = 15
@ -17,62 +24,317 @@ allowInput = true
[node name="教程Header" parent="." instance=ExtResource("2_mn1rn")]
layout_mode = 2
[node name="Main Layout" type="MarginContainer" parent="."]
[node name="UX Window Service" type="MarginContainer" parent="." node_paths=PackedStringArray("tabs", "windows")]
layout_mode = 2
size_flags_vertical = 3
theme_type_variation = &"Margin_16px"
script = ExtResource("3_sfip0")
tabs = [NodePath("Horizontal Layout/导航栏/Button"), NodePath("Horizontal Layout/导航栏/Button3"), NodePath("Horizontal Layout/导航栏/Button2"), NodePath("Horizontal Layout/导航栏/Button4"), NodePath("Horizontal Layout/导航栏/Button5"), NodePath("Horizontal Layout/导航栏/Button6")]
windows = [NodePath("Horizontal Layout/内容/标识模板"), NodePath("Horizontal Layout/内容/标注注册"), NodePath("Horizontal Layout/内容/Container2"), NodePath("Horizontal Layout/内容/Container3"), NodePath("Horizontal Layout/内容/Container4"), NodePath("Horizontal Layout/内容/Container5")]
[node name="Horizontal Layout" type="HBoxContainer" parent="Main Layout"]
[node name="Horizontal Layout" type="HBoxContainer" parent="UX Window Service"]
layout_mode = 2
theme_override_constants/separation = 16
[node name="导航栏" type="VBoxContainer" parent="Main Layout/Horizontal Layout"]
[node name="导航栏" type="VBoxContainer" parent="UX Window Service/Horizontal Layout"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
[node name="Label" type="Label" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Label" type="Label" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
theme_type_variation = &"HeaderMedium"
text = "注册"
text = "管理"
[node name="Button" type="Button" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Button" type="Button" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
text = "注册标识模板"
toggle_mode = true
button_group = ExtResource("3_wv1s6")
text = "管理标识模板"
[node name="Label3" type="Label" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Label3" type="Label" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
theme_type_variation = &"HeaderMedium"
text = "准备生产"
[node name="Button3" type="Button" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Button3" type="Button" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
toggle_mode = true
button_group = ExtResource("3_wv1s6")
text = "注册设备"
[node name="Label4" type="Label" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Label4" type="Label" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
theme_type_variation = &"HeaderMedium"
text = "开始生产"
[node name="Button2" type="Button" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Button2" type="Button" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
toggle_mode = true
button_group = ExtResource("3_wv1s6")
text = "注册订单"
[node name="Button4" type="Button" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Button4" type="Button" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
toggle_mode = true
button_group = ExtResource("3_wv1s6")
text = "内容1"
[node name="Button5" type="Button" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Button5" type="Button" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
toggle_mode = true
button_group = ExtResource("3_wv1s6")
text = "内容1"
[node name="Button6" type="Button" parent="Main Layout/Horizontal Layout/导航栏"]
[node name="Button6" type="Button" parent="UX Window Service/Horizontal Layout/导航栏"]
layout_mode = 2
toggle_mode = true
button_group = ExtResource("3_wv1s6")
text = "内容1"
[node name="内容" type="TabContainer" parent="Main Layout/Horizontal Layout"]
[node name="内容" type="PanelContainer" parent="UX Window Service/Horizontal Layout"]
layout_mode = 2
size_flags_horizontal = 3
tabs_visible = false
theme_override_styles/panel = SubResource("StyleBoxEmpty_clkje")
[node name="标识模板" type="MarginContainer" parent="UX Window Service/Horizontal Layout/内容"]
layout_mode = 2
theme_type_variation = &"Margin_16px"
[node name="VBoxContainer" type="VBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标识模板"]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Label" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
theme_type_variation = &"HeaderLarge"
text = "标识注册模板"
[node name="ItemList" type="ItemList" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
auto_height = true
item_count = 3
item_0/text = "1"
item_1/text = "2"
item_2/text = "3"
[node name="HSeparator" type="HSeparator" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
[node name="Button" type="Button" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
text = "创建新的注册模板"
[node name="VSeparator" type="VSeparator" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 64
[node name="VBoxContainer2" type="VBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2"]
layout_mode = 2
size_flags_vertical = 3
[node name="Label2" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
theme_type_variation = &"HeaderLarge"
text = "模板信息"
[node name="name-edit" type="LineEdit" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
placeholder_text = "标识模板名称"
caret_blink = true
caret_blink_interval = 0.5
[node name="Label3" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
theme_type_variation = &"HeaderLarge"
text = "模板属性"
[node name="description-edit" type="LineEdit" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
placeholder_text = "该模板用于xxx"
caret_blink = true
caret_blink_interval = 0.5
[node name="GridContainer" type="GridContainer" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
columns = 2
[node name="Label5" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/GridContainer"]
layout_mode = 2
text = "创建时间:"
[node name="Label6" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/GridContainer"]
layout_mode = 2
text = "2023年7月7日23:42:40"
[node name="Label7" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/GridContainer"]
layout_mode = 2
text = "更新时间:"
[node name="Label8" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/GridContainer"]
layout_mode = 2
text = "2023年7月7日23:42:40"
[node name="HSeparator" type="HSeparator" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
visible = false
layout_mode = 2
theme_type_variation = &"HSeparator_8px"
[node name="Label" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
theme_type_variation = &"HeaderLarge"
text = "模板格式"
[node name="Label4" type="Label" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
text = "数据名称/提示"
[node name="Format-Container" type="VBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
[node name="标识模板格式" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Format-Container" instance=ExtResource("3_gmthc")]
layout_mode = 2
[node name="标识模板格式2" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Format-Container" node_paths=PackedStringArray("lineEdits") instance=ExtResource("3_gmthc")]
layout_mode = 2
lineEdits = [NodePath("../标识模板格式/HBoxContainer/name-edit"), NodePath("../标识模板格式/HBoxContainer/hint-edit")]
[node name="标识模板格式3" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Format-Container" node_paths=PackedStringArray("lineEdits") instance=ExtResource("3_gmthc")]
layout_mode = 2
lineEdits = [NodePath("../标识模板格式/HBoxContainer/name-edit"), NodePath("../标识模板格式/HBoxContainer/hint-edit")]
[node name="标识模板格式4" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Format-Container" node_paths=PackedStringArray("lineEdits") instance=ExtResource("3_gmthc")]
layout_mode = 2
lineEdits = [NodePath("../标识模板格式/HBoxContainer/name-edit"), NodePath("../标识模板格式/HBoxContainer/hint-edit")]
[node name="标识模板格式5" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Format-Container" node_paths=PackedStringArray("lineEdits") instance=ExtResource("3_gmthc")]
layout_mode = 2
lineEdits = [NodePath("../标识模板格式/HBoxContainer/name-edit"), NodePath("../标识模板格式/HBoxContainer/hint-edit")]
[node name="标识模板格式6" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Format-Container" node_paths=PackedStringArray("lineEdits") instance=ExtResource("3_gmthc")]
layout_mode = 2
lineEdits = [NodePath("../标识模板格式/HBoxContainer/name-edit"), NodePath("../标识模板格式/HBoxContainer/hint-edit")]
[node name="标识模板格式7" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Format-Container" node_paths=PackedStringArray("lineEdits") instance=ExtResource("3_gmthc")]
layout_mode = 2
lineEdits = [NodePath("../标识模板格式/HBoxContainer/name-edit"), NodePath("../标识模板格式/HBoxContainer/hint-edit")]
[node name="Button" type="Button" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer"]
layout_mode = 2
text = "添加新的格式"
[node name="HSeparator" type="HSeparator" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2"]
layout_mode = 2
[node name="Button" type="Button" parent="UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2"]
layout_mode = 2
text = "保存注册模板"
[node name="标注注册" type="MarginContainer" parent="UX Window Service/Horizontal Layout/内容"]
visible = false
layout_mode = 2
theme_type_variation = &"Margin_16px"
[node name="HBoxContainer" type="HBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标注注册"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Label" type="Label" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer"]
layout_mode = 2
theme_type_variation = &"HeaderLarge"
text = "选择标识模板"
[node name="ItemList" type="ItemList" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
auto_height = true
item_count = 4
item_0/text = "1"
item_1/text = "2"
item_2/text = "3"
item_3/text = "4"
[node name="VBoxContainer2" type="VBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Label" type="Label" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2"]
layout_mode = 2
theme_type_variation = &"HeaderLarge"
text = "在这里填写注册表单"
[node name="HBoxContainer" type="HBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2"]
layout_mode = 2
[node name="handle-edit" type="LineEdit" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "需要注册的标识码"
caret_blink = true
caret_blink_interval = 0.5
[node name="generate-button" type="Button" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2/HBoxContainer"]
layout_mode = 2
text = "生成标识"
[node name="register-container" type="VBoxContainer" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="register-button" type="Button" parent="UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2"]
layout_mode = 2
text = "注册标识"
[node name="Container2" type="Container" parent="UX Window Service/Horizontal Layout/内容"]
visible = false
layout_mode = 2
[node name="Container3" type="Container" parent="UX Window Service/Horizontal Layout/内容"]
visible = false
layout_mode = 2
[node name="Container4" type="Container" parent="UX Window Service/Horizontal Layout/内容"]
visible = false
layout_mode = 2
[node name="Container5" type="Container" parent="UX Window Service/Horizontal Layout/内容"]
visible = false
layout_mode = 2
[node name="标识解析服务" type="Node" parent="."]
script = ExtResource("3_xbtmk")
[node name="标识模板服务" type="Node" parent="." node_paths=PackedStringArray("createButton", "newFormatButton", "itemList", "templateNameEdit", "templateDescriptionEdit", "container")]
script = ExtResource("4_oj8cs")
createButton = NodePath("../UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer/Button")
newFormatButton = NodePath("../UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Button")
itemList = NodePath("../UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer/ItemList")
templateNameEdit = NodePath("../UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/name-edit")
templateDescriptionEdit = NodePath("../UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/description-edit")
container = NodePath("../UX Window Service/Horizontal Layout/内容/标识模板/VBoxContainer/HBoxContainer/VBoxContainer2/VBoxContainer/Format-Container")
templateContainer = ExtResource("3_gmthc")
[node name="标识注册服务" type="Node" parent="." node_paths=PackedStringArray("service", "templateService", "templateList", "handleEdit", "generateHandleButton", "container", "registerButton")]
script = ExtResource("8_6uwr0")
service = NodePath("../标识解析服务")
templateService = NodePath("../标识模板服务")
templateList = NodePath("../UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer/ItemList")
handleEdit = NodePath("../UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2/HBoxContainer/handle-edit")
generateHandleButton = NodePath("../UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2/HBoxContainer/generate-button")
container = NodePath("../UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2/register-container")
registerButton = NodePath("../UX Window Service/Horizontal Layout/内容/标注注册/HBoxContainer/VBoxContainer2/register-button")

View File

@ -6,7 +6,7 @@
[ext_resource type="Theme" uid="uid://dokwscirps6nt" path="res://Artists/Themes/Factory_Theme.tres" id="4_l51y6"]
[node name="NinePatchRect" type="NinePatchRect" node_paths=PackedStringArray("courseLabel", "entryButton")]
self_modulate = Color(0, 0, 0, 0.784314)
self_modulate = Color(0, 0, 0, 0.501961)
custom_minimum_size = Vector2(1024, 200)
texture = ExtResource("1_3jo82")
patch_margin_left = 16

View File

@ -17,7 +17,7 @@ corner_radius_bottom_left = 8
[node name="教育平台主菜单" type="Node"]
[node name="TextureRect" type="TextureRect" parent="."]
modulate = Color(0.188235, 0.188235, 0.188235, 0.788235)
modulate = Color(0.278431, 0.278431, 0.278431, 0.666667)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@ -25,7 +25,7 @@ grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("1_uwo3j")
expand_mode = 1
stretch_mode = 4
stretch_mode = 6
[node name="UXPanel" type="VBoxContainer" parent="."]
anchors_preset = 15

46
Temp/CollectionTest.cs Normal file
View File

@ -0,0 +1,46 @@
using Godot;
using System;
using System.ComponentModel;
using Godot.Collections;
namespace BITKit;
[Tool]
public partial class CollectionTest : Node
{
[Export] private Array<Node> nodes;
[Export] private Dictionary<string, Node> Dictionary;
[Export] private ProgressBar progressBar;
[Export(PropertyHint.Range, "0,1")]
private float progress
{
get => _progress;
set
{
if (Engine.IsEditorHint())
{
RequestReady();
}
if (progressBar is null) return;
_progress = value;
var newProgress = Mathf.Lerp(progressBar.MinValue, progressBar.MaxValue, value);
progressBar.Value = newProgress;
}
}
private float _progress;
[Export] private Label label;
[Export]
public string Text
{
get => label?.Text;
set
{
if (label is not null)
label.Text = value;
}
}
}

View File

@ -1,4 +1,4 @@
<Project Sdk="Godot.NET.Sdk/4.0.3">
<Project Sdk="Godot.NET.Sdk/4.1.0">
<PropertyGroup>
<EnableDynamicLoading>true</EnableDynamicLoading>
<TargetFramework>net6.0</TargetFramework>

25
iFactory.csproj.old Normal file
View File

@ -0,0 +1,25 @@
<Project Sdk="Godot.NET.Sdk/4.0.3">
<PropertyGroup>
<EnableDynamicLoading>true</EnableDynamicLoading>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AGV_System\Vol.Net6\RosBridgeClient\RosBridgeClient.csproj" />
<ProjectReference Include="..\BITKit\BITKit.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.19" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.19" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="6.0.19" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0-preview.4.23259.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0-preview.4.23259.5" />
<PackageReference Include="UniTask" Version="2.3.3" />
</ItemGroup>
<ItemGroup>
<Content Include="README.md" />
<Content Include="ReadMe\工业互联网标识解析与注册\标识解析.md" />
<Content Include="ReadMe\工业互联网标识解析与注册\_Deprecated\Clip_20230629_005537.png" />
<Content Include="ReadMe\工业互联网标识解析与注册\_Deprecated\Clip_20230629_005537.png.import" />
<Content Include="ReadMe\工业互联网标识解析与注册\_Deprecated\标识解析.md" />
</ItemGroup>
</Project>

View File

@ -13,7 +13,7 @@ config_version=5
config/name="iFactory"
config/description="智慧工厂的映射与交互"
run/main_scene="res://Mods/教育平台/教育平台主菜单.tscn"
config/features=PackedStringArray("4.0", "C#", "Forward Plus")
config/features=PackedStringArray("4.1", "C#", "Forward Plus")
boot_splash/bg_color=Color(0.00392157, 0, 0.00392157, 1)
config/icon="res://icon.svg"
@ -21,7 +21,6 @@ config/icon="res://icon.svg"
EntitiesManager="*res://Artists/Services/entities_manager.tscn"
BITApp="*res://Artists/Services/BITApp.tscn"
DebugMenu="*res://addons/debug_menu/debug_menu.tscn"
UXMetaService="*res://Artists/Services/UXMetaService.tscn"
UXService="*res://Artists/Services/UXService.tscn"
@ -29,7 +28,7 @@ UXService="*res://Artists/Services/UXService.tscn"
window/size/viewport_width=1920
window/size/viewport_height=1080
window/stretch/mode="viewport"
window/stretch/mode="canvas_items"
window/vsync/vsync_mode=2
mouse_cursor/vsync/vsync_mode=3
mouse_cursor/stretch/aspect="keep"
@ -39,10 +38,6 @@ mouse_cursor/stretch/aspect="keep"
project/assembly_name="iFactory"
export/ssil/half_size=true
[editor_plugins]
enabled=PackedStringArray("res://addons/ui_design_tool/plugin.cfg", "res://addons/debug_menu/plugin.cfg")
[filesystem]
import/fbx/enabled=false
@ -59,10 +54,6 @@ cycle_debug_menu={
]
}
[physics]
3d/run_on_separate_thread=true
[rendering]
driver/threads/thread_model=2