日子查看读取逻辑修改,总览选项卡显示更改
This commit is contained in:
commit
3c4761aed4
4 files changed
+37
-34
No files matched your search
@@ -1051,9 +1051,9 @@
|
||||
<value>機台未就緒</value>
|
||||
</data>
|
||||
<data name="user_lock" xml:space="preserve">
|
||||
<value />
|
||||
<value>鎖定</value>
|
||||
</data>
|
||||
<data name="user_unlock" xml:space="preserve">
|
||||
<value />
|
||||
<value>解鎖</value>
|
||||
</data>
|
||||
</root>
|
||||
+1
-9
@@ -27,14 +27,6 @@
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch" Background="#FF00204E"/>
|
||||
<RichTextBox Grid.Column="2" x:Name="Logtext" IsReadOnly="True" VerticalScrollBarVisibility="Visible" Background="White" SelectionBrush="White">
|
||||
<FlowDocument>
|
||||
<Paragraph>
|
||||
<Run Text="LOG"/>
|
||||
</Paragraph>
|
||||
</FlowDocument>
|
||||
</RichTextBox>
|
||||
<!--遮罩-->
|
||||
|
||||
<RichTextBox Grid.Column="2" x:Name="Logtext" IsReadOnly="True" Background="White" SelectionBrush="White"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+22
-10
@@ -24,6 +24,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
{
|
||||
string Log_time = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
DataTable logdataTable = new DataTable(); //建立RRODUCT缓存
|
||||
long TEXT_L;
|
||||
|
||||
public LogView()
|
||||
{
|
||||
@@ -46,7 +47,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
foreach (var item in loginfo.GetFiles())
|
||||
{
|
||||
DataRow FileRow = logdataTable.NewRow();
|
||||
|
||||
FileRow["Name"] = item.Name;
|
||||
FileRow["Length"] = item.Length / 1024;
|
||||
FileRow["CreationTimeUtc"] = item.CreationTimeUtc;
|
||||
@@ -64,25 +64,37 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
{
|
||||
/*定位选中行及指定列单元格文本信息*/
|
||||
LOGDATA_file((gridLog.Columns[0].GetCellContent(gridLog.Items[rownum]) as TextBlock).Text.TrimEnd());//
|
||||
TEXT_L = long.Parse((gridLog.Columns[1].GetCellContent(gridLog.Items[rownum]) as TextBlock).Text.ToString()) *1024+1024;//
|
||||
}
|
||||
}
|
||||
|
||||
private void LOGDATA_file(string dat) //读取文件显示到前端
|
||||
private async void LOGDATA_file(string dat) //读取文件显示到前端
|
||||
{
|
||||
Logtext.SelectAll();
|
||||
Logtext.Cut();
|
||||
Logtext.Document = new FlowDocument();
|
||||
string filePath = System.Environment.CurrentDirectory + "\\"+comboBox_log.Text+"\\";
|
||||
string filePath = System.Environment.CurrentDirectory + "\\"+comboBox_log.Text+ "\\";
|
||||
try
|
||||
{
|
||||
// 使用StreamReader读取文件
|
||||
using (StreamReader reader = new StreamReader(filePath + dat))
|
||||
Logtext.AppendText("Loading...");
|
||||
string log_ = null;
|
||||
string log_DAT = await Task<string>.Run(() =>
|
||||
{
|
||||
// 读取文件直到文件的末尾
|
||||
while (!reader.EndOfStream)
|
||||
// 使用StreamReader读取文件
|
||||
using (StreamReader reader = new StreamReader(filePath + dat))
|
||||
{
|
||||
// 添加文件的每一行到RichTextBox
|
||||
Logtext.AppendText(reader.ReadLine() + "\r\n");
|
||||
// 读取文件直到文件的末尾
|
||||
while (!reader.EndOfStream)
|
||||
{
|
||||
// 添加文件的每一行到RichTextBox
|
||||
log_ = log_ + reader.ReadLine() + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return log_;
|
||||
});
|
||||
Logtext.SelectAll();
|
||||
Logtext.Cut();
|
||||
Logtext.AppendText(log_DAT);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
+12
-13
@@ -55,12 +55,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
else
|
||||
{ inf[i].name.Background = new SolidColorBrush(Color.FromRgb(255, 0, 0)); }
|
||||
|
||||
inf[i].temp.Text = (Selet_Machines(MainWindowViewModel.Machines, "Temperature", i) + "°C").ToString();
|
||||
inf[i].Process.Text = Selet_Machines(MainWindowViewModel.Machines, "Process", i).ToString();
|
||||
inf[i].Step.Text = Selet_Machines(MainWindowViewModel.Machines, "Step", i).ToString();
|
||||
inf[i].Message.Text = Selet_Machines(MainWindowViewModel.Machines, "Message", i).ToString();
|
||||
inf[i].Orders.Text = Selet_Machines(MainWindowViewModel.Machines, "WorkOrder", i).ToString();
|
||||
inf[i].time.Text = Selet_Machines(MainWindowViewModel.Machines, "time", i).ToString();
|
||||
inf[i].temp.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Temperature", i) + "°C";
|
||||
inf[i].Process.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Process", i);
|
||||
inf[i].Step.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Step", i);
|
||||
inf[i].Message.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Message", i);
|
||||
inf[i].Orders.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "WorkOrder", i);
|
||||
inf[i].time.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "time", i);
|
||||
|
||||
WholeView.Children.Add(inf[i]);
|
||||
}
|
||||
@@ -109,13 +109,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
else
|
||||
{ inf[i].name.Background = new SolidColorBrush(Color.FromRgb(255, 0, 0)); }
|
||||
|
||||
inf[i].temp.Text = (Selet_Machines(MainWindowViewModel.Machines, "Temperature", i) + "°C").ToString();
|
||||
inf[i].Process.Text = Selet_Machines(MainWindowViewModel.Machines, "Process", i).ToString();
|
||||
inf[i].Step.Text = Selet_Machines(MainWindowViewModel.Machines, "Step", i).ToString();
|
||||
inf[i].Message.Text = Selet_Machines(MainWindowViewModel.Machines, "Message", i).ToString();
|
||||
inf[i].Orders.Text = Selet_Machines(MainWindowViewModel.Machines, "WorkOrder", i).ToString();
|
||||
inf[i].time.Text = Selet_Machines(MainWindowViewModel.Machines, "time", i).ToString();
|
||||
|
||||
inf[i].temp.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Temperature", i) + "°C";
|
||||
inf[i].Process.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Process", i);
|
||||
inf[i].Step.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Step", i);
|
||||
inf[i].Message.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Message", i);
|
||||
inf[i].Orders.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "WorkOrder", i);
|
||||
inf[i].time.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "time", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user