Commit 82a7ee96 authored by 潘栩锋's avatar 潘栩锋 🚴

修复 扫描 产品界面 列表无内容(忘记 设ItemSource)

添加 贺总的O架,无法下载扫描解方程数据, object的大包不知道哪里错了。  添加扫描服务器直接保存扫描解方程数据。
parent 6e1f7f79
......@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="FLY.Thick.BlowingScan.UI.Server.MainWindow"
Title="MainWindow"
Icon="Server.ico" Height="164.577" Width="415.903">
Icon="Server.ico" Height="217" Width="418.952">
<flyctrllib:WindowBigClose.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
......@@ -15,7 +15,7 @@
</ResourceDictionary>
</flyctrllib:WindowBigClose.Resources>
<Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" >
<StackPanel Orientation="Vertical" >
<StackPanel >
<StackPanel Orientation="Vertical" Margin="5,20">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="本地IP &amp;端口" />
......@@ -25,6 +25,7 @@
</StackPanel>
</StackPanel>
<Button Content="保存调试数据" Padding="20,5" Margin="5" Click="btnSaveBufListClick"/>
</StackPanel>
</Grid>
</flyctrllib:WindowBigClose>
\ No newline at end of file
using FLY.Thick.BlowingScan.Server;
using FLY.Thick.BlowingScan.IService;
using FLY.Thick.BlowingScan.Server;
using FLY.Thick.BlowingScan.Server.OBJProxy;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.ServiceModel.Syndication;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
......@@ -44,5 +49,54 @@ namespace FLY.Thick.BlowingScan.UI.Server
this.DataContext = mGage.sysParam;
}
List<Common.FlyData_BlowingScan> mBufList;
private void btnSaveBufListClick(object sender, RoutedEventArgs e)
{
mGage.gmRenZiJiaScan.GetBufList((asyncContext, retData) => {
var reponse = retData as GetBufListReponse;
mBufList = reponse.datas;
this.Dispatcher.BeginInvoke(new Action(Save2));
},this);
}
void Save2() {
SaveFileDialog sfd = new SaveFileDialog();
sfd.DefaultExt = ".csv";
sfd.AddExtension = true;
if (sfd.ShowDialog() == true)
{
Task.Factory.StartNew(() =>
{
Save(sfd.FileName);
});
}
}
bool Save(string path)
{
try
{
using (StreamWriter sw = new StreamWriter(path, false, Encoding.GetEncoding("GB2312")))
{
bool hasHeader = false;
foreach (var f in mBufList)
{
if (!hasHeader)
{
hasHeader = true;
sw.WriteLine(f.GetHeader());
}
sw.WriteLine(f.ToString());
}
sw.Flush();
sw.Close();
}
return true;
}
catch (Exception e)
{
return false;
}
}
}
}
......@@ -98,7 +98,8 @@
</StackPanel>
</StackPanel>
</ScrollViewer>
<ListBox Name="listview_profile" Margin="{StaticResource ControlMargin}" MinWidth="400" Grid.Column="1" Background="{StaticResource Background_Title}">
<ListBox Name="listview_profile" Margin="{StaticResource ControlMargin}" MinWidth="400" Grid.Column="1" Background="{StaticResource Background_Title}"
ItemsSource="{Binding ProfileList}">
<ListBox.Resources>
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
......
......@@ -1388,11 +1388,13 @@ namespace FLY.Thick.BlowingScan.Server
f.RotatePeriod = mPDetect.RenZiJiaPeriod;
f.Velocity = mPDetect.FilmVelocity;
mBufList.RAdd(f);
FirstBM = mBufList.Index2No(0);
LastBM = mBufList.GetLastNo();
lock (mBufList)
{
mBufList.RAdd(f);
FirstBM = mBufList.Index2No(0);
LastBM = mBufList.GetLastNo();
}
......@@ -2037,10 +2039,12 @@ namespace FLY.Thick.BlowingScan.Server
public void GetBufList(AsyncCBHandler AsyncDelegate, object AsyncState)
{
GetBufListReponse p = new GetBufListReponse();
p.lastbm = LastBM;
p.firstbm = FirstBM;
p.datas = mBufList;
lock (mBufList)
{
p.datas = mBufList.ToList();
p.lastbm = LastBM;
p.firstbm = FirstBM;
}
AsyncDelegate(AsyncState, p);
}
......
Subproject commit 582acd98f8bb22d5ba23e7010615b7f1d63272b9
Subproject commit 1ca3aa5a8b675b14885fe33e0e5fae13b26d7ec8
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