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

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

添加 贺总的O架,无法下载扫描解方程数据, object的大包不知道哪里错了。  添加扫描服务器直接保存扫描解方程数据。
parent 6e1f7f79
...@@ -5,7 +5,7 @@ ...@@ -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" 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" x:Class="FLY.Thick.BlowingScan.UI.Server.MainWindow"
Title="MainWindow" Title="MainWindow"
Icon="Server.ico" Height="164.577" Width="415.903"> Icon="Server.ico" Height="217" Width="418.952">
<flyctrllib:WindowBigClose.Resources> <flyctrllib:WindowBigClose.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</ResourceDictionary> </ResourceDictionary>
</flyctrllib:WindowBigClose.Resources> </flyctrllib:WindowBigClose.Resources>
<Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" > <Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" >
<StackPanel Orientation="Vertical" > <StackPanel >
<StackPanel Orientation="Vertical" Margin="5,20"> <StackPanel Orientation="Vertical" Margin="5,20">
<StackPanel Orientation="Vertical" Margin="5"> <StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="本地IP &amp;端口" /> <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="本地IP &amp;端口" />
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<Button Content="保存调试数据" Padding="20,5" Margin="5" Click="btnSaveBufListClick"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
</flyctrllib:WindowBigClose> </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 FLY.Thick.BlowingScan.Server.OBJProxy;
using Microsoft.Win32;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.ServiceModel.Syndication;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
...@@ -44,5 +49,54 @@ namespace FLY.Thick.BlowingScan.UI.Server ...@@ -44,5 +49,54 @@ namespace FLY.Thick.BlowingScan.UI.Server
this.DataContext = mGage.sysParam; 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 @@ ...@@ -98,7 +98,8 @@
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</ScrollViewer> </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> <ListBox.Resources>
<Style x:Key="FocusVisual"> <Style x:Key="FocusVisual">
<Setter Property="Control.Template"> <Setter Property="Control.Template">
......
...@@ -1389,10 +1389,12 @@ namespace FLY.Thick.BlowingScan.Server ...@@ -1389,10 +1389,12 @@ namespace FLY.Thick.BlowingScan.Server
f.Velocity = mPDetect.FilmVelocity; f.Velocity = mPDetect.FilmVelocity;
lock (mBufList)
{
mBufList.RAdd(f); mBufList.RAdd(f);
FirstBM = mBufList.Index2No(0); FirstBM = mBufList.Index2No(0);
LastBM = mBufList.GetLastNo(); LastBM = mBufList.GetLastNo();
}
...@@ -2037,10 +2039,12 @@ namespace FLY.Thick.BlowingScan.Server ...@@ -2037,10 +2039,12 @@ namespace FLY.Thick.BlowingScan.Server
public void GetBufList(AsyncCBHandler AsyncDelegate, object AsyncState) public void GetBufList(AsyncCBHandler AsyncDelegate, object AsyncState)
{ {
GetBufListReponse p = new GetBufListReponse(); GetBufListReponse p = new GetBufListReponse();
lock (mBufList)
{
p.datas = mBufList.ToList();
p.lastbm = LastBM; p.lastbm = LastBM;
p.firstbm = FirstBM; p.firstbm = FirstBM;
p.datas = mBufList; }
AsyncDelegate(AsyncState, p); 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