|
@@ -1,4 +1,7 @@
|
|
|
-using System;
|
|
|
+#define ENABLE_PACK
|
|
|
+
|
|
|
+
|
|
|
+using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.ComponentModel;
|
|
|
using System.Data;
|
|
@@ -22,6 +25,8 @@ using RabbitMQ.Client.Events;
|
|
|
|
|
|
namespace ct_terminal
|
|
|
{
|
|
|
+
|
|
|
+
|
|
|
public partial class MainForm : Form
|
|
|
{
|
|
|
//自适应窗口大小
|
|
@@ -81,22 +86,24 @@ namespace ct_terminal
|
|
|
string t_pick_queue_key = "pick_response_" + m_ternimalID.ToString() + "_queue";
|
|
|
m_pick_consumer.consumer_init(m_rabbitmq_ip, m_rabbitmq_port, m_rabbitmq_user, m_rabbitmq_password, t_pick_queue_key, pick_response_thread);
|
|
|
|
|
|
- //this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn_gray.BackgroundImage.png");
|
|
|
- //this.parkingBtn.Enabled = false;
|
|
|
-
|
|
|
- //获取号牌线程
|
|
|
- m_car_number = new NumMachine.NumMachineLinker();
|
|
|
- m_car_number_condition = true;
|
|
|
- m_car_number_thread = new Thread(get_car_number_thread);
|
|
|
|
|
|
- //初始化打印机
|
|
|
- PrintManual.Instance.PrintManualInit();
|
|
|
|
|
|
- //初始化消费指令
|
|
|
- string t_park_queue_key = "park_response_" + m_ternimalID.ToString() + "_queue";
|
|
|
- m_park_consumer.consumer_init(m_rabbitmq_ip, m_rabbitmq_port, m_rabbitmq_user, m_rabbitmq_password, t_park_queue_key, park_response_thread);
|
|
|
+#if ENABLE_PACK
|
|
|
+ //获取号牌线程
|
|
|
+ m_car_number = new NumMachine.NumMachineLinker();
|
|
|
+ m_car_number_condition = true;
|
|
|
+ m_car_number_thread = new Thread(get_car_number_thread);
|
|
|
|
|
|
+ //初始化打印机
|
|
|
+ PrintManual.Instance.PrintManualInit();
|
|
|
|
|
|
+ //初始化消费指令
|
|
|
+ string t_park_queue_key = "park_response_" + m_ternimalID.ToString() + "_queue";
|
|
|
+ m_park_consumer.consumer_init(m_rabbitmq_ip, m_rabbitmq_port, m_rabbitmq_user, m_rabbitmq_password, t_park_queue_key, park_response_thread);
|
|
|
+#else
|
|
|
+ this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn_gray.BackgroundImage.png");
|
|
|
+ this.parkingBtn.Enabled = false;
|
|
|
+#endif
|
|
|
}
|
|
|
private void MainForm_Load(object sender, EventArgs e)
|
|
|
{
|
|
@@ -115,6 +122,7 @@ namespace ct_terminal
|
|
|
//启动接受反馈
|
|
|
m_pick_consumer.run();
|
|
|
|
|
|
+#if ENABLE_PACK
|
|
|
//启动号牌机
|
|
|
m_car_number.Start();
|
|
|
m_car_number_thread.Start();
|
|
@@ -134,6 +142,7 @@ namespace ct_terminal
|
|
|
}
|
|
|
catch (Exception) { }
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
}
|
|
|
public string startNumer(Random r)
|
|
@@ -175,10 +184,10 @@ namespace ct_terminal
|
|
|
if (m_producer.send(park_Table.ToText(), "command_ex", "user_command_port") == false)
|
|
|
{
|
|
|
MessageBoxEe messageBoxEe = new MessageBoxEe();
|
|
|
- messageBoxEe.Show("服务器连接失败!请重试,无效后联系管理人员!");
|
|
|
+ messageBoxEe.Show("服务器连接失败!请联系管理员!");
|
|
|
return;
|
|
|
}
|
|
|
- this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn_gray.BackgroundImage.png");
|
|
|
+ //this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn_gray.BackgroundImage.png");
|
|
|
this.parkingBtn.Enabled = false;
|
|
|
while (!m_park_command_response.IsTimeout())
|
|
|
{
|
|
@@ -214,7 +223,7 @@ namespace ct_terminal
|
|
|
messageBoxEe.Show("反馈解析失败!\n" + ex.StackTrace);
|
|
|
}
|
|
|
m_park_command_response = "";
|
|
|
- this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn.BackgroundImage.png");
|
|
|
+ //this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn.BackgroundImage.png");
|
|
|
this.parkingBtn.Enabled = true;
|
|
|
return;
|
|
|
|
|
@@ -222,11 +231,11 @@ namespace ct_terminal
|
|
|
if (m_park_command_response.IsTimeout() && m_park_command_response.Value == "")
|
|
|
{
|
|
|
MessageBoxEe messageBoxEe = new MessageBoxEe();
|
|
|
- messageBoxEe.Show("反馈超时,请联系管理员!");
|
|
|
+ messageBoxEe.Show("反馈超时,请重试或联系管理员!");
|
|
|
}
|
|
|
m_park_command_response = "";
|
|
|
|
|
|
- this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn.BackgroundImage.png");
|
|
|
+ //this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn.BackgroundImage.png");
|
|
|
|
|
|
this.parkingBtn.Enabled = true;
|
|
|
|
|
@@ -253,10 +262,10 @@ namespace ct_terminal
|
|
|
if (m_producer.send(pick_Table.ToText(), "command_ex", "user_command_port") == false)
|
|
|
{
|
|
|
MessageBoxEe messageBoxEe = new MessageBoxEe();
|
|
|
- messageBoxEe.Show("服务器连接失败!请重试,无效后联系管理人员!");
|
|
|
+ messageBoxEe.Show("服务器连接失败!请联系管理员!");
|
|
|
return;
|
|
|
}
|
|
|
- this.pickupBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "fetchingBtn_gray.BackgroundImage.png");
|
|
|
+ //this.pickupBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "fetchingBtn_gray.BackgroundImage.png");
|
|
|
this.pickupBtn.Enabled = false;
|
|
|
while (!m_pick_command_response.IsTimeout())
|
|
|
{
|
|
@@ -282,10 +291,10 @@ namespace ct_terminal
|
|
|
if (m_pick_command_response.IsTimeout()&& m_pick_command_response.Value == "")
|
|
|
{
|
|
|
MessageBoxEe messageBoxEe = new MessageBoxEe();
|
|
|
- messageBoxEe.Show("反馈超时,请联系管理员!");
|
|
|
+ messageBoxEe.Show("反馈超时,请重试或联系管理员!");
|
|
|
}
|
|
|
m_pick_command_response = "";
|
|
|
- this.pickupBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "fetchingBtn.BackgroundImage.png");
|
|
|
+ //this.pickupBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "fetchingBtn.BackgroundImage.png");
|
|
|
this.pickupBtn.Enabled = true;
|
|
|
}
|
|
|
//停车反馈线程
|
|
@@ -324,6 +333,7 @@ namespace ct_terminal
|
|
|
|
|
|
//关闭播放器
|
|
|
m_mediaPlayer.mediaplayer_uninit();
|
|
|
+#if ENABLE_PACK
|
|
|
//关闭打印机
|
|
|
PrintManual.Instance.Close();
|
|
|
//关闭号牌机连接
|
|
@@ -333,6 +343,7 @@ namespace ct_terminal
|
|
|
{
|
|
|
m_car_number_thread.Abort();
|
|
|
}
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|