Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
8ade983214
5 files changed
+388
-125
No files matched your search
@@ -8,10 +8,10 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
||||
<Grid>
|
||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,10,0,0" x:Name="comboBoxCOM0" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="16" />
|
||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,10,0,0" x:Name="comboBoxCOM0" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged0" FontSize="16" />
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,10,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Port}" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,50,0,0" x:Name="comboBoxCOM1" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="16"/>
|
||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,90,0,0" x:Name="comboBoxCOM2" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="16"/>
|
||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,50,0,0" x:Name="comboBoxCOM1" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged1" FontSize="16"/>
|
||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,90,0,0" x:Name="comboBoxCOM2" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged2" FontSize="16"/>
|
||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,130,0,0" x:Name="comboBoxLanguage" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxLanguage_SelectionChanged" FontSize="16"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,130,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Language}" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,170,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.SERVER}" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||
|
||||
@@ -30,14 +30,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
InitializeComponent();
|
||||
// 获取所有可用串口端口,并添加到comboBoxCOM
|
||||
string[] ports = System.IO.Ports.SerialPort.GetPortNames();
|
||||
ports.Append("COM");
|
||||
comboBoxCOM0.ItemsSource = ports;
|
||||
comboBoxCOM0.Text = Configini.IniReadvalue("SYS", "COM");
|
||||
comboBoxCOM0.Text = Configini.IniReadvalue("SYS", "COMP1");
|
||||
|
||||
comboBoxCOM1.ItemsSource = ports;
|
||||
comboBoxCOM1.Text = Configini.IniReadvalue("SYS", "COM");
|
||||
comboBoxCOM1.Text = Configini.IniReadvalue("SYS", "COMP2");
|
||||
|
||||
comboBoxCOM2.ItemsSource = ports;
|
||||
comboBoxCOM2.Text = Configini.IniReadvalue("SYS", "COM");
|
||||
comboBoxCOM2.Text = Configini.IniReadvalue("SYS", "COMP3");
|
||||
|
||||
string[] Language = {"en-US","zh-CN","zh-TW" };
|
||||
string[] SQMOD = { "Windows Authentication", "SQL SERVER"};
|
||||
@@ -61,13 +62,24 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
|
||||
private SpeechSynthesizer synth = new SpeechSynthesizer();//语音
|
||||
|
||||
private void comboBoxCOM_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
private void comboBoxCOM_SelectionChanged0(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Configini.IniWritevalue("SYS", "COM0", comboBoxCOM0.SelectedValue.ToString());
|
||||
Configini.IniWritevalue("SYS", "COM1", comboBoxCOM1.SelectedValue.ToString());
|
||||
Configini.IniWritevalue("SYS", "COM2", comboBoxCOM2.SelectedValue.ToString());
|
||||
Configini.IniWritevalue("SYS", "COMP0", comboBoxCOM0.SelectedValue.ToString());
|
||||
// Configini.IniWritevalue("SYS", "COMP1", comboBoxCOM1.SelectedValue.ToString());
|
||||
// Configini.IniWritevalue("SYS", "COMP2", comboBoxCOM2.SelectedValue.ToString());
|
||||
}
|
||||
private void comboBoxCOM_SelectionChanged1(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
//Configini.IniWritevalue("SYS", "COMP0", comboBoxCOM0.SelectedValue.ToString());
|
||||
Configini.IniWritevalue("SYS", "COMP1", comboBoxCOM1.SelectedValue.ToString());
|
||||
// Configini.IniWritevalue("SYS", "COMP2", comboBoxCOM2.SelectedValue.ToString());
|
||||
}
|
||||
private void comboBoxCOM_SelectionChanged2(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
//Configini.IniWritevalue("SYS", "COMP0", comboBoxCOM0.SelectedValue.ToString());
|
||||
// Configini.IniWritevalue("SYS", "COMP1", comboBoxCOM1.SelectedValue.ToString());
|
||||
Configini.IniWritevalue("SYS", "COMP2", comboBoxCOM2.SelectedValue.ToString());
|
||||
}
|
||||
|
||||
private void comboBoxLanguage_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Configini.IniWritevalue("SYS", "Language", comboBoxLanguage.SelectedValue.ToString());
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<DataGridTextColumn Binding="{Binding IP}" Width="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding PORT}" Width="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding Serial}" Width="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding Baud}" Width="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding Station}" Width="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding ID}" Width="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding Type}" Width="0" IsReadOnly="True"/>
|
||||
</DataGrid.Columns>
|
||||
@@ -81,7 +81,7 @@
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,150,0,0" TextWrapping="Wrap" Text="IP/PORT" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||
<ComboBox HorizontalAlignment="Left" Height="40" Margin="150,200,0,0" x:Name="comboBoxCOM0" VerticalAlignment="Top" Width="200" FontSize="20" />
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,200,0,0" TextWrapping="Wrap" Text="COM" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="360,200,0,0" x:Name="BAUD" VerticalAlignment="Top" Width="60" FontSize="20" MaxLines="1" Text="57600"/>
|
||||
<TextBox HorizontalAlignment="Left" Height="40" Margin="360,200,0,0" x:Name="Station" VerticalAlignment="Top" Width="60" FontSize="20" MaxLines="1" Text="00"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="350,200,0,0" TextWrapping="Wrap" Text=":" VerticalAlignment="Top" Width="20" FontSize="25"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,250,0,0" x:Name="textlog" TextWrapping="Wrap" Text="------------" VerticalAlignment="Top" Width="140" FontSize="20"/>
|
||||
<Button Content="{x:Static lang:Resources.Save}" HorizontalAlignment="Left" Height="35" Margin="250,250,0,5" VerticalAlignment="Top" Width="80" Click="Save_Click"/>
|
||||
|
||||
@@ -35,7 +35,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
InitializeComponent();
|
||||
|
||||
// 获取所有可用串口端口,并添加到comboBoxCOM
|
||||
string[] ports = System.IO.Ports.SerialPort.GetPortNames();
|
||||
// string[] ports = System.IO.Ports.SerialPort.GetPortNames();
|
||||
string[] ports = { "PORT1", "PORT2", "PORT3" };
|
||||
comboBoxCOM0.ItemsSource = ports;
|
||||
comboBoxCOM0.Text = Configini.IniReadvalue("SYS", "COM");
|
||||
comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field<string>("name")).ToList();//转换机台
|
||||
@@ -64,7 +65,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
IP.Text = (Griddata.Columns[3].GetCellContent(Griddata.Items[rownum]) as TextBlock).Text;//定位第列,
|
||||
PORT.Text = (Griddata.Columns[4].GetCellContent(Griddata.Items[rownum]) as TextBlock).Text;//定位第列,
|
||||
comboBoxCOM0.Text = (Griddata.Columns[5].GetCellContent(Griddata.Items[rownum]) as TextBlock).Text;//定位第列,
|
||||
BAUD.Text = (Griddata.Columns[6].GetCellContent(Griddata.Items[rownum]) as TextBlock).Text;//定位第列,
|
||||
Station.Text = (Griddata.Columns[6].GetCellContent(Griddata.Items[rownum]) as TextBlock).Text;//定位第列,
|
||||
comboBoxtype.Text = (Griddata.Columns[8].GetCellContent(Griddata.Items[rownum]) as TextBlock).Text;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +87,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
dat_["PORT"] = PORT.Text;
|
||||
dat_["Serial"] = comboBoxCOM0.Text;
|
||||
dat_["Type"] = comboBoxtype.Text;
|
||||
dat_["Baud"] = BAUD.Text;
|
||||
dat_["Station"] = Station.Text;
|
||||
dat_["ID"] = 999;
|
||||
dat_["ERR"] = false;
|
||||
dat_["AUTO"] = false;
|
||||
@@ -106,7 +107,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
Machines_DAT.Add("IP", MainWindowViewModel.Machines.Rows[x]["IP"]);
|
||||
Machines_DAT.Add("PORT", MainWindowViewModel.Machines.Rows[x]["PORT"]);
|
||||
Machines_DAT.Add("Serial", MainWindowViewModel.Machines.Rows[x]["Serial"]);
|
||||
Machines_DAT.Add("Baud", MainWindowViewModel.Machines.Rows[x]["Baud"]);
|
||||
Machines_DAT.Add("Station", MainWindowViewModel.Machines.Rows[x]["Station"]);
|
||||
Machines_DAT.Add("Groups", MainWindowViewModel.Machines.Rows[x]["Groups"]);
|
||||
Machines_DAT.Add("Desktop", MainWindowViewModel.Machines.Rows[x]["Desktop"]);
|
||||
Machines_DAT.Add("Dispense", MainWindowViewModel.Machines.Rows[x]["Dispense"]);
|
||||
@@ -125,7 +126,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
dr["PORT"] = PORT.Text;
|
||||
dr["Serial"] = comboBoxCOM0.Text;
|
||||
dr["Type"] = comboBoxtype.Text;
|
||||
dr["Baud"] = BAUD.Text;
|
||||
dr["Station"] = Station.Text;
|
||||
dr.EndEdit();
|
||||
SQLiteHelpers.Delete("Machines", null, null);//
|
||||
for (int x = 0; x < MainWindowViewModel.Machines.Rows.Count; x++)
|
||||
@@ -135,7 +136,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
Machines_DAT.Add("IP", MainWindowViewModel.Machines.Rows[x]["IP"]);
|
||||
Machines_DAT.Add("PORT", MainWindowViewModel.Machines.Rows[x]["PORT"]);
|
||||
Machines_DAT.Add("Serial", MainWindowViewModel.Machines.Rows[x]["Serial"]);
|
||||
Machines_DAT.Add("Baud", MainWindowViewModel.Machines.Rows[x]["Baud"]);
|
||||
Machines_DAT.Add("Station", MainWindowViewModel.Machines.Rows[x]["Station"]);
|
||||
Machines_DAT.Add("Groups", MainWindowViewModel.Machines.Rows[x]["Groups"]);
|
||||
Machines_DAT.Add("Desktop", MainWindowViewModel.Machines.Rows[x]["Desktop"]);
|
||||
Machines_DAT.Add("Dispense", MainWindowViewModel.Machines.Rows[x]["Dispense"]);
|
||||
@@ -152,7 +153,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
IP.Text = null;
|
||||
PORT.Text = "7789";
|
||||
comboBoxCOM0.Text = null;
|
||||
BAUD.Text = "57600";
|
||||
Station.Text = "00";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -182,7 +183,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
Machines_DAT.Add("IP", MainWindowViewModel.Machines.Rows[x]["IP"]);
|
||||
Machines_DAT.Add("PORT", MainWindowViewModel.Machines.Rows[x]["PORT"]);
|
||||
Machines_DAT.Add("Serial", MainWindowViewModel.Machines.Rows[x]["Serial"]);
|
||||
Machines_DAT.Add("Baud", MainWindowViewModel.Machines.Rows[x]["Baud"]);
|
||||
Machines_DAT.Add("Station", MainWindowViewModel.Machines.Rows[x]["Station"]);
|
||||
Machines_DAT.Add("Groups", MainWindowViewModel.Machines.Rows[x]["Groups"]);
|
||||
Machines_DAT.Add("Desktop", MainWindowViewModel.Machines.Rows[x]["Desktop"]);
|
||||
Machines_DAT.Add("Dispense", MainWindowViewModel.Machines.Rows[x]["Dispense"]);
|
||||
@@ -218,7 +219,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
{
|
||||
if (comboBoxtype.Text == "828")
|
||||
{
|
||||
if (!string.IsNullOrEmpty(comboBoxCOM0.Text) && !string.IsNullOrEmpty(BAUD.Text))
|
||||
if (!string.IsNullOrEmpty(comboBoxCOM0.Text) && !string.IsNullOrEmpty(Station.Text))
|
||||
{
|
||||
textlog.Text = "TEST";
|
||||
textlog.Foreground = new SolidColorBrush(Color.FromRgb(0, 0, 255));
|
||||
|
||||
Reference in new issue
Block a user