Browse Source

本地单机版

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

2
CPF_Cef/Common/Utils.cs

@ -219,7 +219,7 @@ namespace AksWebBrowser.Common
/// <returns></returns>
public static int AddOneIfRemainder(int number1, int number2)
{
decimal num = (decimal) number1 / number2;
decimal num = (decimal)number1 / number2;
decimal fraction = num - Math.Floor(num);
return Convert.ToInt32(num + (fraction > 0 ? 1 : 0));
}

26
CPF_Cef/FrmMain.cs

@ -10,9 +10,11 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
namespace AKS.EnterpriseLibrary.WebBrowser
{
@ -85,7 +87,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
//浏览器大小
Parame.webBrowser.Width = w;
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";
//开发者工具暂时只能支持Windows
//webBrowser.ShowDev();
@ -108,8 +110,6 @@ namespace AKS.EnterpriseLibrary.WebBrowser
showDev = true;
Parame.webBrowser.ShowDev();
}
//获取授权
GetSQObject();
//获取设备
MainModel.GetSnIndex();
//打开高拍仪
@ -119,6 +119,26 @@ namespace AKS.EnterpriseLibrary.WebBrowser
}
//开启/关闭纠偏显示
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")

2
CPF_Cef/MainModel.cs

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

2
CPF_Cef/Parame.cs

@ -19,7 +19,7 @@ namespace AksWebBrowser
public static Window frm { 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
public static string key = "1";
//硬件Ip

Loading…
Cancel
Save