You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.4 KiB
C#
99 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Mesnac.Controls.Compressor;
|
|
using System.Reflection;
|
|
using Mesnac.Compressor.Entity;
|
|
|
|
namespace Mesnac.Action.Compressor
|
|
{
|
|
public partial class FrmStationData : Form
|
|
{
|
|
public FrmStationData()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public delegate void InvokeMethod();
|
|
MachineButton machinebutton;
|
|
MachineInfo machine;
|
|
public int page = 1;
|
|
|
|
public FrmStationData(MachineButton machineb)
|
|
{
|
|
InitializeComponent();
|
|
this.machinebutton = machineb;
|
|
this.machine = machineb.Machine;
|
|
machinebutton.ReshreshStationData += RereshData;
|
|
//display();
|
|
}
|
|
|
|
public void RereshData(object sender, EventArgs e)
|
|
{
|
|
if (this.InvokeRequired)
|
|
{
|
|
this.BeginInvoke(new InvokeMethod(display));
|
|
return;
|
|
}
|
|
}
|
|
|
|
public void display()
|
|
{
|
|
if (machine == null)
|
|
{
|
|
return;
|
|
}
|
|
StationInfo station;
|
|
if (page == 1)
|
|
{
|
|
btn_next.Enabled = true;
|
|
btn_pre.Enabled = false;
|
|
station = machine.StationOne;
|
|
}
|
|
else
|
|
{
|
|
btn_next.Enabled = false;
|
|
btn_pre.Enabled = true;
|
|
station = machine.StationTwo;
|
|
}
|
|
ShowStationinfo(station);
|
|
}
|
|
|
|
public void ShowStationinfo(StationInfo station)
|
|
{
|
|
this.lb_stationName.Text = station.StationName;
|
|
this.txt_state.Text = station.Data.state;
|
|
this.txt_data.Text = station.Data.data;
|
|
}
|
|
|
|
private void btn_return_Click(object sender, EventArgs e)
|
|
{
|
|
machinebutton.ReshreshStationData -= RereshData;
|
|
this.Close();
|
|
}
|
|
|
|
private void btn_next_Click(object sender, EventArgs e)
|
|
{
|
|
this.page=2;
|
|
display();
|
|
}
|
|
|
|
private void btn_pre_Click(object sender, EventArgs e)
|
|
{
|
|
this.page = 1;
|
|
display();
|
|
}
|
|
|
|
private void FrmStation_Load(object sender, EventArgs e)
|
|
{
|
|
display();
|
|
}
|
|
|
|
}
|
|
}
|