更新
This commit is contained in:
@@ -29,6 +29,17 @@ namespace 自救器呼吸器综合检验仪
|
||||
_readTimer = InitDispatcherTimer();
|
||||
}
|
||||
|
||||
private void EnsureWindowedLayout()
|
||||
{
|
||||
WindowState = WindowState.Normal;
|
||||
Width = 1024;
|
||||
Height = 600;
|
||||
|
||||
Rect workArea = SystemParameters.WorkArea;
|
||||
Left = workArea.Left + (workArea.Width - Width) / 2;
|
||||
Top = workArea.Top + (workArea.Height - Height) / 2;
|
||||
}
|
||||
|
||||
private DispatcherTimer InitDispatcherTimer()
|
||||
{
|
||||
var timer = new DispatcherTimer
|
||||
@@ -446,6 +457,8 @@ _modbusMaster?.ReadHoldingRegisters(1, 290, 2)
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
EnsureWindowedLayout();
|
||||
|
||||
string plcIp = "192.168.1.10";
|
||||
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
|
||||
if (!initSuccess)
|
||||
|
||||
Reference in New Issue
Block a user