From 57a93bc812dfaaa1d268b2ee0bab5221ab81602e Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Tue, 26 Nov 2024 09:16:45 +0100 Subject: [PATCH] Migration --- .vscode/settings.json | 7 ++ README.md | 19 +++- bin/App.class | Bin 0 -> 7673 bytes bin/Break.class | Bin 0 -> 2424 bytes bin/BreakSchedule.class | Bin 0 -> 1754 bytes bin/Co2Data.class | Bin 0 -> 3726 bytes bin/Date.class | Bin 0 -> 1836 bytes bin/Points.class | Bin 0 -> 2206 bytes bin/Teacher.class | Bin 0 -> 2685 bytes bin/Time.class | Bin 0 -> 1347 bytes bin/TimeTable.class | Bin 0 -> 2706 bytes src/App.class | Bin 0 -> 6042 bytes src/App.java | 203 ++++++++++++++++++++++++++++++++++++++++ src/Break.java | 56 +++++++++++ src/BreakSchedule.java | 47 ++++++++++ src/Co2Data.class | Bin 0 -> 2967 bytes src/Co2Data.java | 88 +++++++++++++++++ src/Date.class | Bin 0 -> 1420 bytes src/Date.java | 74 +++++++++++++++ src/Points.class | Bin 0 -> 1806 bytes src/Points.java | 82 ++++++++++++++++ src/Teacher.class | Bin 0 -> 2623 bytes src/Teacher.java | 73 +++++++++++++++ src/Time.java | 37 ++++++++ src/TimeTable.java | 79 ++++++++++++++++ 25 files changed, 763 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 bin/App.class create mode 100644 bin/Break.class create mode 100644 bin/BreakSchedule.class create mode 100644 bin/Co2Data.class create mode 100644 bin/Date.class create mode 100644 bin/Points.class create mode 100644 bin/Teacher.class create mode 100644 bin/Time.class create mode 100644 bin/TimeTable.class create mode 100644 src/App.class create mode 100644 src/App.java create mode 100644 src/Break.java create mode 100644 src/BreakSchedule.java create mode 100644 src/Co2Data.class create mode 100644 src/Co2Data.java create mode 100644 src/Date.class create mode 100644 src/Date.java create mode 100644 src/Points.class create mode 100644 src/Points.java create mode 100644 src/Teacher.class create mode 100644 src/Teacher.java create mode 100644 src/Time.java create mode 100644 src/TimeTable.java diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/README.md b/README.md index de88071..7c03a53 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ -# co2DataProject +## Getting Started -Hell on earth \ No newline at end of file +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/bin/App.class b/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..d3fe19c9a0351c9b079e45bc4b1207358f2156de GIT binary patch literal 7673 zcmcIpd0-snb^kr>u4c6w+hQ#rE7>pxVdCMgg?FvU?5NK;HJ%W`mmq-mk)m0s!Hk{+Q)dLJPK<@bFv>s?``%|Bi6 z%s1chzW09bz2Em{^v1h0muF|uD<3vcAqZ^CWDEoaHTT#j?6#Dh9&Ot*a*q?w3yfUc zPN$u$VDW$+E##A_wjr;xTM*7Wc6`jq<^+)=1H;|}`xoxtvuF3Qb(@Y29@xEo$9{qI z3l{Xc>0I7U=MUPcf)l{94e2X0H~KRJsQp^vO7AUKdY5f*xy8`%w*AA$`nC=45JWwN zw7Nt2Y%)FC9Y!rDb+&ij+|tp}(tb1b+cDUu=ZCSZd}t$wdg7^MI+@=>1R5F-3WB|E z!ZENyaLrYwR^eJ$2Cka}($MK#-kC753fBuNk~C(Cr&H2x>rZD2d8*~u6WtNiW3`DJ zu|`nYG#1{gZ@wmIrBM(n&pIpcy|4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;@gCx=)2-4B>b9_rZ4v5Lw%JTcuj9RK1Prnuw}n zJ$UFHj}M|ub`>~H-fdd;zd#{gwd9p$AJb~6bY`403oh}lT8G$DuN&{@Q-vIsJ9xhX z3*~MIKY^64aou+GbyQ!ISM`kRo(X+*`Vi$aR^&tSusnj;_W=2g BCIkQg literal 0 HcmV?d00001 diff --git a/bin/Break.class b/bin/Break.class new file mode 100644 index 0000000000000000000000000000000000000000..5193bc123e2ce03416e3ec7d206fa31dbeb0a1d6 GIT binary patch literal 2424 zcmaJ@Yj@K|5WO2e$ zp(k=zmTc)XO82&&s9Hd+A4reibalgOsfs{CIdvXCv>YqADsVI(DWbKoDUe)o>ne)` zOcNO#=8Jq`a}d00B89Zxy<@^anv$yJsI^XOOL-e|%T@xps#}xxrt~a*j)lpfY54+1 zHAG4bnT871BV3t$;SI8k|5iE}qtbZNynHjnOnta98_H3h3>4k(2o&?H)&0QN1J80A zmDpFISChf}0@KYPX#3?-Nw%#b;W-Vz%`6scZmU#lO2<*QU&=DnlP1P6uG8^>iD}Fb zeBeet1V#wH$8!$A854OF1jbu(N3FO{O$HCGpvfJ};RH;^rF`$pUP&MG8q}PLNsQ;X zJCi|CKul$@$U@C5FJ`ffa|X^HAVY-L#Ccp`89ddtWsSwU(T!oHDZO>|w4Ss%LshvPy-1Y?w|Bxjvv*EH)fA#i9*H^P18 zSuPoFY)M}|@N9vxZP#nbAW-#?b2n%~_X5lJRzX_ri<2#BIeeCX-0P*VnZZqRU~#b= z{$}wBRt?-HGHuhur?^AkyVCBcd)oq&eKHagK7+e7w0yRF{xW}cS?}qF8_eJ{f$Z|) z^0|ejrG=%735@(z*Xj)u@8Z2dY~l+84-XdjnIEW@iAVU7G;lj?_|XWw<(BTVA=qwA zPOFl|SNO)j*8;;~1`n!De2ec0zpY=`%)w|s_2aRMeUQoue)yG2cB%-RYB9O`&l&c#DK-V+^?(U?7BOu6mcf%p;#hSl+jWfUtu87l|#8-rXxyo_lt=Q7{m2ZG~o$1L!zqkx^ z1Wx?_RXzB_B;X_&l;CI@;19=mxZ@D#*Pw>HjPbg_MpVu^@ec4E-C(a9<$D z`vd99Q3Pb1?vDKj5SnbQBCrpCGBh>KlFTr#r&;|x=275ZfP4t(YUB!KROpgU@gc5+`K~a# zqs&_ZmvD`;1m73%5qC*inZ(E3r3m~w{{e}r@hde3Z7k((yu__)uFCc9?+}mX=3iiK zEqA}1%zb_#HJX}8F1*BgIsFSBOr-blc)xI`$RVIeP$igHBu|#<>MTx#fG<#TF@$|P zas-Jj-cMsLE~v>cBaV&Xco;w;EU^wMNh`x)peY7Fh#F;ShE=D90Vr(qJHoTga9Ulf Pi>K7+!RsNwE++l~T{i_z literal 0 HcmV?d00001 diff --git a/bin/BreakSchedule.class b/bin/BreakSchedule.class new file mode 100644 index 0000000000000000000000000000000000000000..17a59e2b63e32025f9d8600040e6cdc065152405 GIT binary patch literal 1754 zcmZuw-&0dp5dIFy%?;rS@hU0^S_N%Dlq3+u3&rwFTfIQb1#L=OdI?tugv7?cV`n@a|e%ak`chBygKmYxGZ+{WtCN*K2~*DOdMxuA9e=PakMHJnY5G5#c^I>#>o)23Cuca!ixe2v~Q=t zK_^SvWr0IZhVY8O+fJIWD}=dpBNVP#Fc6F5-7ptJ^@usGL){RV(V=b%%<5460-1}x z8G+12I3SR@2y+6Ni|}>`b2-U%$AT%j*p}!W9rZmi=NMJYcP+%lJg&`ytaLIoXEl4; zLL*`cI^MVN0X|f)3Y>i{(5-%^kWQU2(GyfX_322`hZYiO5;SAMLK8Q@EtZ4X?X8ud zy5O&r0tMTx6#UX7zgm?42g=x}9%KR$%v<;f&8)h%USu6D;qdD_Ibwo?HguH7& zmz5=Imvz#Td!r>6L`#lTOAeIM;9i|VGx;rmiXciI@Jq7sHIn&=ZF~8seb&nx_Bk&f zvoCmg({A_jal6CICu8;{o~Hc{&$xZndx7pc@4E0(!s``YpYU!8FRgi5%^TFbA@YWe zFr6c`Q7Xm`6z_{-f{LkKbnjyL74E&jgI$d6VoGE8HR literal 0 HcmV?d00001 diff --git a/bin/Co2Data.class b/bin/Co2Data.class new file mode 100644 index 0000000000000000000000000000000000000000..805022a2647d7b201e160bc568a62cbb51f56798 GIT binary patch literal 3726 zcma)930E7}75<(OjF87*#1dm;m&Oi82%^MEvw%Zt2t+u-rU>Jbq)i8DfHBgHGBcv4 zNz*0izNK60E@_%>?vl1{8Vkp?NxGc2r$3|p7d@wOzc({N5~z!P&gjj%%e(ix-@R}6 z+uJwZxOo$k_>+Q=fHG;Fd`NRO1z~{$7qty7nb*wKQ!Tn^Ct6y@HS!Y9K}FN0%H_Fi}auGny}%u2ImZF3EU^ zKn%b`DyA?ka7#g3r;(Y}+zW=g#+Bo0rc2g!lL&iHj^Z@p3P_tC4<*A&PLx(wbX(8O z>sn5?6+9x)TanF}#ga?X=vu)S%eZG%oW(g7hH=*@FqleV=(R>L7R4F7N7j2@;9vmI zE|oYDNnt@MohO&7O8&89zWjoU_hO0lU_d$9gR+?$W-0KPipTLj61%9`jxHyNz>x;k ziSH13AD#fm%mw{GBA=yJpQO2D&6+B(h^L*@(mJP-J zVKd5E>A_oj2208@u1T<&tS{ezpVO(SWD~14Ul6oCx5E-MyBVF^fc|0*F%1Zfo%q&^4g_SDb$&0=NNAKn#o?R*s2pK-P9`m9#;ZiWcH#8ZZ4 zdB3dUEBLBFvs26)4588dh(G50t_4imeqF^2vKzu=L?MdH_?Cii3UpM_oiSZ~Rku}q z8{Z+sUMFyG7l|vSpHcAL%HZ(^UdAXC^RjjHY0EBXoQ2Kysg#XLcU!>MZ!&3mg~5-R`lmT^Z5;~DR_+uRKYaN4QpLb z`e^whcUsH3mc1$asVs20wgm%i-(gBKb9vo4p0=#@QgLi=Ics+63>QeS2I{qdH0brf z#iW+cXAA<|-hx*nc%2wcYs^2_KiZ#KSeWadvTe)m&+^LQj)-8Jli%Mn%zoLA{VTeg zUE>#nC;lDD;frN;x$Eo5Vo^?1XLv{3lX=Z?bVtEk0=Ml!uMr*!{vdGlzpJuKeem#3 zvZaYPV2J~>Hy3xZosUeRM-bx-6;`$aG430_iSIU})UPJp;E<%vbeS;p)q3SCH4v8@i z1;*pl4oPhr3d`#_1*bc7uNeU<(hwxsBA)HqOY+^cLo}kQoj4hRayI za0Lf@o3G>1(U#tpKSNFQw!Dt_hj77@E{!(-<>o(Vl)Hk?*;lbTd>w@waDXy45?2{_ z1kd7=c#0g5MLR%L;6Bp)>591mBM({kfKFU)&VB=%>IFahbMOr;a#x3%kPcW7+ zJ$KW~Geqxc;^(jUU4c)Nk1c#}$7k?a+J25cCAECNpXcfe+)1GMZA>V5LcxH7?kC%SI(;1HJ-LMV8uoxQ?OBpS+o`8$u6-IN-NeX)$^(}|{&WqfTm5tcvK@s06q zytov5X$vn)>{-I^k2Y^ZEcG@Y*}{*nrU`GtgZC#Myh6eYeqi52c$++U2Rt}tnA91j z^9Wn$9BDPjkmsqDA&3i@#(59Alt-Nue(FKTMDR2GoF3aSh*!85qV-YgMCkh%z5fEg zWc&$cBAd0DzB)XZd{Eep8%&tGzhX=wT!rklF1~Nk=XLLS!+ZV~Z%`s<$eZ{*{)pax E1E$Z2IRF3v literal 0 HcmV?d00001 diff --git a/bin/Date.class b/bin/Date.class new file mode 100644 index 0000000000000000000000000000000000000000..cff29c258a08b4de39e0cd8c0c5e8aec30566b50 GIT binary patch literal 1836 zcmZ`(?^7F96g^8eKiQTL2tuJ0ftX}N2+}H+M5=<6Xn>CC;4pr1Aqy;qgjtq4^>6Wu z-~FI7QWbmd_ZYC=ZP_VAFl1m5Y33;u_Y%l3`AiC<7>gtO9}0e~fp;*@;uq&_ zhkWv3*}r+aVgmP=xSYTgm(>)eF%!oF4a2wG>K)HMwp|17Vpc=q+;T5$?)^^(^&~XR z8;Bw%=sg2*9~BHFd}JC(`e?yG3b7RLEgGmuv*T9l^zy>n?7GeG9q$L*rOK`6&KZ>( zYB(Kx=kn~pcAr}ZZSG_m-9xLrXSt5N2b;Qg;#^SYhK#GKA>QIjjpX`mQ-R>@M~?jh zBO&@|NXmt0mg_NT(j$`qCkl1>labwNde-50+tztNA%1Lo`^pcT9UYP2`?hb27~zKa zLhfuSYb50~a7V)H`ph(p7K(54P2h8Clv{e#D(9A#{l|=;Re8wxo*LK!YsOz#?Mr+2 zNW)m6-kT{HXH~rPrGW;vDb`WfJ+nB{$04@qRmHb^wKw05lBp)!IkYz&8BJ2uUlhG* z8+sU^BL>73L<8apwbBu4r61HvH*gi>48q{^4&PogI?DBH^LN}WWrkm2WP2g9oS7il zSa!Euo=I4_y6Q2tdFUgC3+MWwh-Qx5Vs zN($4sivotQj5KN(##3bQ6|&gF7~bdYM?N*4Kja%pa_0j@zkv_2!d6H559A}F2y;E= zZ-x1#z15(-A9+Wbo|pE_N#Q?rg`CMw@@7`QLeb1duh7SJmLC%^!Cd#qc#>jGtw|w9PvbSv2>5Ls9=$ zs1c;cf5N!hN{_c>kEeM#&5N`Vh_qu$CX-1^q`5$nWy)Gn6lKm#8c?jN7_Gp~8a@sx zSGdZhDC^DrOfaCb#?z? zOZ~y?p~0WgYW_EKM7>3@T4p2hCnEb15$+nB&3&CHr;v!5S13kQR47hV5_F9(e(BSB OtEXn|M&})MYxiGhh%<8l literal 0 HcmV?d00001 diff --git a/bin/Points.class b/bin/Points.class new file mode 100644 index 0000000000000000000000000000000000000000..e3767140b12e52221eb613b84f31bfcd54cd43c2 GIT binary patch literal 2206 zcma)6+fEx-6kW$-Y%(5f$03B)xOFbHW+0)Vmy{Ti)@dVIH6aox66y;B9>^rdj?5VK zUn=#rFMVjGUQng>1NsB~o2F}@GqwlImayb=*=L`%*1nwi=f6My2C#`*8VQBe^G?tX zPt!;$ zI0W1X+Clh8!Ky61P)I)MG<_QuW*l6BeFemHFol$?t~yAY)inpxNb#%@wEbtjlLNoI z>m9Uwg+ilq=(S#W-9Yw{F&VxLP8FsbhP6uCO1)ke!kL}WJAA$6y@^~imA;dlrrzjq z3482^Pe)^;WJXsw9dned5Z%U2+)m?`LUx#{EiZiO;0_iU@`?AI!W5+lPL>pnc%rfd zzG$FFEuK8_xL}y~n#~cJ{Y205D2CQIXKB6wAu@J5q1WnrOoyGFup6|G6=o|-jbS9l zTAjvyg|CFQY${*Yg??CGY_60IW89+2$_Cu{Xf|2e_!yt2@d+zEWU049pUvaoGdxg8 zpLwmGzkQ@I#|+2BL~d1^eX{Q0E=o44*i2*NLZceZ4j$n#t9#Vxo_K8A^-2sW3hUdL z$+UMh&KG$p*gKtG_t1YDNcUw-T=zsii_a4C?N~@i2XmE>{?#+PmvfdL>~fA7?w;{n zah`Smfa6-fAuB^(hQcrU)-1<4Vu9VC2!v2@oN!nI4 zcJX_pi$5Z%ITpBCFq^zv;-+Lan$yCNGfRXVt|E{3I4+~0IbDMragssDDsimnXcKxR z@mhF?>n)_-Vg|`H6n{{h-_qRQC&d2ErHwksccUOZ1}StU9pv(_$Vv`5=OvAt3u7{Q zo%-jPxf_gh9t+ecnVd5~gQ!X<(t~p8QHtnR^&XgV$@CL1C3LbHV&dM9 zF4uHh0JdAS&QYe&VTo-`ev{?96%%6*#Mn`a6+Rd%CO;}>ajcjRCyU9Cidmu6n7d=eEKL>@YkrfN`xLV_L5wt-h;avayHTcd#UC)^?y*+I{V3h0yR&ov zKQBo<;A>is0p|uO&$0djEFEk?$-`Zq%#arbox?c81{pTV@c6O}E0Y-t!Vr6*CWaar zo{-_|%QEmY$w=hmv(BEAzRgK9^Pk`6P}mOA4r7$$Kg2Rm%MxpUdhT4}az@^MFh&+x*5oC-QcTac%IBzR=!Z{txDc BMwkEq literal 0 HcmV?d00001 diff --git a/bin/Teacher.class b/bin/Teacher.class new file mode 100644 index 0000000000000000000000000000000000000000..03e95938d4b71b2037297cfa929b133b5fd05570 GIT binary patch literal 2685 zcmbVNX?GMw6uq5oIztnnNr12j3Q9685s*a_qGUoAGY}*pKyd5KbY_~&bjO}<5L7VY zF77MtD{i;|5=77O_}O#(1O5U3fS<)%-ObdH=+Wbs>3X+b-TUe-HNX7%!%vqlBZ+e{ zR49lInnpTjx-nEK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|ylgw`Kn4)ccip z^=rHJx2X3E-_WlMnQ@sfdcW>(MBB{Z4jm-?2ph7(yFmtb{0ISB*Pz(Mz(>m|VZ${b zw5U-M4}ou^9P~EiUV0y`tLI{0oPV41eYAV&{lYi&ETD&0;{PwS z?y>eGjK~UkU?XxRMGf8%nlUP1{1AH@_-OYu@X@|xu;j6Ca%xA3_5#t45$#2y9VgmL zM0=TNuMq77(M}TW6wyu-?I_XCG(oGdg)i!8vBO(mp0B>-Lm0_K+att#9zyTYzx7^+ zio6c#pU{yU=^6Qfmi1Sn!<}`F@4*~zka;&ss_rRx4f;@Z-zs`Xjb9Pr{{yR2?}Y#W literal 0 HcmV?d00001 diff --git a/src/App.class b/src/App.class new file mode 100644 index 0000000000000000000000000000000000000000..cdc4b8e96c2869881412a181887d492d64944b5d GIT binary patch literal 6042 zcmcIodwd*Mb^fljs~N4vw!F4uuVf`-TXrN{T0P>YBs;Msn<$ZF6Uk1TG<8P1V`-z+ z&ayLW$KjC%Tml5bJLCa*kszRHNt{-el@jQ?yx)(~mNzZ5rO-l42n6w+nUS=z1V8>k zKmG39d*|Hq{LZ;&_T#^reh$DcwKs+%xKqcg<6OR0$6Y#J7eftRABV!-I^GyZ8Sast zH^)(q*TxaSJ#j>3sE`+j@s1c)_I;ap26v|q;k(NQPkjag7>i9ZUIylhdlj!({LPb|5m+|%~ls7aU zQ;2jsXGSmYe#Ia$MUTG zrzm2?KI9boGr6KivFjRodzX;Z*h6m(dRA(z-^%+MYWSvxZz-%!S=m%EOGOV9Y-{X@ zlgW8>ezf7H9q;sE7Y`9Lro7XsyJHL*MTN#SKq~WF|RHv*pS!;YaZPk}@sc-d7oyFuFIK@=G zE0qm#5gT-hg_M0LBPh`K=krOyxq)G%6zWGkFYk7=v{?B}(i^4SZk}FGrkwGX)Tm@e z)@`BZ4mghIdIc-rZ+oLo+FenBZ|nGuf$!pb#J)-RZEkNh@Nf8c9p9JjA1E+~|3jw# zY2d%`LmmIE<3~DvtmA(SoWzKM|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~F^xz0k+g}@#*qu-l;CLz>7sCUl8o(cNcJGrl%HXamUo`R z+6!2xZ~+O0zHOoP`#AB9ujzjlwa1&zWBtIhs5^chmv%&&6Ol<=CW9%%hDmHZhfOtS zp_&ILWSJAHh{Hf;vu0}V3-b08V^zAiJ_9CijWcCHViAld4 zDtee_#hwl4P``B&o6lj(Brd-nF@MtVr2lBVeq!bab3)~ZFyI=3uMgGeC)y7CLLw;B zR**US@R0dYGMB$bGLHw`>*L#eDfRKD@Yx(blYGwSNC4)ewC@;&Tu(UPz-S+5oNuHE zcKM-**HDBAX%P`EWKq#s^AI+1RWnThU=nSs(LROk6VUr8dgocp5MfXAcnukDqPqfD zZjl6FF6%f!7~jIT!+dX(B87UUXao0?Ojm)=a)D1w-JoGdTKKE*#> zz{St<&sPYu{PvO86y5l`lIM`Jic?8B34o%@D6IfUK04n|2av{H3ES&k8 zpC-NY+8>~ulG>O8Eo-u)PTZ=QTq%wT?`A2*M-h=ckmp;p?2^YgHl)U<7qn*bU0XZ pVhoOAaAbUgKfcKy-{OyN^~bmQ " " + + } + + private static double getDataAverageForMinute(int minute, int hour, int number, String date) { + // get the url + String startTime = ""; + if (hour < 10) { + startTime += "0"; + } + startTime += String.valueOf(hour); + startTime += ":"; + if (minute < 10) { + startTime += "0"; + } + startTime += String.valueOf(minute); + String calcStarttime = startTime + ":00"; + String calcEndTime = startTime + "59"; + + String url = generateLink(number, date, calcStarttime, calcEndTime); + + double averageCO2 = 0.0; + List co2DataList = Co2Data.getData(url); + for (Co2Data co2Data : co2DataList) { + averageCO2 += co2Data.getCo2Level(); + } + + return averageCO2 / co2DataList.size(); // Example CO2 average level + } + + private static void calculateBreakPoints(double[] minuteData, Break calcBreak, Teacher teacher) { + int duration = calcBreak.getEnd().getMinute() - calcBreak.getStart().getMinute(); + int breakPoints = minuteData.length; + if (duration == minuteData.length) { + for (int i = 0; i < duration; i++) { + if (minuteData[i] < minuteData[i + 1]) { + breakPoints--; + } + } + } else + System.out.println("Unexpected error"); + if (duration > 5) { + teacher.addPoints(0, breakPoints, 0); + } else { + teacher.addPoints(breakPoints, 0, 0); + } + + // check if next lesson is lunch another teacher or the same and plan + // accordingly + + } + + private static void initializeTeachers() { + int index = 0; + for (String initial : Teacher.nameMap.keySet()) { + Teacher teacher = new Teacher(initial); + Points points = new Points(); // Initialize Points object for each teacher + teacher.setPoints(points.getLongerBreak(), points.getBonusPoints(), points.getFiveMinuteBreak()); + teachers[index++] = teacher; + } + } + + + // #region User Interaction + private static int getUserInput(String textOutput) { + System.out.println(textOutput); + while (true) { + if (scanner.hasNextInt()) { + return scanner.nextInt(); + } + scanner.next(); // Clear invalid input + } + } + + // #region Explanation + private static void printExplanation() { + System.out.println("Point calculation explanation:"); + System.out.println("1. Up to 5 points for keeping the window open during a small pause."); + System.out.println("2. Up to 10 points for long pauses, depending on window usage."); + System.out.println("3. 5 bonus points for teacher switches in classrooms."); + } + + // #region shutdown + private static void printShutDown() { + System.out.println("Shutting down..."); + for (int i = 3; i > 0; i--) { + System.out.print(i + "..."); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + // #TODO: remove this before hand-in deadline + public static void debbugingValueLists(List data) { + // Debugging co2Data + int index = 0; + for (Co2Data a : data) { + System.out.println(a.toString()); + index++; + } + + System.out.println("-----------------"); + System.out.println(index); + } + + // #TODO + // #region Print & sort + private static void sortTeachers() { + // Sorting teachers by total points (implement sorting logic based on points) + Arrays.sort(teachers, + (a, b) -> Integer.compare(b.getPoints().getTotalPoints(), a.getPoints().getTotalPoints())); + } + + private static void printTeachers() { + int rank = 1; + int previousPoints = -1; + int currentRank = 1; + + for (int i = 0; i < teachers.length; i++) { + Teacher teacher = teachers[i]; + int teacherPoints = teacher.getPoints().getTotalPoints(); // Assuming points are available in getPoints() + + if (teacherPoints == previousPoints) { + System.out.println(currentRank + ". " + teacher.getName() + " " + teacherPoints); + } else { + if (i > 0) { + rank += (i - (currentRank - 1)); + } + currentRank = rank; + System.out.println(rank + ". " + teacher.getName() + " " + teacherPoints); + } + + previousPoints = teacherPoints; + } + } + + // #region Main + public static void main(String[] args) { + System.out.println("Calculations in process please do not shut off..."); + initializeTeachers(); + sortTeachers(); + printTeachers(); + for (int classrooms = 0; classrooms < 3; classrooms++) { + for (int weekday = 0; weekday < 5; weekday++) { + // get the url and data + // calculate points + } + } + // Loop threw each day with a specific classroom and after the weekdays are over + // go to the next of the 3 classroms + // go threw every break calculate the point and give them to the teacher + // directly + // remember the point class + // breakShedule needed + + while (true) { + int userInput = getUserInput( + "Do you want to see how the points were calculated? (Yes 1, No 0; anything is an error)"); + if (userInput == 1) { + printExplanation(); + // add a more detailed listing of the teacher since points can be broken down + // further + printShutDown(); + break; + } else if (userInput == 0) { + printShutDown(); + break; + } else { + System.out.println("Invalid input. Please enter 1 for Yes or 0 for No."); + } + } + scanner.close(); + } +} diff --git a/src/Break.java b/src/Break.java new file mode 100644 index 0000000..a646d36 --- /dev/null +++ b/src/Break.java @@ -0,0 +1,56 @@ +public class Break { + private Time start; + private Time end; + + public Break(Time start, Time end) { + this.start = start; + this.end = end; + } + + public Time getStart() { + return start; + } + + public void setStart(Time start) { + this.start = start; + } + + public Time getEnd() { + return end; + } + + public void setEnd(Time end) { + this.end = end; + } + + /** + * Generates a Thingspeak API link based on channel number, date, and break + * period. + * + * @param channelNumber The Thingspeak channel number. + * @param date The date in format "YYYY-MM-DD". + * @param breakPeriod The Break object containing start and end times. + * @return A formatted URL for fetching data from the Thingspeak API. + */ + public static String generateLink(int channelNumber, String date, Break breakPeriod) { + String baseUrl = "https://api.thingspeak.com/channels/"; + String formattedStartDateTime = date + " " + breakPeriod.getStart().toString(); + String formattedEndDateTime = date + " " + breakPeriod.getEnd().toString(); + + return baseUrl + channelNumber + "/feeds.csv?start=" + formattedStartDateTime.replace(" ", "%20") + + "&end=" + formattedEndDateTime.replace(" ", "%20"); + } + + public static void main(String[] args) { + // Example usage + Time start = Time.valueOf("00:00:00"); + Time end = Time.valueOf("23:59:59"); + Break breakPeriod = new Break(start, end); + + String date = "2024-11-17"; + int channelNumber = 1364580; + + String link = Break.generateLink(channelNumber, date, breakPeriod); + System.out.println(link); + } +} diff --git a/src/BreakSchedule.java b/src/BreakSchedule.java new file mode 100644 index 0000000..165913b --- /dev/null +++ b/src/BreakSchedule.java @@ -0,0 +1,47 @@ +public class BreakSchedule { + private static final String[] START_SMALL_BREAK = { + "8:30", "10:25", "11:15", "12:05", "13:30", "14:20", "16:10", "17:00", "17:50" + }; + + private static final String[] END_SMALL_BREAK = { + "8:35", "10:30", "11:20", "12:10", "13:35", "14:25", "16:15", "17:05", "17:55" + }; + + private static final String[] START_LONG_BREAK = { + "9:20", "15:10" + }; + + private static final String[] END_LONG_BREAK = { + "9:40", "15:25" + }; + + private static final Break[] SMALL_BREAKS; + private static final Break[] LONG_BREAKS; + + static { + SMALL_BREAKS = createBreaks(START_SMALL_BREAK, END_SMALL_BREAK); + LONG_BREAKS = createBreaks(START_LONG_BREAK, END_LONG_BREAK); + } + + private static Break[] createBreaks(String[] startTimes, String[] endTimes) { + Break[] breaks = new Break[startTimes.length]; + for (int i = 0; i < startTimes.length; i++) { + // Append ":00" to include seconds + String startTimeWithSeconds = startTimes[i]; + String endTimeWithSeconds = endTimes[i]; + + Time start = Time.valueOf(startTimeWithSeconds); + Time end = Time.valueOf(endTimeWithSeconds); + breaks[i] = new Break(start, end); + } + return breaks; + } + + public static Break[] getSmallBreaks() { + return SMALL_BREAKS; + } + + public static Break[] getLongBreaks() { + return LONG_BREAKS; + } +} \ No newline at end of file diff --git a/src/Co2Data.class b/src/Co2Data.class new file mode 100644 index 0000000000000000000000000000000000000000..837102d59767a67cdc8f948b8803983b3a14ed1c GIT binary patch literal 2967 zcma)8`&SfY7=8xWon;&a7c>`9(NKYfwyZ3{ynrCoqQs&`+GX7R#F5>Zb!L{No0X;6 zz3hI!`%6Dqr=Z}R>L*X9zoI{+Q$63zE-aT*!8zaTyzlot@B2RQWxn74n)w;P9k{9? zj)T=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9PYucuvw8eiwMO)(!sQi{9g-RgGn+eriYk7-Uja8H=xDB@#0XFcd za7U=^dsJMTI~MkZYq{>^jVG|R#rFmX`*!9{Xp{pD2w^>U-icks{pHY=-zDslRfJVk|B0B2x<9c=#lDKac>}HB4{E{YYt(sO)>1b#`GqZ#{yK{y zOnGlxv}p>Plkv(OQ`j;Xuab`+apRs@G>=BNPGg&7gv4&|49%itG#1)0jn->P1|6Sa zL^5ba1`Sr#&bgqsF=N00^K>_>?jEeeVP getData(String csvURL) { + List dataList = new ArrayList<>(); + + try { + URL url = new URL(csvURL); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + conn.setRequestProperty("Accept", "text/csv"); + + if (conn.getResponseCode() != 200) { + throw new RuntimeException("Failed : HTTP Error code : " + conn.getResponseCode()); + } + + BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream())); + br.readLine(); // Skip header line + + String output; + while ((output = br.readLine()) != null) { + Co2Data data = parseData(output); + if (data != null) { + dataList.add(data); + } + } + conn.disconnect(); + + } catch (Exception e) { + System.out.println("Error in data fetching: " + e); + } + + return dataList; + } + + // Helper method to parse CSV data and create a Co2Data object + private static Co2Data parseData(String line) { + try { + String[] parts = line.split(","); + String dateStr = parts[0].trim(); // assuming date is in the first column + int co2Level = Integer.parseInt(parts[1].trim()); // assuming CO2 level is in the second column + + // Convert the date string into a Date object (assumes CSV date format is + // yyyy-MM-dd HH:mm:ss) + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = sdf.parse(dateStr); + + return new Co2Data(date, co2Level); + } catch (Exception e) { + System.out.println("Error parsing data line: " + e); + return null; + } + } +} diff --git a/src/Date.class b/src/Date.class new file mode 100644 index 0000000000000000000000000000000000000000..c1b075ca424e1e37c4fa38b40c7f372690a09597 GIT binary patch literal 1420 zcmZ`(T~8BH5IvV}yW8yowW1bLK18G}l#c=`A1Wv!B!Gz}Xyc0uU2&1Nq--(xM|?Kn z(FaXXiHZII|B{LE%(e<*P1Bik=g!=jIWz6|pI^QKxPf^SP3SXVo9M@YfwX}^6GIq| z;tWPaWJHXL7!xsWQd~E1L&r^VoRGjt9a9RSytA*M78SyUQqg~*pzXU(nd(KULKP`^ z#ft9|OnXJozpZdCwY25zIYZk{adRl^m%ZZVRNoo{?v?WNYhLn-?nK)633_tI9*&K<(ko_&PL2F-Z#EfxY(Jee08Z=-S>mGuY2M-E8 zxK^upRgAovPBa={(Uc1@vwno;Y)+FJ0u&4>KoQ!^0O>?AK}U$cXMA-fs`H!WsW&Jz F^$X+B{U!ha literal 0 HcmV?d00001 diff --git a/src/Date.java b/src/Date.java new file mode 100644 index 0000000..b3f4079 --- /dev/null +++ b/src/Date.java @@ -0,0 +1,74 @@ +public class Date { + private int year; + private int month; + private int day; + private int hour; + private int minute; + + // Constructor to parse date string + public Date(String dateStr) { + String[] dateTime = dateStr.split(" "); + String[] dateParts = dateTime[0].split("-"); + String[] timeParts = dateTime[1].split(":"); + + this.year = Integer.parseInt(dateParts[0]); + this.month = Integer.parseInt(dateParts[1]); + this.day = Integer.parseInt(dateParts[2]); + this.hour = Integer.parseInt(timeParts[0]); + this.minute = Integer.parseInt(timeParts[1]); + + // Adjust for Switzerland time + adjustForSwitzerlandTime(); + } + + // Constructor to create date with fixed numeric values + public Date(int year, int month, int day, int hour, int minute) { + this.year = year; + this.month = month; + this.day = day; + this.hour = hour; + this.minute = minute; + + // Adjust for Switzerland time + adjustForSwitzerlandTime(); + } + + // Adjust time for Switzerland timezone (UTC+1 or UTC+2 during daylight saving + // time) + private void adjustForSwitzerlandTime() { + // Switzerland time adjustment logic (simplified version) + // For simplicity, this doesn't handle daylight saving time changes but adjusts + // based on UTC+1 + this.hour += 1; // Assuming fixed UTC+1 offset for simplicity + if (this.hour >= 24) { + this.hour -= 24; + this.day += 1; + } + } + + // Getter methods + public int getYear() { + return year; + } + + public int getMonth() { + return month; + } + + public int getDay() { + return day; + } + + public int getHour() { + return hour; + } + + public int getMinute() { + return minute; + } + + // Method to print date in a readable format + public String toString() { + return String.format("%04d-%02d-%02d %02d:%02d", year, month, day, hour, minute); + } +} diff --git a/src/Points.class b/src/Points.class new file mode 100644 index 0000000000000000000000000000000000000000..1cef4994585c2e1616700d4206ee0643f3e36cfc GIT binary patch literal 1806 zcma)+Z%-3h6vm(189Fc>rhpaEQZ24%84#3p{Re6St4XsUMvMvZ4Fe2VEmKpb#P70+ zZ+){bc9Z=>Hrf3E`=Qo-&b?C^8b~&TbMHO(oZme6oO}DvzkmJ>;2s{kaByP)1=Pe$ zi3waxW2PTB9n89z!!4K2+b-tut%ExX#ofkXwAzR}Nwn0C!uJZQu25*U;=QPydJ0>u zxO4EL)rgY=h5TY8ZX}NttlHFT1$()*6Opshh@JPdm9#S}5<;5!d@aZllUQCc;fs_Mo(tWNICRE^54M+>YPu!+$M zWvVcAtY~fPU9_DzxbNWs9(uTnF$W7C7V(JP>mJBIPFM|-w`}`<_)(#c-IX2u83rPL#<$|f|tI7d5*KH7fR7~r2v zMuC1$lS(P+Gf6h1W;Ch%Bb@SQ*qS)b#kg5mL4}KoS?Dk1GGFjXC{o)HF4Im^;dv5Q zk^e&Jwu6FFe4ZS?(A{0<#Q($pc52b1spzK^og=HFMNj{VoK%3LE&@mUlscTJ%2A&F z0!kReI4%-)fiqLl3P-7EUqISVoR|{kwNo}P;u5VC|GI7y;09&u2z~tYamih+Yl7vz z%INZ`c&isb$iuiyzl~eI{Fa9P&FQ1LiTo|MNHu3Y!x$-sVetP0!`4a|% z4OXbUnI7BR1D^rld$;*(?(cTw8Se`}M*-s~-1ok8E=TAK8d?@5y8NAk{Ja5gMSK0^Qc phAjv^llx=qSw8q312Q{;`!lo5g)-{acn@D-7HjlQaxaJL{{hBaEkFPO literal 0 HcmV?d00001 diff --git a/src/Points.java b/src/Points.java new file mode 100644 index 0000000..7fefe2b --- /dev/null +++ b/src/Points.java @@ -0,0 +1,82 @@ +public class Points { + // #region Fields + private int fiveMinuteBreak; + private int longerBreak; + private int bonusPoints; + + // #region Constructor + public Points() { + this.fiveMinuteBreak = 0; // Default initialization + this.longerBreak = 0; // Default initialization + this.bonusPoints = 0; // Default initialization + } + + public Points(int fiveMinuteBreak, int longerBreak, int bonusPoints) { + this.fiveMinuteBreak = fiveMinuteBreak >= 0 ? fiveMinuteBreak : 0; // Validate + this.longerBreak = longerBreak >= 0 ? longerBreak : 0; // Validate + this.bonusPoints = bonusPoints >= 0 ? bonusPoints : 0; // Validate + } + + // Copy constructor to duplicate an existing Points object + public Points(Points points) { + this.fiveMinuteBreak = points.fiveMinuteBreak; + this.longerBreak = points.longerBreak; + this.bonusPoints = points.bonusPoints; + } + + // #region Getters and Setters + public int getFiveMinuteBreak() { + return fiveMinuteBreak; + } + + public void setFiveMinuteBreak(int fiveMinuteBreak) { + this.fiveMinuteBreak = Math.max(fiveMinuteBreak, 0); // Ensure no negative points + } + + public int getLongerBreak() { + return longerBreak; + } + + public void setLongerBreak(int longerBreak) { + this.longerBreak = Math.max(longerBreak, 0); // Ensure no negative points + } + + public int getBonusPoints() { + return bonusPoints; + } + + public void setBonusPoints(int bonusPoints) { + this.bonusPoints = Math.max(bonusPoints, 0); // Ensure no negative points + } + + // #region Points Adjustment Methods + public void addFiveMinuteBreakPoints(int points) { + if (points > 0) { + this.fiveMinuteBreak += points; + } + } + + public void addLongerBreakPoints(int points) { + if (points > 0) { + this.longerBreak += points; + } + } + + public void addBonusPoints(int points) { + if (points > 0) { + this.bonusPoints += points; + } + } + + // #region Total Points Calculation + public int getTotalPoints() { + return fiveMinuteBreak + longerBreak + bonusPoints; + } + + // #region String Representation (Optional for debugging or output) + @Override + public String toString() { + return String.format("Five Minute Break: %d, Longer Break: %d, Bonus Points: %d, Total: %d", + fiveMinuteBreak, longerBreak, bonusPoints, getTotalPoints()); + } +} diff --git a/src/Teacher.class b/src/Teacher.class new file mode 100644 index 0000000000000000000000000000000000000000..e24047f5cc544a6b27ba31a6c48cd9aeced51656 GIT binary patch literal 2623 zcma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jmG0mZDmHeXwiFNg#SwM79~tSt$^Qtg%iEYo5ESgx%Iz)EdZ0B+T83&3ivIsi3V zZ2;;tza^vxYqYh2ra@a5fc4sj0BqE555OjEa{#tzTLW;1c4q(@wWa`U)3)b9knSP& zI53NUy(-y timetable = new HashMap<>(); // Map of Day -> Teachers in class for that day + private Points points; // Points field to store teacher's points + + public static final Map nameMap = new HashMap<>(); + + // #region Initialization + static { + // Mapping short names to full teacher names + nameMap.put("Hm", "Hummel"); + nameMap.put("Bd", "Bender"); + nameMap.put("Bu", "Burger"); + nameMap.put("Cg", "Chung"); + nameMap.put("Do", "Doe"); + nameMap.put("Eh", "Ehrlich"); + nameMap.put("Fh", "Fischer"); + nameMap.put("Gi", "Giordano"); + nameMap.put("Gr", "Graham"); + nameMap.put("Hi", "Higgins"); + nameMap.put("Kg", "Kang"); + nameMap.put("Kh", "Khan"); + nameMap.put("Lz", "Lozano"); + nameMap.put("Lu", "Lund"); + nameMap.put("Or", "Ortega"); + nameMap.put("Re", "Reyes"); + nameMap.put("Se", "Seng"); + nameMap.put("Ts", "Tanaka"); + nameMap.put("Vt", "Vetter"); + nameMap.put("Zu", "Zuniga"); + } + + // #region Constructor + public Teacher(String name) { + // Use the short name to find the full name from the nameMap + this.name = nameMap.getOrDefault(name, "Unknown"); + this.points = new Points(); // Initialize Points object when Teacher is created + } + + // #region Getters and Setters + public String getName() { + return name; // Return the teacher's full name + } + + public Map getTimetable() { + return Collections.unmodifiableMap(timetable); // Return an unmodifiable view of the timetable + } + + public Points getPoints() { + return points; // Return the Points object associated with the teacher + } + + public void setPoints(int fiveMinute, int tenMinutes, int bonusPoints) { + this.points.setFiveMinuteBreak(fiveMinute); + this.points.setLongerBreak(tenMinutes); + this.points.setBonusPoints(bonusPoints); + } + + public void addPoints(int fiveMinute, int tenMinutes, int bonusPoints) { + this.points.addFiveMinuteBreakPoints(fiveMinute); + this.points.addLongerBreakPoints(tenMinutes); + this.points.addBonusPoints(bonusPoints); + } + + public int getTotalPoints() { + return this.points.getTotalPoints(); + } +} diff --git a/src/Time.java b/src/Time.java new file mode 100644 index 0000000..62eee0e --- /dev/null +++ b/src/Time.java @@ -0,0 +1,37 @@ +public class Time { + private int hour; + private int minute; + + public Time(int hour, int minute) { + if (hour >= 1 && hour <= 24 && minute >= 1 && minute <= 60) { + this.hour = hour; + this.minute = minute; + } else { + System.out.println("Failed to initialize the hour"); + } + } + + public int getHour() { + return hour; + } + + public void setHour(int hour) { + this.hour = hour; + } + + public int getMinute() { + return minute; + } + + public void setMinute(int minute) { + this.minute = minute; + } + + public static Time valueOf(String time) { + String[] parts = time.split(":"); + int hour = Integer.parseInt(parts[0]); + int minute = Integer.parseInt(parts[1]); + Time returnValue = new Time(hour, minute); + return returnValue; + } +} diff --git a/src/TimeTable.java b/src/TimeTable.java new file mode 100644 index 0000000..00c917e --- /dev/null +++ b/src/TimeTable.java @@ -0,0 +1,79 @@ +public class TimeTable { + private String[][] shortTeacher; + + public TimeTable(int roomIndex) { + shortTeacher = new String[11][5]; // 11 lessons, 5 weekdays + initializeTimeTable(roomIndex); + } + + private void initializeTimeTable(int roomIndex) { + switch (roomIndex) { + case 0: // Room 37 + fillRoom37(); + break; + case 1: // Room 38 + fillRoom38(); + break; + case 2: // Room 39 + fillRoom39(); + break; + default: + throw new IllegalArgumentException("Invalid room index"); + } + } + + private void fillRoom37() { + shortTeacher = new String[][] { + { "Hm", "Ts", "Lu", "Gi", "Kp" }, + { "Hm", "Ts", "Lu", "Gi", "KP" }, + { "Hi", "Ts", "Lu", "Ba", "Or" }, + { "Hm", "Ts", "Lu", "Ba", "Vt" }, + { "Hm", "Le", "Cg", "Ba", "Vt" }, + { "Lunch", "Lunch", "Lunch", "Lunch", "Lunch" }, + { "Bd", "Lunch", "Se", "Bd", "Lunch" }, + { "Gi", "Fh", "Se", "Du", "Du" }, + { "Gi", "Fh", "Se", "Lz", "Du" }, + { "Ts", "Fh", "Se", "Lz", "Du" }, + { "Ts", "Fh", "Se", "", "" } + }; + } + + private void fillRoom38() { + shortTeacher = new String[][] { + { "Bz", "Kg", "Cg", "Do", "" }, + { "Bz", "Kg", "Cg", "Do", "Hu" }, + { "Bz", "Eh", "Cg", "Gr", "Ge" }, + { "Bz", "Re", "Cg", "Gr", "Eh" }, + { "Bz", "Re", "Es", "Or", "Eh" }, + { "Lunch", "Lunch", "Lunch", "Lunch", "Lunch" }, + { "Lunch", "Lunch", "Lunch", "Lunch", "Bu" }, + { "Hn", "Bt", "Cg", "Bu", "Eh" }, + { "Hn", "Kh", "Cg", "Bu", "Eh" }, + { "Bu", "Kh", "", "Zu", "" }, + { "Hn", "", "", "", "" } + }; + } + + private void fillRoom39() { + shortTeacher = new String[][] { + { "Bd", "Do", "Cg", "Bd", "Gi" }, + { "Bd", "Do", "Cg", "Bd", "Gi" }, + { "Bd", "Zu", "Cg", "Bd", "Gr" }, + { "Bd", "Zu", "Cg", "Bd", "Gr" }, + { "Bd", "Zu", "Bu", "Or", "Gi" }, + { "Lunch", "Lunch", "Lunch", "Lunch", "Lunch" }, + { "Lunch", "Lunch", "Lunch", "Lunch", "Lunch" }, + { "Lu", "Se", "Gi", "Le", "Hi" }, + { "Lu", "Se", "Gi", "Le", "Hi" }, + { "Lu", "Se", "Gi", "Le", "Hi" }, + { "Lu", "Se", "Gi", "", "" } + }; + } + + public String getLesson(int lesson, int day) { + if (lesson < 0 || lesson >= 11 || day < 0 || day >= 5) { + throw new IllegalArgumentException("Invalid lesson or day"); + } + return shortTeacher[lesson][day]; + } +}