Browse Source

2022/12/09 终端增加实时发送号码牌

wk 2 years ago
parent
commit
0fe6c1ee7a

+ 1 - 0
打包命令.txt

@@ -0,0 +1 @@
+pyinstaller -w -F node.py

File diff suppressed because it is too large
+ 0 - 3164
终端/Message.cs


+ 23 - 6
终端/ct_terminal/ct_terminal/MainForm.cs

@@ -59,6 +59,7 @@ namespace ct_terminal
         private DateTime m_pick_command_time = DateTime.Now;
         private Process m_process = null;
 
+        private static readonly object Lock = new object();
         public MainForm()
         {
             InitializeComponent();
@@ -147,12 +148,10 @@ namespace ct_terminal
 
         private void parkingBtn_Click(object sender, EventArgs e)
         {
-   
             string car_license = "";
             //Random r = new Random();
             //car_license = startNumer(r);
             //Console.WriteLine(car_license);
-
             if (m_timed_car_license.IsTimeout() == false && m_timed_car_license.Value != "")
             {
                 car_license = m_timed_car_license.Value;
@@ -175,7 +174,7 @@ namespace ct_terminal
             park_Table.TerminalId = m_ternimalID;
             park_Table.UnitId = m_unitID;
             park_Table.CarNumber = car_license;
-            m_producer.send(park_Table.ToText(),"command_ex", "user_command_port");
+            m_producer.send(park_Table.ToText(), "command_ex", "user_command_port");
             m_park_command_time = DateTime.Now;
             this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn_gray.BackgroundImage.png");
             this.parkingBtn.Enabled = false;
@@ -199,7 +198,10 @@ namespace ct_terminal
                             MessageBoxEe messageBoxEe = new MessageBoxEe();
                             messageBoxEe.Show(response_Table.CarNumber + " 停车成功,请取走您的小票!");
                             //停车成功需要清除车牌号
-                            m_timed_car_license.Value = "";
+                            lock (Lock)
+                            {
+                                m_timed_car_license = "";
+                            }
                         }
                     }
                     catch (Exception ex)
@@ -219,6 +221,7 @@ namespace ct_terminal
                 messageBoxEe.Show("反馈超时,请联系管理员!");
             }
             m_park_command_response = "";
+
             this.parkingBtn.BackgroundImage = Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory + "./Resource/" + "parkingBtn.BackgroundImage.png");
             this.parkingBtn.Enabled = true;
         }
@@ -337,10 +340,24 @@ namespace ct_terminal
                 Console.WriteLine(number=number);
                 if (number != null && number != "")
                 {
-                    m_timed_car_license = number;
-                    m_timed_car_license.Set_timeout_ms(int.MaxValue);
+                    lock (Lock)
+                    {
+                        m_timed_car_license = number;
+                        m_timed_car_license.Set_timeout_ms(int.MaxValue);
+                    }
+
                  //   MessageBoxEe.Show(m_timed_car_license.Value);
                 }
+                if (!m_timed_car_license.IsTimeout() && m_timed_car_license.Value != "")
+                {
+                    terminal_node_statu terminal_Node_Statu = new terminal_node_statu();
+                    terminal_Node_Statu.TerminalId = m_ternimalID;
+                    terminal_Node_Statu.CarNumber = m_timed_car_license.Value;
+                    m_producer.send(terminal_Node_Statu.ToText(), "statu_ex", "terminal_node_" + m_ternimalID.ToString() + "_statu_port");
+                }
+
+
+
                 Thread.Sleep(500);
             }
         }

File diff suppressed because it is too large
+ 1122 - 200
终端/ct_terminal/ct_terminal/Message.cs


+ 1 - 1
终端/ct_terminal/ct_terminal/tool/print/Printer.cs

@@ -25,7 +25,7 @@ namespace tool
         public Printer(Image _img, PrintDocument _document, string _context)
         {
             img = _img;
-            //document = _document;
+            document = _document;
             context = _context;
         }
         public void Print()

+ 0 - 4
终端/ct_terminal/ct_terminal/tool/time_data/TimedData.cs

@@ -36,10 +36,6 @@ namespace tool
 
         public Data_type Value
         {
-            set
-            {
-                m_data = value;
-            }
             get
             {
                 return m_data;