基于html5 拖拽连线加强版实现_html5 坐标之间连线-程序员宅基地

技术标签: canvas  html5  

    自动折线,自动判断起始点坐标,拖拽位置变换,大小拖拽,箭头指向等功能,这个版本稍微复杂一点,

还有个简单版本的实现http://zha-zi.iteye.com/blog/1586814 这个应该比较容易理解坐标换算不太多

<!DOCTYPE HTML>
<html>
  <head>
    <style>
      body {
        margin: 0px;
        padding: 0px;
      }
      canvas {
        border: 1px solid #9C9898;
      }
    </style>
    	<script type="text/javascript" src="ext/bootstrap.js"></script> 		
		<!-- ENDLIBS -->
		<script type="text/javascript" src="ext/ext-all-debug.js"></script>
    <script src="js/kinetic-v3.10.2.min.js"></script>
    <script>
    
    Ext.onReady(function(){
    	/**
			自动折叠连线算法
		*/   
       
       var stage=new Kinetic.Stage({
       		container:'container',
       		width:1000,
       		height:1000
       });
       /**
       		箭头角度
       */
       var arrowAngle=30;
       /**
       		箭头半径
       */
       
       var arrowRadius=5;
       /**
        	箭头长度
       */
       var arrowLenght=10;
       /**
       		表示方向
       */
       var E="E";
       var W="W";
       var S="S";
       var N="N";
       var layer=new Kinetic.Layer();
       var flag=false;
       var imgArray=[]; 
       var lineArray=[];
       var tmpMoveImg=null;
       var loop=0;
       function  Pos(x,y){
       		this.x=x;
       		this.y=y;
       }; 
       /**
       		img 图像
       		lineArrow 带有箭头的line
       		flag 图像与箭头的指向关系
       */
       function LineImage(img,lineArrow,flag){
       		this.img=img;
       		this.lineArrow=lineArrow;
       		this.flag=flag
       };
       
       function LineArrow(line,arrow){
       		this.line=line;
       		this.arrow=arrow;
       };
       function NewImage(img,opsArray,group){
       		this.img=img;
       		this.group=group;
       		this.opsArray=opsArray; 
       };
        
       var imgA= new Image();
       var imgObjA;
       var groupA;
       imgA.οnlοad=function(){
	       imgObjA= createImage(imgA,100,100,100,100)
           var array=new Array(); 
          
           groupA=new Kinetic.Group({ 
       			draggable:true
           }); 
	       groupA.add(imgObjA); 
	       layer.add(groupA);
	       addAnchor(groupA, 100, 100, "topLeft");
	       addAnchor(groupA, 200, 100, "topRight");
	       addAnchor(groupA, 200, 200, "bottomRight");
	       addAnchor(groupA, 100, 200, "bottomLeft");
	       var na=new  NewImage(imgObjA,array,groupA); 
           imgArray.push(na); 
       	   stage.add(layer); 
       } 
       
       var imgB= new Image();
       var imgObjB;
       var groupB;
       imgB.οnlοad=function(){
       	   imgObjB= createImage(imgB,400,400,100,100)
       	   var array=new Array(); 
          
       	   groupB=new Kinetic.Group({ 
       			draggable:true
           }); 
	       groupB.add(imgObjB); 
	       layer.add(groupB);
	       addAnchor(groupB, 400, 400, "topLeft");
	       addAnchor(groupB, 500, 400, "topRight");
	       addAnchor(groupB, 500, 500, "bottomRight");
	       addAnchor(groupB, 400, 500, "bottomLeft");
	       var nb=new  NewImage(imgObjB,array,groupB);
           imgArray.push(nb);
           
       	   stage.add(layer); 
       } 
       
       var imgC= new Image();
       var imgObjC;
       var groupC;
       imgC.οnlοad=function(){ 
       	   imgObjC= createImage(imgC,700,100,100,100) 
           var array=new Array(); 
         
       	   groupC=new Kinetic.Group({ 
       			draggable:true
           }); 
	       groupC.add(imgObjC); 
	       layer.add(groupC);
	       addAnchor(groupC, 700, 100, "topLeft");
	       addAnchor(groupC, 800, 100, "topRight");
	       addAnchor(groupC, 800, 200, "bottomRight");
	       addAnchor(groupC, 700, 200, "bottomLeft");
	       var nc=new  NewImage(imgObjC,array,groupC); 
           imgArray.push(nc);
	       
       	   stage.add(layer); 
       }  
       
       
       var rect=new Kinetic.Rect({
       		x:0,
       		y:0,
       		width:1000,
       		height:1000,
       		fill:'white',
       		storke:'red',
       		storkeWidth:5
       		
       });
       layer.add(rect); 
       imgA.src='img/db.png'; 
       imgB.src='img/mj.png'; 
       imgC.src="img/kt1.png";
      
      
       
       rect.on('dblclick',function(){
       		
       		if(loop%2==0){
       			flag=true;
       			for(var i=0;i<imgArray.length;i++){
       				imgArray[i].group.setDraggable(false);
       				
       			}
       		}else{
       			flag=false;
       		 
       			for(var i=0;i<imgArray.length;i++){
       			   
       				imgArray[i].group.setDraggable(true);
       				imgArray[i].img.on('mouseover',function(){
       					
       					var p=new Pos(this.getAbsolutePosition().x,this.getAbsolutePosition().y);
       					tmpMoveImg=getImgByPos(p); 
       					
       				});
       				
       				imgArray[i].group.on('dragmove',function(){ 
       						
       				   		for(var j=0;j<tmpMoveImg.opsArray.length;j++){
				        	    var realPoints=[];  
				        	    
				        	    if(tmpMoveImg.opsArray[j].flag){
				        	    	calculateStartEndPos(tmpMoveImg.opsArray[j].img,this.children[0],realPoints);
				        	    }else{
				        	    	calculateStartEndPos(this.children[0],tmpMoveImg.opsArray[j].img,realPoints);
				        	    } 
					        	tmpMoveImg.opsArray[j].lineArrow.line.setPoints(realPoints); 
					        	var arrowPoint= calculateArrowPointsByPoints(realPoints);
					        	tmpMoveImg.opsArray[j].lineArrow.arrow.setPoints(arrowPoint);  
				       			layer.draw(); 
				       			realPoints=[]; 
				        	}
				        	layer.draw(); 
				    });
				    imgArray[i].group.on('dragmove',function(){
				    	 for(var j=0;j<lineArray.length;j++){
				    	 	//lineArray[j].hide();
				    	 	//moveLineToTarget(lineArray[j])
				    	 }
				    });
				   
				   
       			}
       		}
       		loop++;
       		
       		for(var i=0;i<imgArray.length;i++){
	       		var innerFlag=false;
	       		var points=[];//标记性的点,为了获取img 使用
	       		var realPoints=[];//真正计算后合理的划线点
	       		imgArray[i].img.on('mousedown',function(){
	       			 
	       			 if(flag){
	       			 	var pos= stage.getMousePosition();  
	       			 	points=[];
	       			 	points.push(this.getAbsolutePosition().x);
	       			 	points.push(this.getAbsolutePosition().y);
	       			 	innerFlag=true;
	       			 }
	       		});
	       		imgArray[i].img.on('mouseup',function(){
	       			 if(flag&&innerFlag){
	       			 	var pos= stage.getMousePosition();  
	       			 	points.push(this.getAbsolutePosition().x);
	       			 	points.push(this.getAbsolutePosition().y);
	       			  	//起始点
	       		 	    var p=new Pos(points[0],points[1]);
	       		 	    //结束点 
	       		 	    var op=new Pos(points[2],points[3]); 
	       		 	 	// 划线起始图像
						var opImg=getImgByPos(p);
						// 划线结束图像 
						var owImg=getImgByPos(op); 
						 
						if(opImg!=owImg){ 
							calculateStartEndPos(opImg.img,owImg.img,realPoints);
		       			  	var lineArrow= createLine(realPoints); 
							var opLine=new LineImage(opImg.img,lineArrow,true);
							var owLine=new LineImage(owImg.img,lineArrow,false);  
							owImg.opsArray.push(opLine); 
							opImg.opsArray.push(owLine); 
		       		 	    flag=false;
		       		 	    innerFlag=false;
		       		 	    points=[];
		       		 	    realPoints=[]; 
		       		 	    lineArray.push(lineArrow);
		       		 	    layer.add(lineArrow.line); 
		       		 	    
		       		 	    layer.add(lineArrow.arrow);
		       		 	    layer.draw(); 
		       		 	    bandEventToLine(lineArrow.line);
		       		 	    
						} 
						
	       		 	    
       			     }
       		   });
            }
       })
       /**
       * 通过坐标获取Img对象
       */
       function getImgByPos(pos){ 
       		for(var i=0;i<imgArray.length;i++){ 
       			if(imgArray[i].img.getAbsolutePosition().x==pos.x&&imgArray[i].img.getAbsolutePosition().y==pos.y){ 
       				return imgArray[i]; 
       			}
       		} 
       }
       /**
       * 替换对方中line
       */
       function replaceOppoLine(imgObj,oldLine,newLine){
       		for(var i=0;i<imgObj.opsArray.length;i++){
       			 
       			if(imgObj.opsArray[i].line==oldLine){ 
       				imgObj.opsArray[i].line=newLine;
       			} 
       		}
       }
      
       /**
       * 计算划线的开始坐标
       */
       function calculateStartEndPos(imgStart,imgEnd,realPoints){ 
       		var realSx=0;
       		var realSy=0;
       		var realEx=0;
       		var realEy=0;
       
       		var sx=imgStart.getAbsolutePosition().x;
       		var sy=imgStart.getAbsolutePosition().y;
       		var swidth=imgStart.getWidth();
       		var sheight=imgStart.getHeight(); 
       		var ex=imgEnd.getAbsolutePosition().x;
       		var ey=imgEnd.getAbsolutePosition().y; 
       		var ewidth=imgEnd.getWidth();
       		var eheight=imgEnd.getHeight();  
       		var array=calculateXY(sy,sheight,ey,eheight ,sx,swidth,ex,ewidth);
       		var crossArray=null;
       		if((array[0]!=array[2])&&(array[1]!=array[3])){
       			var crossArray= calculateCrossPoints(array,sy,sheight,ey,eheight ,sx,swidth,ex,ewidth);
       		} 
       		realPoints.push(array[0]);
       		realPoints.push(array[1]);
       		if(crossArray!=null) 
	       		for(var i=0;i<crossArray.length;i++){
	       			realPoints.push(crossArray[i]);
	       		}
       		realPoints.push(array[2]);
       		realPoints.push(array[3]); 
       		
       }
       	/**
       		计算连线开始和结束坐标的位置
       	*/
       function calculateXY(sy,sheight,ey,eheight,sx,swidth,ex,ewidth ){
       		 
       		 
       		var array=[];
       		if(sy==ey){ 
       			if(sx>ex){ 
       				array.push(sx);
       				array.push(sy+(sheight/2));
       				array.push(ex+ewidth);
       				array.push(sy+(eheight/2));
       			}else{
       				array.push(sx+swidth);
       				array.push(sy+(sheight/2));
       				array.push(ex);
       				array.push(sy+(eheight/2));
       			}
       			
       			
       		}else{ 
       			if(sy>ey&&(sy-ey>sheight)){
       				if(sx>ex){
       				 	if(sx-ex<swidth/2){
       				 		array.push(sx);
	       					array.push(sy+(sheight/2));
	       					array.push(ex);
	       					array.push(ey+eheight/2);
       				 	}else{
       				 		array.push(sx);
	       					array.push(sy+(sheight/2));
	       					array.push(ex+(ewidth/2));
	       					array.push(ey+eheight);
       				 	}
       					
       				 
       				}else if(sx==ex){
       					 
       					array.push(sx+(swidth/2));
       					array.push(sy);
       					array.push(ex+(ewidth/2));
       					array.push(ey+eheight);
       				}else{
       					if(ex-sx<ewidth/2){
       						array.push(sx);
	       					array.push(sy+(sheight/2));
	       					array.push(ex);
	       					array.push(ey+eheight/2);
       					}else{
       						array.push(sx+swidth);
	       					array.push(sy+(sheight/2));
	       					array.push(ex+(ewidth/2));
	       					array.push(ey+eheight);
       					}
       				
       				}
       			}else if(sy<ey&&(ey-sy>eheight)){
       				if(sx>ex){
       				 	if(sx-ex<swidth/2){
       				 		array.push(sx);
       				 		array.push(sy+sheight/2);
       				 		array.push(ex);
       				 		array.push(ey+eheight/2);
       				 	}else{
       				 		array.push(sx+(swidth/2));
	       					array.push(sy+sheight);
	       					array.push(ex+ewidth);
	       					array.push(ey+(eheight/2));
       				 	}
       					
       				}else if(sx==ex){
       					 
       					array.push(sx+(swidth/2));
       					array.push(sy+sheight);
       					array.push(ex+(ewidth/2));
       					array.push(ey);
       				}else{
       					if(ex-sx<ewidth/2){
       						array.push(sx);
       						array.push(sy+sheight/2);
       						array.push(ex);
       						array.push(ey+eheight/2);
       					}else{
	       					array.push(sx+(swidth/2));
	       					array.push(sy+sheight);
	       					array.push(ex);
	       					array.push(ey+(eheight/2));
       					}
       					
       				}
       			}else{
       				if((sy<ey&&(ey-sy<eheight))||sy>ey&&(sy-ey<sheight)){
       					array.push(sx+swidth/2);
       					array.push(sy);
       					array.push(ex+ewidth/2);
       					array.push(ey);
       				} 
       			}
       			
       			
       		} 
       		return  array;
       }
       /**
       		计算折叠点的位置
       */
       function calculateCrossPoints(array,sy,sheight,ey,eheight ,sx,swidth,ex,ewidth){
       	 
       		var pointsArray=[];
       		var x=array[0];
       		var y=array[1];
       		var x1=array[2];
       		var y1=array[3];
       		var f=false;
       		if((x-x1)>0&&(y-y1)>0){
       			f=true;
       		}
       		if((x1-x)>0&&(y1-y)>0){
       			f=true;
       		}
       		/**
       			y轴的多个折叠点
       		*/
       		if((sy>ey&&sy-ey<=sheight)||(sy<ey&&ey-sy<=eheight)){
       			if(sy>ey&&sy-ey<=sheight){
       				pointsArray.push(x);
       				pointsArray.push(y1-sheight);
       				pointsArray.push(x1);
       				pointsArray.push(y1-sheight);
       				
       			}else if(sy<ey&&ey-sy<=eheight){
       				pointsArray.push(x);
       				pointsArray.push(y-eheight);
       				pointsArray.push(x1);
       				pointsArray.push(y-eheight);
       			}
       			
       		 
       		}else if((sx>ex&&sx-ex<=sheight/2)||(sx<ex&&ex-sx<=eheight/2)){
       			/**
       		 		x轴的多个折点
       		 	*/
       			//x= sx-swidth/2
       			//y=y+sheight/2
       			 
       			if(sx-ex<sheight/2){
       			 
       				pointsArray.push(sx-ewidth);
       				pointsArray.push(sy+sheight/2);
       				pointsArray.push(sx-ewidth);
       				pointsArray.push(ey+eheight/2);
       			}else if(ex-sx<eheight/2){
       			 
       				pointsArray.push(ex-swidth);
       				pointsArray.push(sy+sheight/2);
       				pointsArray.push(ex-swidth);
       				pointsArray.push(ey+eheight/2);
       			}
       			 
       		
       		}else{
       			/**
       			单个折叠点
       			*/
       			if(f){
	       			if(x<x1){
	       				pointsArray.push(x);
	       			}else{
	       				pointsArray.push(x1);
	       			}
	       			if(y<y1){
	       				pointsArray.push(y1);
	       			}else{
	       				pointsArray.push(y);
	       			}
	       		}else{ 
	       			if(x<x1){
	       				pointsArray.push(x1);
	       			}else{
	       				pointsArray.push(x);
	       			}
	       			if(y<y1){
	       				pointsArray.push(y1);
	       			}else{
	       				pointsArray.push(y);
	       			}
	       		}
       		}
       		 
       		
       		return pointsArray;
       }
       function createImage(img,x,y,width,height){
       		var imgObj=new Kinetic.Image({
	       		x:x,
	       		y:y,
	       		width:width,
	       		height:height, 
	       		//draggable:true,
	       		image:img,
	       		name:"image",
	       });
	       imgObj.on("mouseover", function(){
                document.body.style.cursor = "pointer";
           });
           imgObj.on("mouseout", function(){
                document.body.style.cursor = "default";
           });
           return imgObj
       	
       } 
       
        /**
       		根据points 节点数组划线
       */
       function createLine(points){ 
       		 
			var line=new Kinetic.Line({ 
		  		points:points,
		  		stroke:'green', 
		  		strokeWidth:2, 
		  		lineCap:'round',
		  		lineJoin:'round' 
		 	 	
	 	    });
	 	    var lenght=points.length; 
	 	    var x=points[lenght-4];
	 	    var y=points[lenght-3];
	 	    var x1=points[lenght-2];
	 	    var y1=points[lenght-1];  
	 	    var arrow=createArrow(calculateArrowPosition(x1,y1,calculateArrowAspect(x,y,x1,y1)),"black");
	 	    
	 	    var la =new LineArrow(line,arrow);
	 	    return la;
       }
       function bandEventToLine(line){
     	   line.saveData();
		       		 	   
       	   line.on("mouseover", function(){
                document.body.style.cursor = "pointer";
           });
           line.on("mouseout", function(){
                document.body.style.cursor = "default";
           });
       }
       /**
       		通过line计算 arrow 的points 数组
       */
       function calculateArrowPointsByLine(line){
       		var points=line.getPoints();
       		var lenght=points.length; 
	 	    var x=points[lenght-4];
	 	    var y=points[lenght-3];
	 	    var x1=points[lenght-2];
	 	    var y1=points[lenght-1];  
	 	    return calculateArrowPosition(x1,y1,calculateArrowAspect(x,y,x1,y1));
	 	     
       }
       function calculateArrowPointsByPoints(points){
       		var lenght=points.length;
       		var x=points[lenght-4];
	 	    var y=points[lenght-3];
	 	    var x1=points[lenght-2];
	 	    var y1=points[lenght-1]; 
	 	    return calculateArrowPosition(x1,y1,calculateArrowAspect(x,y,x1,y1));
       }
       /**
       	 计算箭头朝向
       */
       function calculateArrowAspect(x,y,x1,y1){
       		 
       		if(x==x1){
       			if(y>y1){
       				return N;
       			}else{
       				return S;
       			}
       		}else if(y==y1){
       			if(x>x1){
       				return W;
       			}else{
       				return E;
       				
       			}
       		}
       }
       
       /**
       	  计算箭头具体位置
       */
       function calculateArrowPosition(x,y,aspect){
       		 
       		var points=[];
       		switch(aspect){
       			case N:
       				points.push(x);
       				points.push(y);
       				points.push(x-arrowRadius);
       				points.push(y+arrowLenght);
       				points.push(x+arrowRadius);
       				points.push(y+arrowLenght); 
       				break;
       			case S:
       				points.push(x);
       				points.push(y);
       				points.push(x-arrowRadius);
       				points.push(y-arrowLenght);
       				points.push(x+arrowRadius);
       				points.push(y-arrowLenght);
       			 
       				break;
       			case E:
       				points.push(x);
       				points.push(y);
       				
       				points.push(x-arrowLenght);
       				points.push(y+arrowRadius);  
       				
       				points.push(x-arrowLenght);
       				points.push(y-arrowRadius);
       				
       				break;
       			case W:
       				points.push(x);
       				points.push(y);
       				points.push(x+arrowLenght);
       				points.push(y+arrowRadius);  
       				
       				points.push(x+arrowLenght);
       				points.push(y-arrowRadius);
       				
       				break;
       		}
       	 
       		return points;
       }
       function createArrow(points,fill){
       		var arrow=new Kinetic.Polygon({
       			  points: points,
		          fill: fill,
		          stroke: "black",
		          strokeWidth: 1
       		}); 
       		return arrow;
       }
       function addAnchor(group,x,y,name){
       		var stage=group.getStage();
       		var layer=group.getLayer();
       		var anchor=new Kinetic.Circle({
       			x:x,
       			y:y,
       			stroke:'#666',
       			fill:'green',
       			radius:1,
       			name:name,
       			draggable:true
       		});
       		anchor.on('dragmove',function(){
       			 update(group, this);
       			 layer.draw();
       		});
       		anchor.on('dragend',function(){
       			group.setDraggable(true);
         		 layer.draw();
       		
       		});
       		anchor.on('mousedown touchstar',function(){
       			group.setDraggable(false);
          		//this.moveToTop();
       		
       		});
       		anchor.on('mouseover',function(){
      			  var layer = this.getLayer();
		          document.body.style.cursor = "pointer";
		          this.setRadius(3);
		          layer.draw();
       		
       		});
       		anchor.on('mouseout',function(){
       			  var layer = this.getLayer();
		          document.body.style.cursor = "default";
		          this.setRadius(1);
		          layer.draw();
       			
       		});
       		group.add(anchor);
       }
       function update(group,activeAnchor){
       		var topLeft=group.get(".topLeft")[0];
       		var topRight=group.get(".topRight")[0];
       		var bottomLeft=group.get(".bottomLeft")[0];
       		var bottomRight=group.get(".bottomRight")[0];
       		
       		var image=group.children[0]; 
       		
       		switch(activeAnchor.getName()){
       			 case "topLeft":
		            topRight.attrs.y = activeAnchor.attrs.y;
		            bottomLeft.attrs.x = activeAnchor.attrs.x;
		            break;
		          case "topRight":
		            topLeft.attrs.y = activeAnchor.attrs.y;
		            bottomRight.attrs.x = activeAnchor.attrs.x;
		            break;
		          case "bottomRight":
		            bottomLeft.attrs.y = activeAnchor.attrs.y;
		            topRight.attrs.x = activeAnchor.attrs.x;
		            break;
		          case "bottomLeft":
		            bottomRight.attrs.y = activeAnchor.attrs.y;
		            topLeft.attrs.x = activeAnchor.attrs.x;
		            break;
       		}
       	 
       		image.setPosition(topLeft.attrs.x, topLeft.attrs.y);
       		image.setSize(topRight.attrs.x - topLeft.attrs.x, bottomLeft.attrs.y - topLeft.attrs.y);
       }
       
       
        
    }); 

    </script>
  </head>
  <body>
    <div id="container"></div>
  </body>
</html>



 


 

 

 

  • 大小: 76.3 KB
  • 大小: 167.2 KB
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/zha_zi/article/details/41676923

智能推荐

React学习记录-程序员宅基地

文章浏览阅读936次,点赞22次,收藏26次。React核心基础

Linux查磁盘大小命令,linux系统查看磁盘空间的命令是什么-程序员宅基地

文章浏览阅读2k次。linux系统查看磁盘空间的命令是【df -hl】,该命令可以查看磁盘剩余空间大小。如果要查看每个根路径的分区大小,可以使用【df -h】命令。df命令以磁盘分区为单位查看文件系统。本文操作环境:red hat enterprise linux 6.1系统、thinkpad t480电脑。(学习视频分享:linux视频教程)Linux 查看磁盘空间可以使用 df 和 du 命令。df命令df 以磁..._df -hl

Office & delphi_range[char(96 + acolumn) + inttostr(65536)].end[xl-程序员宅基地

文章浏览阅读923次。uses ComObj;var ExcelApp: OleVariant;implementationprocedure TForm1.Button1Click(Sender: TObject);const // SheetType xlChart = -4109; xlWorksheet = -4167; // WBATemplate xlWBATWorksheet = -4167_range[char(96 + acolumn) + inttostr(65536)].end[xlup]

若依 quartz 定时任务中 service mapper无法注入解决办法_ruoyi-quartz无法引入ruoyi-admin的service-程序员宅基地

文章浏览阅读2.3k次。上图为任务代码,在任务具体执行的方法中使用,一定要写在方法内使用SpringContextUtil.getBean()方法实例化Spring service类下边是ruoyi-quartz模块中util/SpringContextUtil.java(已改写)import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.s..._ruoyi-quartz无法引入ruoyi-admin的service

CentOS7配置yum源-程序员宅基地

文章浏览阅读2w次,点赞10次,收藏77次。yum,全称“Yellow dog Updater, Modified”,是一个专门为了解决包的依赖关系而存在的软件包管理器。可以这么说,yum 是改进型的 RPM 软件管理器,它很好的解决了 RPM 所面临的软件包依赖问题。yum 在服务器端存有所有的 RPM 包,并将各个包之间的依赖关系记录在文件中,当管理员使用 yum 安装 RPM 包时,yum 会先从服务器端下载包的依赖性文件,通过分析此文件从服务器端一次性下载所有相关的 RPM 包并进行安装。_centos7配置yum源

智能科学毕设分享(算法) 基于深度学习的抽烟行为检测算法实现(源码分享)-程序员宅基地

文章浏览阅读828次,点赞21次,收藏8次。今天学长向大家分享一个毕业设计项目毕业设计 基于深度学习的抽烟行为检测算法实现(源码分享)毕业设计 深度学习的抽烟行为检测算法实现通过目前应用比较广泛的 Web 开发平台,将模型训练完成的算法模型部署,部署于 Web 平台。并且利用目前流行的前后端技术在该平台进行整合实现运营车辆驾驶员吸烟行为检测系统,方便用户使用。本系统是一种运营车辆驾驶员吸烟行为检测系统,为了降低误检率,对驾驶员视频中的吸烟烟雾和香烟目标分别进行检测,若同时检测到则判定该驾驶员存在吸烟行为。进行流程化处理,以满足用户的需要。

随便推点

STM32单片机示例:多个定时器同步触发启动_stm32 定时器同步-程序员宅基地

文章浏览阅读3.7k次,点赞3次,收藏14次。多个定时器同步触发启动是一种比较实用的功能,这里将对此做个示例说明。_stm32 定时器同步

android launcher分析和修改10,Android Launcher分析和修改9——Launcher启动APP流程(转载)...-程序员宅基地

文章浏览阅读348次。出处 : http://www.cnblogs.com/mythou/p/3187881.html本来想分析AppsCustomizePagedView类,不过今天突然接到一个临时任务。客户反馈说机器界面的图标很难点击启动程序,经常点击了没有反应,Boss说要优先解决这问题。没办法,只能看看是怎么回事。今天分析一下Launcher启动APP的过程。从用户点击到程序启动的流程,下面针对WorkSpa..._回调bubbletextview

Ubuntu 12 最快的两个源 个人感觉 163与cn99最快 ubuntu安装源下包过慢_un.12.cc-程序员宅基地

文章浏览阅读6.2k次。Ubuntu 12 最快的两个源 个人感觉 163与cn99最快 ubuntu下包过慢 1、首先备份Ubuntu 12.04源列表 sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (备份下当前的源列表,有备无患嘛) 2、修改更新源 sudo gedit /etc/apt/sources.list (打开Ubuntu 12_un.12.cc

vue动态路由(权限设置)_vue动态路由权限-程序员宅基地

文章浏览阅读5.8k次,点赞6次,收藏86次。1.思路(1)动态添加路由肯定用的是addRouter,在哪用?(2)vuex当中获取到菜单,怎样展示到界面2.不管其他先试一下addRouter找到router/index.js文件,内容如下,这是我自己先配置的登录路由现在先不管请求到的菜单是什么样,先写一个固定的菜单通过addRouter添加添加以前注意:addRoutes()添加的是数组在export defult router的上一行图中17行写下以下代码var addRoute=[ { path:"/", name:"_vue动态路由权限

JSTL 之变量赋值标签-程序员宅基地

文章浏览阅读8.9k次。 关键词: JSTL 之变量赋值标签 /* * Author Yachun Miao * Created 11-Dec-06 */关于JSP核心库的set标签赋值变量,有两种方式: 1.日期" />2. 有种需求要把ApplicationResources_zh_CN.prope

VGA带音频转HDMI转换芯片|VGA转HDMI 转换器方案|VGA转HDMI1.4转换器芯片介绍_vga转hdmi带音频转换器,转接头拆解-程序员宅基地

文章浏览阅读3.1k次,点赞3次,收藏2次。1.1ZY5621概述ZY5621是VGA音频到HDMI转换器芯片,它符合HDMI1.4 DV1.0规范。ZY5621也是一款先进的高速转换器,集成了MCU和VGA EDID芯片。它还包含VGA输入指示和仅音频到HDMI功能。进一步降低系统制造成本,简化系统板上的布线。ZY5621方案设计简单,且可以完美还原输入端口的信号,此方案设计广泛应用于投影仪、教育多媒体、视频会议、视频展台、工业级主板显示、手持便携设备、转换盒、转换线材等产品设计上面。1.2 ZY5621 特性内置MCU嵌入式VGA_vga转hdmi带音频转换器,转接头拆解

推荐文章

热门文章

相关标签