提交窗口功能完成
This commit is contained in:
parent
704ebc12d8
commit
0698dce205
|
|
@ -8,10 +8,11 @@
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="0ae961c9-2aa8-4465-9e53-e04d62044e0d" name="更改" comment="">
|
<list default="true" id="0ae961c9-2aa8-4465-9e53-e04d62044e0d" name="更改" comment="">
|
||||||
|
<change afterPath="$PROJECT_DIR$/ToolsForm/Assets/img/UploadExperiment/提交.png" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.ToolsForm/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.ToolsForm/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.ToolsForm/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.ToolsForm/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ToolsForm/Models/IdeModel.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Models/IdeModel.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ToolsForm/Assets/img/检测中-悬浮.png" beforeDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ToolsForm/Views/IDEWindow2.axaml.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Views/IDEWindow2.axaml.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ToolsForm/Views/ExperimentWindow.axaml" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Views/ExperimentWindow.axaml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ToolsForm/Views/OverviewWindow.axaml" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Views/OverviewWindow.axaml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ToolsForm/Views/ExperimentWindow.axaml.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Views/ExperimentWindow.axaml.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ToolsForm/Views/UploadExperimentWindow.axaml" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Views/UploadExperimentWindow.axaml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ToolsForm/Views/UploadExperimentWindow.axaml" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Views/UploadExperimentWindow.axaml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ToolsForm/Views/UploadExperimentWindow.axaml.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Views/UploadExperimentWindow.axaml.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ToolsForm/Views/UploadExperimentWindow.axaml.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/Views/UploadExperimentWindow.axaml.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ToolsForm/bin/Debug/net8.0/ToolsForm.dll" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/bin/Debug/net8.0/ToolsForm.dll" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ToolsForm/bin/Debug/net8.0/ToolsForm.dll" beforeDir="false" afterPath="$PROJECT_DIR$/ToolsForm/bin/Debug/net8.0/ToolsForm.dll" afterDir="false" />
|
||||||
|
|
@ -143,7 +144,7 @@
|
||||||
<workItem from="1729819752329" duration="7261000" />
|
<workItem from="1729819752329" duration="7261000" />
|
||||||
<workItem from="1729835370931" duration="39273000" />
|
<workItem from="1729835370931" duration="39273000" />
|
||||||
<workItem from="1730253804607" duration="6537000" />
|
<workItem from="1730253804607" duration="6537000" />
|
||||||
<workItem from="1730270228361" duration="23639000" />
|
<workItem from="1730270228361" duration="29342000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|
@ -195,6 +196,32 @@
|
||||||
</properties>
|
</properties>
|
||||||
<option name="timeStamp" value="5" />
|
<option name="timeStamp" value="5" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
|
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
||||||
|
<url>file://$PROJECT_DIR$/ToolsForm/Views/ExperimentWindow.axaml.cs</url>
|
||||||
|
<line>178</line>
|
||||||
|
<properties documentPath="E:\Unity Projects\GitLab\2024\ICT_ToolsForm\ToolsForm\ToolsForm\Views\ExperimentWindow.axaml.cs" containingFunctionPresentation="方法 'UpdateButtonImages'">
|
||||||
|
<startOffsets>
|
||||||
|
<option value="6147" />
|
||||||
|
</startOffsets>
|
||||||
|
<endOffsets>
|
||||||
|
<option value="6186" />
|
||||||
|
</endOffsets>
|
||||||
|
</properties>
|
||||||
|
<option name="timeStamp" value="7" />
|
||||||
|
</line-breakpoint>
|
||||||
|
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
||||||
|
<url>file://$PROJECT_DIR$/ToolsForm/Views/ExperimentWindow.axaml.cs</url>
|
||||||
|
<line>220</line>
|
||||||
|
<properties documentPath="E:\Unity Projects\GitLab\2024\ICT_ToolsForm\ToolsForm\ToolsForm\Views\ExperimentWindow.axaml.cs" containingFunctionPresentation="方法 'FindImagesInVisualTree'">
|
||||||
|
<startOffsets>
|
||||||
|
<option value="7481" />
|
||||||
|
</startOffsets>
|
||||||
|
<endOffsets>
|
||||||
|
<option value="7530" />
|
||||||
|
</endOffsets>
|
||||||
|
</properties>
|
||||||
|
<option name="timeStamp" value="8" />
|
||||||
|
</line-breakpoint>
|
||||||
</breakpoints>
|
</breakpoints>
|
||||||
</breakpoint-manager>
|
</breakpoint-manager>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 303 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
|
@ -173,26 +173,45 @@
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <Button -->
|
||||||
|
<!-- Canvas.Left="1" -->
|
||||||
|
<!-- Canvas.Top="500" -->
|
||||||
|
<!-- Click="UploadButton_OnClick" -->
|
||||||
|
<!-- Name="ExperimentButton"> -->
|
||||||
|
<!-- <Button.Template> -->
|
||||||
|
<!-- <ControlTemplate> -->
|
||||||
|
<!-- <Grid x:Name="TemplateRoot"> -->
|
||||||
|
<!-- <Image Source="../Assets/img/提交实验-默认.png" x:Name="DefaultImage" /> -->
|
||||||
|
<!-- <Image -->
|
||||||
|
<!-- IsVisible="False" -->
|
||||||
|
<!-- Source="../Assets/img/提交实验-悬浮.png" -->
|
||||||
|
<!-- x:Name="HoverImage" /> -->
|
||||||
|
<!-- <Image -->
|
||||||
|
<!-- IsVisible="False" -->
|
||||||
|
<!-- Source="../Assets/img/提交实验-点击.png" -->
|
||||||
|
<!-- x:Name="ClickedImage" /> -->
|
||||||
|
<!-- </Grid> -->
|
||||||
|
<!-- </ControlTemplate> -->
|
||||||
|
<!-- </Button.Template> -->
|
||||||
|
<!-- </Button> -->
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
Canvas.Left="1"
|
Canvas.Left="1"
|
||||||
Canvas.Top="500"
|
Canvas.Top="500"
|
||||||
Click="UploadButton_OnClick"
|
Click="UploadButton_OnClick"
|
||||||
|
IsVisible="True"
|
||||||
x:Name="ExperimentButton">
|
x:Name="ExperimentButton">
|
||||||
<Button.Template>
|
<Image Source="../Assets/img/提交实验-默认.png" />
|
||||||
<ControlTemplate>
|
|
||||||
<Grid x:Name="TemplateRoot">
|
|
||||||
<Image Source="../Assets/img/提交实验-默认.png" x:Name="DefaultImage" />
|
|
||||||
<Image
|
|
||||||
IsVisible="False"
|
|
||||||
Source="../Assets/img/提交实验-悬浮.png"
|
|
||||||
x:Name="HoverImage" />
|
|
||||||
<Image
|
|
||||||
IsVisible="False"
|
|
||||||
Source="../Assets/img/提交实验-点击.png"
|
|
||||||
x:Name="ClickedImage" />
|
|
||||||
</Grid>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Button.Template>
|
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Canvas.Left="1"
|
||||||
|
Canvas.Top="500"
|
||||||
|
IsVisible="False"
|
||||||
|
x:Name="SubmittedButton">
|
||||||
|
<Image Source="../Assets/img/提交实验-点击.png" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
||||||
|
|
@ -64,14 +64,14 @@ public partial class ExperimentWindow : Window
|
||||||
|
|
||||||
private void OnPositionChanged(object? sender, PixelPointEventArgs pixelPointEventArgs)
|
private void OnPositionChanged(object? sender, PixelPointEventArgs pixelPointEventArgs)
|
||||||
{
|
{
|
||||||
AppWindowManager.UpdateWindowPosition(AppWindowManager.OverviewWindow, 0, 0,MainType.子窗口);
|
AppWindowManager.UpdateWindowPosition(AppWindowManager.OverviewWindow, 0, 0, MainType.子窗口);
|
||||||
AppWindowManager.UpdateWindowPosition(AppWindowManager.IdeWindow, 0, 0,MainType.子窗口);
|
AppWindowManager.UpdateWindowPosition(AppWindowManager.IdeWindow, 0, 0, MainType.子窗口);
|
||||||
AppWindowManager.UpdateWindowPosition(AppWindowManager.ResetSceneWindow, 0, 0,MainType.子窗口);
|
AppWindowManager.UpdateWindowPosition(AppWindowManager.ResetSceneWindow, 0, 0, MainType.子窗口);
|
||||||
AppWindowManager.UpdateWindowPosition(AppWindowManager.TemporaryStorageWindow, 0, 0,MainType.子窗口);
|
AppWindowManager.UpdateWindowPosition(AppWindowManager.TemporaryStorageWindow, 0, 0, MainType.子窗口);
|
||||||
AppWindowManager.UpdateWindowPosition(AppWindowManager.TemporaryStorageMessage, 0, 300,MainType.子窗口);
|
AppWindowManager.UpdateWindowPosition(AppWindowManager.TemporaryStorageMessage, 0, 300, MainType.子窗口);
|
||||||
AppWindowManager.UpdateWindowPosition(AppWindowManager.DownCodeWindow, 0, 0,MainType.子窗口);
|
AppWindowManager.UpdateWindowPosition(AppWindowManager.DownCodeWindow, 0, 0, MainType.子窗口);
|
||||||
AppWindowManager.UpdateWindowPosition(AppWindowManager.ReadCodeWindow, 0, 0,MainType.子窗口);
|
AppWindowManager.UpdateWindowPosition(AppWindowManager.ReadCodeWindow, 0, 0, MainType.子窗口);
|
||||||
AppWindowManager.UpdateWindowPosition(AppWindowManager.UploadExperimentWindow, 0, 0,MainType.子窗口);
|
AppWindowManager.UpdateWindowPosition(AppWindowManager.UploadExperimentWindow, 0, 0, MainType.子窗口);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开总览窗口
|
// 打开总览窗口
|
||||||
|
|
@ -79,7 +79,7 @@ public partial class ExperimentWindow : Window
|
||||||
{
|
{
|
||||||
ResetOtherButtons("Overview");
|
ResetOtherButtons("Overview");
|
||||||
|
|
||||||
AppWindowManager.ToggleWindow(ref AppWindowManager.OverviewWindow, () => new OverviewWindow(), true, true,MainType.子窗口);
|
AppWindowManager.ToggleWindow(ref AppWindowManager.OverviewWindow, () => new OverviewWindow(), true, true, MainType.子窗口);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开 IDE 窗口
|
// 打开 IDE 窗口
|
||||||
|
|
@ -87,7 +87,7 @@ public partial class ExperimentWindow : Window
|
||||||
{
|
{
|
||||||
ResetOtherButtons("AI");
|
ResetOtherButtons("AI");
|
||||||
|
|
||||||
AppWindowManager.ToggleWindow(ref AppWindowManager.IdeWindow, () => new IDEWindow(), true, true,MainType.子窗口);
|
AppWindowManager.ToggleWindow(ref AppWindowManager.IdeWindow, () => new IDEWindow(), true, true, MainType.子窗口);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开重置窗口
|
// 打开重置窗口
|
||||||
|
|
@ -117,7 +117,7 @@ public partial class ExperimentWindow : Window
|
||||||
{
|
{
|
||||||
ResetOtherButtons("TemporaryStorage");
|
ResetOtherButtons("TemporaryStorage");
|
||||||
|
|
||||||
AppWindowManager.ToggleWindow(ref AppWindowManager.TemporaryStorageWindow, () => new TemporaryStorageWindow(), true, true,MainType.子窗口);
|
AppWindowManager.ToggleWindow(ref AppWindowManager.TemporaryStorageWindow, () => new TemporaryStorageWindow(), true, true, MainType.子窗口);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@ public partial class ExperimentWindow : Window
|
||||||
{
|
{
|
||||||
ResetOtherButtons("Recording");
|
ResetOtherButtons("Recording");
|
||||||
|
|
||||||
AppWindowManager.ToggleWindow(ref AppWindowManager.RecordingWindow, () => new RecordingWindow(), false,true, MainType.子窗口);
|
AppWindowManager.ToggleWindow(ref AppWindowManager.RecordingWindow, () => new RecordingWindow(), false, true, MainType.子窗口);
|
||||||
var mainWindowPosition = Position;
|
var mainWindowPosition = Position;
|
||||||
AppWindowManager.RecordingWindow.Position = new PixelPoint(mainWindowPosition.X, mainWindowPosition.Y);
|
AppWindowManager.RecordingWindow.Position = new PixelPoint(mainWindowPosition.X, mainWindowPosition.Y);
|
||||||
AppWindowManager.MainWindow.Hide();
|
AppWindowManager.MainWindow.Hide();
|
||||||
|
|
@ -137,7 +137,7 @@ public partial class ExperimentWindow : Window
|
||||||
private void ReadCodeButton6_OnClick(object? sender, RoutedEventArgs e)
|
private void ReadCodeButton6_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ResetOtherButtons("ReadCode");
|
ResetOtherButtons("ReadCode");
|
||||||
AppWindowManager.ToggleWindow(ref AppWindowManager.ReadCodeWindow, () => new ReadCodeWindow(), true, true,MainType.子窗口);
|
AppWindowManager.ToggleWindow(ref AppWindowManager.ReadCodeWindow, () => new ReadCodeWindow(), true, true, MainType.子窗口);
|
||||||
}
|
}
|
||||||
|
|
||||||
//切换
|
//切换
|
||||||
|
|
@ -170,12 +170,7 @@ public partial class ExperimentWindow : Window
|
||||||
private void UploadButton_OnClick(object? sender, RoutedEventArgs e)
|
private void UploadButton_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// 当按钮被点击时,设置点击状态,并禁用悬浮状态
|
// 当按钮被点击时,设置点击状态,并禁用悬浮状态
|
||||||
_isClicked = true; // 设置点击状态
|
AppWindowManager.ToggleWindow(ref AppWindowManager.UploadExperimentWindow, () => new UploadExperimentWindow(), true, true, MainType.子窗口);
|
||||||
_isHovering = false; // 禁用悬浮状态
|
|
||||||
UpdateButtonImages((Button)sender, ButtonState.Clicked);
|
|
||||||
|
|
||||||
AppWindowManager.ToggleWindow(ref AppWindowManager.UploadExperimentWindow, () => new UploadExperimentWindow(), true, true,MainType.子窗口);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateButtonImages(Button button, ButtonState state)
|
private void UpdateButtonImages(Button button, ButtonState state)
|
||||||
|
|
@ -255,4 +250,14 @@ public partial class ExperimentWindow : Window
|
||||||
{
|
{
|
||||||
WebSocketManager.GetInstance().SendMessage(ToolsEventEnum.MiniModel, null);
|
WebSocketManager.GetInstance().SendMessage(ToolsEventEnum.MiniModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Submit()
|
||||||
|
{
|
||||||
|
var ExperimentButton = this.FindControl<Button>("ExperimentButton");
|
||||||
|
var SubmittedButton = this.FindControl<Button>("SubmittedButton");
|
||||||
|
|
||||||
|
ExperimentButton.IsVisible = false;
|
||||||
|
SubmittedButton.IsVisible = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +102,8 @@
|
||||||
FontFamily="{StaticResource SourceNormal}"
|
FontFamily="{StaticResource SourceNormal}"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Foreground="#B181FF"
|
Foreground="#B181FF"
|
||||||
Text="202410080926 02:31" />
|
Text="202410080926 02:31"
|
||||||
|
x:Name="VideoTextBlockName" />
|
||||||
|
|
||||||
<Image
|
<Image
|
||||||
Canvas.Left="40"
|
Canvas.Left="40"
|
||||||
|
|
@ -125,6 +126,7 @@
|
||||||
<Button
|
<Button
|
||||||
Canvas.Left="400"
|
Canvas.Left="400"
|
||||||
Canvas.Top="455"
|
Canvas.Top="455"
|
||||||
|
Click="CancelButton_OnClick"
|
||||||
FontFamily="{StaticResource SourceRegular}"
|
FontFamily="{StaticResource SourceRegular}"
|
||||||
FontSize="18"
|
FontSize="18"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
|
|
@ -133,6 +135,19 @@
|
||||||
VerticalAlignment="Top">
|
VerticalAlignment="Top">
|
||||||
<Image Source="../Assets/img/UploadExperiment/取消.png" />
|
<Image Source="../Assets/img/UploadExperiment/取消.png" />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
Canvas.Left="482"
|
||||||
|
Canvas.Top="455"
|
||||||
|
FontFamily="{StaticResource SourceRegular}"
|
||||||
|
FontSize="18"
|
||||||
|
FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
IsVisible="True"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
x:Name="CheckingButton">
|
||||||
|
<Image Source="../Assets/img/UploadExperiment/检测中.png" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
Canvas.Left="482"
|
Canvas.Left="482"
|
||||||
|
|
@ -142,9 +157,11 @@
|
||||||
FontSize="18"
|
FontSize="18"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
|
IsVisible="False"
|
||||||
Margin="0,0,0,0"
|
Margin="0,0,0,0"
|
||||||
VerticalAlignment="Top">
|
VerticalAlignment="Top"
|
||||||
<Image Source="../Assets/img/UploadExperiment/检测中.png" />
|
x:Name="SubmitButton">
|
||||||
|
<Image Source="../Assets/img/UploadExperiment/提交.png" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
|
|
@ -194,14 +211,25 @@
|
||||||
Canvas.Top="148"
|
Canvas.Top="148"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
Source="../Assets/img/UploadExperiment/完成.png"
|
Source="../Assets/img/UploadExperiment/完成.png"
|
||||||
x:Name="CheckMarkImage1" />
|
x:Name="VideoCheckTure" />
|
||||||
|
<Image
|
||||||
|
Canvas.Left="520"
|
||||||
|
Canvas.Top="148"
|
||||||
|
IsVisible="False"
|
||||||
|
Source="../Assets/img/UploadExperiment/失败.png"
|
||||||
|
x:Name="VideoCheckFalse" />
|
||||||
<Image
|
<Image
|
||||||
Canvas.Left="520"
|
Canvas.Left="520"
|
||||||
Canvas.Top="194"
|
Canvas.Top="194"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
Source="../Assets/img/UploadExperiment/完成.png"
|
Source="../Assets/img/UploadExperiment/完成.png"
|
||||||
x:Name="CheckMarkImage2" />
|
x:Name="FileCheckTure" />
|
||||||
|
<Image
|
||||||
|
Canvas.Left="520"
|
||||||
|
Canvas.Top="194"
|
||||||
|
IsVisible="False"
|
||||||
|
Source="../Assets/img/UploadExperiment/失败.png"
|
||||||
|
x:Name="FileCheckFalse" />
|
||||||
|
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Controls.Documents;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Layout;
|
using Avalonia.Layout;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
@ -59,11 +61,14 @@ public partial class UploadExperimentWindow : Window
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void LoadDirectoryContents(string path, StackPanel container)
|
public bool LoadDirectoryContents(string path, StackPanel container)
|
||||||
{
|
{
|
||||||
// 检查文件夹是否存在
|
// 检查文件夹是否存在
|
||||||
if (!Directory.Exists(path))
|
if (!Directory.Exists(path))
|
||||||
throw new DirectoryNotFoundException("指定的文件夹未找到");
|
{
|
||||||
|
Console.WriteLine("指定的文件夹未找到");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 清空容器
|
// 清空容器
|
||||||
container.Children.Clear();
|
container.Children.Clear();
|
||||||
|
|
@ -73,6 +78,8 @@ public partial class UploadExperimentWindow : Window
|
||||||
|
|
||||||
// 加载目录和文件
|
// 加载目录和文件
|
||||||
LoadContentsRecursively(dirInfo, container, 0);
|
LoadContentsRecursively(dirInfo, container, 0);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadContentsRecursively(DirectoryInfo dirInfo, StackPanel container, int level)
|
private void LoadContentsRecursively(DirectoryInfo dirInfo, StackPanel container, int level)
|
||||||
|
|
@ -103,7 +110,7 @@ public partial class UploadExperimentWindow : Window
|
||||||
|
|
||||||
var dirIcon = new Image
|
var dirIcon = new Image
|
||||||
{
|
{
|
||||||
Source = new Bitmap(AssetLoader.Open(new Uri("avares://ToolsForm/Assets/img/UploadExperiment/文件夹.png"))),
|
Source = new Bitmap(AssetLoader.Open(new Uri("avares://ToolsForm/Assets/img/UploadExperiment/文件夹.png"))),
|
||||||
Width = 16,
|
Width = 16,
|
||||||
Height = 16,
|
Height = 16,
|
||||||
Margin = new Thickness(0, 0, 5, 0)
|
Margin = new Thickness(0, 0, 5, 0)
|
||||||
|
|
@ -153,16 +160,16 @@ public partial class UploadExperimentWindow : Window
|
||||||
switch (file.Extension.ToLower())
|
switch (file.Extension.ToLower())
|
||||||
{
|
{
|
||||||
case ".py":
|
case ".py":
|
||||||
iconPath = "avares://ToolsForm/Assets/img/UploadExperiment/python.png";
|
iconPath = "avares://ToolsForm/Assets/img/UploadExperiment/python.png";
|
||||||
break;
|
break;
|
||||||
case ".java":
|
case ".java":
|
||||||
iconPath = "avares://ToolsForm/Assets/img/UploadExperiment/java.png";
|
iconPath = "avares://ToolsForm/Assets/img/UploadExperiment/java.png";
|
||||||
break;
|
break;
|
||||||
case ".c":
|
case ".c":
|
||||||
iconPath = "avares://ToolsForm/Assets/img/UploadExperiment/c.png";
|
iconPath = "avares://ToolsForm/Assets/img/UploadExperiment/c.png";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
iconPath = "avares://ToolsForm/Assets/img/UploadExperiment/其他文件.png";
|
iconPath = "avares://ToolsForm/Assets/img/UploadExperiment/其他文件.png";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,22 +212,107 @@ public partial class UploadExperimentWindow : Window
|
||||||
// 模拟加载完成的方法
|
// 模拟加载完成的方法
|
||||||
private async void CompleteLoading()
|
private async void CompleteLoading()
|
||||||
{
|
{
|
||||||
await Task.Delay(2000);
|
await Task.Delay(1000);
|
||||||
// 停止旋转
|
// 停止旋转
|
||||||
_rotationTimer1.Stop();
|
_rotationTimer1.Stop();
|
||||||
await Task.Delay(2000);
|
LoadingImage1.IsVisible = false;
|
||||||
|
|
||||||
|
|
||||||
|
bool isVideo = LoadLatestMp4File(this.FindControl<TextBlock>("VideoTextBlockName"));
|
||||||
|
|
||||||
|
if (isVideo)
|
||||||
|
{
|
||||||
|
VideoCheckTure.IsVisible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VideoCheckFalse.IsVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
await Task.Delay(1000);
|
||||||
_rotationTimer2.Stop();
|
_rotationTimer2.Stop();
|
||||||
LoadDirectoryContents("E:\\Eclipse Workspace\\Upa_Java", StackPanelWord);
|
LoadingImage2.IsVisible = false;
|
||||||
|
|
||||||
|
bool isFile = LoadDirectoryContents("E:\\Eclipse Workspace\\Upa_Java", StackPanelWord);
|
||||||
//LoadDirectoryContents(AppDataManager.IdeModel.FolderPath, StackPanelWord);
|
//LoadDirectoryContents(AppDataManager.IdeModel.FolderPath, StackPanelWord);
|
||||||
|
|
||||||
LoadingImage1.IsVisible = false;
|
if (isFile)
|
||||||
LoadingImage2.IsVisible = false;
|
{
|
||||||
CheckMarkImage1.IsVisible = true;
|
FileCheckTure.IsVisible = true;
|
||||||
CheckMarkImage2.IsVisible = true;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FileCheckFalse.IsVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Buttons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void GetVideo()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Buttons()
|
||||||
|
{
|
||||||
|
// 获取按钮引用
|
||||||
|
var submitButton = this.FindControl<Button>("SubmitButton"); // 假设这是提交按钮
|
||||||
|
var checkingButton = this.FindControl<Button>("CheckingButton"); // 假设这是检测中按钮
|
||||||
|
|
||||||
|
// 控制按钮的可见性
|
||||||
|
if (submitButton != null && checkingButton != null)
|
||||||
|
{
|
||||||
|
submitButton.IsVisible = true; // 隐藏提交按钮
|
||||||
|
checkingButton.IsVisible = false; // 显示检测中按钮
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OnSubmitButtonClick(object sender, RoutedEventArgs e)
|
private void OnSubmitButtonClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// 调用加载完成的方法
|
AppWindowManager.ExperimentWindow.Submit();
|
||||||
|
AppWindowManager.CloseWindow(ref AppWindowManager.UploadExperimentWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool LoadLatestMp4File(TextBlock textBlock)
|
||||||
|
{
|
||||||
|
// 获取当前 EXE 文件的路径
|
||||||
|
var exeDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
|
var capturesDirectory = Path.Combine(exeDirectory, "Captures");
|
||||||
|
|
||||||
|
// 检查 Captures 文件夹是否存在
|
||||||
|
if (!Directory.Exists(capturesDirectory))
|
||||||
|
{
|
||||||
|
textBlock.Text = "";
|
||||||
|
Console.WriteLine("Captures 文件夹未找到");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取最新创建的 MP4 文件
|
||||||
|
var latestFile = new DirectoryInfo(capturesDirectory)
|
||||||
|
.GetFiles("*.mp4")
|
||||||
|
.OrderByDescending(f => f.CreationTime)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
// 如果找到文件,则更新 TextBlock 的文本
|
||||||
|
if (latestFile != null)
|
||||||
|
{
|
||||||
|
var creationTime = latestFile.CreationTime.ToString("yyyyMMddHHmm");
|
||||||
|
var fileName = Path.GetFileNameWithoutExtension(latestFile.Name); // 获取文件名(不带扩展名)
|
||||||
|
textBlock.Text = $"{creationTime} {fileName}"; // 设置 TextBlock 的文本
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textBlock.Text = "没有找到 MP4 文件"; // 如果没有找到文件
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CancelButton_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AppWindowManager.CloseWindow(ref AppWindowManager.UploadExperimentWindow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
e76f595a14d7ab41574f9eac585b1a80a32339df1611162aada8377a10d2bcdd
|
4f8bc25ec09d514703db0be08bb36ccf0ef7bede5211af7fae4def96df36fcac
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -13,7 +13,7 @@ using System.Reflection;
|
||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("ToolsForm")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("ToolsForm")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e3d4f719bf17b0d5405927cb05d18368d2f72acb")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+704ebc12d8f15de82f0f089ec9fc95d70a4a97ed")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("ToolsForm")]
|
[assembly: System.Reflection.AssemblyProductAttribute("ToolsForm")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("ToolsForm")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("ToolsForm")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
a834706ef20a0cc167aa5e69c7811af9b6b9b9b9c52dff7029ce0449d696aa14
|
6b847eeaec54d2b71165b694438a55a79155fb71730be52ae068654d1fdd135b
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue