Commit dbda18bc 几米阳光

波特率改为可配置

1 个父辈 a698bebd
......@@ -35,6 +35,7 @@
<add key ="Config_Pwd" value ="123456"/>
<!--出库等待料盘拿走的时间,秒-->
<add key ="OutStoreWaitSeconds" value ="600"/>
<add key ="ACBaudRate" value ="4800"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -39,8 +39,9 @@
伺服波特率改为可配置:
LDACSingleStore.exe.config增加配置:
<add key ="ACBaudRate" value ="4800"/>
......
......@@ -75,5 +75,10 @@ namespace OnlineStore.Common
/// 出库等待料盘拿走的时间,秒
/// </summary>
public static string OutStoreWaitSeconds = "OutStoreWaitSeconds";
/// <summary>
/// 伺服波特率
/// </summary>
public static string ACBaudRate = "ACBaudRate";
}
}
......@@ -77,7 +77,8 @@ namespace OnlineStore.DeviceLibrary
{
return true ;
}
AcSerialBean bean = new AcSerialBean(portName, 9600, Parity.Even, 8, StopBits.One);
int ACBaudRate = ConfigAppSettings.GetIntValue(Setting_Init.ACBaudRate);
AcSerialBean bean = new AcSerialBean(portName, ACBaudRate, Parity.Even, 8, StopBits.One);
bool result = bean.openPort();
if (!result)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!