Commit ee92836d authored by 潘栩锋's avatar 潘栩锋 🚴

???

parent e0a9f888
...@@ -25,7 +25,7 @@ namespace FLY.AppHelper ...@@ -25,7 +25,7 @@ namespace FLY.AppHelper
(p.ProcessName == process.ProcessName) && (p.ProcessName == process.ProcessName) &&
(p.Id != process.Id) && (p.Id != process.Id) &&
(p.MainModule.FileName == process.MainModule.FileName) && (p.MainModule.FileName == process.MainModule.FileName) &&
(p.HasExited) (!p.HasExited)
select p; select p;
try try
{ {
......
...@@ -32,7 +32,7 @@ namespace ThickTcpUiInWindow.Converter ...@@ -32,7 +32,7 @@ namespace ThickTcpUiInWindow.Converter
case CTRL_STATE.CORR: case CTRL_STATE.CORR:
return Application.Current.FindResource("strCSCorr"); return Application.Current.FindResource("strCSCorr");
case CTRL_STATE.GETSAMPLE: case CTRL_STATE.GETSAMPLE:
return Application.Current.FindResource("strCSGetSampl"); return Application.Current.FindResource("strCSGetSample");
case CTRL_STATE.RUNNING: case CTRL_STATE.RUNNING:
return Application.Current.FindResource("strCSRunning"); return Application.Current.FindResource("strCSRunning");
case CTRL_STATE.DISCONNECTED: case CTRL_STATE.DISCONNECTED:
......
...@@ -81,7 +81,7 @@ namespace ThickTcpUiInWindow ...@@ -81,7 +81,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e) private void button_apply_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
mBoltMapService.ApplyBorder(); mBoltMapService.ApplyBorder();
FLY.ControlLibrary.Window_Tip.Show("应用成功", FLY.ControlLibrary.Window_Tip.Show("应用成功",
...@@ -92,7 +92,7 @@ namespace ThickTcpUiInWindow ...@@ -92,7 +92,7 @@ namespace ThickTcpUiInWindow
private void button_createimg_Click(object sender, RoutedEventArgs e) private void button_createimg_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
Window_BoltCreate w = new Window_BoltCreate(); Window_BoltCreate w = new Window_BoltCreate();
w.Init(mBoltMapService, mInitParamService); w.Init(mBoltMapService, mInitParamService);
......
...@@ -95,7 +95,7 @@ namespace ThickTcpUiInWindow ...@@ -95,7 +95,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e) private void button_apply_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
mCurveService.Apply(); mCurveService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功", FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
...@@ -312,7 +312,7 @@ namespace ThickTcpUiInWindow ...@@ -312,7 +312,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e) private void button_apply_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
mCurveService.Apply(); mCurveService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功", FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
...@@ -60,7 +60,7 @@ namespace ThickTcpUiInWindow ...@@ -60,7 +60,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e) private void button_apply_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(2)) if (Window_Password.Authorize(10))
{ {
mFlyADService.Apply(); mFlyADService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功", FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
...@@ -414,7 +414,7 @@ namespace ThickTcpUiInWindow ...@@ -414,7 +414,7 @@ namespace ThickTcpUiInWindow
} }
void button_start_Click(object sender, RoutedEventArgs e) void button_start_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
if (mGageInfoService.IsRunning) if (mGageInfoService.IsRunning)
mGageInfoService.Stop(); mGageInfoService.Stop();
......
...@@ -65,7 +65,7 @@ namespace ThickTcpUiInWindow ...@@ -65,7 +65,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e) private void button_apply_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
mGetSampleService.Apply(); mGetSampleService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功", FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
...@@ -45,7 +45,7 @@ namespace ThickTcpUiInWindow ...@@ -45,7 +45,7 @@ namespace ThickTcpUiInWindow
} }
private void button_apply_Click(object sender, RoutedEventArgs e) private void button_apply_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
mInitParamService.Apply(); mInitParamService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功", FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
...@@ -47,7 +47,7 @@ namespace ThickTcpUiInWindow ...@@ -47,7 +47,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e) private void button_apply_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
mScanWarningService.Apply(); mScanWarningService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功", FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
...@@ -30,7 +30,7 @@ namespace ThickTcpUiInWindow ...@@ -30,7 +30,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e) private void button_apply_Click(object sender, RoutedEventArgs e)
{ {
if (Window_Password.Authorize(1)) if (Window_Password.Authorize(2))
{ {
mWarningService.Apply(); mWarningService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功", FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
...@@ -66,21 +66,25 @@ namespace ThickTcpUiInWindow ...@@ -66,21 +66,25 @@ namespace ThickTcpUiInWindow
switch (r) switch (r)
{ {
case AUTHORIZE_RESULT.OK: case AUTHORIZE_RESULT.OK:
this.DialogResult = true; {
mPwKeep.SetPSK(PSK); mPwKeep.SetPSK(PSK);
break; this.DialogResult = true;
this.Close();
return;
}
case AUTHORIZE_RESULT.ERR_LEVEL: case AUTHORIZE_RESULT.ERR_LEVEL:
FLY.ControlLibrary.Window_WarningTip.Show("错误", "权限不足", {
TimeSpan.FromSeconds(2)); FLY.ControlLibrary.Window_WarningTip.Show("错误", $"权限不足 需要Lv{Level}以上密码",
this.DialogResult = false; TimeSpan.FromSeconds(2));
break; return;
}
case AUTHORIZE_RESULT.ERR_PW: case AUTHORIZE_RESULT.ERR_PW:
FLY.ControlLibrary.Window_WarningTip.Show("错误", "密码错误", {
TimeSpan.FromSeconds(2)); FLY.ControlLibrary.Window_WarningTip.Show("错误", "密码错误",
this.DialogResult = false; TimeSpan.FromSeconds(2));
break; return;
}
} }
this.Close();
return; return;
} }
......
...@@ -81,7 +81,7 @@ namespace ThickTcpUiInWindow ...@@ -81,7 +81,7 @@ namespace ThickTcpUiInWindow
public int Level { get; set; } public int Level { get; set; }
public int[] Levels { get; } = new int[] { 0, 1 }; public int[] Levels { get; } = new int[] { 0, 1, 2 };
PasswordService mPasswordService = null; PasswordService mPasswordService = null;
...@@ -106,17 +106,15 @@ namespace ThickTcpUiInWindow ...@@ -106,17 +106,15 @@ namespace ThickTcpUiInWindow
} }
else if (mPasswordService.PWs.Exists(pw => pw.Password == PSK)) else if (mPasswordService.PWs.Exists(pw => pw.Password == PSK))
{ {
FLY.ControlLibrary.Window_WarningTip.Show("错误", "此密码已经存在", //此密码已经存在
TimeSpan.FromSeconds(2)); //把它改级别
return false; PasswordCell pc = mPasswordService.PWs.Find(pw => pw.Password == PSK);
if (pc != null)
pc.Level = Level;
mPasswordService.Apply();
return true;
} }
//else if (Level) else
//{
// FLY.ControlLibrary.Window_WarningTip.Show("错误", "请选择密码级别",
// TimeSpan.FromSeconds(2));
// return false;
//}
//else
{ {
//删除全部level=1的密码 //删除全部level=1的密码
......
...@@ -85,8 +85,8 @@ namespace FLY.Thick.Base.Server ...@@ -85,8 +85,8 @@ namespace FLY.Thick.Base.Server
while (data.Count()>0) while (data.Count()>0)
{ {
int cnt = (data.Count() > size) ? size : data.Count(); int cnt = (data.Count() > size) ? size : data.Count();
var ADs2 = data.Take(cnt); int[] ADs2 = data.Take(cnt).ToArray();
var thicks2 = thicks.Take(cnt); double[] thicks2 = thicks.Take(cnt).ToArray();
data.RemoveRange(0, cnt); data.RemoveRange(0, cnt);
thicks.RemoveRange(0, cnt); thicks.RemoveRange(0, cnt);
...@@ -96,8 +96,8 @@ namespace FLY.Thick.Base.Server ...@@ -96,8 +96,8 @@ namespace FLY.Thick.Base.Server
{ {
time = dt, time = dt,
ts = ts, ts = ts,
ADs = ADs2.ToArray(), ADs = ADs2,
thicks = thicks2.ToArray() thicks = thicks2
}); });
dt += TimeSpan.FromTicks(cnt * ts.Ticks); dt += TimeSpan.FromTicks(cnt * ts.Ticks);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment