sc 10 months ago
parent
commit
429b5a6601
  1. 4
      View/EquipmentSimulationView.xaml
  2. 24
      View/EquipmentSimulationView.xaml.cs
  3. 19
      ViewModel/MainWindowViewModel.cs

4
View/EquipmentSimulationView.xaml

@ -14,5 +14,9 @@
<Image Width="300" Height="300" gif:ImageBehavior.AnimatedSource="/Lmage/10001.gif"
gif:ImageBehavior.RepeatBehavior="Forever" HorizontalAlignment="Left" Canvas.Left="20" Canvas.Top="180"/>
</Canvas>
<TextBlock x:Name="M_T" HorizontalAlignment="Left" Height="30" Margin="260,180,0,0" TextWrapping="Wrap" Text="C" TextAlignment="Right"
VerticalAlignment="Top" Width="100" FontSize="20" Background="White" Padding="5,0,5,0"/>
<TextBlock x:Name="M_L" HorizontalAlignment="Left" Height="30" Margin="260,340,0,0" TextWrapping="Wrap" Text="L" TextAlignment="Right"
VerticalAlignment="Top" Width="100" FontSize="20" Background="White" Padding="5,0,5,0"/>
</Grid>
</UserControl>

24
View/EquipmentSimulationView.xaml.cs

@ -1,4 +1,5 @@
using System;
using DyeingComputer.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -12,6 +13,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using static System.Net.WebRequestMethods;
namespace DyeingComputer.View
{
@ -23,6 +26,25 @@ namespace DyeingComputer.View
public EquipmentSimulationView()
{
InitializeComponent();
CountDown();
}
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
{
M_T.Text = string.Format(" {0:###.#}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1010"))) + "°C";
M_L.Text = string.Format("{0:D4}", Convert.ToInt16(MainWindowViewModel.Selet_dtm("1015"))) + "L";
}
public void CountDown()
{
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
{
Interval = TimeSpan.FromSeconds(1)//秒
};
timer1s.Tick += Tick_Event_1S;
timer1s.Start();
}
}
}

19
ViewModel/MainWindowViewModel.cs

@ -1514,8 +1514,11 @@ namespace DyeingComputer.ViewModel
SYSlog = SYSlog + "\n" + Resources.MasterCylinder + Resources.Pressure + " : " + string.Format("{0:###.#}", Convert.ToDouble(Selet_dtm("1042"))) + "Bar";
SYSlog = SYSlog + " | " + Resources.Nozzle + Resources.Pressure + " : " + string.Format("{0:###.#}", Convert.ToDouble(Selet_dtm("1043"))) + "Bar";
SYSlog = SYSlog + "\n-------------------------------------------------------";
if (S16 == 0)
{
SYSlog = SYSlog + "\n" + Resources.DifferentialPressure + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1044"))) + "%";
SYSlog = SYSlog + "\n" + Resources.Blower + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1021"))) + "%";
// SYSlog = SYSlog + "\n" + Resources.GuidingWheel + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1046"))) + "M/min";
SYSlog = SYSlog + "\n" + Resources.Nozzle + Resources.Flowmeter + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1045"))) + "L/min";
SYSlog = SYSlog + "\n" + Resources.ClothWheel + "M/min";
SYSlog = SYSlog + "\n" + "1 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1022")));
if (MT18 >= 2) SYSlog = SYSlog + " | " + "2 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1023")));
@ -1538,16 +1541,8 @@ namespace DyeingComputer.ViewModel
if (MT18 >= 8) SYSlog = SYSlog + " | " + "8 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1039")));
if (MT18 >= 9) SYSlog = SYSlog + " | " + "9 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1040")));
if (MT18 >= 10) SYSlog = SYSlog + "\n" + "10 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1041")));
}//溢流/o型
else if (S16 == 1) //气流
{
SYSlog = SYSlog + "\n" + Resources.DifferentialPressure + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1044"))) + "%";
SYSlog = SYSlog + "\n" + Resources.Blower + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1021"))) + "%";
SYSlog = SYSlog + "\n" + Resources.GuidingWheel + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1046"))) + "M/min";
SYSlog = SYSlog + "\n" + Resources.Nozzle + Resources.Flowmeter + " : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1045"))) + "L/min";
}
else if (S16 == 2) //桶纱
{ }
SYSlog = SYSlog + "\n-------------------------------------------------------";
if (SM01 == 1)
{

Loading…
Cancel
Save