Bläddra i källkod

20230105, huli test

yct 2 år sedan
förälder
incheckning
2131434547

+ 5 - 2
exit.sh

@@ -7,7 +7,7 @@ yct_proc=$(ps -ef|grep measure_wj|grep -v grep|awk '{print $2}')
 zzw_proc=$(ps -ef|grep zzw|grep -v grep|awk '{print $2}')
 
 # huli
-huli_proc=$(ps -ef|grep 'terminal '|grep -v grep|awk '{print $2}')
+#huli_proc=$(ps -ef|grep 'terminal '|grep -v grep|awk '{print $2}')
 
 # wk
 wk_proc=$(ps -ef|grep wk|grep -v grep|grep -v awk|awk '{print $2}')
@@ -20,7 +20,10 @@ p3=$(ps -ef|grep node.py|grep -v grep|grep -v awk|awk '{print $2}')
 
 if [ $(echo $yct_proc|wc -L) -gt 0 -o $(echo $zzw_proc|wc -L) -gt 0 -o $(echo $huli_proc|wc -L) -gt 0 -o $(echo $wk_proc|wc -L) -gt 0 -o $(echo $bash_proc|wc -L) -gt 0 ] ; then
 	echo "chutian nodes ready to kill" $yct_proc "|| " $zzw_proc "|| " $huli_proc "|| " $wk_proc "|| " $bash_proc
-	kill $yct_proc $zzw_proc $huli_proc $wk_proc $bash_proc
+	kill $yct_proc $zzw_proc $wk_proc $bash_proc 
 else
 	echo "cannot find node to kill"
 fi
+
+
+#$huli_proc

+ 1 - 0
plc调度节点/dispatch/dispatch_command.cpp

@@ -765,6 +765,7 @@ Error_manager Dispatch_command::update_parkspace_info_clear_car_number()
 	//执行sql操作
 	char update_space_sql[1024];
 	memset(update_space_sql, 0, 1024);
+	//	sprintf(update_space_sql, "update space set car_number = null, statu = 1 where car_number = '%s' ",
 	sprintf(update_space_sql, "update space set car_number = null where car_number = '%s' ",
 			m_dispatch_command_map[m_car_number_optimal].m_car_number.c_str());
 	Error_manager ec = Database_controller::get_instance_pointer()->sql_update(update_space_sql);

+ 17 - 0
plc调度节点/dispatch/dispatch_ground_lidar.cpp

@@ -64,6 +64,7 @@ Error_manager Dispatch_ground_lidar::dispatch_ground_lidar_uninit()
 //	return Error_code::SUCCESS;
 //}
 
+
 //调度地面雷达 执行状态消息
 Error_manager Dispatch_ground_lidar::execute_for_ground_status_msg_new(measure_info &t_measure_info)
 {
@@ -71,9 +72,25 @@ Error_manager Dispatch_ground_lidar::execute_for_ground_status_msg_new(measure_i
 	m_measure_info = t_measure_info;
 	m_ground_status_msg_updata_time = std::chrono::system_clock::now();
 	m_ground_status_msg_updata_flag = true;
+	//胡力 新增 接受雷达雷达 通信周期 超过1秒就打印
+	int time_key = 10+m_ground_lidar_id;
+	Time_tool::get_instance_references().time_end(time_key);
+	if ( Time_tool::get_instance_references().timetool_map.find(time_key)!=Time_tool::get_instance_references().timetool_map.end() )
+	{
+		if ( Time_tool::get_instance_references().timetool_map[time_key].t_time_difference >= std::chrono::milliseconds(1) )
+		{
+			Time_tool::get_instance_references().cout_time_microsecond(time_key);
+            double dieoutTime=(double)Time_tool::get_instance_references().timetool_map[time_key].t_time_difference.count()/1000000;
+//            std::cout << "计时器:"<<key<<" 计时的时间为:" <<dieoutTime<<" 毫秒" << std::endl;
+            LOG(INFO) << "计时器:"<<time_key<<" 计时的时间为:" <<dieoutTime<<" 毫秒" << " --- " << this;
+		}
+	}
+	Time_tool::get_instance_references().time_start(time_key);
+	//胡力 新增 接受雷达雷达 通信周期 超过1秒就打印
 	return Error_code::SUCCESS;
 }
 
+
 Dispatch_ground_lidar::Dispatch_ground_lidar_status Dispatch_ground_lidar::get_dispatch_ground_lidar_status()
 {
 	return m_dispatch_ground_lidar_status;

+ 9 - 4
出口单片机节点/DatabaseSearchPickCmd.py

@@ -24,25 +24,30 @@ class DBSeacherPickCmd():
         self._close=True
         self.join()
         self.conn.close()
+
+
     def search_pickcmd(self):
-        self.conn.begin()
+    #    self.conn.begin()
         cursor=self.conn.cursor()
         SQL="select * from command_queue where statu=2 "    #寻找已到出口的取车指令
         cursor.execute(SQL)
         pick_cmds=cursor.fetchall()
-        cursor.close()
+
         self.conn.commit()
+        cursor.close()
         return pick_cmds
 
+
     def delete_cmd(self,id):
-        self.conn.begin()
+     #   self.conn.begin()
         cursor=self.conn.cursor()
         SQL1="select * from command_queue for update"
         cursor.execute(SQL1)
         SQL2="delete from command_queue where statu=2 and export_id=%d"%id
         cursor.execute(SQL2)
-        cursor.close()
+
         self.conn.commit()
+        cursor.close()
 
 '''
     def run(self):

+ 9 - 8
出口单片机节点/ExportIO.py

@@ -80,6 +80,7 @@ class ExportIO(threading.Thread):
                             self._user_leave_callback(self._id)
                             self._open_door_flag = False
                             self._retry_count = self._retry_count + 1
+                            print(" _retry_count = %d"%self._retry_count)
                     else:#else  无限等待,什么也不做,  等待汽车离开
                         self._retry_count = 0
 
@@ -102,15 +103,15 @@ class ExportIO(threading.Thread):
         print("Connected to {}:{}".format(self._ip, self._port))
         return reader, writer
     async def recv_loop(self):
-        if (self._id == 5):
-            print(" test 1 ")
+    #    if (self._id == 5):
+    #        print(" test 1 ")
         while self._close==False:
-            if (self._id == 5):
-                print(" test 2 ")
+     #       if (self._id == 5):
+     #           print(" test 2 ")
             try:
                 recieve=await self._reader.readuntil(b'$')
-                if (self._id == 5):
-                    print(" 00 recieve = " + str(recieve))
+    #            if (self._id == 5):
+     #               print(" 00 recieve = " + str(recieve))
             except Exception as e:
                 print("self._reader.readuntil(b'$') error")
                 print("  e: {}".format(e))
@@ -130,8 +131,8 @@ class ExportIO(threading.Thread):
                         print("self._latest_iomsg error")
                         continue
                     else:
-                        if (self._id == 5):
-                            print(" 11 recieve = " + str(recieve))
+                     #   if (self._id == 5):
+                     #       print(" 11 recieve = " + str(recieve))
                         ex_name = "statu_ex"
                         key = "out_mcpu_%d_statu_port" % self._id
                         self._rabbit_mq.publish(ex_name, key, tf.MessageToString(self._latest_iomsg, as_utf8=True))

+ 4 - 1
出口单片机节点/node.py

@@ -36,6 +36,8 @@ def user_leave_callback(id):
 
 
 if __name__=="__main__":
+    print("出口 danpianji")
+
     for parameter in mcpu_paramters:
         id=parameter[1]
         if not g_exports.get(id)==None:
@@ -57,7 +59,7 @@ if __name__=="__main__":
                 table.unit_id=cmd[2]
                 table.queue_id=cmd[3]
                 table.export_id=cmd[8]
-                # print(table)
+                print(table)
                 if not table.export_id==None:
                     export=g_exports.get(table.export_id)
                     if not export==None:
@@ -66,6 +68,7 @@ if __name__=="__main__":
                             export.open_door(table)
                         else :
                             g_db.close()
+                            print("database restart")
                             g_db.__init__(db_parameter["ip"],db_parameter["port"],db_parameter["dbname"],
                                           db_parameter["user"],db_parameter["password"])