From 9448728d6f015f409e06bbb36ac285b924e63ada Mon Sep 17 00:00:00 2001 From: rmh3093 Date: Tue, 19 Aug 2008 12:46:59 -0400 Subject: [PATCH] mask target at end of trial --- .gitignore | 0 motsim/.classpath | 0 motsim/.project | 0 motsim/MOTSIM.class | Bin 934 -> 934 bytes motsim/MOTSIM.jar | Bin motsim/MOTSIM.java | 6 ++ motsim/MOTSIM_Controller$StartListener.class | Bin 3888 -> 4079 bytes motsim/MOTSIM_Controller$TargetMover.class | Bin 3251 -> 1243 bytes motsim/MOTSIM_Controller.class | Bin 1202 -> 3650 bytes motsim/MOTSIM_Controller.java | 152 ++++++++++++++++----------- motsim/MOTSIM_Model.class | Bin 596 -> 873 bytes motsim/MOTSIM_Model.java | 11 ++ motsim/MOTSIM_View$ControlPanel.class | Bin 3460 -> 3460 bytes motsim/MOTSIM_View$TrialPanel.class | Bin 3715 -> 3710 bytes motsim/MOTSIM_View.class | Bin 1348 -> 2793 bytes motsim/MOTSIM_View.java | 29 ++++- motsim/Target.class | Bin motsim/Target.java | 0 motsim/TrialDataDynamic.class | Bin motsim/TrialDataDynamic.java | 0 20 files changed, 134 insertions(+), 64 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 motsim/.classpath mode change 100644 => 100755 motsim/.project mode change 100644 => 100755 motsim/MOTSIM.class mode change 100644 => 100755 motsim/MOTSIM.jar mode change 100644 => 100755 motsim/MOTSIM.java mode change 100644 => 100755 motsim/MOTSIM_Controller$StartListener.class rewrite motsim/MOTSIM_Controller$TargetMover.class (97%) mode change 100644 => 100755 rewrite motsim/MOTSIM_Controller.class (73%) mode change 100644 => 100755 mode change 100644 => 100755 motsim/MOTSIM_Controller.java rewrite motsim/MOTSIM_Model.class (87%) mode change 100644 => 100755 mode change 100644 => 100755 motsim/MOTSIM_Model.java mode change 100644 => 100755 motsim/MOTSIM_View$ControlPanel.class rewrite motsim/MOTSIM_View$TrialPanel.class (68%) mode change 100644 => 100755 rewrite motsim/MOTSIM_View.class (66%) mode change 100644 => 100755 mode change 100644 => 100755 motsim/MOTSIM_View.java mode change 100644 => 100755 motsim/Target.class mode change 100644 => 100755 motsim/Target.java mode change 100644 => 100755 motsim/TrialDataDynamic.class mode change 100644 => 100755 motsim/TrialDataDynamic.java diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/motsim/.classpath b/motsim/.classpath old mode 100644 new mode 100755 diff --git a/motsim/.project b/motsim/.project old mode 100644 new mode 100755 diff --git a/motsim/MOTSIM.class b/motsim/MOTSIM.class old mode 100644 new mode 100755 index e139ea16839d45d83068d8d0df566fe4ec68ef7f..810148ffc0f10f630d1de9d2a8b5870b5266c24c GIT binary patch delta 55 zcwSq^zKngt4<K5Cm~{aBR|rD@ diff --git a/motsim/MOTSIM.jar b/motsim/MOTSIM.jar old mode 100644 new mode 100755 diff --git a/motsim/MOTSIM.java b/motsim/MOTSIM.java old mode 100644 new mode 100755 index 87266fc..e1cf06c --- a/motsim/MOTSIM.java +++ b/motsim/MOTSIM.java @@ -32,6 +32,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ public class MOTSIM { + + /* + * TODO Account for resolution differences + * TODO Account for screen size differences + * TODO Add calibration "measure line" + */ /** * Create a new MOTSIM diff --git a/motsim/MOTSIM_Controller$StartListener.class b/motsim/MOTSIM_Controller$StartListener.class old mode 100644 new mode 100755 index 9e0348d220b4becf521b30d8d25ac6fe61ea7261..cb45035d21b53a1ba9d18f3c0d9195837f013083 GIT binary patch delta 785 zcwSYJOGuPa6vuz(&gl4k^J$jW_(-Lohl3DB(4tk)B6=C2fg04vOj!;yHO?rlTm=QS zX%-Rmep%T=b4E)uD|^wdP1LSU+oH0Um3BTHiWc|&{^!rR=bU?QU-gF?`^D7oePD%D z_uDO2PU(@YYRrPm=AM6zTt?@)SlITbth(;{R`04PA z-|0fTw%o_GP`o$P8Cn(%#da@iXiG#wVV_7kYb|IL#N%LL+e}HGD#;fDOE><@-e_8?PJts9#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Wcp0_&GdQo|_Q&SxE!=$(nHEX!~;Gc=UoBB+#iLOc*H zVnwsQY57etn=RiK>sErdqpa3NinW7|5uc11*^+$qU?y+J)oznFO)Kt$Eo_Y>qN6BP#i{LrYN=$ZrS>-i$29aCx`iCasnF4{AtzHQS2>e?>T zqJGr^8ZWw%tLa(o^1Dd;ZZy$~HAx<8a3j5`$Pg^r@*Sd+DoO3H;#I7T&S@7acD{_} z{g<)6zil3M^SF5)?=N6ehks7HCFFk*?SeA4y~DT2y(`#x4sV8h^VoSBM?B=MW2( z{ONHej}?$uKxzdsy?{)}w|^eCkF;$j+kt0sL&#S_X56Q}=te#`a~=<~%n^R1;ziCU z=ke$~jxp(Y;@HV=;$DwP-KjI^?DE#kp8<(AX77az1Qmb%w(hdIq@}guVQ?!yP?uw`I<6D#Q1>PUc)r z^m~6>j^W0oLfTxwxsg&*mZ;4Id~eam3k6&(u@)r?v}&Y`x$nncz>9P6dn)kCQ&_u9 zwz&HFGw*G`2%#OVMGKlD%Riu(Lvt=d+?x0VoV&R zJO2q7;yA{|2`I|zLGc>h&TqjK|GH^gn^-S6E&^#}Zs-a%Rk8h&rl`V!q!e**psp>8H} diff --git a/motsim/MOTSIM_Controller.class b/motsim/MOTSIM_Controller.class old mode 100644 new mode 100755 dissimilarity index 73% index 599504edd280739088a8277c0070466b80ae5570..f1b5d9005b18e36586413637e410d054f8526f26 GIT binary patch literal 3650 zcwU`XdsGzH8UNj3msyr8@={!lXn-bw7HVS90x?lm!x~nI5D<*TVRwXqWp*<=yi8(_ ztqD!jq%nQO7?ajCfxcT?7L(XU)AVW6chh&%_MHCJKYH5#+uHA&S=?Q*r{|P&cJAEo ze$U_i9>e8-zxFzSTkuB}ia<%Yv!^>09&C%7wiS=XbW4RtpmcM1I?^Ix-nR&NCJlW`V8s%>m$pRCv!hXg(vBX>&|*Q&)`BypHf}^%!qQCV z%&{_I8?nayM2U~nS&6M#!@3=gPwH0Bh^1>8M#mkOMvVEbhH2P41S)HDJ<9Q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$xL#}mYki;Zs+7g26)^^vn`K`)a(56 zor0xdn=V|xv(i9zR+`@Q%p-}FD5hr#?M}es$T!rVM`^uCVO9MFRP>)mAceK{n^L%; zescz`DQJcc1b0neQ-Sn&^Yrw6fWeeHcigMhB0FA9mY@_q-XrR-Lt_3vW zJ&qp@j;F$TV_y||-$IhEM>|OupOw`wpmG7XTtHJlIk$ZgEg7?ZT7edn()eQ&(iKUY zs39e3b)K*bhjOyGyj5Jnu5jLt3kXtxdzw9D;f4j=wTN(Y{=Bj-kpC*~5x9iDW^Z1T z>YnzO9-6~sz`KA!encX!TU84N#xZ*Em0{4F3dkR%V@ed6^!` zkIfDjojQYa0Z+iYhzI&kH-2fUsXPPp)Vu=Melk>b-6r(rD7o|r=sy>D8?N5b=zTWRt~uaZAb z&{N}nxUcq`h2+$gCdH@vovJblVz^r_HBrR-N`@gt(qKOM?3{FvhLph1xo(NC#Y zY*7jbn_1HG^K_}ZT)!Z$w}~=}(krNfszL}AyXY4r-u=K8Jk0-hT&1e$BRX}86^+GP zi`UezF00;9eFdAYE4l^VY$`MrZ_%K{FP$dzEBu<)D)OL-{P_*N|CZL@)7na7^$)aO Ir1c%(KjArlZ2$lO delta 502 zcwR-2;Y(9t6vlt=wR!KZFSs;y+FGtwZrAC`O=p{yacbxa2-e<_2RWlHlJE z??2G@J{4Pogg*2w|0wC)P3X(>JiOt6Zs^%nktR+p(6s)9LHSersCQl*g zT31Y`US0cax0;=HtI?>nOX-SBkqw)YB5Jm*Xh^fkQ}fp*HC zLm3%)2Dl|=LB0`5rg$NGTX;vfNGQQe_y_TpOr!t+ diff --git a/motsim/MOTSIM_Controller.java b/motsim/MOTSIM_Controller.java old mode 100644 new mode 100755 index 969d379..9aed583 --- a/motsim/MOTSIM_Controller.java +++ b/motsim/MOTSIM_Controller.java @@ -46,7 +46,7 @@ public class MOTSIM_Controller { Random rand; - Thread targetMoverThread; + Thread targetMoverThread = null; public MOTSIM_Controller(MOTSIM_Model model, MOTSIM_View view) { rand = new Random(); @@ -58,73 +58,100 @@ public class MOTSIM_Controller { public void registerActionListeners() { view.cp.addStartListener(new StartListener()); } + + protected synchronized void moveTargets() { + int sleep = 20; + int[] entropy = null; + int spawn = 0; + HashSet remove = new HashSet(); + for (Target t : model.targets) { + boolean flip = false; + if (model.borderstyle == "Spawn") { + if (((t.x + t.velX) > (view.screen_size.width - t.string_width)) || + ((t.x + t.velX) < 0) || + ((t.y + t.velY) > view.screen_size.height) || + ((t.y + t.velY - (2*t.font_size/3)) < 0)) { + remove.add(t); + spawn++; + continue; + } + } else { + if (((t.x + t.velX) > (view.screen_size.width - t.string_width)) || + ((t.x + t.velX) < 0)) { + t.velX = t.velX * -1; + flip = true; + } + if (((t.y + t.velY) > view.screen_size.height) || + ((t.y + t.velY - (2*t.font_size/3)) < 0)) { + t.velY = t.velY * -1; + flip = true; + } + if (flip==true) { + t.moveAngle = t.moveAngle + 180; + t.move = true; + } + } + if (model.entropy != "None") { + if (t.move == false) { + if (model.entropy == "Low") { + entropy = tdd.generateEntropyLow(); + } else if (model.entropy == "Medium") { + entropy = tdd.generateEntropyMedium(); + } else if (model.entropy == "High") { + entropy = tdd.generateEntropyHigh(); + } + t.moveAngle = (t.moveAngle + entropy[rand.nextInt(10000)]) % 360; + t.move = true; + } else { + t.steps++; + if (t.steps > 5) { + t.move = false; + t.steps = 0; + } + } + t.velX = tdd.calcAngleMoveX(t.moveAngle); + t.velY = tdd.calcAngleMoveY(t.moveAngle); + } + t.x = t.x + t.velX * t.velocityMOD; + t.y = t.y + t.velY * t.velocityMOD; + } + if (model.borderstyle == "Spawn") { + model.targets.removeAll(remove); + tdd.spawnTargetOnBorder(model.targets, spawn); + } + view.tp.repaint(); + try { + model.duration = model.duration + sleep; + Thread.sleep(sleep); + } catch (InterruptedException e) { + } + + } class TargetMover implements Runnable { - int sleep = 20; + public void run() { - int[] entropy = null; - while((model.move_targets == true) && (model.duration < model.maxduration)) { - int spawn = 0; - HashSet remove = new HashSet(); - for (Target t : model.targets) { - if (model.entropy != "None") { - if (t.move == false) { - if (model.entropy == "Low") { - entropy = tdd.generateEntropyLow(); - } else if (model.entropy == "Medium") { - entropy = tdd.generateEntropyMedium(); - } else if (model.entropy == "High") { - entropy = tdd.generateEntropyHigh(); - } - t.moveAngle = t.moveAngle + entropy[rand.nextInt(10000)]; - t.move = true; - } else { - t.velX = tdd.calcAngleMoveX(t.moveAngle); - t.velY = tdd.calcAngleMoveY(t.moveAngle); - t.steps++; - if (t.steps > 5) { - t.move = false; - t.steps = 0; - } + while (true) { + if ((model.move_targets == true) && (model.duration < model.maxduration)) { + moveTargets(); + } else { + synchronized (targetMoverThread) { + try { + model.mask_targets = true; + view.tp.repaint(); + targetMoverThread.wait(); + model.mask_targets = false; + } catch (InterruptedException e) { } } - if (model.borderstyle == "Spawn") { - if (((t.x + t.velX) > (view.screen_size.width - t.string_width)) || - ((t.x + t.velX) < 0) || - ((t.y + t.velY) > view.screen_size.height) || - ((t.y + t.velY - (2*t.font_size/3)) < 0)) { - remove.add(t); - spawn++; - continue; - } - } else { - if (((t.x + t.velX) > (view.screen_size.width - - t.string_width)) || ((t.x + t.velX) < 0)) { - t.velX = t.velX * -1; - } - if (((t.y + t.velY) > view.screen_size.height) || - ((t.y + t.velY - (2*t.font_size/3)) < 0)) { - t.velY = t.velY * -1; - } - } - t.x = t.x + t.velX * t.velocityMOD; - t.y = t.y + t.velY * t.velocityMOD; - } - if (model.borderstyle == "Spawn") { - model.targets.removeAll(remove); - tdd.spawnTargetOnBorder(model.targets, spawn); - } - view.tp.repaint(); - try { - model.duration = model.duration + sleep; - Thread.sleep(sleep); - } catch (InterruptedException e) { } } } + } class StartListener implements ActionListener { + public void actionPerformed(ActionEvent e) { model.targets = tdd.generate_targets((Integer)view.cp. targets_spinner.getValue()); @@ -159,10 +186,17 @@ public class MOTSIM_Controller { t.y = t.font_size; } model.move_targets = true; + model.duration = 0; model.borderstyle = view.cp.borderstyle_combobox.getSelectedItem().toString(); - targetMoverThread = new Thread(new TargetMover()); - targetMoverThread.start(); + if (targetMoverThread == null) { + targetMoverThread = new Thread(new TargetMover()); + targetMoverThread.start(); + } else { + synchronized (targetMoverThread) { + targetMoverThread.notifyAll(); + } + } } } diff --git a/motsim/MOTSIM_Model.class b/motsim/MOTSIM_Model.class old mode 100644 new mode 100755 dissimilarity index 87% index ef19d33e2d3770136afa7ac77a54bcf561a8b570..3b09b43f8db96e5cecd359be3ce2aace6a4fb659 GIT binary patch delta 478 zcwTKz%TB^T6g^YXgj&D{7D2%mzUqU-rKk(VxKV$=1sUmp)$&MNF|KgyvgvoYa6wF5 z_yMl{34g+PnKogeGs!u3a?d$)zGB~F>gUh<2Y@}4eDyh@HMx6N^|;dzp6mNhJ*6QS z3g@@H%S-&hE1fyKb7R%q(^l7V+O4K&d1VHrVKQX@sw$#u)dUIBrsZ~Q{#b3cO;I&P zo!{FYgFduWLcs;?Nv}uxT#wq*$)Ftf7E~I2ei= z;!p?EnuhUk+R!kC>EMJ}EE&A8d{4#TXh=v-A|-hudQV179?9v5XP`^YU{-P#ImvSo z&m&LB=u#KLMS5LAp@}k#H!K;kK30s8eg&(9SbwF3f=xmlqlEj2p-lA;sL~;QdIST5 Pnlb=e*p~4-(zW{wleu63 delta 202 zcwT$Sc7=uO)W2Q(7#J9g7?dY+bxvGVH~BH6gp>pig9w8tCj%pc6b}O@0~d%T!^0rR zAT(K?DU*?7awn5)Jr4s2@G|g$X?_L>UjRx2)q-hZFwF>rKofza7?9`6zyxFg^=NHp z5Z7Ya${?x5yp=(EBT$HmK^8~~F|Yth10ZP#wB874g)xI1P=p7fjX|D4fq@%jsv=m6 F5&$hP6l(wg diff --git a/motsim/MOTSIM_Model.java b/motsim/MOTSIM_Model.java old mode 100644 new mode 100755 index e36dc5a..4f5a070 --- a/motsim/MOTSIM_Model.java +++ b/motsim/MOTSIM_Model.java @@ -31,22 +31,33 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import java.awt.DisplayMode; import java.awt.Font; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; import java.util.HashSet; public class MOTSIM_Model { HashSet targets; boolean move_targets; + boolean mask_targets; String borderstyle; Font target_font; String defaultvelocities; String entropy; int duration; int maxduration; + GraphicsEnvironment ge; + GraphicsDevice gd; + DisplayMode display_mode_default; + DisplayMode display_mode_preferred; + DisplayMode[] display_mode_available; + public MOTSIM_Model() { move_targets = true; + mask_targets = false; duration = 0; } diff --git a/motsim/MOTSIM_View$ControlPanel.class b/motsim/MOTSIM_View$ControlPanel.class old mode 100644 new mode 100755 index c31389d0937a1eae2e7cce3cf2e02f4eb61855bf..e3dda58294e295f80a480f966befa664bdb8a4fb GIT binary patch delta 252 zcwP<0yDmck9LMqR@1LAR6K60VVKI1sMiY}*#B!!CBy6a$#I00|LtRR7TIzl+aTyGK zfIdK9pq{`akyvcb^!Wr{;C=M8=bmwxBSspJ84}Dg%sf5|Bw1vHCC14x%`&U3P#{Y= zT7?`hk?-WGvqpn;nrzS_;FC?hBY)W9kAfVw)xnOs*i|=sN<{Wk)FAuvCppk4B~5Xt z6i3QN<~df8P*uvRQBj=}H8@q1s#=`si*x;QVQ^_KSJuh3^>SlzZf%G=OLA{xJlF(} UmZoMIp2CoavKK;04~tP;cQ0hZHg9@mL^Ek}1;oERkTDX;zqHHQE|^)+w_= zolP2Kc#C{zix%6o*`dQOUH157pYO;Y4*26x4q5eaqydgKNKWy{G4h(AAb*jfW;jub zQ>8gmF0x3V3MDl;*DGbUxKNu*b+}TOYkg7CFE<9a=5lBK+}ki!8=+>CgqEOgvotKp VgJpQMEX^?Hjyuov@Dlp&=s#OUJkbCE diff --git a/motsim/MOTSIM_View$TrialPanel.class b/motsim/MOTSIM_View$TrialPanel.class old mode 100644 new mode 100755 dissimilarity index 68% index d169e19e8159a4b7cf19e1104a4c4bd06666ab68..28f09a91ea241da449c5f4b79abd45863da4a953 GIT binary patch delta 1036 zcwTLjX>3$g6vuyeUT5Acx3Va0hEh6d!#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ta3ilQNGs3}IoR@ws&k5b X$hgleZqiyuyYob!ru|h~{{sF4&Lz}8 delta 586 zcwS|ZO>YuW6o#Kmm4V5iwnDpVqA9h*&~_9*s^SMNiiLtyAx&JFS&RfjriPBixZy9D z%x`exu1Ud06IZU>^mq6NTpG^|jWsbhdC$qY=REH{xj!@Cb^XWhFW-Oy?F0Rz3fAJK z%=Dh`^!@U#=l6Ge+m7erL15Le3L5gJZ3b z-4aHl*=|)EFL%1`AlvSDoyn#;HS$RmPlLt8haqiZav*JeX2!~o$XG|rjhP>D`9SJ1 z7DQ(_BU%z&C&>mEDU+4T>|~Zju0WKXB`$EqlH{_h)OKV_Nz7VbF<*#{HDbj&WaSWh z7{)Qz$E+Q3e@yw*@*Gp56~d(!*o^Fq3FyR5QT=ODJTXa$Ni8&~k7%62^yr;i0;vB3 aO0hH{#b`#l&9i9PnEbiox#Ts8E%*bXCuqk2 diff --git a/motsim/MOTSIM_View.java b/motsim/MOTSIM_View.java old mode 100644 new mode 100755 index 8d31bbb..4902b8a --- a/motsim/MOTSIM_View.java +++ b/motsim/MOTSIM_View.java @@ -33,6 +33,7 @@ import java.awt.Color; import java.awt.Dimension; +import java.awt.DisplayMode; import java.awt.FlowLayout; import java.awt.Graphics; import java.awt.GraphicsEnvironment; @@ -64,6 +65,19 @@ public class MOTSIM_View { public MOTSIM_View(MOTSIM_Model model) { this.model = model; screen_size = Toolkit.getDefaultToolkit().getScreenSize(); + int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); + System.out.println(dpi); + System.out.println(screen_size.width/dpi + "x" + screen_size.height/dpi); + model.ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + model.gd = model.ge.getDefaultScreenDevice(); + model.display_mode_default = model.gd.getDisplayMode(); + model.display_mode_available = model.gd.getDisplayModes(); + for (DisplayMode dm : model.display_mode_available) { + if ((dm.getWidth() == 800) && (dm.getHeight() == 600)) { + model.display_mode_preferred = dm; + break; + } + } } public void startControlPanel() { @@ -172,13 +186,13 @@ public class MOTSIM_View { setResizable(false); setLocationRelativeTo(null); setUndecorated(true); - GraphicsEnvironment.getLocalGraphicsEnvironment(). - getDefaultScreenDevice().setFullScreenWindow(this); addWindowListener(this); addMouseMotionListener(this); + model.gd.setFullScreenWindow(this); + //model.gd.setDisplayMode(model.display_mode_preferred); setBackground(Color.black); offscreen = createImage(screen_size.width, screen_size.height); - bufferGraphics = offscreen.getGraphics(); + bufferGraphics = offscreen.getGraphics(); } public void drawTargets(Graphics g) { @@ -186,8 +200,12 @@ public class MOTSIM_View { /*String s = t.x + "," + t.y + " - " + t.moveAngle; bufferGraphics.drawString(s, (int)Math.round(t.x), (int)Math.round(t.y));*/ - bufferGraphics.drawString(t.callsign, (int)Math.round(t.x), - (int)Math.round(t.y)); + if (model.mask_targets) + bufferGraphics.drawString("XXXXXX", (int)Math.round(t.x), + (int)Math.round(t.y)); + else + bufferGraphics.drawString(t.callsign, (int)Math.round(t.x), + (int)Math.round(t.y)); } } @@ -221,6 +239,7 @@ public class MOTSIM_View { public void windowDeactivated(WindowEvent e) { model.move_targets = false; + //model.gd.setDisplayMode(model.display_mode_preferred); } public void windowDeiconified(WindowEvent e) { diff --git a/motsim/Target.class b/motsim/Target.class old mode 100644 new mode 100755 diff --git a/motsim/Target.java b/motsim/Target.java old mode 100644 new mode 100755 diff --git a/motsim/TrialDataDynamic.class b/motsim/TrialDataDynamic.class old mode 100644 new mode 100755 diff --git a/motsim/TrialDataDynamic.java b/motsim/TrialDataDynamic.java old mode 100644 new mode 100755 -- 2.11.4.GIT