Compare commits

..

No commits in common. "74d40d25e2e38038ca66afeab53726a43db19d44" and "9eb3acb94cf3da6943ea8149822d406a58bfeafc" have entirely different histories.

6 changed files with 36 additions and 68 deletions

View File

@ -41,7 +41,7 @@ namespace Common
0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
}; };
/// <summary> /// <summary>
/// 整数转成二进制字节数组 /// 整数转成二进制字节数组
/// </summary> /// </summary>
@ -167,26 +167,6 @@ namespace Common
} }
/// <summary>
/// [TODO:description]
/// </summary>
/// <param name="uintArray">[TODO:parameter]</param>
/// <returns>[TODO:return]</returns>
public static Result<byte[]> UInt32ArrayToBytes(UInt32[] uintArray)
{
byte[] byteArray = new byte[uintArray.Length * 4];
try
{
Buffer.BlockCopy(uintArray, 0, byteArray, 0, uintArray.Length * 4);
return byteArray;
}
catch (Exception error)
{
return new(error);
}
}
/// <summary> /// <summary>
/// 比特合并成二进制字节 /// 比特合并成二进制字节

View File

@ -1,4 +1,3 @@
using System.Collections;
using System.Net; using System.Net;
using DotNext; using DotNext;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -369,6 +368,21 @@ public class JtagStatusReg
} }
} }
/// <summary>
/// [TODO:description]
/// </summary>
public class JtagBoundaryRegister
{
/// <summary>
/// [TODO:description]
/// </summary>
public int PortNum { get; set; }
/// <summary>
/// [TODO:description]
/// </summary>
public UInt32[] PortStatus { get; set; } = new UInt32[] { };
}
/// <summary> /// <summary>
/// Jtag控制器 /// Jtag控制器
/// </summary> /// </summary>
@ -931,7 +945,7 @@ public class Jtag
/// </summary> /// </summary>
/// <param name="portNum">[TODO:parameter]</param> /// <param name="portNum">[TODO:parameter]</param>
/// <returns>[TODO:return]</returns> /// <returns>[TODO:return]</returns>
public async ValueTask<Result<BitArray>> BoundaryScan(int portNum) public async ValueTask<Result<JtagBoundaryRegister>> BoundaryScan(int portNum)
{ {
if (portNum <= 0) if (portNum <= 0)
return new(new ArgumentException("The number of port couldn't be negative", nameof(portNum))); return new(new ArgumentException("The number of port couldn't be negative", nameof(portNum)));
@ -965,8 +979,6 @@ public class Jtag
if (!ret.IsSuccessful) return new(ret.Error); if (!ret.IsSuccessful) return new(ret.Error);
else if (!ret.Value) return new(new Exception("Jtag Close Test Failed")); else if (!ret.Value) return new(new Exception("Jtag Close Test Failed"));
var byteArray = Common.Number.UInt32ArrayToBytes(retData.Value); return new JtagBoundaryRegister() { PortNum = portNum, PortStatus = retData.Value };
if (!byteArray.IsSuccessful) return new(byteArray.Error);
return new BitArray(byteArray.Value);
} }
} }

View File

@ -5,19 +5,19 @@
<div class="flex flex-col w-full h-full"> <div class="flex flex-col w-full h-full">
<label class="input w-full my-3"> <label class="input w-full my-3">
<img class="h-[1em] opacity-50" src="@/assets/user.svg" alt="User img" /> <img class="h-[1em] opacity-50" src="@/assets/user.svg" alt="User img" />
<input type="text" class="grow" placeholder="用户名" /> <input type="text" class="grow" placeholder="User Name" />
</label> </label>
<label class="input w-full my-3"> <label class="input w-full my-3">
<img class="h-[1em] opacity-50" src="@/assets/pwd.svg" alt="User img" /> <img class="h-[1em] opacity-50" src="@/assets/pwd.svg" alt="User img" />
<input type="text" class="grow" placeholder="密码" /> <input type="text" class="grow" placeholder="User Name" />
</label> </label>
</div> </div>
<div> <div>
<RouterLink class="flex justify-end mx-3" to="/">忘记密码?</RouterLink> <RouterLink class="flex justify-end mx-3" to="/">Forget Password</RouterLink>
</div> </div>
<div class="card-actions flex items-end my-3"> <div class="card-actions flex items-end my-3">
<button class="btn flex-1">注册</button> <button class="btn flex-1">Sign Up</button>
<button class="btn btn-primary flex-3">登录</button> <button class="btn btn-primary flex-3">Login</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -2,28 +2,24 @@
<div class="navbar bg-base-100 shadow-xl"> <div class="navbar bg-base-100 shadow-xl">
<div class="navbar-start"> <div class="navbar-start">
<div class="dropdown"> <div class="dropdown">
<div tabindex="0" role="button" <div tabindex="0" role="button" class="btn btn-ghost hover:bg-primary hover:bg-opacity-20 transition-all duration-300">
class="btn btn-ghost hover:bg-primary hover:bg-opacity-20 transition-all duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" />
</svg> </svg>
</div> </div>
<ul tabindex="0" <ul tabindex="0" class="menu menu-sm dropdown-content bg-base-100 rounded-lg z-50 mt-3 w-52 p-2 shadow-lg transition-all duration-300 ease-in-out">
class="menu menu-sm dropdown-content bg-base-100 rounded-lg z-50 mt-3 w-52 p-2 shadow-lg transition-all duration-300 ease-in-out">
<li class="my-1 hover:translate-x-1 transition-all duration-300"> <li class="my-1 hover:translate-x-1 transition-all duration-300">
<router-link to="/" class="text-base font-medium"> <router-link to="/" class="text-base font-medium">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
stroke="currentColor" stroke-width="2"> <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" /> <polyline points="9 22 9 12 15 12 15 22"/>
<polyline points="9 22 9 12 15 12 15 22" />
</svg> </svg>
首页 首页
</router-link> </router-link>
</li> </li>
<li class="my-1 hover:translate-x-1 transition-all duration-300"> <li class="my-1 hover:translate-x-1 transition-all duration-300">
<router-link to="/user" class="text-base font-medium"> <router-link to="/user" class="text-base font-medium">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path> <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle> <circle cx="12" cy="7" r="4"></circle>
</svg> </svg>
@ -32,8 +28,7 @@
</li> </li>
<li class="my-1 hover:translate-x-1 transition-all duration-300"> <li class="my-1 hover:translate-x-1 transition-all duration-300">
<router-link to="/project" class="text-base font-medium"> <router-link to="/project" class="text-base font-medium">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
stroke="currentColor" stroke-width="2">
<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path> <path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path>
<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path> <path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path>
</svg> </svg>
@ -42,8 +37,7 @@
</li> </li>
<li class="my-1 hover:translate-x-1 transition-all duration-300"> <li class="my-1 hover:translate-x-1 transition-all duration-300">
<router-link to="/test" class="text-base font-medium"> <router-link to="/test" class="text-base font-medium">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
stroke="currentColor" stroke-width="2">
<path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path> <path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path>
</svg> </svg>
测试功能 测试功能
@ -51,8 +45,7 @@
</li> </li>
<li class="my-1 hover:translate-x-1 transition-all duration-300"> <li class="my-1 hover:translate-x-1 transition-all duration-300">
<router-link to="/test/jtag" class="text-base font-medium"> <router-link to="/test/jtag" class="text-base font-medium">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
stroke="currentColor" stroke-width="2">
<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect> <rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
<line x1="8" y1="21" x2="16" y2="21"></line> <line x1="8" y1="21" x2="16" y2="21"></line>
<line x1="12" y1="17" x2="12" y2="21"></line> <line x1="12" y1="17" x2="12" y2="21"></line>
@ -60,17 +53,6 @@
JTAG测试 JTAG测试
</router-link> </router-link>
</li> </li>
<li class="my-1 hover:translate-x-1 transition-all duration-300">
<a href="http://localhost:5000/swagger" target="_self" rel="noopener noreferrer"
class="text-base font-medium">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<path d="M3 3h18v18H3z"></path>
<path d="M8 8h8v8H8z" fill="currentColor"></path>
</svg>
OpenAPI文档
</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -80,8 +62,7 @@
</router-link> </router-link>
</div> </div>
<div class="navbar-end"> <div class="navbar-end">
<router-link to="/login" <router-link to="/login" class="btn btn-primary text-base-100 transition-all duration-300 hover:scale-105 hover:shadow-lg mr-3">
class="btn btn-primary text-base-100 transition-all duration-300 hover:scale-105 hover:shadow-lg mr-3">
登录 登录
</router-link> </router-link>
<div class="ml-2 transition-all duration-500 hover:rotate-12"> <div class="ml-2 transition-all duration-500 hover:rotate-12">

View File

@ -11,8 +11,8 @@ const routes = [
{ path: "/login", name: "Login", component: LoginView }, { path: "/login", name: "Login", component: LoginView },
{ path: "/user", name: "User", component: UserView }, { path: "/user", name: "User", component: UserView },
{ path: "/test", name: "Test", component: TestView }, { path: "/test", name: "Test", component: TestView },
{ path: "/test/jtag", name: "JtagTest", component: JtagTest }, { path: "/test/jtag", name:"JtagTest", component: JtagTest},
{ path: "/project", name: "Project", component: ProjectView }, { path: "/project", name: "Project", component: ProjectView } // 新增工程界面
]; ];
const router = createRouter({ const router = createRouter({

View File

@ -41,12 +41,7 @@ export default defineConfig({
emptyOutDir: true, // also necessary emptyOutDir: true, // also necessary
}, },
server: { server: {
proxy: { proxy: {},
"/swagger": {
target: 'http://localhost:5000',
changeOrigin: true
}
},
port: 5173, port: 5173,
} }
}) })