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

???

parent e0a9f888
......@@ -25,7 +25,7 @@ namespace FLY.AppHelper
(p.ProcessName == process.ProcessName) &&
(p.Id != process.Id) &&
(p.MainModule.FileName == process.MainModule.FileName) &&
(p.HasExited)
(!p.HasExited)
select p;
try
{
......
......@@ -32,7 +32,7 @@ namespace ThickTcpUiInWindow.Converter
case CTRL_STATE.CORR:
return Application.Current.FindResource("strCSCorr");
case CTRL_STATE.GETSAMPLE:
return Application.Current.FindResource("strCSGetSampl");
return Application.Current.FindResource("strCSGetSample");
case CTRL_STATE.RUNNING:
return Application.Current.FindResource("strCSRunning");
case CTRL_STATE.DISCONNECTED:
......
......@@ -81,7 +81,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(1))
if (Window_Password.Authorize(2))
{
mBoltMapService.ApplyBorder();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......@@ -92,7 +92,7 @@ namespace ThickTcpUiInWindow
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();
w.Init(mBoltMapService, mInitParamService);
......
......@@ -95,7 +95,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(1))
if (Window_Password.Authorize(2))
{
mCurveService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
......@@ -312,7 +312,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(1))
if (Window_Password.Authorize(2))
{
mCurveService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
......@@ -60,7 +60,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(2))
if (Window_Password.Authorize(10))
{
mFlyADService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
......@@ -414,7 +414,7 @@ namespace ThickTcpUiInWindow
}
void button_start_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(1))
if (Window_Password.Authorize(2))
{
if (mGageInfoService.IsRunning)
mGageInfoService.Stop();
......
......@@ -65,7 +65,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(1))
if (Window_Password.Authorize(2))
{
mGetSampleService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
......@@ -45,7 +45,7 @@ namespace ThickTcpUiInWindow
}
private void button_apply_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(1))
if (Window_Password.Authorize(2))
{
mInitParamService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
......@@ -47,7 +47,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(1))
if (Window_Password.Authorize(2))
{
mScanWarningService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
......@@ -30,7 +30,7 @@ namespace ThickTcpUiInWindow
private void button_apply_Click(object sender, RoutedEventArgs e)
{
if (Window_Password.Authorize(1))
if (Window_Password.Authorize(2))
{
mWarningService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
......@@ -66,21 +66,25 @@ namespace ThickTcpUiInWindow
switch (r)
{
case AUTHORIZE_RESULT.OK:
this.DialogResult = true;
mPwKeep.SetPSK(PSK);
break;
{
mPwKeep.SetPSK(PSK);
this.DialogResult = true;
this.Close();
return;
}
case AUTHORIZE_RESULT.ERR_LEVEL:
FLY.ControlLibrary.Window_WarningTip.Show("错误", "权限不足",
TimeSpan.FromSeconds(2));
this.DialogResult = false;
break;
{
FLY.ControlLibrary.Window_WarningTip.Show("错误", $"权限不足 需要Lv{Level}以上密码",
TimeSpan.FromSeconds(2));
return;
}
case AUTHORIZE_RESULT.ERR_PW:
FLY.ControlLibrary.Window_WarningTip.Show("错误", "密码错误",
TimeSpan.FromSeconds(2));
this.DialogResult = false;
break;
{
FLY.ControlLibrary.Window_WarningTip.Show("错误", "密码错误",
TimeSpan.FromSeconds(2));
return;
}
}
this.Close();
return;
}
......
......@@ -81,7 +81,7 @@ namespace ThickTcpUiInWindow
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;
......@@ -106,17 +106,15 @@ namespace ThickTcpUiInWindow
}
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)
//{
// FLY.ControlLibrary.Window_WarningTip.Show("错误", "请选择密码级别",
// TimeSpan.FromSeconds(2));
// return false;
//}
//else
else
{
//删除全部level=1的密码
......
......@@ -85,8 +85,8 @@ namespace FLY.Thick.Base.Server
while (data.Count()>0)
{
int cnt = (data.Count() > size) ? size : data.Count();
var ADs2 = data.Take(cnt);
var thicks2 = thicks.Take(cnt);
int[] ADs2 = data.Take(cnt).ToArray();
double[] thicks2 = thicks.Take(cnt).ToArray();
data.RemoveRange(0, cnt);
thicks.RemoveRange(0, cnt);
......@@ -96,8 +96,8 @@ namespace FLY.Thick.Base.Server
{
time = dt,
ts = ts,
ADs = ADs2.ToArray(),
thicks = thicks2.ToArray()
ADs = ADs2,
thicks = thicks2
});
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