43 lines
1.6 KiB
PowerShell
43 lines
1.6 KiB
PowerShell
#!/usr/bin/env pwsh
|
||
|
||
Write-Host "========================================" -ForegroundColor Green
|
||
Write-Host "IEC104 Console App 独立调试测试" -ForegroundColor Green
|
||
Write-Host "========================================" -ForegroundColor Green
|
||
Write-Host ""
|
||
|
||
Write-Host "正在启动IEC104控制台应用程序(调试模式)..." -ForegroundColor Yellow
|
||
Write-Host "默认配置: 192.168.65.101:2410, RTU地址=1" -ForegroundColor Yellow
|
||
Write-Host ""
|
||
|
||
# 切换到输出目录
|
||
$outputPath = "YunDa.Server\Yunda.SOMS.DataMonitoringServer\bin\Debug\net6.0-windows7.0\IEC104Console\net6.0"
|
||
Set-Location $outputPath
|
||
|
||
Write-Host "当前目录: $(Get-Location)" -ForegroundColor Cyan
|
||
Write-Host ""
|
||
|
||
$exePath = "Yunda.SOMS.IEC104.ConsoleApp.exe"
|
||
|
||
if (Test-Path $exePath) {
|
||
Write-Host "找到可执行文件,正在启动..." -ForegroundColor Green
|
||
Write-Host ""
|
||
Write-Host "提示: 在调试模式下,您可以使用以下命令:" -ForegroundColor Magenta
|
||
Write-Host " status - 显示连接状态" -ForegroundColor Magenta
|
||
Write-Host " info - 显示连接信息" -ForegroundColor Magenta
|
||
Write-Host " help - 显示帮助信息" -ForegroundColor Magenta
|
||
Write-Host " quit - 退出程序" -ForegroundColor Magenta
|
||
Write-Host ""
|
||
|
||
# 启动程序
|
||
& ".\$exePath"
|
||
} else {
|
||
Write-Host "错误: 找不到 $exePath" -ForegroundColor Red
|
||
Write-Host "请先编译项目: dotnet build" -ForegroundColor Red
|
||
Write-Host ""
|
||
Read-Host "Press any key to continue"
|
||
}
|
||
|
||
Write-Host ""
|
||
Write-Host "程序已退出" -ForegroundColor Yellow
|
||
Read-Host "Press any key to continue"
|