var boxtype='4klap_rot'; var boximg=new Array; boximg["4klap_rot"]='4klap_rot'; boximg["lotok"]='lotok'; boximg["lotok2"]='lotok_2'; boximg["lotok3"]='lotok_3'; boximg["lotok4"]='lotok_4'; boximg["tv"]='tv'; boximg["tomato"]='tomato'; boximg["427"]='427'; function ChangeBoxType(){ eval('document.all.l_data_'+boxtype+'.style.display="none"'); boxtype=sel_boxtype.options[sel_boxtype.options.selectedIndex].value; eval('document.all.l_data_'+boxtype+'.style.display="block"'); eval('document.images["img_box"].src="pic/calc_rot_'+boximg[boxtype]+'.wmf"'); }; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- var pi=Math.PI; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- function Sum_4klap_rot(){ var l=parseFloat(f_data_4klap_rot.t_l.value); var b=parseFloat(f_data_4klap_rot.t_b.value); var h=parseFloat(f_data_4klap_rot.t_h.value); var d=parseFloat(f_data_4klap_rot.t_d.value); var t=0; switch(f_data_4klap_rot.sel_profile.options.selectedIndex){ case 0: t=2.8; break; case 1: t=3.8; break; case 2: t=6.6; break; default: break; }; var speed=f_data_4klap_rot.sel_speed.options.selectedIndex; var y1=0; var y2=0; switch(speed){ case 0: y1=60; y2=80; break; case 1: y1=80; y2=100; break; case 2: y1=100; y2=150; break; default: break; }; var corrleft=parseFloat(f_data_4klap_rot.t_corrleft.value); var corrinside=parseFloat(f_data_4klap_rot.t_corrinside.value); var corrright=parseFloat(f_data_4klap_rot.t_corrright.value); var corrheight=parseFloat(f_data_4klap_rot.t_corrheight.value); var corrgap=parseFloat(f_data_4klap_rot.t_corrgap.value); var corrangle=parseFloat(f_data_4klap_rot.t_corrangle.value); var corrradius=parseFloat(f_data_4klap_rot.t_corrradius.value); var biglevel=f_data_4klap_rot.ch_biglevel.checked; var price=parseFloat(f_data_4klap_rot.t_price.value); var price_nds=price_4klap_rot_nds; var num=parseFloat(f_data_4klap_rot.t_num.value); var big=0; var knifes=0; var tech=0; var bigs=new Array; var kns=new Array; var techs=new Array; var hm=0; //высотаклапанов if(l>0 & b>0 & h>0 & d>0 & price>0 & num>0){ b>l?hm=(l+corrinside)/2-corrgap/2+0.5:hm=(b+corrinside)/2-corrgap/2+0.5; bigs[0]=h+corrheight-2*0.5; bigs[1]=bigs[0]-2*(1*Math.tan(rad(15)))-t; if(biglevel){ if(l>=b){ (t+0.5)<=(corrradius*(1-Math.cos(rad(90-corrangle/2))))?bigs[2]=l+corrleft-corrradius*Math.sin(rad(90-corrangle/2)):bigs[2]=l+corrleft-corrradius*Math.sin(rad(90-corrangle/2))-(t+0.5-corrradius*(1-Math.cos(rad(90-corrangle/2))))*Math.cos(rad(90-corrangle/2)); //!!! bigs[3]=b+corrinside-2*Math.sqrt(corrradius*corrradius-(corrradius-0.5)*(corrradius-0.5)); (t+0.5)<=(corrradius*(1-Math.cos(rad(90-corrangle/2))))?bigs[4]=l+corrinside-2*corrradius*Math.sin(rad(90-corrangle/2)):bigs[4]=l+corrinside-2*corrradius*Math.sin(rad(90-corrangle/2))-2*(t+0.5-corrradius*(1-Math.cos(rad(90-corrangle/2))))*Math.cos(rad(90-corrangle/2)); //!!! bigs[5]=b+corrright-Math.sqrt(corrradius*corrradius-(corrradius-0.5)*(corrradius-0.5))-1; } else{ bigs[2]=l+corrleft-Math.sqrt(corrradius*corrradius-(corrradius-0.5)*(corrradius-0.5)); (t+0.5)<=(corrradius*(1-Math.cos(rad(90-corrangle/2))))?bigs[3]=b+corrinside-2*corrradius*Math.sin(rad(90-corrangle/2)):bigs[3]=b+corrinside-2*corrradius*Math.sin(rad(90-corrangle/2))-2*(t+0.5-corrradius*(1-Math.cos(rad(90-corrangle/2))))*Math.cos(rad(90-corrangle/2)); bigs[4]=l+corrinside-2*Math.sqrt(corrradius*corrradius-(corrradius-0.5)*(corrradius-0.5)); (t+0.5)<=(corrradius*(1-Math.cos(rad(90-corrangle/2))))?bigs[5]=b+corrright-corrradius*Math.sin(rad(90-corrangle/2)):bigs[5]=b+corrright-corrradius*Math.sin(rad(90-corrangle/2))-(t+0.5-corrradius*(1-Math.cos(rad(90-corrangle/2))))*Math.cos(rad(90-corrangle/2)); //!!! }; } else{ bigs[2]=l+corrleft-Math.sqrt(corrradius*corrradius-(corrradius-0.5)*(corrradius-0.5)); bigs[3]=b+corrinside-2*Math.sqrt(corrradius*corrradius-(corrradius-0.5)*(corrradius-0.5)); bigs[4]=l+corrinside-2*Math.sqrt(corrradius*corrradius-(corrradius-0.5)*(corrradius-0.5)); bigs[5]=b+corrright-Math.sqrt(corrradius*corrradius-(corrradius-0.5)*(corrradius-0.5))-1; }; big=bigs[0]*3+bigs[1]+(bigs[2]+bigs[3]+bigs[4]+bigs[5])*2; kns[0]=h+corrheight; kns[1]=(d+1)/Math.cos(rad(15)); kns[2]=kns[0]-2*0.5-t-2*kns[1]*Math.sin(rad(15)); kns[6]=corrradius*rad(180-corrangle); kns[7]=(hm-(corrradius*(1-Math.cos(rad(90-corrangle/2)))))/Math.cos(rad(corrangle/2)); kns[4]=l+corrinside-2*corrradius*Math.cos(rad(corrangle/2))-2*kns[7]*Math.sin(rad(corrangle/2)); kns[5]=b+corrinside-2*corrradius*Math.cos(rad(corrangle/2))-2*kns[7]*Math.sin(rad(corrangle/2)); kns[8]=Math.sqrt(Math.pow((l+corrleft-corrradius*Math.cos(rad(corrangle/2))-kns[7]*Math.sin(rad(corrangle/2))-kns[4]),2)+Math.pow((hm-0.5),2)); kns[3]=Math.sqrt(Math.pow((b+corrright-corrradius*Math.cos(rad(corrangle/2))-kns[7]*Math.sin(rad(corrangle/2))-kns[5]),2)+Math.pow((hm+t/2),2)); knifes=kns[0]+kns[2]+kns[1]*2+kns[3]*2+kns[4]*4+kns[5]*4+kns[6]*6+kns[7]*12+kns[8]*2; techs[0]=numOFtech(kns[4]-6,y1,y2)*(35+24)-24; techs[1]=numOFtech(kns[5]-6,y1,y2)*(35+24)-24*2; techs[2]=numOFtech(kns[4]-6,y1,y2)*(35+24)-24*2; techs[3]=numOFtech(kns[5]-6,y1,y2)*(35+24)-24; techs[4]=numOFtech(kns[2]-6,y1,y2)*35; techs[5]=numOFtech(kns[4]-6,y1,y2)*35; techs[6]=numOFtech(kns[5]-6,y1,y2)*35; techs[7]=numOFtech(kns[4]-6,y1,y2)*35; techs[8]=numOFtech(kns[5]-6,y1,y2)*35; var ll=10+hm-0.5+t/2+kns[1]*Math.sin(rad(15))+3; var nn=numOFtech(ll,y1,y2)-2; techs[9]=nn*(35+d+1); for(i=1;i<=nn;i++){ tech[9]+=(b+corrright-corrradius*Math.cos(rad(corrangle/2))-kns[7]*Math.sin(rad(corrangle/2))-kns[5])*(1-(i*y1-10)/(hm-0.5+t/2)); }; techs[9]=techs[9]*2; var lll=0; ll=h+corrheight+hm*2-0.5*2+10*2; nn=numOFtech(ll,y1,y2)-2; techs[10]=nn*35; for(i=1;i<=nn;i++){ if((i*y1-10)<(hm-0.5)){ techs[10]+=(l+corrleft-corrradius*Math.cos(rad(corrangle/2))-kns[7]*Math.sin(rad(corrangle/2))-kns[4])*(1-(i*y1-10)/(hm-0.5)); }; if(i*y1ll-10-hm+0.5){ techs[10]+=(l+corrleft-corrradius*Math.cos(rad(corrangle/2))-kns[7]*Math.sin(rad(corrangle/2))-kns[4])*(1-(ll-10-i*y1)/(hm-0.5)); }; }; for(i=0;i1){ big=big*num; knifes=knifes*num; tech=tech*num; knifes=knifes-(num-1)*(kns[4]*2+kns[5]*2); tech=tech-(num-1)*(techs[0]+techs[1]+techs[2]+techs[3]+techs[5]+techs[6]+techs[7]+techs[8]); }; f_data_4klap_rot.t_knifes_length.value=Math.round(knifes)/1000; f_data_4klap_rot.t_big_length.value=Math.round(big)/1000; f_data_4klap_rot.t_tech_length.value=Math.round(tech)/1000; f_data_4klap_rot.t_total_length.value=Math.round((big+knifes+tech))/1000; f_data_4klap_rot.t_total_cost.value=Math.round((big+knifes+tech)*price/1000); f_data_4klap_rot.t_total_cost_nds.value=Math.round(((big+knifes+tech)*price+(big+knifes+tech)*price*price_nds)/1000); } else{alert('Неверно введены исходные данные!')}; }; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- function changeProfile(){ var cl=0; var ci=0; var cr=0; var ch=0; switch(f_data_4klap_rot.sel_profile.options.selectedIndex){ case 0: cl=2; ci=4; cr=2; ch=5; break; case 1: cl=3; ci=5; cr=3; ch=6; break; case 2: cl=7; ci=10 cr=7; ch=14; break; default: break; }; f_data_4klap_rot.t_corrleft.value=cl; f_data_4klap_rot.t_corrinside.value=ci; f_data_4klap_rot.t_corrright.value=cr; f_data_4klap_rot.t_corrheight.value=ch; }; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //-------------lotok-------------------------------------------------------------- function Sum_lotok(){ var l=parseFloat(f_data_lotok.t_l.value); var b=parseFloat(f_data_lotok.t_b.value); var h=parseFloat(f_data_lotok.t_h.value); var s=0; var t=0; var hole=0; var bp=0; var dp=0; switch(f_data_lotok.sel_profile.options.selectedIndex){ case 0: t=2.8; s=4; hole=8; bp=7; dp=4; break; case 1: t=3.8; s=5; hole=7; bp=8; dp=5; break; default: break; }; var speed=f_data_lotok.sel_speed.options.selectedIndex; var y1=0; var y2=0; switch(speed){ case 0: y1=60; y2=80; break; case 1: y1=80; y2=100; break; case 2: y1=100; y2=150; break; default: break; }; var r=3; var al=3; var price=parseFloat(f_data_lotok.t_price.value); var price_nds=price_lotok_nds; var num=parseFloat(f_data_lotok.t_num.value); var offs=parseFloat(f_data_lotok.t_offset.value); var big=0; var knifes=0; var tech=0; var perf=0; var bigs=new Array; var perfs=new Array; var kns=new Array; var techs=new Array; if(l>0 & b>0 & h>0 & price>0 & num>0){ bigs[0]=l+s+2*hole; bigs[1]=b+s-2*40; bigs[2]=h; big=bigs[0]*2+bigs[1]*2+bigs[2]*4; perfs[0]=b+s; perfs[1]=b+s-2*dp; perf=perfs[0]*2+perfs[1]*2+16; var kh=b/2-2; if(kh>h+s/2+bp+h+5){kh=h+s/2+bp+h+5+3}; kns[0]=l+s+2*hole+2*kh; kns[1]=h-r*CosG(al)-(kh-h-2+1-r*(1-SinG(al)))*TanG(al); kns[2]=(kh-h-2+1-r*(1-SinG(al)))/CosG(al)+r*(pi/2-rad(al)); kns[3]=h+s/2+Math.sqrt(dp*dp+bp*bp)+h; kns[4]=perfs[1]-4*2+4*Math.sqrt(4+25); kns[5]=2*40+2*hole; knifes=kns[0]*2+kns[1]*4+kns[2]*4+kns[3]*4+kns[4]*2+kns[5]*4; var tl1=0; var tl2=0; if(khy2){ techs[1]+=tl1*(numOFtech(kns[1]-6,y1,y2)-2) }; techs[2]=tl2*numOFtech(perfs[1]-6,y1,y2); techs[3]=24*(2*techs[1]/tl1+numOFtech(perfs[1]-6,y1,y2)-4); techs[4]=0; if(bp+h+5+10>y2){techs[4]=dp+r*CosG(al)+(h-kns[1])/2}; tech=techs[0]*2+techs[1]*4*num+techs[2]*2*num+techs[3]*num-(num-1)*(24+tl1*2); big=big*num; perf=perf*num; knifes=knifes*num-(num-1)*kns[0]; f_data_lotok.t_knifes_length.value=Math.round(knifes)/1000; f_data_lotok.t_big_length.value=Math.round(big)/1000; f_data_lotok.t_tech_length.value=Math.round(tech)/1000; f_data_lotok.t_perf_length.value=Math.round(perf)/1000; f_data_lotok.t_gab_x.value=Math.round((b+2*h+s)*num); f_data_lotok.t_gab_y.value=Math.round(l+2*hole+2*(h+2)+2*bp+2*(h+5)); f_data_lotok.t_zag_x.value=parseFloat(f_data_lotok.t_gab_x.value)+Math.round(2*offs); f_data_lotok.t_zag_y.value=parseFloat(f_data_lotok.t_gab_y.value)+Math.round(2*offs); f_data_lotok.t_total_length.value=Math.round((big+knifes+tech+perf))/1000; f_data_lotok.t_total_cost.value=Math.round((big+knifes+tech+perf)*price/1000); f_data_lotok.t_total_cost_nds.value=Math.round(((big+knifes+tech+perf)*price+(big+knifes+tech+perf)*price*price_nds)/1000); } else{alert('Неверно введены исходные данные!')}; }; //--------------------------------------------------------------------------- //-------------lotok2-------------------------------------------------------------- function Sum_lotok2(){ var l=parseFloat(f_data_lotok2.t_l.value); var b=parseFloat(f_data_lotok2.t_b.value); var h=parseFloat(f_data_lotok2.t_h.value); var t=0; var s=0; var d1=5; var d2=0; switch(f_data_lotok2.sel_profile.options.selectedIndex){ case 0: t=2.8; s=4; d2=2; break; case 1: t=3.8; s=5; d2=2; break; default: break; }; var speed=f_data_lotok2.sel_speed.options.selectedIndex; var y1=0; var y2=0; switch(speed){ case 0: y1=60; y2=80; break; case 1: y1=80; y2=100; break; case 2: y1=100; y2=150; break; default: break; }; var r=3; var al1=5; var al2=1; var price=parseFloat(f_data_lotok2.t_price.value); var price_nds=price_lotok2_nds; var num=parseFloat(f_data_lotok2.t_num.value); var offs=parseFloat(f_data_lotok2.t_offset.value); var big=0; var knifes=0; var tech=0; var perf=0; var bigs=new Array; var perfs=new Array; var kns=new Array; var techs=new Array; if(l>0 & b>0 & h>0 & price>0 & num>0){ l+=s; b+=s; h+=s; bigs[0]=b-2*r; bigs[1]=h; big=bigs[0]*2+bigs[1]*4; perfs[0]=l; perf=perfs[0]*2; kns[0]=l; kns[1]=d1+r*(pi/2-rad(al2))+(h+d2-d1-r*(1-SinG(al2)))/CosG(al2); kns[2]=h-r*CosG(al2)-(h+d2-d1-r*(1-SinG(al2)))*TanG(al2)-r*CosG(al1)-(h+d2-r*(1-SinG(al1)))*TanG(al1); kns[3]=(h+d2-r*(1-SinG(al1)))/CosG(al1)+r*(pi-rad(al1)); kns[4]=h; kns[5]=bigs[0]; knifes=kns[0]*2+kns[1]*4+kns[2]*4+kns[3]*4+kns[4]*4+kns[5]*2; techs[0]=35*(numOFtech(kns[0]+2*d1,y1,y2)); if(h+r*(1-SinG(al1))+10>y2){techs[1]=(35+r)*(numOFtech(h+d1-3+10,y1,y2)-1)}else{techs[1]=0}; techs[2]=35*2; if(kns[2]-6>y2){techs[2]+=35*(numOFtech(kns[2]-6,y1,y2)-2)}; techs[3]=35*(numOFtech(kns[5]-6,y1,y2)+1); techs[4]=0; if(h+r*(1-SinG(al1))+10>y2){techs[4]=r+h/CosG(al1)/2}; techs[5]=24*(2*techs[2]/35+techs[3]/35)-24*4; tech=techs[0]*2+techs[1]*4+techs[2]*4*num+techs[3]*2*num+techs[4]*4*num+techs[5]*num+(num-1)*r*2*2-(num-1)*24*4; big=big*num; perf=perf*num; knifes=knifes*num-(num-1)*(kns[0]+2*d1); f_data_lotok2.t_knifes_length.value=Math.round(knifes)/1000; f_data_lotok2.t_big_length.value=Math.round(big)/1000; f_data_lotok2.t_tech_length.value=Math.round(tech)/1000; f_data_lotok2.t_perf_length.value=Math.round(perf)/1000; f_data_lotok2.t_gab_x.value=Math.round((b+2*h)*num); f_data_lotok2.t_gab_y.value=Math.round(l+2*d2+2*h); f_data_lotok2.t_zag_x.value=Math.round((b+2*h)*num+2*offs); f_data_lotok2.t_zag_y.value=Math.round(l+2*d2+2*h+2*offs); f_data_lotok2.t_total_length.value=Math.round((big+knifes+tech+perf))/1000; f_data_lotok2.t_total_cost.value=Math.round((big+knifes+tech+perf)*price/1000); f_data_lotok2.t_total_cost_nds.value=Math.round(((big+knifes+tech+perf)*price+(big+knifes+tech+perf)*price*price_nds)/1000); } else{alert('Неверно введены исходные данные!')}; }; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //-------------lotok3-------------------------------------------------------------- function Sum_lotok3(){ var l=parseFloat(f_data_lotok3.t_l.value); var b=parseFloat(f_data_lotok3.t_b.value); var h=parseFloat(f_data_lotok3.t_h.value); var d=parseFloat(f_data_lotok3.t_d.value); var t=0; var s=0; switch(f_data_lotok3.sel_profile.options.selectedIndex){ case 0: t=2.8; s=4; break; case 1: t=3.8; s=5; break; default: break; }; var speed=f_data_lotok3.sel_speed.options.selectedIndex; var y1=0; var y2=0; switch(speed){ case 0: y1=60; y2=80; break; case 1: y1=80; y2=100; break; case 2: y1=100; y2=150; break; default: break; }; var r=3; var al=3; var price=parseFloat(f_data_lotok3.t_price.value); var price_nds=price_lotok3_nds; var num=parseFloat(f_data_lotok3.t_num.value); var offs=parseFloat(f_data_lotok3.t_offset.value); var big=0; var knifes=0; var tech=0; var perf=0; var bigs=new Array; var perfs=new Array; var kns=new Array; var techs=new Array; if(l>0 & b>0 & h>0 & price>0 & num>0){ bigs[0]=l+s; big=bigs[0]*2; perfs[0]=b+s-2*r*Math.sqrt(1-(r-2)*(r-2)/r/r); perfs[1]=h+s/2; perf=perfs[0]*2+perfs[1]*4; kns[0]=l+s+2*17; kns[1]=17; kns[2]=0; //k2+k4 kns[3]=Math.sqrt(Math.pow(d-17-2*r,2)+Math.pow(h+s/2-(d-5)-2*r,2)); kns[4]=r*pi; kns[5]=d-5-d*TanG(al/2); kns[6]=(d+2)/CosG(al/2); kns[7]=r*(pi-rad(al)); kns[8]=d/CosG(al/2); kns[9]=perfs[0]-2*kns[8]*SinG(al/2); knifes=kns[0]*2+kns[1]*4+kns[2]*4+kns[3]*4+kns[4]*4+kns[5]*4+kns[6]*4+kns[7]*4+kns[8]*4+kns[9]*2; techs[0]=35*(numOFtech(kns[0]+2*17-2,y1,y2)); techs[1]=35*(numOFtech(h+s/2-d+5+10,y1,y2)-1); //!!!!!! techs[2]=35*(numOFtech(kns[5]-3,y1,y2)+1); techs[3]=35*numOFtech(kns[9]-6,y1,y2); d+2+10>y2?techs[4]=2*d/2*TanG(al/2)*(numOFtech(d+2+10,y1,y2)-1):techs[4]=0; techs[5]=24*(techs[0]/35); techs[6]=0; if(h+s/2-d+5+10>y2){techs[6]=(numOFtech(h+s/2-d+5+10,y1,y2)-1)*(d+2-17)}; tech=techs[0]*2*num+techs[1]*4+techs[2]*4+techs[3]*2+techs[4]*4*num+techs[5]*num+(num-1)*2*techs[6]; if(d+2-17<15){tech=tech-(num-1)*24*4}; big=big*num; perf=perf*num; knifes=knifes*num-(num-1)*(kns[9]+2*kns[5]); f_data_lotok3.t_knifes_length.value=Math.round(knifes)/1000; f_data_lotok3.t_big_length.value=Math.round(big)/1000; f_data_lotok3.t_tech_length.value=Math.round(tech)/1000; f_data_lotok3.t_perf_length.value=Math.round(perf)/1000; f_data_lotok3.t_gab_x.value=Math.round((l+s+2*2+2*d)*num); f_data_lotok3.t_gab_y.value=Math.round(b+s+2*(h+s)); f_data_lotok3.t_zag_x.value=Math.round((l+2*2+2*d)*num+2*offs); f_data_lotok3.t_zag_y.value=Math.round(b+s+2*(h+s)+2*offs); f_data_lotok3.t_total_length.value=Math.round((big+knifes+tech+perf))/1000; f_data_lotok3.t_total_cost.value=Math.round((big+knifes+tech+perf)*price/1000); f_data_lotok3.t_total_cost_nds.value=Math.round(((big+knifes+tech+perf)*price+(big+knifes+tech+perf)*price*price_nds)/1000); } else{alert('Неверно введены исходные данные!')}; }; //--------------------------------------------------------------------------- //-------------lotok4-------------------------------------------------------------- function Sum_lotok4(){ var l=parseFloat(f_data_lotok4.t_l.value); var b=parseFloat(f_data_lotok4.t_b.value); var h=parseFloat(f_data_lotok4.t_h.value); var a=parseFloat(f_data_lotok4.t_a.value); var d=parseFloat(f_data_lotok4.t_d.value); var t=0; var s=0; var x0=0; var x1=0; var x2=0; switch(f_data_lotok4.sel_profile.options.selectedIndex){ case 0: t=2.8; s=4; x0=10; x1=12; x2=2; break; case 1: t=3.8; s=5; x0=12; x1=14; x2=2.5; break; default: break; }; var speed=f_data_lotok4.sel_speed.options.selectedIndex; var y1=0; var y2=0; switch(speed){ case 0: y1=60; y2=80; break; case 1: y1=80; y2=100; break; case 2: y1=100; y2=150; break; default: break; }; var price=parseFloat(f_data_lotok4.t_price.value); var price_nds=price_lotok4_nds; var num=parseFloat(f_data_lotok4.t_num.value); var offs=parseFloat(f_data_lotok4.t_offset.value); var big=0; var knifes=0; var tech=0; var perf=0; var bigs=new Array; var perfs=new Array; var kns=new Array; var techs=new Array; if(l>0 & b>0 & h>0 & a>0 & d>0 & price>0 & num>0){ bigs[0]=l+2*(x0+1); bigs[1]=h+s; bigs[2]=a; bigs[3]=b+s-2*60; bigs[4]=b+s-2*a-4-2*60; bigs[5]=bigs[4]+4*x0/CosG(11); big=bigs[0]*4+bigs[1]*4+bigs[2]*4+bigs[3]*2+bigs[4]*2+bigs[5]*2; perfs[0]=h+s-x2+x0-x1; perf=perfs[0]*8; kns[0]=b+s+2*(h+s+a+d); kns[1]=perfs[0]; kns[2]=(kns[0]-(b+s-2*a-4))/2; kns[3]=x1; kns[4]=a+2; kns[5]=h+s; kns[6]=15+pi/2*10+(h+s-20-bigs[3]/3-10); kns[7]=h+s+a+d-15-10; kns[8]=h+s-20; kns[9]=kns[8]; kns[10]=d; kns[11]=l+2*(x0+1); kns[12]=2*pi*12.5; kns[13]=2*pi*16; kns[14]=(90-2*15)*2+pi*15*2; kns[15]=60+40+14.5*2+2*pi/2*10; kns[16]=8*2+pi/2*10+60-2*18*TanG(11); knifes=kns[0]*2+kns[1]*4+kns[2]*4+kns[3]*4+kns[4]*4+kns[5]*4+kns[6]*4+kns[7]*4+kns[8]*4+kns[9]*4+kns[10]*4+kns[11]*2+kns[12]*6+kns[13]*4+kns[14]*4+kns[15]*4+kns[16]*4; //alert(knifes+'\n\n'+kns); //alert(numOFtech(kns[11]+6,y1,y2)+'\n\n'+(kns[11]+6)); techs[0]=numOFtech(kns[0]-6,y1,y2)*35; techs[1]=numOFtech(kns[1]-3+10,y1,y2)*35; techs[2]=numOFtech(kns[9]-6,y1,y2)*35; techs[3]=(numOFtech(kns[11]+6,y1,y2)-1)*(35+d); techs[4]=20*2; if(kns[7]-a-d>y2){ techs[4]+=Math.round((kns[7]-a-d)/y1)*20 }; if(a+d+10>y2){ techs[4]+=Math.round((a+d+10)/y1)*20 }; techs[5]=x1; techs[6]=techs[0]/35*24; tech=techs[0]*2*num+techs[1]*4+techs[2]*4+techs[3]*2+techs[4]*4*num+techs[5]*4*num+techs[6]*num-(num-1)*(35*2+24)+(num-1)*(techs[3]/(35+d)*d*2+20*2); big=big*num; perf=perf*num; knifes=knifes*num-(num-1)*(kns[1]*2+kns[9]*2); f_data_lotok4.t_knifes_length.value=Math.round(knifes)/1000; f_data_lotok4.t_big_length.value=Math.round(big)/1000; f_data_lotok4.t_tech_length.value=Math.round(tech)/1000; f_data_lotok4.t_perf_length.value=Math.round(perf)/1000; f_data_lotok4.t_gab_x.value=Math.round((b+s+2*(h+s)+2*(a+d))*num); f_data_lotok4.t_gab_y.value=Math.round(l+2*(x0+1)+2*(h+s)+2*x0+2*(h+s-x2)); f_data_lotok4.t_zag_x.value=Math.round((b+s+2*(h+s)+2*(a+d))*num+2*offs); f_data_lotok4.t_zag_y.value=Math.round(l+2*(x0+1)+2*(h+s)+2*x0+2*(h+s-x2)+2*offs); f_data_lotok4.t_total_length.value=Math.round((big+knifes+tech+perf))/1000; f_data_lotok4.t_total_cost.value=Math.round((big+knifes+tech+perf)*price/1000); f_data_lotok4.t_total_cost_nds.value=Math.round(((big+knifes+tech+perf)*price+(big+knifes+tech+perf)*price*price_nds)/1000); } else{alert('Неверно введены исходные данные!')}; }; //--------------------------------------------------------------------------- //-------------tv-------------------------------------------------------------- function Sum_tv(){ var l=parseFloat(f_data_tv.t_l.value); var b=parseFloat(f_data_tv.t_b.value); var h=parseFloat(f_data_tv.t_h.value); var c=parseFloat(f_data_tv.t_c.value); var d=parseFloat(f_data_tv.t_d.value); var f=parseFloat(f_data_tv.t_f.value); var g=parseFloat(f_data_tv.t_g.value); var t=0; var s=0; switch(f_data_tv.sel_profile.options.selectedIndex){ case 0: t=2.8; s=4; break; case 1: t=3.8; s=5; break; default: break; }; var speed=f_data_tv.sel_speed.options.selectedIndex; var y1=0; var y2=0; switch(speed){ case 0: y1=60; y2=80; break; case 1: y1=80; y2=100; break; case 2: y1=100; y2=150; break; default: break; }; var price=parseFloat(f_data_tv.t_price.value); var price_nds=price_tv_nds; var num=parseFloat(f_data_tv.t_num.value); var offs=parseFloat(f_data_tv.t_offset.value); var big=0; var knifes=0; var tech=0; var perf=0; var bigs=new Array; var perfs=new Array; var kns=new Array; var techs=new Array; if(l>0 & b>0 & h>0 & c>0 & d>0 & f>0 & g>0 & price>0 & num>0){ bigs[0]=l+s; bigs[1]=b+s; //!!! bigs[2]=h+s; bigs[3]=36; big=bigs[0]*2+bigs[1]*2+bigs[2]*4+bigs[3]*4; perfs[0]=l+s-2*36; perfs[1]=b+s-60; perf=perfs[0]*2+perfs[1]*2; kns[0]=l+s-2*c*TanG(20); kns[1]=c/CosG(20); kns[5]=h+s+5; var hk1=b/2+s/2-2; if(s+h+2*s+g-36-hk1<=8){ //alert(s+h+2*s+g-36-hk1+'\n'+hk1+'\n'+(s+h+2*s+g-36)); if(s+h+2*s+g-36-hk1>-8){hk1=s+h+2*s+g-36-9} else{kns[5]-=26}; }; kns[2]=perfs[1]/2+0.5; kns[3]=5; kns[4]=hk1-kns[2]; kns[6]=10; kns[7]=h+2*s+g-36; kns[8]=86; kns[9]=c+2; kns[10]=Sqrt(Pow2((b+s-2*c-d)/2)+Pow2(g-f)); kns[11]=d; kns[12]=60+5*2; kns[13]=36+4.5*2; knifes=kns[0]*2+kns[1]*4+kns[2]*4+kns[3]*4+kns[4]*4+kns[5]*4+kns[6]*4+kns[7]*4+kns[8]*4+kns[9]*4+kns[10]*4+kns[11]*2+kns[12]*2+kns[13]*4; techs[0]=35*(numOFtech(kns[0]-6,y1,y2)+1); techs[1]=(35+c)*numOFtech(hk1+c*TanG(20),y1,y2)-5; techs[2]=(35+(s+h+2*s+g+4-hk1))*numOFtech(h+s-2-3-3,y1,y2); techs[3]=0; if(s+h+2*s+g-36-hk1>0){techs[3]=s+h+2*s+g-36-hk1+4}; techs[4]=35; techs[5]=35*(numOFtech(b+s+4+6,y1,y2)-2)+2*(g-f+4); techs[6]=(numOFtech(b+s+4+6,y1,y2)+2+2*numOFtech(h+s-2-3-3,y1,y2))*24; tech=techs[0]*2+techs[1]*4+techs[2]*4*num+techs[3]*4*num+techs[4]*4*num+techs[5]*2*num+techs[6]*num+(num-1)*(2*c*2*techs[1]/(35+c)); if(c*2>y2){tech+=(num-1)*2*(c*TanG(20)+s+h+2*s+g+4+35)}; big=big*num; perf=perf*num; knifes=knifes*num-(num-1)*kns[0]; f_data_tv.t_knifes_length.value=Math.round(knifes)/1000; f_data_tv.t_big_length.value=Math.round(big)/1000; f_data_tv.t_tech_length.value=Math.round(tech)/1000; f_data_tv.t_perf_length.value=Math.round(perf)/1000; f_data_tv.t_gab_x.value=Math.round((b+s+2*(h+s+c))*num); f_data_tv.t_gab_y.value=Math.round(l+s+2*(s+h+2*s+g+4)); f_data_tv.t_zag_x.value=Math.round((b+s+2*(h+s+c))*num+2*offs); f_data_tv.t_zag_y.value=Math.round(l+s+2*(s+h+2*s+g+4)+2*offs); f_data_tv.t_total_length.value=Math.round((big+knifes+tech+perf))/1000; f_data_tv.t_total_cost.value=Math.round((big+knifes+tech+perf)*price/1000); f_data_tv.t_total_cost_nds.value=Math.round(((big+knifes+tech+perf)*price+(big+knifes+tech+perf)*price*price_nds)/1000); } else{alert('Неверно введены исходные данные!')}; }; //--------------------------------------------------------------------------- //-------------tomato-------------------------------------------------------------- function Sum_tomato(){ var l=parseFloat(f_data_tomato.t_l.value); var b=parseFloat(f_data_tomato.t_b.value); var h=parseFloat(f_data_tomato.t_h.value); var c=parseFloat(f_data_tomato.t_c.value); var t=0; var s=0; var d1=0; //8 9 18 switch(f_data_tomato.sel_profile.options.selectedIndex){ case 0: t=2.8; s=4; d1=8; break; case 1: t=3.8; s=5; d1=9; break; case 2: t=6.6; s=9; d1=18; break; default: break; }; var speed=f_data_tomato.sel_speed.options.selectedIndex; var y1=0; var y2=0; switch(speed){ case 0: y1=60; y2=80; break; case 1: y1=80; y2=100; break; case 2: y1=100; y2=150; break; default: break; }; var price=parseFloat(f_data_tomato.t_price.value); var price_nds=price_tomato_nds; var num=parseFloat(f_data_tomato.t_num.value); var offs=parseFloat(f_data_tomato.t_offset.value); var big=0; var knifes=0; var tech=0; var perf=0; var bigs=new Array; var perfs=new Array; var kns=new Array; var techs=new Array; if(l>0 & b>0 & h>0 & c>0 & price>0 & num>0){ bigs[0]=l+2*d1; bigs[1]=c-s; //!!! big=bigs[0]*2+bigs[1]*4; perfs[0]=b+s-2*45; perfs[1]=b+s-2*38; perfs[2]=h; perf=perfs[0]*2+perfs[1]*2+perfs[2]*8; kns[0]=b+s+2*h; kns[1]=l+2*(d1+h+c); kns[2]=h; kns[3]=131+107; kns[4]=158; kns[5]=96; kns[6]=201; kns[7]=h-35+72; knifes=kns[0]*2+kns[1]*2+kns[2]*4+kns[3]*2+kns[4]*4+kns[5]*4+kns[6]*2+kns[7]*4; //alert(numOFtech(kns[1]-6,y1,y2)+'\n\n'+(kns[1]-6)); techs[0]=35*(numOFtech(kns[0]+20,y1,y2)-1); techs[1]=40*(numOFtech(kns[1]-6,y1,y2)-1); techs[2]=24*techs[1]/40; tech=techs[0]*2+techs[1]*2*num+techs[2]*num-(num-1)*(40*2+24); big=big*num; perf=perf*num; knifes=knifes*num-(num-1)*kns[0]; f_data_tomato.t_knifes_length.value=Math.round(knifes)/1000; f_data_tomato.t_big_length.value=Math.round(big)/1000; f_data_tomato.t_tech_length.value=Math.round(tech)/1000; f_data_tomato.t_perf_length.value=Math.round(perf)/1000; f_data_tomato.t_gab_x.value=Math.round(kns[1]*num); f_data_tomato.t_gab_y.value=Math.round(kns[0]); f_data_tomato.t_zag_x.value=Math.round(kns[1]*num+2*offs); f_data_tomato.t_zag_y.value=Math.round(kns[0]+2*offs); f_data_tomato.t_total_length.value=Math.round((big+knifes+tech+perf))/1000; f_data_tomato.t_total_cost.value=Math.round((big+knifes+tech+perf)*price/1000); f_data_tomato.t_total_cost_nds.value=Math.round(((big+knifes+tech+perf)*price+(big+knifes+tech+perf)*price*price_nds)/1000); } else{alert('Неверно введены исходные данные!')}; }; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- function Sum_427(){ var l=parseFloat(f_data_427.t_l.value); var b=parseFloat(f_data_427.t_b.value); var h=parseFloat(f_data_427.t_h.value); var d=parseFloat(f_data_427.t_d.value); var price=parseFloat(f_data_427.t_price.value); var price_nds=price_427_nds; var num=parseFloat(f_data_427.t_num.value); var offs=parseFloat(f_data_427.t_offset.value); var t=0; var s=0; var dhole=0; var dklap=0; var dklap1=0; var dklap2=0; switch(f_data_427.sel_profile.options.selectedIndex){ case 0: t=3; s=4; dhole=11; dklap=10; dklap1=6; dklap2=3; break; case 1: t=4; s=5; dhole=13; dklap=12; dklap1=8; dklap2=4; break; default: break; }; var big=0; var knifes=0; var tech=0; var bigs=new Array; var kns=new Array; var techs=new Array; var speed=f_data_427.sel_speed.options.selectedIndex; var y1=0; var y2=0; switch(speed){ case 0: y1=60; y2=80; break; case 1: y1=80; y2=100; break; case 2: y1=100; y2=150; break; default: break; }; if(l>0 & b>0 & h>0 & d>0 & t>0 & price>0 & num>0){ var hk1=0; var hk2=0; if(b/2>h+s+dklap+h+5+dklap2){hk1=h+s+dklap+h+5+dklap2} else{hk1=b/2}; hk2=hk1+(dklap1-dklap2); bigs[0]=l+s; bigs[1]=l+2*s+2*dhole; bigs[2]=h; bigs[3]=b+2*s; bigs[4]=h+s; bigs[5]=b+s-2*40+s; bigs[6]=bigs[5]+2*40; bigs[7]=bigs[6]-2*s; bigs[8]=h; big=bigs[0]*2+bigs[1]*2+bigs[2]*2+bigs[3]*2+bigs[4]*2+bigs[5]*2+bigs[6]*2+bigs[7]*2+bigs[8]*2; kns[0]=l+2*s+2*dhole-2*dklap1+2*hk2; kns[1]=h+s; kns[12]=0; if(hk1>h+s+dklap2){ kns[1]=kns[1]-(hk1-h+s+dklap2)*TanG(3)+s kns[12]=5*pi/2+(hk1-h+s+dklap2)/CosG(3); }; kns[2]=Sqrt(Pow2(dklap1)+Pow2(s/2))+h+s+Sqrt(Pow2(s)+Pow2(dklap))+h; kns[3]=bigs[7]+4*5; kns[4]=hk1; kns[5]=5*pi+d/CosG(15); kns[6]=bigs[3]-2*d*TanG(15); kns[7]=h-20+dklap1; kns[8]=20*pi/2; kns[9]=h*pi/2; kns[10]=l+2*s+2*dhole-dklap1; kns[11]=40*2+dhole*2; knifes=kns[0]+kns[1]*4+kns[2]*4+kns[3]*2+kns[4]*2+kns[5]*4+kns[6]*2+kns[7]*2+kns[8]*2+kns[9]*2+kns[10]+kns[11]*4+kns[12]*4; //alert(kns); //alert(numOFtech(kns[10]-2,y1,y2)+'\n'+(kns[10]-2)); for(i=0;i<13;i++){techs[i]=0}; if(kns[0]-6>y2){techs[0]=Math.floor((kns[0]-6)/y1)*35+2*35} else{techs[0]=35*2}; if(kns[1]-6>y2){techs[1]=Math.floor((kns[1]-6)/y1)*35; if(hk1>h+s+dklap2){techs[1]+=2*35} else{techs[1]+=1*35}; } else{ if(hk1>h+s+dklap2){techs[1]=2*35} else{techs[1]=1*35}; }; if(h+s+dklap+h+dklap2-hk2+10>y2){techs[2]=Math.floor((h+s+dklap+h+dklap2-hk2+10)/y1)*(35+s/2+h)}; if(kns[3]-6>y2){techs[3]=Math.floor((kns[3]-6)/y1)*40+2*40} else{techs[3]=40*2}; if(h+s+dklap+h+dklap1-hk1+10>y2){techs[4]=Math.floor((h+s+dklap+h+dklap1-hk1+10)/y1)*(35+h+b+2*s+h+s+s/2)}; if(Math.min(hk1,d)>y2){techs[5]=Math.floor(Math.min(hk1,d)/y1) if(techs[5]>1){techs[5]=techs[5]*(2.5+Math.min(hk1,d)/2*TanG(15))} else{techs[5]=techs[5]*d*TanG(15)}; }; if(kns[6]-6>y2){techs[6]=(Math.floor((kns[6]-6)/y1)+2)*(h+s+dklap+h+dklap1+35-d)} else{techs[6]=(h+s+dklap+h+dklap1+35-d)*2}; if(h+10>y2){techs[7]=Math.floor((h+10)/y1)*(h+s+dklap+h+dklap1+35-h)}; if(h>y2){techs[8]=Math.floor(h/y1)*(35+h/4)}; if(kns[10]-2>y2){techs[9]=Math.floor((kns[10]-2)/y1)*35+2*35} else{techs[9]=35*2}; techs[10]=techs[3]/40*24; if(Math.min(h,d)>y2){techs[11]=Math.floor(Math.min(h,d)/y1) if(techs[11]>1){techs[11]=techs[11]*(2.5+Math.min(h,d)/2*TanG(15))} else{techs[11]=techs[11]*d*TanG(15)}; }; if(hk1-d+10>y2){techs[12]=Math.floor((hk1-d+10)/y1)*(35+h+b+2*s)}; /* techs[0]=35*numOFtech(kns[0]-6,y1,y2); techs[1]=(35+h+s+dklap+h+5-b/2+dklap1)*(numOFtech(kns[1]-3,y1,y2)-1); techs[2]=(h+s+35)*(numOFtech(h+s+dklap+h+5-b/2+10,y1,y2)-1); techs[3]=40*numOFtech(kns[3]-20-6,y1,y2)-10; techs[4]=(35+h+b+2*s+h+s+s)*(techs[2]/(h+s+35)); techs[5]=0; if(d>y2){techs[5]=(d/2*TanG(15))*(numOFtech(d,y1,y2)-1)}; techs[6]=(35+h+s+dklap+h+5-d+dklap2)*numOFtech(kns[6]-20-6,y1,y2); techs[7]=0; if(h>y2){techs[7]=h*(numOFtech(h,y1,y2))}; techs[8]=0; if(h>y2){techs[8]=(35+h/2-10)*(numOFtech(h,y1,y2)-1)}; techs[9]=35*numOFtech(kns[10]-2,y1,y2); techs[10]=24*(techs[3]+10)/40; */ tech=techs[0]+techs[1]*4*num+techs[2]*2*num+techs[3]*2*num+techs[4]*2*num+techs[5]*2*num+techs[6]*2*num+techs[7]*2*num+techs[8]*2*num+techs[9]*num+techs[10]*num+techs[11]*2*num+techs[12]*2*num-(num-1)*(techs[0]+techs[2]/(35+s/2+h)); big=big*num; knifes=knifes*num-(num-1)*kns[0]; alert(techs+'\n'+tech); //alert(s); f_data_427.t_knifes_length.value=Math.round(knifes)/1000; f_data_427.t_big_length.value=Math.round(big)/1000; f_data_427.t_tech_length.value=Math.round(tech)/1000; f_data_427.t_gab_x.value=Math.round((h+b+2*s+h+s+b+s+h)*num); f_data_427.t_gab_y.value=Math.round(l+2*s+2*(dhole+h+s+dklap+h+5)); f_data_427.t_zag_x.value=Math.round((h+b+2*s+h+s+b+s+h)*num+2*offs); f_data_427.t_zag_y.value=Math.round(l+2*s+2*(dhole+h+s+dklap+h+5)+2*offs); f_data_427.t_total_length.value=Math.round((big+knifes+tech))/1000; f_data_427.t_total_cost.value=Math.round((big+knifes+tech)*price/1000); f_data_427.t_total_cost_nds.value=Math.round(((big+knifes+tech)*price+(big+knifes+tech)*price*price_nds)/1000); } else{alert('Неверно введены исходные данные!')}; }; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //------x=float - длина-----z1 - (min) растояние между ножами------z2 - max растояние между ножами---------------------- function numOFtech(x,z1,z2){ var k=0; k=Math.floor(x/z1)+1; if(x-(k-1)*z1>z2){k++}; return(k); }; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- function SinG(grads){ return(Math.sin(rad(grads))) }; function CosG(grads){ return(Math.cos(rad(grads))) }; function TanG(grads){ return(Math.tan(rad(grads))) }; //--------------------------------------------------------------------------- function SinR(rads){ return(Math.sin(rads)) }; function CosR(rads){ return(Math.cos(rads)) }; function TanR(rads){ return(Math.tan(rads)) }; //--------------------------------------------------------------------------- function rad(gr){ return(gr*Math.PI/180); }; //--------------------------------------------------------------------------- function Sqrt(x){ return(Math.sqrt(x)); }; function Pow2(x){ return(Math.pow(x,2)); }; //--------------------------------------------------------------------------- //---------------------------------------------------------------------------