Moving Modules to separate directory
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ad5001 2024-09-22 21:59:11 +02:00
parent a4e9ad7f5a
commit c66d08b352
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
33 changed files with 77 additions and 79 deletions

View file

@ -17,11 +17,11 @@
*/ */
// Loading modules in order // Loading modules in order
import * as Objects from "./objects.mjs" import * as Objects from "./module/objects.mjs"
import * as ExprParser from "./lib/expr-eval/integration.mjs" import * as ExprParser from "./module/expreval.mjs"
import * as ObjsAutoload from "./objs/autoload.mjs" import * as ObjsAutoload from "./objs/autoload.mjs"
import * as Latex from "./math/latex.mjs" import * as Latex from "./module/latex.mjs"
import * as HistoryCommon from "./history/common.mjs" import * as History from "./module/history.mjs"
import * as CanvasAPI from "./canvas.mjs" import * as CanvasAPI from "./module/canvas.mjs"
import * as IOAPI from "./io.mjs" import * as IOAPI from "./module/io.mjs"
import * as PreferencesAPI from "./preferences.mjs" import * as PreferencesAPI from "./module/preferences.mjs"

View file

@ -17,7 +17,7 @@
*/ */
import EditedProperty from "editproperty.mjs" import EditedProperty from "editproperty.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
export default class ColorChanged extends EditedProperty { export default class ColorChanged extends EditedProperty {
// Action used everytime when an object's color is changed // Action used everytime when an object's color is changed

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import History from "./module.mjs" import History from "../module/history.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
export class Action { export class Action {
/** /**

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import { Action } from "common.mjs" import { Action } from "common.mjs"
export default class CreateNewObject extends Action { export default class CreateNewObject extends Action {

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import CreateNewObject from "create.mjs" import CreateNewObject from "create.mjs"

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import * as MathLib from "../mathlib.mjs" import * as MathLib from "../mathlib.mjs"
import { Action } from "common.mjs" import { Action } from "common.mjs"
import { DrawableObject } from "../objs/common.mjs" import { DrawableObject } from "../objs/common.mjs"

View file

@ -17,7 +17,7 @@
*/ */
import EditedProperty from "editproperty.mjs" import EditedProperty from "editproperty.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
export default class NameChanged extends EditedProperty { export default class NameChanged extends EditedProperty {

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import * as MathLib from "../mathlib.mjs" import * as MathLib from "../mathlib.mjs"
import { escapeHTML } from "../utils.mjs" import { escapeHTML } from "../utils.mjs"
import { Action } from "common.mjs" import { Action } from "common.mjs"

View file

@ -17,7 +17,7 @@
*/ */
import EditedProperty from "editproperty.mjs" import EditedProperty from "editproperty.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
export default class EditedVisibility extends EditedProperty { export default class EditedVisibility extends EditedProperty {

View file

@ -17,10 +17,10 @@
*/ */
import Latex from "latex.mjs"
import * as Utils from "../utils.mjs" import * as Utils from "../utils.mjs"
import ExprParser from "../lib/expr-eval/integration.mjs" import Latex from "../module/latex.mjs"
import Objects from "../objects.mjs" import ExprParser from "../module/expreval.mjs"
import Objects from "../module/objects.mjs"
/** /**
* Represents any kind of x-based or non variable based expression. * Represents any kind of x-based or non variable based expression.

View file

@ -18,9 +18,9 @@
import * as Expr from "expression.mjs" import * as Expr from "expression.mjs"
import * as Utils from "../utils.mjs" import * as Utils from "../utils.mjs"
import Latex from "./latex.mjs" import Latex from "../module/latex.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import ExprParser from "../lib/expr-eval/integration.mjs" import ExprParser from "../module/expreval.mjs"
/** /**
* Represents mathematical object for sequences. * Represents mathematical object for sequences.

View file

@ -16,12 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Module } from "./modules.mjs" import { Module } from "./common.mjs"
import { textsup } from "./utils.mjs" import { textsup } from "../utils.mjs"
import { Expression } from "./mathlib.mjs" import { Expression } from "../mathlib.mjs"
import Latex from "./math/latex.mjs" import Latex from "./latex.mjs"
import Objects from "./objects.mjs" import Objects from "./objects.mjs"
import History from "./history/module.mjs" import History from "./history.mjs"
class CanvasAPI extends Module { class CanvasAPI extends Module {

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Module } from "../../modules.mjs" import { Module } from "./common.mjs"
import { Parser } from "./parser.mjs" import { Parser } from "../lib/expr-eval/parser.mjs"
const evalVariables = { const evalVariables = {
// Variables not provided by expr-eval.js, needs to be provided manually // Variables not provided by expr-eval.js, needs to be provided manually

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Module } from "../modules.mjs" import { Module } from "./common.mjs"
import Latex from "../math/latex.mjs" import Latex from "./latex.mjs"
class HistoryAPI extends Module { class HistoryAPI extends Module {

View file

@ -16,9 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Module } from "./modules.mjs" import { Module } from "./common.mjs"
import Objects from "./objects.mjs" import Objects from "./objects.mjs"
import History from "./history/module.mjs" import History from "./history.mjs"
import Canvas from "./canvas.mjs" import Canvas from "./canvas.mjs"
class IOAPI extends Module { class IOAPI extends Module {

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Module } from "../modules.mjs" import { Module } from "./common.mjs"
import * as Instruction from "../lib/expr-eval/instruction.mjs" import * as Instruction from "../lib/expr-eval/instruction.mjs"
import { escapeValue } from "../lib/expr-eval/expression.mjs" import { escapeValue } from "../lib/expr-eval/expression.mjs"

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Module } from './modules.mjs' import { Module } from './common.mjs'
import { textsub } from './utils.mjs' import { textsub } from '../utils.mjs'
class ObjectsAPI extends Module { class ObjectsAPI extends Module {

View file

@ -15,10 +15,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {Module} from "modules.mjs" import {Module} from "./common.mjs"
import General from "preferences/general.mjs" import General from "../preferences/general.mjs"
import Editor from "preferences/expression.mjs" import Editor from "../preferences/expression.mjs"
import DefaultGraph from "preferences/default.mjs" import DefaultGraph from "../preferences/default.mjs"
class PreferencesAPI extends Module { class PreferencesAPI extends Module {
constructor() { constructor() {

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import { DrawableObject } from "common.mjs" import { DrawableObject } from "common.mjs"
import Point from "point.mjs" import Point from "point.mjs"
import Text from "text.mjs" import Text from "text.mjs"

View file

@ -17,17 +17,15 @@
*/ */
import { parseDomain, executeExpression, Expression, EmptySet, Domain } from "../mathlib.mjs" import { parseDomain, executeExpression, Expression, EmptySet, Domain } from "../mathlib.mjs"
import { CreateNewObject } from "../historylib.mjs"
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import History from "../module/history.mjs"
import { ExecutableObject } from "common.mjs" import { ExecutableObject } from "common.mjs"
import Function from "function.mjs" import Function from "function.mjs"
import { API as HistoryAPI } from "../history/common.mjs"
import { CreateNewObject } from "../historylib.mjs"
export default class BodeMagnitude extends ExecutableObject { export default class BodeMagnitude extends ExecutableObject {
static type(){return 'Gain Bode'} static type(){return 'Gain Bode'}
static displayType(){return qsTranslate("bodemagnitude", 'Bode Magnitude')} static displayType(){return qsTranslate("bodemagnitude", 'Bode Magnitude')}
@ -52,7 +50,7 @@ export default class BodeMagnitude extends ExecutableObject {
if(om_0 == null) { if(om_0 == null) {
// Create new point // Create new point
om_0 = Objects.createNewRegisteredObject('Point', [Objects.getNewName('ω'), true, this.color, 'name']) om_0 = Objects.createNewRegisteredObject('Point', [Objects.getNewName('ω'), true, this.color, 'name'])
HistoryAPI.addToHistory(new CreateNewObject(om_0.name, 'Point', om_0.export())) History.addToHistory(new CreateNewObject(om_0.name, 'Point', om_0.export()))
om_0.update() om_0.update()
labelPosition = 'below' labelPosition = 'below'
} }

View file

@ -18,8 +18,8 @@
import { Range, Expression, Domain } from "../mathlib.mjs" import { Range, Expression, Domain } from "../mathlib.mjs"
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import { ExecutableObject } from "common.mjs" import { ExecutableObject } from "common.mjs"
import Function from "function.mjs" import Function from "function.mjs"

View file

@ -17,11 +17,11 @@
*/ */
import { executeExpression, Expression } from "../mathlib.mjs" import { executeExpression, Expression } from "../mathlib.mjs"
import * as P from "../parameters.mjs"
import Objects from "../objects.mjs"
import { API as HistoryAPI } from "../history/common.mjs"
import { CreateNewObject } from "../historylib.mjs" import { CreateNewObject } from "../historylib.mjs"
import Latex from "../math/latex.mjs" import * as P from "../parameters.mjs"
import Objects from "../module/objects.mjs"
import History from "../module/history.mjs"
import Latex from "../module/latex.mjs"
import { ExecutableObject } from "common.mjs" import { ExecutableObject } from "common.mjs"
@ -52,7 +52,7 @@ export default class BodePhase extends ExecutableObject {
// Create new point // Create new point
om_0 = Objects.createNewRegisteredObject('Point', [Objects.getNewName('ω'), this.color, 'name']) om_0 = Objects.createNewRegisteredObject('Point', [Objects.getNewName('ω'), this.color, 'name'])
om_0.labelPosition = this.phase.execute() >= 0 ? 'above' : 'below' om_0.labelPosition = this.phase.execute() >= 0 ? 'above' : 'below'
HistoryAPI.history.addToHistory(new CreateNewObject(om_0.name, 'Point', om_0.export())) History.history.addToHistory(new CreateNewObject(om_0.name, 'Point', om_0.export()))
labelPosition = 'below' labelPosition = 'below'
} }
om_0.requiredBy.push(this) om_0.requiredBy.push(this)

View file

@ -18,8 +18,8 @@
import { executeExpression, Expression } from "../mathlib.mjs" import { executeExpression, Expression } from "../mathlib.mjs"
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import { ExecutableObject } from "common.mjs" import { ExecutableObject } from "common.mjs"

View file

@ -17,8 +17,8 @@
*/ */
import { getRandomColor, textsub } from "../utils.mjs" import { getRandomColor, textsub } from "../utils.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import {ensureTypeSafety, serializesByPropertyType} from "../parameters.mjs" import {ensureTypeSafety, serializesByPropertyType} from "../parameters.mjs"
// This file contains the default data to be imported from all other objects // This file contains the default data to be imported from all other objects

View file

@ -17,8 +17,8 @@
*/ */
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import { ExecutableObject } from "common.mjs" import { ExecutableObject } from "common.mjs"

View file

@ -17,11 +17,11 @@
*/ */
import { textsub } from "../utils.mjs" import { textsub } from "../utils.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import { ExecutableObject } from "common.mjs" import { ExecutableObject } from "common.mjs"
import { parseDomain, Expression, SpecialDomain } from "../mathlib.mjs" import { parseDomain, Expression, SpecialDomain } from "../mathlib.mjs"
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
export default class Function extends ExecutableObject { export default class Function extends ExecutableObject {

View file

@ -18,8 +18,8 @@
import { Expression } from "../mathlib.mjs" import { Expression } from "../mathlib.mjs"
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import { DrawableObject } from "common.mjs" import { DrawableObject } from "common.mjs"

View file

@ -18,8 +18,8 @@
import { Sequence as MathSequence, Domain } from "../mathlib.mjs" import { Sequence as MathSequence, Domain } from "../mathlib.mjs"
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import { ExecutableObject } from "common.mjs" import { ExecutableObject } from "common.mjs"
import Function from "function.mjs" import Function from "function.mjs"

View file

@ -18,8 +18,8 @@
import { Expression } from "../mathlib.mjs" import { Expression } from "../mathlib.mjs"
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import { DrawableObject } from "common.mjs" import { DrawableObject } from "common.mjs"

View file

@ -18,8 +18,8 @@
import { Expression } from "../mathlib.mjs" import { Expression } from "../mathlib.mjs"
import * as P from "../parameters.mjs" import * as P from "../parameters.mjs"
import Latex from "../math/latex.mjs" import Latex from "../module/latex.mjs"
import Objects from "../objects.mjs" import Objects from "../module/objects.mjs"
import { DrawableObject } from "common.mjs" import { DrawableObject } from "common.mjs"

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import {parseDomain, Expression as Expr, Domain} from "./mathlib.mjs" import {parseDomain, Expression as Expr, Domain} from "./mathlib.mjs"
import { Objects } from "./objects.mjs" import Objects from "./module/objects.mjs"
const NONE = class Empty {} const NONE = class Empty {}
@ -175,15 +175,15 @@ export class List extends PropertyType {
parse(value) { parse(value) {
let result = NONE let result = NONE
if(typeof value == 'object' && value.__proto__ === Array) { if(typeof value == 'object' && value.__proto__ === Array) {
let list = [] let valid = 0
for(let v of value) { for(let v of value) {
if (this.format.test(v)) { if (this.format.test(v)) {
v = stringValuesValidators[this.valueType][0](v) v = stringValuesValidators[this.valueType][0](v)
if(stringValuesValidators[this.valueType][1](v)) if(stringValuesValidators[this.valueType][1](v))
list.append(v) valid++
} }
} }
if(list.length === value.length) if(valid === value.length) // Ensure every value is valid.
result = value result = value
} }
return result return result

View file

@ -17,8 +17,8 @@
*/ */
import {BoolSetting} from "common.mjs" import {BoolSetting} from "common.mjs"
import Canvas from "../canvas.mjs" import Canvas from "../module/canvas.mjs"
import LatexAPI from "../math/latex.mjs" import LatexAPI from "../module/latex.mjs"
const CHECK_FOR_UPDATES = new BoolSetting( const CHECK_FOR_UPDATES = new BoolSetting(
qsTranslate("general", "Check for updates on startup"), qsTranslate("general", "Check for updates on startup"),