|
@@ -45,35 +45,31 @@ struct area_business_factory
|
|
|
};
|
|
|
|
|
|
|
|
|
- 确定需要推送人员
|
|
|
- 人员推送哪个区域,存储在card_localtion_base上,每次调用前清空,该类只将优先级最高的区域设定给该值即可
|
|
|
+ 确定推送人员信息时的区域,每一个明确需要推送的区域,都要推送
|
|
|
*/
|
|
|
-
|
|
|
struct area_business_post_area:area_business
|
|
|
{
|
|
|
virtual int area_business_type()
|
|
|
{
|
|
|
return 1;
|
|
|
}
|
|
|
-
|
|
|
- virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+
|
|
|
+ virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- virtual void on_hover(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
+
|
|
|
+ virtual void on_leave(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
-
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
|
|
|
判断车辆超速,确定超速后记录日志、数据库并告警
|
|
|
每张卡在每个区域的超速相关的数据信息记录在 area_hover 对象
|
|
|
人员&车辆的代码重用,请自行设计
|
|
|
*/
|
|
|
-
|
|
|
struct area_business_speed_checker:area_business
|
|
|
{
|
|
|
virtual int area_business_type()
|
|
@@ -81,14 +77,15 @@ struct area_business_speed_checker:area_business
|
|
|
return 4;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+
|
|
|
+
|
|
|
+ virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
virtual void on_hover(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
@@ -111,19 +108,14 @@ struct area_business_restricted:area_business
|
|
|
|
|
|
return 7;
|
|
|
}
|
|
|
-
|
|
|
- virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+
|
|
|
+ virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> )
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- virtual void on_hover(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- virtual void on_leave(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
+
|
|
|
+ virtual void on_leave(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> )
|
|
|
{
|
|
|
}
|
|
|
};
|
|
@@ -138,13 +130,17 @@ struct area_business_monkey_area:area_business
|
|
|
|
|
|
return 8;
|
|
|
}
|
|
|
-
|
|
|
- virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+
|
|
|
+ virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ virtual void on_hover(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
virtual void on_leave(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
}
|
|
@@ -153,7 +149,6 @@ struct area_business_monkey_area:area_business
|
|
|
|
|
|
车辆考勤
|
|
|
*/
|
|
|
-
|
|
|
struct area_business_car_attendance:area_business
|
|
|
{
|
|
|
virtual int area_business_type()
|
|
@@ -161,13 +156,13 @@ struct area_business_car_attendance:area_business
|
|
|
return 6;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+
|
|
|
+ virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
virtual void on_leave(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
}
|
|
@@ -176,7 +171,6 @@ struct area_business_car_attendance:area_business
|
|
|
|
|
|
人员考勤
|
|
|
*/
|
|
|
-
|
|
|
struct area_business_person_attendance:area_business
|
|
|
{
|
|
|
virtual int area_business_type()
|
|
@@ -185,7 +179,7 @@ struct area_business_person_attendance:area_business
|
|
|
|
|
|
}
|
|
|
|
|
|
- virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+ virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
|
}
|
|
@@ -199,6 +193,7 @@ struct area_business_person_attendance:area_business
|
|
|
|
|
|
判断当前区域a中的人数是否超过设定人数,超过后告警
|
|
|
区域内实时人数存储在area对象中,在当前类on_enter/on_leave中进行更新
|
|
|
+ 整个井下的超员和某个区域的超员都使用这个代码
|
|
|
*/
|
|
|
struct area_business_count_checker:area_business
|
|
|
{
|
|
@@ -208,7 +203,7 @@ struct area_business_count_checker:area_business
|
|
|
|
|
|
}
|
|
|
|
|
|
- virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+ virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
|
}
|
|
@@ -220,26 +215,26 @@ struct area_business_count_checker:area_business
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+
|
|
|
|
|
|
判断当前区域a中的人卡停留时间
|
|
|
人员进入区域时间存储在area_hover对象中,在当前类on_enter/on_leave中进行更新
|
|
|
人员&车辆的代码重用,请自行设计
|
|
|
*/
|
|
|
-
|
|
|
struct area_business_person_dwell_checker:area_business
|
|
|
{
|
|
|
virtual int area_business_type()
|
|
|
{
|
|
|
return 2;
|
|
|
}
|
|
|
-
|
|
|
- virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+
|
|
|
+ virtual void on_enter(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- virtual void on_hover(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>*ptr)
|
|
|
+
|
|
|
+ virtual void on_hover(std::shared_ptr<area_hover>&a,std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
|
|
|
{
|
|
|
|
|
|
}
|