添加语言功能及相关设置
This commit is contained in:
commit
3d64a4474d
11 files changed
+119
-6
No files matched your search
@@ -28,6 +28,11 @@
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,375,0,0" x:Name="textlog" TextWrapping="Wrap" Text="------------" VerticalAlignment="Top" Width="140" FontSize="20"/>
|
||||
<CheckBox x:Name="dDispenser" Content="{x:Static lang:Resources.LinkDispenser}" HorizontalAlignment="Left" Height="35 " Margin="410,10,0,0" VerticalAlignment="Top" Width="200"
|
||||
Checked="dDispenser_Checked" Unchecked="dDispenser_Checked" FontSize="20"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,450,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Speed}" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||
<TextBox x:Name="VOICE_V1" HorizontalAlignment="Left" Height="40" Margin="150,450,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="200" FontSize="16"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,490,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Vol}" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||
<TextBox x:Name="VOICE_V2" HorizontalAlignment="Left" Height="40" Margin="150,490,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="200" FontSize="16"/>
|
||||
<Button Content="{x:Static lang:Resources.VOICE}" HorizontalAlignment="Left" Height="35" Margin="270,535,0,0" VerticalAlignment="Top" Width="80" Click="VOICE_Click"/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,9 +1,11 @@
|
||||
using SunlightCentralizedControlManagement_SCCM_.UserClass;
|
||||
using ScottPlot.TickGenerators.TimeUnits;
|
||||
using SunlightCentralizedControlManagement_SCCM_.UserClass;
|
||||
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Speech.Synthesis;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -50,11 +52,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
TEXT_SQLUSER.Text = Configini.IniReadvalue("SQL_SERVER", "SQL4");
|
||||
TEXT_SQLPASWORD.Text = Configini.IniReadvalue("SQL_SERVER", "SQL5");
|
||||
dDispenser.IsChecked = Convert.ToBoolean(Configini.IniReadvalue("SYS", "DyelotsDispenser"));
|
||||
VOICE_V1.Text = Configini.IniReadvalue("VOICE", "V1");
|
||||
VOICE_V2.Text = Configini.IniReadvalue("VOICE", "V2");
|
||||
}
|
||||
catch (Exception ex) { LogGing.ERRDATA(ex); }
|
||||
}
|
||||
//调用配置文件
|
||||
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)
|
||||
{
|
||||
@@ -118,5 +123,18 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
Configini.IniWritevalue("SYS", "DyelotsDispenser", dDispenser.IsChecked.ToString());
|
||||
MainWindowViewModel.DyelotsDispenser = (bool)dDispenser.IsChecked;
|
||||
}
|
||||
|
||||
private void VOICE_Click(object sender, RoutedEventArgs e)//语言测试按钮
|
||||
{
|
||||
try
|
||||
{
|
||||
synth.Rate = int.Parse(VOICE_V1.Text);
|
||||
synth.Volume = int.Parse(VOICE_V2.Text);
|
||||
synth.SpeakAsync(Properties.Resources.TESTVOICE);
|
||||
Configini.IniWritevalue("VOICE", "V1", VOICE_V1.Text);
|
||||
Configini.IniWritevalue("VOICE", "V2", VOICE_V2.Text);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
dyelot= MainWindowViewModel.dyelot;
|
||||
machin_LOG.Text = MainWindowViewModel.machin_LOG;
|
||||
IsInteractive = false;
|
||||
DATA_view();
|
||||
DATA_view();
|
||||
|
||||
}
|
||||
|
||||
private string machine;
|
||||
|
||||
Reference in new issue
Block a user