user interface - Open Matlab/Simulink file and select block from Java GUI -
i open matlab/simulink file gui (java/eclipse), select block within simulink model, , somehow path of block.
i know how implement browse button in gui select file, need hints go on: how automatically open selected file matlab/simulink, , how proceed "path" of block within system architecture. need path input further task.
edit. open file, necessary implement jbutton browsing, , then:
desktop.getdesktop().open(file);
first, may use autoit following automatically.
1) open matlab session 2) uiopen simulink model 3) wait user select block , return current block path 4) save string gcb command in matlab autoit var.
then, build autoit script exe, , in java gui button listerner invoke execute file, example:
private static actionlistener onpress = new actionlistener(){ @override public void actionperformed(actionevent e) { try { runtime.getruntime().exec("cmd /c yourautoitscript.exe"); } catch (ioexception e1) { e1.printstacktrace(); } } }; note though autoit free, works on windows.
Comments
Post a Comment