├── project
└── build.properties
├── sbt.lnk
├── mathact_examples
├── src
│ └── main
│ │ ├── resources
│ │ ├── application.conf
│ │ ├── examples
│ │ │ ├── wiring
│ │ │ │ ├── consumer.png
│ │ │ │ ├── processor.png
│ │ │ │ └── producer.png
│ │ │ └── ui
│ │ │ │ └── logger_ui.fxml
│ │ └── manual
│ │ │ └── sketches
│ │ │ └── my_fxml_ui.fxml
│ │ └── scala
│ │ ├── manual
│ │ └── sketches
│ │ │ ├── MyFirstSketch.scala
│ │ │ ├── MySecondSketch.scala
│ │ │ └── MySketches.scala
│ │ └── examples
│ │ ├── tools
│ │ ├── indicators
│ │ │ ├── ValueIndicatorExample.scala
│ │ │ └── BoolIndicatorExample.scala
│ │ ├── pots
│ │ │ ├── BoolStrobeExample.scala
│ │ │ ├── BoolSwitchExample.scala
│ │ │ └── SettingDialExample.scala
│ │ ├── generators
│ │ │ └── DiscreteGeneratorExample.scala
│ │ ├── plots
│ │ │ └── ChartRecorderExample.scala
│ │ └── math
│ │ │ └── BooleanLogicExample.scala
│ │ └── common
│ │ └── DTriggerExample.scala
└── build.sbt
├── mathact_tools
├── src
│ └── main
│ │ ├── resources
│ │ ├── application.conf
│ │ └── mathact
│ │ │ ├── parts
│ │ │ └── ui
│ │ │ │ ├── start_d.png
│ │ │ │ ├── start_e.png
│ │ │ │ ├── step_d.png
│ │ │ │ ├── step_e.png
│ │ │ │ ├── stop_d.png
│ │ │ │ └── stop_e.png
│ │ │ └── tools
│ │ │ ├── time
│ │ │ ├── reset_d.png
│ │ │ ├── reset_e.png
│ │ │ └── time_loop.png
│ │ │ ├── pots
│ │ │ ├── analog_pot.png
│ │ │ ├── up_strobe.png
│ │ │ ├── up_switch.png
│ │ │ ├── bool_strobe.png
│ │ │ ├── bool_switch.png
│ │ │ ├── down_strobe.png
│ │ │ ├── down_switch.png
│ │ │ ├── setting_dial.png
│ │ │ └── timed_values_pot.png
│ │ │ ├── math
│ │ │ ├── timed
│ │ │ │ ├── adder.png
│ │ │ │ ├── integrator.png
│ │ │ │ ├── multiplier.png
│ │ │ │ ├── differentiator.png
│ │ │ │ └── sign_inverter.png
│ │ │ └── logic
│ │ │ │ └── bool
│ │ │ │ ├── and.png
│ │ │ │ ├── nor.png
│ │ │ │ ├── not.png
│ │ │ │ ├── or.png
│ │ │ │ └── flip_flop.png
│ │ │ ├── plots
│ │ │ ├── chart_recorder.png
│ │ │ └── simple_scope.png
│ │ │ ├── generators
│ │ │ ├── analog_generator.png
│ │ │ ├── on_off_button_d.png
│ │ │ ├── on_off_button_on.png
│ │ │ ├── discrete_generator.png
│ │ │ └── on_off_button_off.png
│ │ │ └── indicators
│ │ │ └── boolean_indicator.png
│ │ └── scala
│ │ └── mathact
│ │ ├── data
│ │ ├── Timed.scala
│ │ ├── basic
│ │ │ └── SingleValue.scala
│ │ ├── discrete
│ │ │ ├── TimedEvent.scala
│ │ │ └── TimedValue.scala
│ │ ├── analog
│ │ │ └── Sample.scala
│ │ ├── Value.scala
│ │ └── ui
│ │ │ ├── E.scala
│ │ │ └── C.scala
│ │ ├── tools
│ │ ├── math
│ │ │ ├── continuous
│ │ │ │ ├── Adder.scala
│ │ │ │ ├── Multiplier.scala
│ │ │ │ └── SignInverter.scala
│ │ │ ├── logic
│ │ │ │ └── bool
│ │ │ │ │ ├── Nor.scala
│ │ │ │ │ ├── Or.scala
│ │ │ │ │ ├── And.scala
│ │ │ │ │ └── Not.scala
│ │ │ └── timed
│ │ │ │ ├── Adder.scala
│ │ │ │ ├── Multiplier.scala
│ │ │ │ ├── SignInverter.scala
│ │ │ │ ├── Integrator.scala
│ │ │ │ └── Differentiator.scala
│ │ ├── workbenches
│ │ │ └── SimpleWorkbench.scala
│ │ ├── Tool.scala
│ │ └── EmptyBlock.scala
│ │ └── parts
│ │ └── ui
│ │ ├── Colors.scala
│ │ └── IconButton.scala
└── build.sbt
├── docs
├── imges
│ ├── Tank.png
│ ├── DTrigger.png
│ ├── PidGraph.png
│ ├── Saucepan.png
│ ├── UILogger.png
│ ├── Amplifier.png
│ ├── SketchList.png
│ ├── Architecture.png
│ ├── PIDemoPreview.png
│ ├── SchemeExample.png
│ ├── SketchControl.png
│ ├── UISketchList.png
│ ├── BlockConnections.png
│ ├── UISketchControl.png
│ ├── UIVisualization.png
│ └── MathActDemoPreview.png
├── manual_v0.2.docx
└── ~$nual_v0.2.docx
├── mathact_core
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── mathact
│ │ │ │ ├── userLog
│ │ │ │ │ ├── error_img.png
│ │ │ │ │ ├── info_img.png
│ │ │ │ │ ├── warn_img.png
│ │ │ │ │ ├── clean_btn_d.png
│ │ │ │ │ ├── clean_btn_e.png
│ │ │ │ │ ├── auto_scroll_btn_off.png
│ │ │ │ │ └── auto_scroll_btn_on.png
│ │ │ │ ├── sketchIU
│ │ │ │ │ ├── log_btn_d.png
│ │ │ │ │ ├── log_btn_h.png
│ │ │ │ │ ├── log_btn_s.png
│ │ │ │ │ ├── run_btn_d.png
│ │ │ │ │ ├── run_btn_e.png
│ │ │ │ │ ├── layout_fill_d.png
│ │ │ │ │ ├── layout_fill_e.png
│ │ │ │ │ ├── layout_stairs_d.png
│ │ │ │ │ ├── layout_stairs_e.png
│ │ │ │ │ ├── stop_sketch_btn_d.png
│ │ │ │ │ ├── stop_sketch_btn_e.png
│ │ │ │ │ ├── show_all_blocks_ui_d.png
│ │ │ │ │ ├── show_all_blocks_ui_e.png
│ │ │ │ │ ├── visualisation_btn_d.png
│ │ │ │ │ ├── visualisation_btn_h.png
│ │ │ │ │ ├── visualisation_btn_s.png
│ │ │ │ │ ├── skip_all_timeout_task_d.png
│ │ │ │ │ ├── skip_all_timeout_task_e.png
│ │ │ │ │ ├── hide_all_blocks_ui_btn_d.png
│ │ │ │ │ └── hide_all_blocks_ui_btn_e.png
│ │ │ │ └── sketchList
│ │ │ │ │ ├── sketch_start_d.png
│ │ │ │ │ └── sketch_start_e.png
│ │ │ └── application.conf
│ │ └── scala
│ │ │ └── mathact
│ │ │ └── core
│ │ │ ├── model
│ │ │ ├── messages
│ │ │ │ └── Msg.scala
│ │ │ ├── config
│ │ │ │ ├── MainUIConfigLike.scala
│ │ │ │ ├── SketchUIConfigLike.scala
│ │ │ │ ├── UserLoggingConfigLike.scala
│ │ │ │ ├── VisualizationConfigLike.scala
│ │ │ │ ├── PlumbingConfigLike.scala
│ │ │ │ ├── PumpConfigLike.scala
│ │ │ │ ├── LayoutConfigLike.scala
│ │ │ │ ├── SketchInstanceConfigLike.scala
│ │ │ │ ├── MainConfigLike.scala
│ │ │ │ └── DriveConfigLike.scala
│ │ │ └── data
│ │ │ │ ├── layout
│ │ │ │ ├── WindowPreference.scala
│ │ │ │ └── WindowState.scala
│ │ │ │ ├── verification
│ │ │ │ ├── PublisherVerificationData.scala
│ │ │ │ ├── SubscriberVerificationData.scala
│ │ │ │ ├── InletVerificationData.scala
│ │ │ │ ├── OutletVerificationData.scala
│ │ │ │ └── BlockVerificationData.scala
│ │ │ │ ├── pipes
│ │ │ │ ├── InletData.scala
│ │ │ │ └── OutletData.scala
│ │ │ │ ├── sketch
│ │ │ │ └── SketchInfo.scala
│ │ │ │ └── visualisation
│ │ │ │ ├── InletInfo.scala
│ │ │ │ ├── OutletInfo.scala
│ │ │ │ └── BlockInfo.scala
│ │ │ ├── plumbing
│ │ │ ├── fitting
│ │ │ │ ├── Flange.scala
│ │ │ │ ├── FlowLike.scala
│ │ │ │ ├── life
│ │ │ │ │ ├── OnStartLike.scala
│ │ │ │ │ └── OnStopLike.scala
│ │ │ │ ├── flows
│ │ │ │ │ ├── InflowLike.scala
│ │ │ │ │ └── OutflowLike.scala
│ │ │ │ ├── Pipe.scala
│ │ │ │ └── pipes
│ │ │ │ │ ├── InPipe.scala
│ │ │ │ │ └── OutPipe.scala
│ │ │ ├── PumpLike.scala
│ │ │ └── infrastructure
│ │ │ │ └── impeller
│ │ │ │ └── Impeller.scala
│ │ │ ├── bricks
│ │ │ ├── ui
│ │ │ │ └── interaction
│ │ │ │ │ ├── UIEvent.scala
│ │ │ │ │ └── UICommand.scala
│ │ │ ├── linking
│ │ │ │ ├── ThroughF.scala
│ │ │ │ ├── ThroughS.scala
│ │ │ │ ├── LinkIn2.scala
│ │ │ │ ├── LinkThrough.scala
│ │ │ │ ├── LinkThrough2.scala
│ │ │ │ ├── InS.scala
│ │ │ │ ├── InF.scala
│ │ │ │ └── LinkIn.scala
│ │ │ ├── blocks
│ │ │ │ ├── Workbench.scala
│ │ │ │ └── BlockContext.scala
│ │ │ ├── plumbing
│ │ │ │ ├── wiring
│ │ │ │ │ ├── obj
│ │ │ │ │ │ ├── ObjOnStop.scala
│ │ │ │ │ │ └── ObjOnStart.scala
│ │ │ │ │ └── fun
│ │ │ │ │ │ ├── FunOnStart.scala
│ │ │ │ │ │ └── FunOnStop.scala
│ │ │ │ └── fitting
│ │ │ │ │ ├── Socket.scala
│ │ │ │ │ └── Plug.scala
│ │ │ └── data
│ │ │ │ └── SketchData.scala
│ │ │ ├── sketch
│ │ │ ├── view
│ │ │ │ └── logging
│ │ │ │ │ ├── UserLogUIControllerLike.scala
│ │ │ │ │ └── UserLogging.scala
│ │ │ ├── blocks
│ │ │ │ ├── WorkbenchLike.scala
│ │ │ │ └── BlockLike.scala
│ │ │ └── infrastructure
│ │ │ │ └── instance
│ │ │ │ └── SketchInstance.scala
│ │ │ ├── IdGenerator.scala
│ │ │ ├── gui
│ │ │ └── ui
│ │ │ │ └── BlockUILike.scala
│ │ │ └── WorkerBase.scala
│ └── test
│ │ └── scala
│ │ └── mathact
│ │ ├── core
│ │ ├── TestJFXApplication.scala
│ │ ├── dummies
│ │ │ ├── TestSketchWithError.scala
│ │ │ ├── TestSketchWithSmallTimeout.scala
│ │ │ └── TestSketchWithBigTimeout.scala
│ │ ├── FutureHelpers.scala
│ │ ├── UIActorTestSpec.scala
│ │ └── RandomDataGenerators.scala
│ │ └── playing
│ │ ├── actors
│ │ └── ActorCreation.scala
│ │ └── types
│ │ └── TypeHierarchy.scala
└── build.sbt
├── .gitignore
└── license.txt
/project/build.properties:
--------------------------------------------------------------------------------
1 | sbt.version = 0.13.12
2 |
--------------------------------------------------------------------------------
/sbt.lnk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/sbt.lnk
--------------------------------------------------------------------------------
/mathact_examples/src/main/resources/application.conf:
--------------------------------------------------------------------------------
1 | # MathAct config
2 |
3 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/application.conf:
--------------------------------------------------------------------------------
1 | # MathAct config
2 |
3 |
--------------------------------------------------------------------------------
/docs/imges/Tank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/Tank.png
--------------------------------------------------------------------------------
/docs/manual_v0.2.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/manual_v0.2.docx
--------------------------------------------------------------------------------
/docs/~$nual_v0.2.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/~$nual_v0.2.docx
--------------------------------------------------------------------------------
/docs/imges/DTrigger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/DTrigger.png
--------------------------------------------------------------------------------
/docs/imges/PidGraph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/PidGraph.png
--------------------------------------------------------------------------------
/docs/imges/Saucepan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/Saucepan.png
--------------------------------------------------------------------------------
/docs/imges/UILogger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/UILogger.png
--------------------------------------------------------------------------------
/docs/imges/Amplifier.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/Amplifier.png
--------------------------------------------------------------------------------
/docs/imges/SketchList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/SketchList.png
--------------------------------------------------------------------------------
/docs/imges/Architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/Architecture.png
--------------------------------------------------------------------------------
/docs/imges/PIDemoPreview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/PIDemoPreview.png
--------------------------------------------------------------------------------
/docs/imges/SchemeExample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/SchemeExample.png
--------------------------------------------------------------------------------
/docs/imges/SketchControl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/SketchControl.png
--------------------------------------------------------------------------------
/docs/imges/UISketchList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/UISketchList.png
--------------------------------------------------------------------------------
/docs/imges/BlockConnections.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/BlockConnections.png
--------------------------------------------------------------------------------
/docs/imges/UISketchControl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/UISketchControl.png
--------------------------------------------------------------------------------
/docs/imges/UIVisualization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/UIVisualization.png
--------------------------------------------------------------------------------
/docs/imges/MathActDemoPreview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/docs/imges/MathActDemoPreview.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/userLog/error_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/userLog/error_img.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/userLog/info_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/userLog/info_img.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/userLog/warn_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/userLog/warn_img.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/parts/ui/start_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/parts/ui/start_d.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/parts/ui/start_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/parts/ui/start_e.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/parts/ui/step_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/parts/ui/step_d.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/parts/ui/step_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/parts/ui/step_e.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/parts/ui/stop_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/parts/ui/stop_d.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/parts/ui/stop_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/parts/ui/stop_e.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/log_btn_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/log_btn_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/log_btn_h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/log_btn_h.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/log_btn_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/log_btn_s.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/run_btn_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/run_btn_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/run_btn_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/run_btn_e.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/userLog/clean_btn_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/userLog/clean_btn_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/userLog/clean_btn_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/userLog/clean_btn_e.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/time/reset_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/time/reset_d.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/time/reset_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/time/reset_e.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/layout_fill_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/layout_fill_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/layout_fill_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/layout_fill_e.png
--------------------------------------------------------------------------------
/mathact_examples/src/main/resources/examples/wiring/consumer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_examples/src/main/resources/examples/wiring/consumer.png
--------------------------------------------------------------------------------
/mathact_examples/src/main/resources/examples/wiring/processor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_examples/src/main/resources/examples/wiring/processor.png
--------------------------------------------------------------------------------
/mathact_examples/src/main/resources/examples/wiring/producer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_examples/src/main/resources/examples/wiring/producer.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/analog_pot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/analog_pot.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/up_strobe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/up_strobe.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/up_switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/up_switch.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/time/time_loop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/time/time_loop.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/layout_stairs_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/layout_stairs_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/layout_stairs_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/layout_stairs_e.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/timed/adder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/timed/adder.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/bool_strobe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/bool_strobe.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/bool_switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/bool_switch.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/down_strobe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/down_strobe.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/down_switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/down_switch.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/setting_dial.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/setting_dial.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/stop_sketch_btn_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/stop_sketch_btn_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/stop_sketch_btn_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/stop_sketch_btn_e.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchList/sketch_start_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchList/sketch_start_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchList/sketch_start_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchList/sketch_start_e.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/userLog/auto_scroll_btn_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/userLog/auto_scroll_btn_off.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/userLog/auto_scroll_btn_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/userLog/auto_scroll_btn_on.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/and.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/and.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/nor.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/not.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/not.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/or.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/or.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/plots/chart_recorder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/plots/chart_recorder.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/plots/simple_scope.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/plots/simple_scope.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/show_all_blocks_ui_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/show_all_blocks_ui_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/show_all_blocks_ui_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/show_all_blocks_ui_e.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/visualisation_btn_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/visualisation_btn_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/visualisation_btn_h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/visualisation_btn_h.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/visualisation_btn_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/visualisation_btn_s.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/timed/integrator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/timed/integrator.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/timed/multiplier.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/timed/multiplier.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/pots/timed_values_pot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/pots/timed_values_pot.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/skip_all_timeout_task_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/skip_all_timeout_task_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/skip_all_timeout_task_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/skip_all_timeout_task_e.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/flip_flop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/logic/bool/flip_flop.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/timed/differentiator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/timed/differentiator.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/math/timed/sign_inverter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/math/timed/sign_inverter.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/hide_all_blocks_ui_btn_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/hide_all_blocks_ui_btn_d.png
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/mathact/sketchIU/hide_all_blocks_ui_btn_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_core/src/main/resources/mathact/sketchIU/hide_all_blocks_ui_btn_e.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/generators/analog_generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/generators/analog_generator.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/generators/on_off_button_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/generators/on_off_button_d.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/generators/on_off_button_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/generators/on_off_button_on.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/generators/discrete_generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/generators/discrete_generator.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/generators/on_off_button_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/generators/on_off_button_off.png
--------------------------------------------------------------------------------
/mathact_tools/src/main/resources/mathact/tools/indicators/boolean_indicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexCAB/MathAct/HEAD/mathact_tools/src/main/resources/mathact/tools/indicators/boolean_indicator.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | target/
3 | project/target/
4 | project/project/target/
5 |
6 | mathact_core/target/
7 | mathact_core/project/target/
8 | mathact_core/project/project/target/
9 |
10 | mathact_tools/target/
11 | mathact_tools/project/target/
12 | mathact_tools/project/project/target/
13 |
14 | mathact_examples/target/
15 | mathact_examples/project/target/
16 | mathact_examples/project/project/target/
17 |
18 |
19 |
--------------------------------------------------------------------------------
/mathact_examples/build.sbt:
--------------------------------------------------------------------------------
1 | name := "MathAct"
2 |
3 | version := "0.2.0"
4 |
5 | scalaVersion := "2.11.8"
6 |
7 | val jdkVersion = "1.8"
8 |
9 | javacOptions ++= Seq("-encoding", "UTF-8", "-source", jdkVersion, "-target", jdkVersion, "-Xlint:deprecation", "-Xlint:unchecked")
10 |
11 | scalacOptions ++= Seq("-encoding", "UTF-8", s"-target:jvm-$jdkVersion", "-feature", "-language:_", "-deprecation", "-unchecked", "-Xlint")
12 |
13 |
14 | libraryDependencies ++= Seq(
15 | )
16 |
17 | addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
18 |
19 |
20 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/resources/manual/sketches/my_fxml_ui.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/mathact_tools/build.sbt:
--------------------------------------------------------------------------------
1 | name := "MathAct Tools"
2 |
3 | version := "0.2.0"
4 |
5 | scalaVersion := "2.11.8"
6 |
7 | val jdkVersion = "1.8"
8 |
9 | javacOptions ++= Seq("-encoding", "UTF-8", "-source", jdkVersion, "-target", jdkVersion, "-Xlint:deprecation", "-Xlint:unchecked")
10 |
11 | scalacOptions ++= Seq("-encoding", "UTF-8", s"-target:jvm-$jdkVersion", "-feature", "-language:_", "-deprecation", "-unchecked", "-Xlint")
12 |
13 |
14 | libraryDependencies ++= Seq(
15 | "net.sf.jchart2d" % "jchart2d" % "3.3.2",
16 | "org.jfree" % "jfreechart" % "1.0.19",
17 | "org.jfree" % "fxgraphics2d" % "1.5"
18 | )
19 |
20 | addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
21 |
--------------------------------------------------------------------------------
/mathact_core/build.sbt:
--------------------------------------------------------------------------------
1 | name := "MathAct Core"
2 |
3 | version := "0.2.0"
4 |
5 | scalaVersion := "2.11.8"
6 |
7 | val jdkVersion = "1.8"
8 |
9 | javacOptions ++= Seq("-encoding", "UTF-8", "-source", jdkVersion, "-target", jdkVersion, "-Xlint:deprecation", "-Xlint:unchecked")
10 |
11 | scalacOptions ++= Seq("-encoding", "UTF-8", s"-target:jvm-$jdkVersion", "-feature", "-language:_", "-deprecation", "-unchecked", "-Xlint")
12 |
13 |
14 | libraryDependencies ++= Seq(
15 | "com.typesafe.akka" %% "akka-actor" % "2.4.8",
16 | "org.scalafx" %% "scalafx" % "8.0.102-R11",
17 | "org.scalafx" %% "scalafxml-core-sfx8" % "0.2.2",
18 | "org.tinyjee.jgraphx" % "jgraphx" % "3.4.1.3",
19 | "org.scalatest" %% "scalatest" % "3.0.0" % "test",
20 | "com.typesafe.akka" %% "akka-testkit" % "2.4.8" % "test"
21 | )
22 |
23 | addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
24 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2017 CAB
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6 | persons to whom the Software is furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in all copies or
9 | substantial portions of the Software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
12 | THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
14 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
15 | IN THE SOFTWARE.
16 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/resources/examples/ui/logger_ui.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/messages/Msg.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.messages
16 |
17 |
18 | /** Base trait for all messages
19 | * Created by CAB on 03.09.2016.
20 | */
21 |
22 | private[core] trait Msg
23 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/Flange.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting
16 |
17 | /** Base trite for Plug and Socket.
18 | * Created by CAB on 13.05.2016.
19 | */
20 |
21 | private[core] trait Flange[H]
22 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/FlowLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting
16 |
17 |
18 | /** Base class for Inlet and Outlet
19 | * Created by CAB on 24.08.2016.
20 | */
21 |
22 | private[core] trait FlowLike
23 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/ui/interaction/UIEvent.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.ui.interaction
16 |
17 | /** Base class of UI events (sends from UI to block)
18 | * Created by CAB on 31.10.2016.
19 | */
20 |
21 | trait UIEvent
22 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/ui/interaction/UICommand.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.ui.interaction
16 |
17 | /** Base trait for UI commands (sends from block to UI)
18 | * Created by CAB on 31.10.2016.
19 | */
20 |
21 | trait UICommand
22 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/MainUIConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 |
18 | /** Main UI config like
19 | * Created by CAB on 11.10.2016.
20 | */
21 |
22 | private [core] trait MainUIConfigLike {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/layout/WindowPreference.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.layout
16 |
17 |
18 | /** Window preference
19 | * Created by CAB on 03.11.2016.
20 | */
21 |
22 | case class WindowPreference(prefX: Option[Double], prefY: Option[Double])
23 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/SketchUIConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 |
16 | package mathact.core.model.config
17 |
18 | import scalafx.scene.image.Image
19 |
20 |
21 | /** SketchUI config
22 | * Created by CAB on 21.09.2016.
23 | */
24 |
25 | private [core] trait SketchUIConfigLike
26 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/UserLoggingConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 |
18 | /** User logging config
19 | * Created by CAB on 23.09.2016.
20 | */
21 |
22 | private [core] trait UserLoggingConfigLike {
23 | val showUIOnError: Boolean}
24 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/VisualizationConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 |
18 | /** Visualization config
19 | * Created by CAB on 28.09.2016.
20 | */
21 |
22 | private [core] trait VisualizationConfigLike {
23 |
24 | //TODO
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/PumpLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing
16 |
17 | import mathact.core.sketch.blocks.BlockLike
18 |
19 |
20 | /** Pump interface
21 | * Created by CAB on 31.08.2016.
22 | */
23 |
24 | private[core] trait PumpLike {
25 | val block: BlockLike}
26 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/verification/PublisherVerificationData.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.verification
16 |
17 |
18 | /** Publisher verification data
19 | * Created by CAB on 26.10.2016.
20 | */
21 |
22 | case class PublisherVerificationData(blockId: Int, outletId: Int)
23 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/verification/SubscriberVerificationData.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.verification
16 |
17 |
18 | /** Subscribers verification data
19 | * Created by CAB on 26.10.2016.
20 | */
21 |
22 | case class SubscriberVerificationData(blockId: Int, inletId: Int)
23 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/layout/WindowState.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.layout
16 |
17 |
18 | /** Represent window current state
19 | * Created by CAB on 03.11.2016.
20 | */
21 |
22 | case class WindowState(isShown: Boolean, x: Double, y: Double, h: Double, w: Double, title: String)
23 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/linking/ThroughF.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.linking
16 |
17 | import mathact.core.sketch.blocks.BlockLike
18 |
19 |
20 | /** Composing InF and LinkOut
21 | * Created by CAB on 05.12.2016.
22 | */
23 |
24 | trait ThroughF[F, H] extends InF[F] with LinkOut[H]{ _: BlockLike ⇒ }
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/linking/ThroughS.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.linking
16 |
17 | import mathact.core.sketch.blocks.BlockLike
18 |
19 |
20 | /** Composing InS and LinkOut
21 | * Created by CAB on 05.12.2016.
22 | */
23 |
24 | trait ThroughS[S, H] extends InS[S] with LinkOut[H]{ _: BlockLike ⇒ }
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/PlumbingConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 |
18 | /** PlumbingActor configuration
19 | * Created by CAB on 03.09.2016.
20 | */
21 |
22 | private [core] trait PlumbingConfigLike {
23 | val drive: DriveConfigLike
24 |
25 | //TODO Add more
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/data/Timed.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.data
16 |
17 | /** Base trite for the timed messages
18 | * Created by CAB on 03.12.2016.
19 | */
20 |
21 | trait Timed[V <: Timed[V]]{ _: V ⇒
22 | //Abstract
23 | val time: Long
24 | def time(t: Long): V
25 | //Concrete
26 | def tick: V = time(time + 1)}
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/linking/LinkIn2.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.linking
16 |
17 | import mathact.core.sketch.blocks.BlockLike
18 |
19 |
20 | /** Chain connecting for blocks with two inflow
21 | * Created by CAB on 05.12.2016.
22 | */
23 |
24 | trait LinkIn2[F, S] extends InF[F] with InS[S]{ _: BlockLike ⇒ }
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/linking/LinkThrough.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.linking
16 |
17 | import mathact.core.sketch.blocks.BlockLike
18 |
19 |
20 | /** Composing LinkOut and LinkIn
21 | * Created by CAB on 13.11.2016.
22 | */
23 |
24 | trait LinkThrough[T,H] extends LinkIn[T] with LinkOut[H]{ _: BlockLike ⇒ }
25 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/manual/sketches/MyFirstSketch.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package manual.sketches
16 |
17 | import mathact.tools.workbenches.SimpleWorkbench
18 |
19 |
20 | /** My first sketch
21 | * Created by CAB on 31.12.2016.
22 | */
23 |
24 | class MyFirstSketch extends SimpleWorkbench {
25 |
26 | //TODO Add my definitions here
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/linking/LinkThrough2.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.linking
16 |
17 | import mathact.core.sketch.blocks.BlockLike
18 |
19 |
20 | /** Composing ThroughF and ThroughS
21 | * Created by CAB on 05.12.2016.
22 | */
23 |
24 | trait LinkThrough2[F,S,H] extends ThroughF[F,H] with ThroughS[S,H]{ _: BlockLike ⇒ }
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/PumpConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 | import akka.util.Timeout
18 |
19 |
20 | /** Pump configuration
21 | * Created by CAB on 03.09.2016.
22 | */
23 |
24 | private [core] trait PumpConfigLike {
25 | val askTimeout: Timeout
26 |
27 | //TODO Add more
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/verification/InletVerificationData.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.verification
16 |
17 |
18 | /** Inlet verification info
19 | * Created by CAB on 23.10.2016.
20 | */
21 |
22 | private[core] case class InletVerificationData(
23 | inletId: Int,
24 | publishers: Seq[PublisherVerificationData])
25 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/verification/OutletVerificationData.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.verification
16 |
17 |
18 | /** Outlet verification info
19 | * Created by CAB on 23.10.2016.
20 | */
21 |
22 | private[core] case class OutletVerificationData(
23 | outletId: Int,
24 | subscribers: Seq[SubscriberVerificationData])
25 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/linking/InS.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.linking
16 |
17 | import mathact.core.bricks.plumbing.fitting.Socket
18 | import mathact.core.sketch.blocks.BlockLike
19 |
20 |
21 | /** Chain connecting for second inflow
22 | * Created by CAB on 05.12.2016.
23 | */
24 |
25 | trait InS[S]{ _: BlockLike ⇒ def inS: Socket[S] }
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/linking/InF.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.linking
16 |
17 | import mathact.core.bricks.plumbing.fitting.Socket
18 | import mathact.core.sketch.blocks.BlockLike
19 |
20 |
21 | /** Chain connecting for first inflow
22 | * Created by CAB on 05.12.2016.
23 | */
24 |
25 | trait InF[F]{ _: BlockLike ⇒ def inF: Socket[F] }
26 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/life/OnStartLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting.life
16 |
17 | import mathact.core.sketch.blocks.BlockLike
18 |
19 |
20 | /** Adding on start function to block
21 | * Created by CAB on 30.10.2016.
22 | */
23 |
24 | private[core] trait OnStartLike { _: BlockLike ⇒ private[core] def doStart(): Unit }
25 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/life/OnStopLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting.life
16 |
17 | import mathact.core.sketch.blocks.BlockLike
18 |
19 |
20 | /** Adding on stop function to block
21 | * Created by CAB on 30.10.2016.
22 | */
23 |
24 | private[core] trait OnStopLike { _: BlockLike ⇒ private[core] def doStop(): Unit }
25 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/flows/InflowLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting.flows
16 |
17 | import mathact.core.plumbing.fitting.FlowLike
18 |
19 | /** Inlet interface
20 | * Created by CAB on 24.10.2016.
21 | */
22 |
23 | private[core] trait InflowLike[T] extends FlowLike{
24 | private[core] def processValue(value: Any): Unit}
25 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/verification/BlockVerificationData.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.verification
16 |
17 |
18 | /** Block verification data
19 | * Created by CAB on 23.10.2016.
20 | */
21 |
22 | private[core] case class BlockVerificationData(
23 | blockId: Int,
24 | inlets: Seq[InletVerificationData],
25 | outlets:Seq[OutletVerificationData])
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/data/basic/SingleValue.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.data.basic
16 |
17 | import mathact.data.Value
18 |
19 |
20 | /** Single value
21 | * Created by CAB on 05.12.2016.
22 | */
23 |
24 | case class SingleValue(value: Double) extends Value[SingleValue]{
25 | def value(v: Double) = copy(value = v)
26 | override def toString = s"SingleValue(value = $value)"}
27 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/LayoutConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 | import mathact.core.model.enums.WindowsLayoutKind
18 |
19 | /** Represent layout config
20 | * Created by CAB on 03.11.2016.
21 | */
22 |
23 | trait LayoutConfigLike {
24 | val initialLayoutKind: WindowsLayoutKind
25 | val screenIndent: Int
26 | val stairsStep: Int}
27 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/Pipe.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting
16 |
17 | import mathact.core.bricks.plumbing.fitting.{Socket, Plug}
18 | import mathact.core.plumbing.Pump
19 |
20 |
21 | /** Base class for Outlet and Inlet
22 | * Created by CAB on 09.05.2016.
23 | */
24 |
25 | private[core] trait Pipe[H]{
26 | //Fields
27 | private[core] val pump: Pump}
28 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/data/discrete/TimedEvent.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.data.discrete
16 |
17 | import mathact.data.Timed
18 |
19 | /** Represent event with time-stamp
20 | * Created by CAB on 13.11.2016.
21 | */
22 |
23 | case class TimedEvent(time: Long) extends Timed[TimedEvent]{
24 | def time(t: Long): TimedEvent = copy(time = t)
25 | override def toString = s"TimedEvent(time = $time)"}
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/core/TestJFXApplication.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core
16 |
17 | import javafx.application.Application
18 | import javafx.stage.Stage
19 |
20 |
21 | /** Test JFXApplication for UI testing
22 | * Created by CAB on 21.09.2016.
23 | */
24 |
25 | class TestJFXApplication extends Application {
26 | def start(stage: Stage) = println("[TestJFXApplication.start] Stage: " + stage)}
27 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/pipes/InletData.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.pipes
16 |
17 | import mathact.core.model.holders.DriveRef
18 |
19 |
20 | /** Inlet data
21 | * Created by CAB on 03.09.2016.
22 | */
23 |
24 | private[core] case class InletData(
25 | blockDrive: DriveRef,
26 | blockId: Int,
27 | blockName: Option[String],
28 | inletId: Int,
29 | inletName: Option[String])
30 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/pipes/OutletData.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.pipes
16 |
17 | import mathact.core.model.holders.DriveRef
18 |
19 |
20 | /** Outlet data
21 | * Created by CAB on 05.07.2016.
22 | */
23 |
24 | private[core] case class OutletData(
25 | blockDrive: DriveRef,
26 | blockId: Int,
27 | blockName: Option[String],
28 | outletId: Int,
29 | outletName: Option[String])
30 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/sketch/SketchInfo.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.sketch
16 |
17 | import mathact.core.model.enums.SketchStatus
18 |
19 |
20 | /** Sketch info
21 | * Created by CAB on 11.10.2016.
22 | */
23 |
24 | private[core] case class SketchInfo(
25 | className: String,
26 | sketchName: Option[String],
27 | sketchDescription: Option[String],
28 | lastRunStatus: SketchStatus)
29 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/blocks/Workbench.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.blocks
16 |
17 | import mathact.core.app.Application
18 | import mathact.core.sketch.blocks.WorkbenchLike
19 |
20 |
21 | /** Box class for placing of blocks
22 | * Created by CAB on 09.05.2016.
23 | */
24 |
25 | abstract class Workbench extends WorkbenchLike{
26 | //Get of BlockContext
27 | protected implicit val context = Application.getSketchContext(this)}
28 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/SketchInstanceConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 | import com.typesafe.config.Config
18 |
19 | import scala.concurrent.duration.FiniteDuration
20 |
21 |
22 | /** Sketch instance config
23 | * Created by CAB on 17.10.2016.
24 | */
25 |
26 | trait SketchInstanceConfigLike {
27 | val commonConfig: Config
28 | val sketchBuildingTimeout: FiniteDuration
29 | val pumpConfig: PumpConfigLike}
30 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/sketch/view/logging/UserLogUIControllerLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.sketch.view.logging
16 |
17 | import akka.actor.ActorRef
18 | import mathact.core.sketch.view.logging.UserLogging.LogRow
19 |
20 |
21 | /** UserLogUIController interface
22 | * Created by CAB on 07.10.2016.
23 | */
24 |
25 | private[core] trait UserLogUIControllerLike {
26 | def setActor(actor: ActorRef): Unit
27 | def setRows(rows: List[LogRow]): Unit}
28 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/flows/OutflowLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting.flows
16 |
17 | import mathact.core.plumbing.Pump
18 | import mathact.core.plumbing.fitting.FlowLike
19 | import mathact.core.plumbing.fitting.pipes.OutPipe
20 |
21 |
22 | /** Outlet interface
23 | * Created by CAB on 24.10.2016.
24 | */
25 |
26 | private[core] trait OutflowLike[T] extends FlowLike{
27 | private[core] def injectOutPipe(pipe: OutPipe[T]): Unit}
28 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/continuous/Adder.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.continuous
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.ContinuousMath
19 |
20 |
21 | /** Adder
22 | * Created by CAB on 28.12.2016.
23 | */
24 |
25 | class Adder(implicit context: BlockContext)
26 | extends ContinuousMath(context, "+", "mathact/tools/math/continuous/adder.png"){
27 | protected def eval(input: Seq[Double]): Double = input.sum}
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/logic/bool/Nor.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.logic.bool
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.BooleanLogic
19 |
20 |
21 | /** NOR operator
22 | * Created by CAB on 26.12.2016.
23 | */
24 |
25 | class Nor(implicit context: BlockContext)
26 | extends BooleanLogic(context, "NOR", "mathact/tools/math/logic/bool/nor.png"){
27 | protected def eval(input: Seq[Boolean]): Boolean = ! input.exists(v ⇒ v)}
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/logic/bool/Or.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.logic.bool
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.BooleanLogic
19 |
20 |
21 | /** OR operator
22 | * Created by CAB on 26.12.2016.
23 | */
24 |
25 | class Or(implicit context: BlockContext)
26 | extends BooleanLogic(context, "OR", "mathact/tools/math/logic/bool/or.png"){
27 | protected def eval(input: Seq[Boolean]): Boolean = input.exists(v ⇒ v)}
28 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/logic/bool/And.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.logic.bool
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.BooleanLogic
19 |
20 |
21 | /** AND operator
22 | * Created by CAB on 26.12.2016.
23 | */
24 |
25 | class And(implicit context: BlockContext)
26 | extends BooleanLogic(context, "AND", "mathact/tools/math/logic/bool/and.png"){
27 | protected def eval(input: Seq[Boolean]): Boolean = input.forall(v ⇒ v)}
28 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/plumbing/wiring/obj/ObjOnStop.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.plumbing.wiring.obj
16 |
17 | import mathact.core.plumbing.fitting.life.OnStopLike
18 | import mathact.core.sketch.blocks.BlockLike
19 |
20 |
21 | /** Contain method to called on stop
22 | * Created by CAB on 14.05.2016.
23 | */
24 |
25 | trait ObjOnStop extends OnStopLike{ _: BlockLike with ObjWiring ⇒
26 | protected def onStop(): Unit
27 | private[core] def doStop(): Unit = onStop()}
28 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/visualisation/InletInfo.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.visualisation
16 |
17 |
18 | /** Subscriber info
19 | * Created by CAB on 03.09.2016.
20 | */
21 |
22 | private[core] case class InletInfo(
23 | blockId: Int,
24 | blockName: Option[String],
25 | inletId: Int,
26 | inletName: Option[String]) {
27 | override def toString =
28 | s"InletInfo(blockId: $blockId, blockName: $blockName, inletId: $inletId, inletName: $inletName)"}
29 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/continuous/Multiplier.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.continuous
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.ContinuousMath
19 |
20 |
21 | /** Multiplier
22 | * Created by CAB on 28.12.2016.
23 | */
24 |
25 | class Multiplier(implicit context: BlockContext)
26 | extends ContinuousMath(context, "*", "mathact/tools/math/continuous/multiplier.png"){
27 | protected def eval(input: Seq[Double]): Double = input.product}
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/plumbing/wiring/obj/ObjOnStart.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.plumbing.wiring.obj
16 |
17 | import mathact.core.plumbing.fitting.life.OnStartLike
18 | import mathact.core.sketch.blocks.BlockLike
19 |
20 |
21 | /** Contain method to call on start
22 | * Created by CAB on 14.05.2016.
23 | */
24 |
25 | trait ObjOnStart extends OnStartLike { _: BlockLike with ObjWiring ⇒
26 | protected def onStart(): Unit
27 | private[core] def doStart(): Unit = onStart()}
28 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/visualisation/OutletInfo.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.visualisation
16 |
17 |
18 | /** Publisher info
19 | * Created by CAB on 30.08.2016.
20 | */
21 |
22 | private[core] case class OutletInfo(
23 | blockId: Int,
24 | blockName: Option[String],
25 | outletId: Int,
26 | outletName: Option[String]) {
27 | override def toString =
28 | s"OutletInfo(blockId: $blockId, blockName: $blockName, inletId: $outletId, outletName: $outletName)"}
29 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/data/analog/Sample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.data.analog
16 |
17 | import mathact.data.Timed
18 |
19 | /** Quantized representation of analog signal
20 | * Created by CAB on 19.11.2016.
21 | */
22 |
23 | case class Sample(
24 | time: Long, // Virtual time in milliseconds
25 | shift: Double,
26 | value: Double)
27 | extends Timed[Sample]{
28 | def time(t: Long): Sample = copy(time = t)
29 | override def toString = s"Sample(time = $time, shift = $shift, value = $value)"}
30 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/sketch/blocks/WorkbenchLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.sketch.blocks
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 |
19 |
20 | /** Workbench interface
21 | * Created by CAB on 07.10.2016.
22 | */
23 |
24 | private[core] trait WorkbenchLike {
25 | //Context
26 | protected implicit val context: BlockContext
27 | //Parameters (this methods will be called by SketchController after sketch will constructed)
28 | private[core] def sketchTitle: Option[String]}
29 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/continuous/SignInverter.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.continuous
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.ContinuousMath
19 |
20 |
21 | /** Sign inverter
22 | * Created by CAB on 28.12.2016.
23 | */
24 |
25 | class SignInverter(implicit context: BlockContext)
26 | extends ContinuousMath(context, "-", "mathact/tools/math/continuous/sign_inverter.png"){
27 | protected def eval(input: Seq[Double]): Double = input.sum * -1.0}
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/data/Value.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.data
16 |
17 |
18 | /** Base trite for the messages with double value field
19 | * Created by CAB on 03.12.2016.
20 | */
21 |
22 | trait Value[V <: Value[V]]{ _: V ⇒
23 | //Abstract
24 | val value: Double
25 | def value(v: Double): V
26 | //Concrete
27 | def +(other: Double) = value(value + other)
28 | def -(other: Double) = value(value - other)
29 | def *(other: Double) = value(value * other)
30 | def /(other: Double) = value(value / other)}
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/timed/Adder.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.timed
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.TimedMath
19 |
20 |
21 | /** Timed adder
22 | * Created by CAB on 03.12.2016.
23 | */
24 |
25 | class Adder(implicit context: BlockContext)
26 | extends TimedMath(context, "+", "mathact/tools/math/timed/adder.png"){
27 | protected def eval(timedInput: Vector[Double], singleInput: Vector[Double]): Double =
28 | timedInput.sum + singleInput.sum}
29 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/timed/Multiplier.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 |
16 | package mathact.tools.math.timed
17 |
18 | import mathact.core.bricks.blocks.BlockContext
19 | import mathact.tools.math.TimedMath
20 |
21 | /** Multiplier
22 | * Created by CAB on 03.12.2016.
23 | */
24 |
25 | class Multiplier(implicit context: BlockContext)
26 | extends TimedMath(context, "*", "mathact/tools/math/timed/multiplier.png"){
27 | protected def eval(timedInput: Vector[Double], singleInput: Vector[Double]): Double =
28 | timedInput.product * singleInput.product}
--------------------------------------------------------------------------------
/mathact_core/src/main/resources/application.conf:
--------------------------------------------------------------------------------
1 | # MathAct config
2 |
3 | # AKKA
4 |
5 | akka {
6 | loglevel = "INFO"
7 | log-dead-letters = 0
8 | log-dead-letters-during-shutdown = off
9 | }
10 |
11 |
12 | # MAIN
13 |
14 | main{
15 | sketch.building.timeout = 5000 # In milli seconds, timeout of building of sketch (extends Workbench) class instance
16 | }
17 |
18 |
19 | # PLUMBING
20 |
21 | plumbing {
22 | pump{
23 | ask.timeout = 5000 # In milli seconds, timeout of execution actor ask call
24 | }
25 | drive{
26 | push.timeout.coefficient = 10 # pushTimeout = max(queueSize) * pushTimeoutCoefficient, pushTimeout in mills
27 | start.function.timeout = 5000 # In milli seconds, timeout of execution of user defined start function
28 | message.processing.timeout = 5000 # In milli seconds, timeout of processing of user message
29 | stop.function.timeout = 5000 # In milli seconds, timeout of execution of user defined stop function
30 | impeller.max.queue.size = 5 # Max number of tasks in impeller quque, after exceedances will return error for new tasks
31 | ui.operation.timeout = 2000 # In milli seconds, timeout of execution of user defined UI operation functions
32 | ui.slowdown.coefficient = 10 # procTimeout = uiEventQueueSize * slowdownCoefficient, procTimeout in mills
33 | }
34 | }
35 |
36 | # VIEW
37 |
38 | view {
39 | logging {
40 | show.ui.on.error = true
41 | }
42 | layout {
43 | initial = "FillScreen" #Layout on satert sketch: "FillScreen" | "WindowsStairs"
44 | indent = 20 #Screen indent at all four sides
45 | algo.stairs {
46 | step = 30 #Step of window position
47 |
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/timed/SignInverter.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.timed
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.TimedMath
19 |
20 | /** Sign inverter
21 | * Created by CAB on 03.12.2016.
22 | */
23 |
24 | class SignInverter(implicit context: BlockContext)
25 | extends TimedMath(context, "+", "mathact/tools/math/timed/sign_inverter.png"){
26 | protected def eval(timedInput: Vector[Double], singleInput: Vector[Double]): Double =
27 | (timedInput.sum + singleInput.sum) * -1.0}
28 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/IdGenerator.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core
16 |
17 |
18 | /** Generator of IDs
19 | * Created by CAB on 26.08.2016.
20 | */
21 |
22 | private[core] trait IdGenerator {
23 | //Variables
24 | private var intIdCounter = 0
25 | private var longIdCounter = 0L
26 | //Methods
27 | /** Generate next integer ID
28 | * @return - Int ID */
29 | def nextIntId: Int = {intIdCounter += 1; intIdCounter}
30 | /** Generate next long ID
31 | * @return - Long ID */
32 | def nextLongId: Long = {longIdCounter += 1; longIdCounter}}
33 |
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/core/dummies/TestSketchWithError.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.dummies
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.core.sketch.blocks.WorkbenchLike
19 |
20 |
21 | /** Test sketch with error
22 | * Created by CAB on 05.09.2016.
23 | */
24 |
25 | class TestSketchWithError extends WorkbenchLike{
26 | def sketchTitle = Some("TestSketchWithError")
27 | protected implicit val context: BlockContext = null
28 | println(s"[TestSketchWithError] DriveCreating and throw error.")
29 | throw new Exception("Oops!!")}
30 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/plumbing/wiring/fun/FunOnStart.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.plumbing.wiring.fun
16 |
17 | import mathact.core.plumbing.fitting.life.OnStartLike
18 | import mathact.core.sketch.blocks.BlockLike
19 |
20 |
21 | /** Execution on start
22 | * Created by CAB on 27.10.2016.
23 | */
24 |
25 | trait FunOnStart extends OnStartLike{ _: BlockLike with FunWiring ⇒
26 | private val source = new Source[Unit]{ def run(): Unit = push(Unit) }
27 | private[core] def doStart(): Unit = source.run()
28 | protected val start: Source[Unit] = source}
29 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/plumbing/wiring/fun/FunOnStop.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.plumbing.wiring.fun
16 |
17 | import mathact.core.plumbing.fitting.life.OnStopLike
18 | import mathact.core.sketch.blocks.BlockLike
19 |
20 |
21 | /** Execution on stop
22 | * Created by CAB on 27.10.2016.
23 | */
24 |
25 | trait FunOnStop[H] extends OnStopLike { _: BlockLike with FunWiring ⇒
26 | private val source = new Source[Unit]{ def run(): Unit = push(Unit) }
27 | private[core] def doStart(): Unit = source.run()
28 | protected val stop: Source[Unit] = source}
29 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/data/visualisation/BlockInfo.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.data.visualisation
16 |
17 |
18 | /** Block built info
19 | * Created by CAB on 15.05.2016.
20 | */
21 |
22 | private[core] case class BlockInfo(
23 | blockId: Int,
24 | blockName: String,
25 | blockImagePath: Option[String],
26 | inlets: Seq[InletInfo],
27 | outlets: Seq[OutletInfo])
28 | {
29 | override def toString =
30 | s"InletConnectionsInfo(blockId: $blockId, blockName: $blockName, blockImagePath: $blockImagePath, " +
31 | s"inlets: $inlets, outlets: $outlets)"}
32 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/MainConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 | import com.typesafe.config.Config
18 |
19 |
20 | /** Main config
21 | * Created by CAB on 03.09.2016.
22 | */
23 |
24 | private [core] trait MainConfigLike {
25 | val config: Config
26 | val sketchInstance: SketchInstanceConfigLike
27 | val layout: LayoutConfigLike
28 | val plumbing: PlumbingConfigLike
29 | val sketchUI: SketchUIConfigLike
30 | val mainUI: MainUIConfigLike
31 | val userLogging: UserLoggingConfigLike
32 | val visualization: VisualizationConfigLike}
33 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/sketch/infrastructure/instance/SketchInstance.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.sketch.infrastructure.instance
16 |
17 | import mathact.core.model.messages.Msg
18 | import mathact.core.sketch.blocks.WorkbenchLike
19 |
20 |
21 | /** Sketch instance
22 | * Created by CAB on 17.10.2016.
23 | */
24 |
25 | private[core] object SketchInstance {
26 | //Local messages
27 | case class SketchInstanceBuilt(instance: WorkbenchLike) extends Msg
28 | case class SketchInstanceBuiltError(error: Throwable) extends Msg
29 | case object SketchInstanceBuildTimeout extends Msg}
30 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/data/discrete/TimedValue.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.data.discrete
16 |
17 | import mathact.data.basic.SingleValue
18 | import mathact.data.{Timed, Value}
19 |
20 | /** Represent of one double value with time-stamp
21 | * Created by CAB on 13.11.2016.
22 | */
23 |
24 | case class TimedValue(time: Long, value: Double) extends Timed[TimedValue] with Value[TimedValue]{
25 | def time(t: Long) = copy(time = t)
26 | def value(v: Double) = copy(value = v)
27 | def toSingleValue = SingleValue(value)
28 | override def toString = s"TimedEvent(time = $time, value = $value)"}
29 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/gui/ui/BlockUILike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.gui.ui
16 |
17 | import mathact.core.bricks.ui.interaction.UIEvent
18 |
19 |
20 | /** BlockUI interface
21 | * Created by CAB on 31.10.2016.
22 | */
23 |
24 | private[core] trait BlockUILike {
25 | private[core] def uiInit(): Unit
26 | private[core] def uiCreate(): Unit
27 | private[core] def uiLayout(windowId: Int, x: Double, y: Double): Unit
28 | private[core] def uiEvent(event: UIEvent): Unit
29 | private[core] def uiShow(): Unit
30 | private[core] def uiHide(): Unit
31 | private[core] def uiClose(): Unit}
32 |
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/playing/actors/ActorCreation.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.playing.actors
16 |
17 | import akka.actor.{Props, ActorSystem, Actor}
18 |
19 |
20 | /** Actor creation playing
21 | * Created by CAB on 31.10.2016.
22 | */
23 |
24 | object ActorCreation extends App{
25 | println("==== ActorCreation ====")
26 | //System
27 | val system = ActorSystem.create("Termination")
28 | //Actors
29 | val a = new Actor{
30 | def receive = { case m ⇒ }}
31 | //Creation
32 | system.actorOf(Props(a), "A")
33 | system.actorOf(Props[Actor])
34 |
35 | //
36 | system.terminate()}
37 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/sketch/blocks/BlockLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.sketch.blocks
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.core.plumbing.Pump
19 |
20 |
21 | /** Block interface
22 | * Created by CAB on 24.10.2016.
23 | */
24 |
25 | private[core] trait BlockLike {
26 | //Context
27 | protected implicit val context: BlockContext
28 | //Pump
29 | private[core] val pump: Pump
30 | //Parameters (this methods will be called by Drive after block will constructed)
31 | private[core] def blockName: Option[String]
32 | private[core] def blockImagePath: Option[String]}
33 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/timed/Integrator.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.timed
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.TimedMath
19 |
20 | /** Integrator
21 | * Created by CAB on 03.12.2016.
22 | */
23 |
24 | class Integrator(implicit context: BlockContext)
25 | extends TimedMath(context, "+", "mathact/tools/math/timed/integrator.png"){
26 | //Variables
27 | private var sum = 0.0
28 | //Evaluation
29 | protected def eval(timedInput: Vector[Double], singleInput: Vector[Double]): Double = {
30 | sum += (timedInput.sum + singleInput.sum)
31 | sum}}
32 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/model/config/DriveConfigLike.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.model.config
16 |
17 | import scala.concurrent.duration.FiniteDuration
18 |
19 |
20 | /** DriveActor commonConfig
21 | * Created by CAB on 03.09.2016.
22 | */
23 |
24 | private [core] trait DriveConfigLike {
25 | val pushTimeoutCoefficient: Int
26 | val startFunctionTimeout: FiniteDuration
27 | val messageProcessingTimeout: FiniteDuration
28 | val stopFunctionTimeout: FiniteDuration
29 | val impellerMaxQueueSize: Int
30 | val uiOperationTimeout: FiniteDuration
31 | val uiSlowdownCoefficient: Int
32 |
33 | //TODO Add more
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/data/ui/E.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.data.ui
16 |
17 | import mathact.core.bricks.ui.interaction.UIEvent
18 |
19 | /** Set of predefined of UI events
20 | * Created by CAB on 11.11.2016.
21 | */
22 |
23 | object E {
24 | //Execution events
25 | case object Start extends UIEvent
26 | case object Stop extends UIEvent
27 | case object Step extends UIEvent
28 | case object Reset extends UIEvent
29 | case class IntValueChanged(newVal: Int) extends UIEvent
30 | case class LongValueChanged(newVal: Long) extends UIEvent
31 | case class DoubleValueChanged(newVal: Double) extends UIEvent
32 |
33 | //TODO Add more
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/core/dummies/TestSketchWithSmallTimeout.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.dummies
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.core.sketch.blocks.WorkbenchLike
19 |
20 | import scala.concurrent.duration._
21 |
22 |
23 | /** Test sketch with timeout
24 | * Created by CAB on 05.09.2016.
25 | */
26 |
27 | class TestSketchWithSmallTimeout extends WorkbenchLike{
28 | def sketchTitle = Some("TestSketchWithSmallTimeout")
29 | protected implicit val context: BlockContext = null
30 | val timeout = 2.second
31 | println(s"[TestSketchWithTimeout] DriveCreating, timeout: $timeout.")
32 | Thread.sleep(timeout.toMillis)}
33 |
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/core/dummies/TestSketchWithBigTimeout.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.dummies
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.core.sketch.blocks.WorkbenchLike
19 |
20 | import scala.concurrent.duration._
21 |
22 |
23 | /** Test sketch with big timeout
24 | * Created by CAB on 06.09.2016.
25 | */
26 |
27 | class TestSketchWithBigTimeout extends WorkbenchLike{
28 | def sketchTitle = Some("TestSketchWithBigTimeout")
29 | protected implicit val context: BlockContext = null
30 | val timeout = 6.second
31 | println(s"[TestSketchWithBigTimeout] DriveCreating, timeout: $timeout.")
32 | Thread.sleep(timeout.toMillis)}
33 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/workbenches/SimpleWorkbench.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.workbenches
16 |
17 | import mathact.core.bricks.blocks.Workbench
18 |
19 |
20 | /** Simple workbench
21 | * Created by CAB on 24.10.2016.
22 | */
23 |
24 | class SimpleWorkbench extends Workbench{
25 | //Variables
26 | private var _heading: Option[String] = None
27 | //DSL
28 | def heading_=(v: String) { _heading = v match{case "" ⇒ None; case s ⇒ Some(s)} }
29 | def heading = _heading
30 | //Abstract callbacks (will called by system after sketch will constructed)
31 | private[mathact] def sketchTitle: Option[String] = _heading
32 |
33 | //TODO Add more
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/sketch/view/logging/UserLogging.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.sketch.view.logging
16 |
17 |
18 | /** User logging object
19 | * Created by CAB on 28.09.2016.
20 | */
21 |
22 | private[core] object UserLogging {
23 | //Enums
24 | object LogType extends Enumeration {
25 | val Info = Value
26 | val Warn = Value
27 | val Error = Value}
28 | type LogType = LogType.Value
29 | //Data
30 | case class LogRow(msgType: LogType, blockName: String, message: String)
31 | //Messages
32 | case class DoSearch(text: String)
33 | case class SetLogLevel(level: LogType)
34 | case class SetLogAmount(amount: Int)
35 | case object DoClean}
36 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/data/SketchData.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.data
16 |
17 | import mathact.core.model.data.sketch.SketchInfo
18 | import mathact.core.model.enums.SketchStatus
19 |
20 |
21 | /** SketchData model
22 | * Created by CAB on 19.06.2016.
23 | */
24 |
25 | case class SketchData(
26 | clazz: Class[_],
27 | className: String,
28 | sketchName: Option[String],
29 | sketchDescription: Option[String],
30 | autorun: Boolean, //false - manual run
31 | showUserLogUiAtStart: Boolean,
32 | showVisualisationUiAtStart: Boolean)
33 | {
34 | //Converters
35 | def toSketchInfo(status: SketchStatus) = SketchInfo(className, sketchName, sketchDescription, status)}
36 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/timed/Differentiator.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.timed
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.tools.math.TimedMath
19 |
20 | /** Differentiator
21 | * Created by CAB on 03.12.2016.
22 | */
23 |
24 | class Differentiator(implicit context: BlockContext)
25 | extends TimedMath(context, "+", "mathact/tools/math/timed/differentiator.png"){
26 | //Variables
27 | private var pastValue = 0.0
28 | //Evaluation
29 | protected def eval(timedInput: Vector[Double], singleInput: Vector[Double]): Double = {
30 | val sum = timedInput.sum + singleInput.sum
31 | val diff = pastValue - sum
32 | pastValue = sum
33 | diff}}
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/data/ui/C.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.data.ui
16 |
17 | import mathact.core.bricks.ui.interaction.UICommand
18 |
19 | /** Set of predefined of UI commands
20 | * Created by CAB on 31.10.2016.
21 | */
22 |
23 | object C {
24 | //Frame commands
25 | case object ShowFrame extends UICommand
26 | case object HideFrame extends UICommand
27 | case class SetFrameTitle(text: String) extends UICommand
28 | //Execution commands
29 | case object Ready extends UICommand
30 | case object Start extends UICommand
31 | case object Stop extends UICommand
32 | case object Update extends UICommand
33 | case object Clean extends UICommand
34 | case object Ended extends UICommand
35 |
36 | //TODO Add more
37 |
38 |
39 | }
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/plumbing/fitting/Socket.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.plumbing.fitting
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.core.plumbing.fitting.Flange
19 | import mathact.core.plumbing.fitting.pipes.InPipe
20 |
21 |
22 | /** Event receiver must be implemented by Inlet
23 | * Created by CAB on 17.05.2016.
24 | */
25 |
26 | trait Socket[H] extends Flange[H] { _: InPipe[H] ⇒
27 | //Methods
28 | /** Connecting of this Socket to given Plug
29 | * @param plug - Plug[T] */
30 | def plug(plug: ⇒Plug[H])(implicit context: BlockContext): Unit = pump.connect(context, plug, this)
31 | def <~ (plug: ⇒Plug[H])(implicit context: BlockContext): Unit = pump.connect(context, plug, this)}
32 |
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/core/FutureHelpers.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core
16 |
17 | import scala.concurrent.duration._
18 | import scala.concurrent.{Await, Future}
19 |
20 |
21 | /** Future helpers used in tests
22 | * Created by CAB on 12.08.2016.
23 | */
24 |
25 | trait FutureHelpers {
26 | //Classes
27 | implicit class FutureEx[T](future: Future[T]){
28 | def get(timeout: Duration = 5.second): T = Await.result(future, timeout)
29 | def await(timeout: Duration = 5.second): Unit = Await.result(future, timeout)}
30 | //Methods
31 | def sleep(timeout: Duration):Unit = {
32 | println(s"[FutureHelpers.sleep] Start of $timeout sleep")
33 | Thread.sleep(timeout.toMillis)
34 | println(s"[FutureHelpers.sleep] Done of $timeout sleep")}}
35 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/math/logic/bool/Not.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools.math.logic.bool
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.core.bricks.linking.LinkThrough
19 | import mathact.core.bricks.plumbing.wiring.fun.{FunOnStart, FunWiring}
20 | import mathact.tools.Tool
21 |
22 |
23 | /** NOT operator
24 | * Created by CAB on 26.12.2016.
25 | */
26 |
27 | class Not(implicit context: BlockContext)
28 | extends Tool(context, "NOT", "mathact/tools/math/logic/bool/not.png")
29 | with FunWiring with FunOnStart with LinkThrough[Boolean, Boolean]{
30 | //Connection points
31 | val in = In[Boolean]
32 | val out = Out[Boolean]
33 | //Processing
34 | start.map(_ ⇒ true).next(out)
35 | in.map(v ⇒ ! v).next(out)}
36 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/tools/indicators/ValueIndicatorExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.tools.indicators
16 |
17 | import mathact.tools.indicators.ValueIndicator
18 | import mathact.tools.pots.SettingDial
19 | import mathact.tools.workbenches.SimpleWorkbench
20 |
21 |
22 | /** Example of using value indicator tool.
23 | * Created by CAB on 28.12.2016.
24 | */
25 |
26 | class ValueIndicatorExample extends SimpleWorkbench {
27 | //Sketch parameters
28 | heading = "Boolean indicator example"
29 | //Blocks
30 | val dial1 = new SettingDial{ name = "Dial 1" }
31 | val dial2 = new SettingDial{ name = "Dial 2" }
32 | val indicator = new ValueIndicator{ name = "Value indicator" }
33 | //Connecting
34 | dial1 ~> indicator
35 | dial2 ~> indicator.in("dial2")}
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/plumbing/fitting/Plug.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.plumbing.fitting
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.core.plumbing.fitting.Flange
19 | import mathact.core.plumbing.fitting.pipes.OutPipe
20 |
21 |
22 | /** Source of events, must be implemented by Outlet
23 | * Created by CAB on 17.05.2016.
24 | */
25 |
26 | trait Plug[H] extends Flange[H] { _: OutPipe[H] ⇒
27 | //Methods
28 | /** Connecting of this Plug to given Socket
29 | * @param socket - Socket[T] */
30 | def attach(socket: ⇒Socket[H])(implicit context: BlockContext): Unit = pump.connect(context, this, socket)
31 | def ~> (socket: ⇒Socket[H])(implicit context: BlockContext): Unit = pump.connect(context, this, socket)}
32 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/infrastructure/impeller/Impeller.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.infrastructure.impeller
16 |
17 | import mathact.core.model.enums._
18 |
19 | import scala.concurrent.duration.FiniteDuration
20 |
21 |
22 | /** Impeller
23 | * Created by CAB on 16.10.2016.
24 | */
25 |
26 | private[core] object Impeller {
27 | //Definitions
28 | case class TaskState(
29 | taskNumber: Long,
30 | kind: TaskKind,
31 | taskId: Int,
32 | skipOnTimeout: Boolean,
33 | startTime: Long,
34 | isTimeout: Boolean)
35 | //Local messages
36 | case class TaskTimeout(taskNumber: Long, timeout: FiniteDuration)
37 | case class TaskSuccess(taskNumber: Long, res: Any)
38 | case class TaskFailure(taskNumber: Long, err: Throwable)}
39 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/tools/indicators/BoolIndicatorExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.tools.indicators
16 |
17 | import mathact.tools.indicators.BoolIndicator
18 | import mathact.tools.pots.BoolSwitch
19 | import mathact.tools.workbenches.SimpleWorkbench
20 |
21 |
22 | /** Example of using boolean indicator tool.
23 | * Created by CAB on 24.12.2016.
24 | */
25 |
26 | class BoolIndicatorExample extends SimpleWorkbench {
27 | //Sketch parameters
28 | heading = "Boolean indicator example"
29 | //Blocks
30 | val switch1 = new BoolSwitch{ name = "switch1" }
31 | val switch2 = new BoolSwitch{ name = "switch2" }
32 | val indicator = new BoolIndicator{ name = "Boolean indicator" }
33 | //Connecting
34 | switch1 ~> indicator
35 | switch2 ~> indicator.in("switch2")}
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/manual/sketches/MySecondSketch.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package manual.sketches
16 |
17 | import mathact.core.bricks.plumbing.wiring.fun.FunWiring
18 | import mathact.tools.EmptyBlock
19 | import mathact.tools.workbenches.SimpleWorkbench
20 |
21 |
22 | /** My second sketch
23 | * Created by CAB on 31.12.2016.
24 | */
25 |
26 | class MySecondSketch extends SimpleWorkbench {
27 | //Blocks
28 | class BlockB extends EmptyBlock with FunWiring {
29 | //Connection points
30 | val in1 = In[Double]
31 | val in2 = In[String]
32 | val out1 = Out[Double]
33 | val out2 = Out[String]
34 | //Wiring
35 | in1.map(_.toString) >> out2
36 | in1.filter(_ != 0) >> out1
37 | in2.map(s ⇒ "Received: " + s) >> out2
38 | }
39 | //Connecting
40 |
41 | //TODO
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/playing/types/TypeHierarchy.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.playing.types
16 |
17 |
18 | /** Playing with types hierarchy
19 | * Created by CAB on 03.12.2016.
20 | */
21 |
22 | object TypeHierarchy extends App{
23 | println("==== TypeHierarchy ====")
24 | //
25 | trait Timed[V <: Timed[V]]{ _: V ⇒
26 | val time: Long
27 | def time(t: Long): V
28 |
29 |
30 |
31 | }
32 |
33 |
34 |
35 |
36 |
37 | case class TE(v: Double, time: Long) extends Timed[TE]{
38 |
39 | def time(t: Long): TE = copy(time = t)
40 |
41 |
42 |
43 | }
44 |
45 |
46 |
47 |
48 | def inc[T <: Timed[T]](v: T): T = {
49 |
50 | val t = v.time(v.time + 1)
51 |
52 | t
53 |
54 | }
55 |
56 | val t1 = TE(1, 1)
57 | val t2 = inc(t1)
58 |
59 | println(t2)
60 |
61 |
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/parts/ui/Colors.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.parts.ui
16 | import scalafx.scene.paint.Color
17 | import scalafx.scene.paint.Color._
18 | import java.awt.{Color => JColor}
19 |
20 |
21 |
22 | /** Tools for working with colors
23 | * Created by CAB on 24.11.2016.
24 | */
25 |
26 | trait Colors {
27 | //Parameters
28 | val lineColors = List(Black, Gold, Gray, Green, Bisque, Blue, Honeydew)
29 | //Variables
30 | @volatile private var currentColor = 0
31 | //Methods
32 | protected def nextColor: Color = {
33 | val c = lineColors(currentColor)
34 | currentColor = if(currentColor >= lineColors.size) 0 else currentColor + 1
35 | c}
36 | //Helpers
37 | implicit class ColorEx (c: Color) {
38 | def toJColor: JColor = new JColor((c.red * 255).toInt, (c.green * 255).toInt, (c.blue * 255).toInt)}}
39 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/linking/LinkIn.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.linking
16 |
17 | import mathact.core.bricks.blocks.BlockContext
18 | import mathact.core.bricks.plumbing.fitting.{Plug, Socket}
19 | import mathact.core.sketch.blocks.BlockLike
20 |
21 |
22 | /** Chain connecting for blocks with single inflow
23 | * Created by CAB on 13.11.2016.
24 | */
25 |
26 | trait LinkIn[H]{ _: BlockLike ⇒
27 | //Inlet producer method
28 | def in: Socket[H]
29 | //Connecting methods
30 | def <~(linkOut: LinkOut[H])(implicit context: BlockContext): Unit = in.plug(linkOut.out)(context)
31 | def <~(out: Plug[H])(implicit context: BlockContext): Unit = in.plug(out)(context)
32 | def <~[T](linkThrough: LinkThrough[T,H])(implicit context: BlockContext): LinkThrough[T,H] = {
33 | in.plug(linkThrough.out)(context)
34 | linkThrough}}
35 |
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/core/UIActorTestSpec.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core
16 |
17 | import javafx.application.Application
18 |
19 | import scala.concurrent.Future
20 | import scalafx.application.Platform
21 |
22 | import scala.concurrent.ExecutionContext.Implicits.global
23 |
24 |
25 | /** Base class for testing of UI actors
26 | * Created by CAB on 21.09.2016.
27 | */
28 |
29 | class UIActorTestSpec extends ActorTestSpec {
30 | //Starting JFX Application
31 | Platform.implicitExit = false
32 | Future{
33 | println("[UIActorTestSpec] Try to start TestJFXApplication.")
34 | Application.launch(classOf[TestJFXApplication])
35 | println("[UIActorTestSpec] TestJFXApplication stopped.")}
36 | Thread.sleep(500)
37 | //Stopping JFX Application
38 | override def afterAll = {
39 | Platform.exit()
40 | Thread.sleep(500)
41 | super.afterAll}}
42 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/bricks/blocks/BlockContext.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.bricks.blocks
16 |
17 | import akka.actor.ActorSystem
18 | import com.typesafe.config.Config
19 | import mathact.core.model.config.PumpConfigLike
20 | import mathact.core.model.enums.BlockType
21 | import mathact.core.model.holders._
22 |
23 |
24 | /** Provide support and management of Workbench
25 | * Created by CAB on 20.06.2016.
26 | */
27 |
28 | case class BlockContext(
29 | val blockType: BlockType,
30 | val system: ActorSystem,
31 | val controller: SketchControllerRef,
32 | val userLogging: UserLoggingRef,
33 | val layout: LayoutRef,
34 | val plumbing: PlumbingRef,
35 | val pumpConfig: PumpConfigLike,
36 | val commonConfig: Config)
37 | {
38 | override def toString =
39 | s"BlockContext(blockType = $blockType, $controller, $userLogging, $layout, $plumbing )"}
40 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/tools/pots/BoolStrobeExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.tools.pots
16 |
17 | import mathact.core.bricks.linking.LinkIn
18 | import mathact.core.bricks.plumbing.wiring.fun.FunWiring
19 | import mathact.tools.EmptyBlock
20 | import mathact.tools.pots.BoolStrobe
21 | import mathact.tools.workbenches.SimpleWorkbench
22 |
23 |
24 | /** Bool strobe example
25 | * Created by CAB on 26.12.2016.
26 | */
27 |
28 | class BoolStrobeExample extends SimpleWorkbench {
29 | //Sketch parameters
30 | heading = "Boolean strobe example"
31 | //Blocks
32 | val switch = new BoolStrobe{
33 | name = "Boolean strobe"
34 | default = false}
35 | val logger = new EmptyBlock with FunWiring with LinkIn[Boolean]{
36 | name = "Logger"
37 | val in = In[Boolean]
38 | in.foreach(v ⇒ logger.info("Logger received: " + v))}
39 | //Connecting
40 | switch ~> logger }
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/parts/ui/IconButton.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.parts.ui
16 |
17 | import scalafx.Includes._
18 | import scalafx.scene.control.Button
19 | import scalafx.scene.image.{Image, ImageView}
20 |
21 |
22 | /** Button with icon
23 | * Created by CAB on 11.11.2016.
24 | */
25 |
26 | class IconButton(btnSize: Int, enabledImg: Image, disabledImg: Image)(action: ⇒Unit) extends Button {
27 | //Images
28 | private val eView = new ImageView{ image = enabledImg }
29 | private val dView = new ImageView{ image = disabledImg }
30 | //Config
31 | prefWidth = btnSize
32 | prefHeight = btnSize
33 | graphic = dView
34 | disable = true
35 | onAction = handle{
36 | passive()
37 | action }
38 | //Methods
39 | def active(): Unit = {
40 | graphic = eView
41 | disable = false}
42 | def passive(): Unit = {
43 | graphic = dView
44 | disable = true}}
45 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/tools/pots/BoolSwitchExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.tools.pots
16 |
17 | import mathact.core.bricks.linking.LinkIn
18 | import mathact.core.bricks.plumbing.wiring.fun.FunWiring
19 | import mathact.tools.EmptyBlock
20 | import mathact.tools.pots.BoolSwitch
21 | import mathact.tools.workbenches.SimpleWorkbench
22 |
23 |
24 | /** Example of using boolean switch
25 | * Created by CAB on 24.12.2016.
26 | */
27 |
28 | class BoolSwitchExample extends SimpleWorkbench {
29 | //Sketch parameters
30 | heading = "Boolean switch example"
31 | //Blocks
32 | val switch = new BoolSwitch{
33 | name = "Boolean switch"
34 | default = false}
35 | val logger = new EmptyBlock with FunWiring with LinkIn[Boolean]{
36 | name = "Logger"
37 | val in = In[Boolean]
38 | in.foreach(v ⇒ logger.info("Logger received: " + v))}
39 | //Connecting
40 | switch ~> logger }
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/Tool.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools
16 |
17 | import mathact.core.bricks.blocks.{Block, BlockContext}
18 |
19 |
20 | /** Base class for tall tools.
21 | * Created by CAB on 07.05.2016.
22 | */
23 |
24 | private[mathact] abstract class Tool(
25 | blockContext: BlockContext,
26 | toolTypeName: String,
27 | toolImgPath: String)
28 | extends Block(blockContext){
29 | //Variables
30 | private var _name: Option[String] = None
31 | //DSL
32 | def name_=(v: String) { _name = v match{case "" ⇒ None; case s ⇒ Some(s)} }
33 | def name = _name
34 | //Abstract callbacks (will called by system after sketch will constructed)
35 | private[mathact] def blockName: Option[String] =
36 | Some(toolTypeName + (_name match{case Some(n) ⇒ " - " + n case _ ⇒ ""}))
37 | private[mathact] def blockImagePath: Option[String] = Some(toolImgPath)
38 |
39 | //TODO Add more
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/mathact_tools/src/main/scala/mathact/tools/EmptyBlock.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.tools
16 |
17 | import mathact.core.bricks.blocks.{Block, BlockContext}
18 |
19 |
20 | /** Empty block
21 | * Created by CAB on 24.10.2016.
22 | */
23 |
24 | class EmptyBlock(implicit blockContext: BlockContext) extends Block(blockContext){
25 | //Variables
26 | private var _name: Option[String] = None
27 | private var _imagePath: Option[String] = None
28 | //DSL
29 | def name_=(v: String) { _name = v match{case "" ⇒ None; case s ⇒ Some(s)} }
30 | def name = _name
31 | def imagePath_=(v: String) { _imagePath = v match{case "" ⇒ None; case s ⇒ Some(s)} }
32 | def imagePath = _imagePath
33 | //Abstract callbacks (will called by system after sketch will constructed)
34 | private[mathact] def blockName: Option[String] = _name
35 | private[mathact] def blockImagePath: Option[String] = _imagePath
36 |
37 | //TODO Add more
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/WorkerBase.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core
16 |
17 | import akka.actor.Actor
18 | import akka.event.{Logging, LoggingAdapter}
19 |
20 |
21 | /** Worker actor base (should not have children actors)
22 | * Created by CAB on 24.05.2016.
23 | */
24 |
25 | private[core] abstract class WorkerBase extends Actor{
26 | //Objects
27 | val log: LoggingAdapter = Logging.getLogger(context.system, this)
28 | implicit val execContext = context.system.dispatcher
29 | //Messages handling with logging
30 | def reaction: PartialFunction[Any, Unit]
31 | /** Resources cleanup (called in postStop) */
32 | def cleanup(): Unit
33 | //Receive
34 | def receive: PartialFunction[Any, Unit] = { case m ⇒
35 | log.debug(s"MESSAGE: $m FROM: $sender")
36 | reaction.applyOrElse[Any, Unit](m, _ ⇒ log.warning(s"LAST MESSAGE NOT HANDLED: $m"))}
37 | //On stop
38 | override def postStop(): Unit = cleanup()}
39 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/tools/generators/DiscreteGeneratorExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.tools.generators
16 |
17 | import mathact.core.bricks.plumbing.wiring.fun.FunWiring
18 | import mathact.data.discrete.TimedEvent
19 | import mathact.tools.EmptyBlock
20 | import mathact.tools.generators.DiscreteGenerator
21 | import mathact.tools.workbenches.SimpleWorkbench
22 |
23 |
24 | /** Example of using of discrete generator
25 | * Created by CAB on 10.11.2016.
26 | */
27 |
28 | class DiscreteGeneratorExample extends SimpleWorkbench {
29 | //Sketch parameters
30 | heading = "Discrete generator example"
31 | //Blocks
32 | val generator = new DiscreteGenerator{
33 | name = "Example generator"
34 | initFrequency = 2} //Hertz
35 | val logger = new EmptyBlock with FunWiring{ name = "Logger"
36 | val in = In[TimedEvent]
37 | in.foreach(v ⇒ logger.info("Logger received: " + v))}
38 | //Connecting
39 | generator.out ~> logger.in}
40 |
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/pipes/InPipe.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting.pipes
16 |
17 | import mathact.core.bricks.plumbing.fitting.Socket
18 | import mathact.core.model.enums.DequeueAlgo
19 | import mathact.core.plumbing.Pump
20 | import mathact.core.plumbing.fitting.Pipe
21 | import mathact.core.plumbing.fitting.flows.InflowLike
22 |
23 |
24 | /** Wrapper fot Inlet
25 | * Created by CAB on 24.08.2016.
26 | */
27 |
28 | private[core] class InPipe[H] (
29 | private[core] val in: InflowLike[H],
30 | private[core] val inletName: Option[String],
31 | private[core] val pump: Pump,
32 | private[core] val dequeue: DequeueAlgo)
33 | extends Pipe[H] with Socket[H]{
34 | //Construction
35 | private[core] val (blockId, inletId) = pump.addInlet(this, inletName)
36 | //Methods
37 | override def toString: String = s"InPipe(in: $in, outletName: $inletName, pump: $pump)"
38 | def processValue(value: Any): Unit = in.processValue(value)}
39 |
--------------------------------------------------------------------------------
/mathact_core/src/test/scala/mathact/core/RandomDataGenerators.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core
16 |
17 | import java.util.UUID
18 |
19 | import mathact.core.model.enums._
20 |
21 |
22 | /** Random model generator methods
23 | * Created by CAB on 13.08.2016.
24 | */
25 |
26 | trait RandomDataGenerators {
27 | def randomBoolean(): Boolean = math.random > .5
28 | def randomOpt[T](v: T): Option[T] = randomBoolean() match{case true ⇒ Some(v); case _ ⇒ None}
29 | def randomInt(from:Int = 0, to:Int = 1000): Int = from + (math.random * (to - from + 1)).toInt
30 | def randomDouble(from:Double = 0, to:Double = 100): Double = from + math.random * (to - from)
31 | def randomString(n:Int = 32): String = UUID.randomUUID().toString.reverse.take(n)
32 | def randomTaskKind(): TaskKind = TaskKind(randomInt(0, TaskKind.maxId - 1))
33 | def randomVisualisationLaval(): VisualisationLaval = VisualisationLaval(randomInt(0, VisualisationLaval.maxId - 1))
34 |
35 | //TODO Add more
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/tools/pots/SettingDialExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.tools.pots
16 |
17 | import mathact.core.bricks.linking.LinkIn
18 | import mathact.core.bricks.plumbing.wiring.fun.FunWiring
19 | import mathact.data.basic.SingleValue
20 | import mathact.tools.EmptyBlock
21 | import mathact.tools.pots.SettingDial
22 | import mathact.tools.workbenches.SimpleWorkbench
23 |
24 |
25 | /** Example of using SettingDial tool.
26 | * Created by CAB on 05.12.2016.
27 | */
28 |
29 | class SettingDialExample extends SimpleWorkbench {
30 | //Sketch parameters
31 | heading = "Setting dial example"
32 | //Blocks
33 | val dial = new SettingDial{
34 | name = "Setting dial"
35 | min = -1
36 | max = 1
37 | init = 0 }
38 | val logger = new EmptyBlock with FunWiring with LinkIn[SingleValue]{
39 | name = "Logger"
40 | val in = In[SingleValue]
41 | in.foreach(v ⇒ logger.info("Logger received: " + v))}
42 | //Connecting
43 | dial ~> logger }
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/common/DTriggerExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.common
16 |
17 | import mathact.tools.indicators.BoolIndicator
18 | import mathact.tools.math.logic.bool._
19 | import mathact.tools.pots._
20 | import mathact.tools.workbenches.SimpleWorkbench
21 |
22 |
23 | /** D-rigger example
24 | * Created by CAB on 26.12.2016.
25 | */
26 |
27 | class DTriggerExample extends SimpleWorkbench {
28 | //Sketch parameters
29 | heading = "D-trigger example"
30 | //Helpers
31 | val dIn = new BoolSwitch{ name = "D in" }
32 | val eIn = new BoolStrobe{ name = "E in" }
33 | val indicator = new BoolIndicator{ name = "Out" }
34 | //Operators
35 | val fAnd = new And
36 | val iAnd = new And
37 | val flipFlop = new FlipFlop
38 | //Connecting
39 | dIn ~> new Not ~> fAnd ~> flipFlop.r
40 | eIn ~> fAnd
41 | eIn ~> iAnd
42 | dIn ~> iAnd ~> flipFlop.s
43 | flipFlop.out ~> indicator.in("Q")
44 | flipFlop.inv ~> indicator.in("!Q")}
--------------------------------------------------------------------------------
/mathact_core/src/main/scala/mathact/core/plumbing/fitting/pipes/OutPipe.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package mathact.core.plumbing.fitting.pipes
16 |
17 | import mathact.core.bricks.plumbing.fitting.Plug
18 | import mathact.core.model.messages.M
19 | import mathact.core.plumbing.Pump
20 | import mathact.core.plumbing.fitting.Pipe
21 | import mathact.core.plumbing.fitting.flows.OutflowLike
22 |
23 |
24 | /** Wrapper for Outlet
25 | * Created by CAB on 24.08.2016.
26 | */
27 |
28 | private[core] class OutPipe[H](
29 | private[core] val out: OutflowLike[H],
30 | private[core] val outletName: Option[String],
31 | private[core] val pump: Pump)
32 | extends Pipe[H] with Plug[H]{
33 | //Construction
34 | private[core] val (blockId, outletId) = pump.addOutlet(this, outletName)
35 | out.injectOutPipe(this)
36 | //Methods
37 | private[core] def pushUserData(value: H): Unit = pump.pushUserMessage(M.UserData[H](outletId, value))
38 | override def toString: String = s"OutPipe(in: $out, outletName: $outletName, pump: $pump)"}
39 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/manual/sketches/MySketches.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package manual.sketches
16 |
17 | import mathact.tools.Sketches
18 |
19 |
20 | /** My sketches
21 | * Created by CAB on 31.12.2016.
22 | */
23 |
24 | object MySketches extends Sketches{
25 | SketchOf[MyFirstSketch](
26 | name = "My first sketch",
27 | description = "The first sketch that I define but not implemented.",
28 | logger = true,
29 | visualisation = true)
30 | SketchOf[MySecondSketch](
31 | name = "My second sketch",
32 | description = "The second sketch that I wrote.")
33 | SketchOf[MyThirdSketch](
34 | name = "My third sketch",
35 | description = "The third complex sketch.",
36 | logger = true)
37 | SketchOf[MyFourthSketch](
38 | name = "My fourth sketch",
39 | description = "Wiring example.",
40 | logger = true)
41 | SketchOf[MyFifthSketch](
42 | name = "My fifth sketch",
43 | description = "Using of block UI.",
44 | logger = true)
45 |
46 |
47 | //TODO Add more
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/tools/plots/ChartRecorderExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.tools.plots
16 |
17 | import mathact.tools.generators.DiscreteGenerator
18 | import mathact.tools.plots.ChartRecorder
19 | import mathact.tools.pots.TimedValuesPot
20 | import mathact.tools.workbenches.SimpleWorkbench
21 | import scalafx.scene.paint.Color._
22 |
23 |
24 | /** Example of using of simple chart recorder
25 | * Created by CAB on 13.11.2016.
26 | */
27 |
28 | class ChartRecorderExample extends SimpleWorkbench {
29 | //Sketch parameters
30 | heading = "Chart simple recorder example"
31 | //Blocks
32 | val generator = new DiscreteGenerator{ name = "generator"}
33 | val pot1 = new TimedValuesPot{ name = "pot1" }
34 | val pot2 = new TimedValuesPot{ name = "pot2" }
35 | val pot3 = new TimedValuesPot{ name = "pot3" }
36 | val chart = new ChartRecorder{ name = "chart" }
37 | //Connecting
38 | generator ~> pot1 ~> chart
39 | generator ~> pot2 ~> chart
40 | generator ~> pot3 ~> chart.line(name = "Pot 3 line", color = Red)}
41 |
--------------------------------------------------------------------------------
/mathact_examples/src/main/scala/examples/tools/math/BooleanLogicExample.scala:
--------------------------------------------------------------------------------
1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2 | * @ @ *
3 | * # # # # (c) 2017 CAB *
4 | * # # # # # # *
5 | * # # # # # # # # # # # # *
6 | * # # # # # # # # # *
7 | * # # # # # # # # # # # # # # # # # # *
8 | * # # # # # # # # # # # # # # # # # *
9 | * # # # # # # # # # # # # # *
10 | * # # # # # # # # # # # # # # *
11 | * # # # # # # # # # # # # # # # # # # *
12 | * @ @ *
13 | \* * http://github.com/alexcab * * * * * * * * * * * * * * * * * * * * * * * * * */
14 |
15 | package examples.tools.math
16 |
17 | import mathact.tools.indicators.BoolIndicator
18 | import mathact.tools.math.logic.bool._
19 | import mathact.tools.pots.BoolSwitch
20 | import mathact.tools.workbenches.SimpleWorkbench
21 |
22 |
23 | /** Example of using boolean logic operators
24 | * Created by CAB on 26.12.2016.
25 | */
26 |
27 | class BooleanLogicExample extends SimpleWorkbench {
28 | //Sketch parameters
29 | heading = "Boolean logic example"
30 | //Helpers
31 | val potX = new BoolSwitch{ name = "In X" }
32 | val potY = new BoolSwitch{ name = "In Y" }
33 | val indicator = new BoolIndicator{ name = "Out" }
34 | //Operators
35 | val not = new Not
36 | val nor = new Nor
37 | val and = new And
38 | val or = new Or
39 | //Connecting
40 | potX ~> not ~> indicator.in("NOT")
41 | potX ~> nor
42 | potX ~> nor ~> indicator.in("NOR")
43 | potX ~> and
44 | potY ~> and ~> indicator.in("AND")
45 | potX ~> or
46 | potY ~> or ~> indicator.in("OR")}
--------------------------------------------------------------------------------