Browse Source

本地单机版

master
胡超1 1 year ago
parent
commit
e423cc4214
  1. 26
      CPF_Cef/FrmMain.cs
  2. 2
      CPF_Cef/MainModel.cs
  3. 2
      CPF_Cef/Parame.cs

26
CPF_Cef/FrmMain.cs

@ -10,9 +10,11 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Net.Http; using System.Net.Http;
using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers;
namespace AKS.EnterpriseLibrary.WebBrowser namespace AKS.EnterpriseLibrary.WebBrowser
{ {
@ -85,7 +87,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
//浏览器大小 //浏览器大小
Parame.webBrowser.Width = w; Parame.webBrowser.Width = w;
Parame.webBrowser.Height = h; Parame.webBrowser.Height = h;
Parame.webBrowser.Url = "http://192.168.0.34:8078/#/main-out"; Parame.webBrowser.Url = "http://127.0.0.1:8096/#/main-out";
//Parame.webBrowser.Url = Application.StartupPath + @"\html\index.html"; //Parame.webBrowser.Url = Application.StartupPath + @"\html\index.html";
//开发者工具暂时只能支持Windows //开发者工具暂时只能支持Windows
//webBrowser.ShowDev(); //webBrowser.ShowDev();
@ -108,8 +110,6 @@ namespace AKS.EnterpriseLibrary.WebBrowser
showDev = true; showDev = true;
Parame.webBrowser.ShowDev(); Parame.webBrowser.ShowDev();
} }
//获取授权
GetSQObject();
//获取设备 //获取设备
MainModel.GetSnIndex(); MainModel.GetSnIndex();
//打开高拍仪 //打开高拍仪
@ -119,6 +119,26 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
//开启/关闭纠偏显示 //开启/关闭纠偏显示
MainModel.EnableDeskImage(1); MainModel.EnableDeskImage(1);
//开启定时
System.Timers.Timer timer = new System.Timers.Timer(1000);//3秒钟的时间间隔
timer.Elapsed += OnTimedEvent;
timer.AutoReset = true;//重复执行
timer.Enabled = true;//启动定时器
}
//矫正授权
private void OnTimedEvent(Object source, ElapsedEventArgs e)
{
try
{
//获取授权
GetSQObject();
//检测服务是否启动
MainModel.StartShll();
}
catch { }
finally { }
} }
public void Writelog(string str, string dirName = @"logs") public void Writelog(string str, string dirName = @"logs")

2
CPF_Cef/MainModel.cs

@ -58,8 +58,6 @@ namespace AKS.EnterpriseLibrary.WebBrowser
//读取参数 //读取参数
if (content != "ping" && !string.IsNullOrEmpty(content)) if (content != "ping" && !string.IsNullOrEmpty(content))
{ {
//检测服务是否启动
StartShll();
//返回内容 //返回内容
string result = string.Empty; string result = string.Empty;
content = Base64str2(content); content = Base64str2(content);

2
CPF_Cef/Parame.cs

@ -19,7 +19,7 @@ namespace AksWebBrowser
public static Window frm { get; set; } public static Window frm { get; set; }
public static List<Func> FuncObject { get; set; } public static List<Func> FuncObject { get; set; }
//接口地址 //接口地址
public static string apiUrl = "http://192.168.0.34:92"; public static string apiUrl = "http://127.0.0.1:8098";
//授权key //授权key
public static string key = "1"; public static string key = "1";
//硬件Ip //硬件Ip

Loading…
Cancel
Save