diff --git a/src/base/B777-300ER/plugins/SASLFree/64/lin.xpl b/src/base/B777-300ER/plugins/SASLFree/64/lin.xpl index cadd765..ca59116 100755 Binary files a/src/base/B777-300ER/plugins/SASLFree/64/lin.xpl and b/src/base/B777-300ER/plugins/SASLFree/64/lin.xpl differ diff --git a/src/base/B777-300ER/plugins/SASLFree/64/mac.xpl b/src/base/B777-300ER/plugins/SASLFree/64/mac.xpl index 73ff22a..d6dc398 100755 Binary files a/src/base/B777-300ER/plugins/SASLFree/64/mac.xpl and b/src/base/B777-300ER/plugins/SASLFree/64/mac.xpl differ diff --git a/src/base/B777-300ER/plugins/SASLFree/64/win.xpl b/src/base/B777-300ER/plugins/SASLFree/64/win.xpl index d5eab4f..a78492d 100755 Binary files a/src/base/B777-300ER/plugins/SASLFree/64/win.xpl and b/src/base/B777-300ER/plugins/SASLFree/64/win.xpl differ diff --git a/src/base/B777-300ER/plugins/SASLFree/changelog.txt b/src/base/B777-300ER/plugins/SASLFree/changelog.txt index 5a16ac6..7d55a55 100755 --- a/src/base/B777-300ER/plugins/SASLFree/changelog.txt +++ b/src/base/B777-300ER/plugins/SASLFree/changelog.txt @@ -1,3 +1,262 @@ +---------------------------------------------------------- +SASL 3.9.0 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed tracking of 3D panel mouse position in multi-monitor configurations and with rotational offsets applied for monitors +- Fixed bug with mouse cursor associated with 3D panel component being active after leaving 3D panel +- Fixed configuring 3D positional sounds for Aircraft plugins +- Fixed context windows states saving and restoring, also visibily is now saved as well +- Added Lua functions to track 3D panel mouse position - , +- Added Lua routines to save and restore OGL internal line primitives settings +- Added option to draw text vertically +- Added async variants of functions to perform data transfers from URL (Net interface) +- Updated SASL Dev Widget UI (scrollbars, drefs & commands search, dynamic text size, bugfixes) +- Updated SASL default cursors texture + +---------------------------------------------------------- +SASL 3.8.0 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed cathing middle mouse button events for legacy pop-ups and 3d panel +- Fixed bug with attempt to render into texture, which is already freed +- Fixed SASL_CW_RESIZE_RIGHT_BOTTOM resizing mode for non-propotional context windows +- Improved cursor showing behavior for component, more logical and convenient +- Improved windows layering (legacy pop-ups window now live in separate layer) +- Added ability to save context window state (position, active context) between project loadings +- Added functional to work with stereographic projections +- Added ability to completely destroy context window, freeing all handled resources ( method) +- Added function to reset timer +- Added function to create hi-res system timer (can be used to measure time within same callback) +- Added annotations for Lua SASL interface (used for auto-completion) +- Restructured internal code related to events system, etc + +---------------------------------------------------------- +SASL 3.7.2 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed usage of nested render targets in non-graphics callbacks (, etc) + +---------------------------------------------------------- +SASL 3.7.1 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed some unnecessary re-activation triggers on Windows OS (Commercial Version) +- Fixed irrelevant entry in the Log about error before activation (Commercial Version) + +---------------------------------------------------------- +SASL 3.7.0 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed possible CTD during automatic context window positioning +- Used other method to catch click event for additional Click System Layer in VR +- Added function to disable and enable Unicode support for the font instance +- Added new Lua callback for components on shutdown - + +---------------------------------------------------------- +SASL 3.6.5 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed CTD on X-Plane exit in case if SASL project is a Global Plugin +- Fixed internal click system bug with HOLD and UP mouse buttons statuses + +---------------------------------------------------------- +SASL 3.6.4 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed possibility of CTD on startup in Linux version +- Fixed middle mouse button event for old-style windows + +---------------------------------------------------------- +SASL 3.6.3 (XP11.25+ support) +---------------------------------------------------------- + +- Minor internal DRM fix (Commercial Version) + +---------------------------------------------------------- +SASL 3.6.1 (XP11.25+ support) +---------------------------------------------------------- + +- Added function +- Added functions for changing OpenGL line width and stipple parameters +- Updated arguments specification for component creation (properties are passed as references) +- Updated function + +---------------------------------------------------------- +SASL 3.6.0 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed drawing multi-line text with non-default alignment +- Fixed cursor management for context windows after window is closed +- Fixed some cases when incorrect functions arguments are not handled +- Fixed rendering in to target with anti-aliasing enabled +- Fixed memory issue in case of using anti-aliasing +- Fixed logging of failed command handler call, shows failed command ID +- Fixed data management for functional array-like properties (datarefs) +- Fixed possible memory leak in case of image loading failure +- Added size getter callback usage for functional array-like properties (datarefs) +- Added new text rendering mode (forcing monospacing) +- Added function for empty texture creation +- Added ability to specify font glyphs spacing factor +- Added ability to use nested masking stack and nested render targets +- Added functional for text rendering with background +- Added ability to create global properties (datarefs) as read-only +- Updated Click System layer functional +- Updated logging in some places +- Updated routines for text measurement +- Removed ability to setup cursors scale factor in Click System +- Removed some experimental text rendering modes + +---------------------------------------------------------- +SASL 3.5.1 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed wrapper for string datarefs +- Fixed crash after on Mac and Linux +- Fixed setting string datarefs (non-partial setters) +- Fixed broken function +- Fixed special font render modes parametrization - ratio should be used instead of fixed value +- Fixed text measurement in case if special modes applied +- Added new mode for text drawing: with forced fixed horizontal advance +- Added new functions for fonts system (instance configurations, instance-specific drawing) +- Partially reverted focus logic for Context Windows (fixes possible issues with global key handlers) + +---------------------------------------------------------- +SASL 3.5.0 (XP11.25+ support) +---------------------------------------------------------- + +- Fixed possible corruption of X-Plane interface textures after textured drawing in the Context Window +- Fixed Context Window keyboard focusing logic in different modes +- Fixed various issues with keeping Context Windows proportionality +- Fixed missing TYPE_UNKNOWN global value +- Fixed crash during rendering to texture target on initial project loading outside of any callback function +- Fixed a few issues with functional Lua datarefs +- Fixed auto-management of Context Window position +- Fixed receiving global monitors bounds via in X-Plane < 11.30 +- Fixed cursor shape cut by Context Window edges +- Fixed issue with CA certificates on Windows OS during usage of functionality +- Fixed instancing of Fonts IDs - specifying different fonts options for different fonts instances is now working +- Fixed fonts usage with outline thickness < 1.0 +- Fixed a few SVG usage issues: loading, fill rules, passing SVG error message into Log +- Fixed fonts data caching +- Fixed necessity of tuning X-Plane App Security Settings on Mac OS 10.14 +- Added ability to use fixed glyph spacing mode for text rendering +- Added ability to use partial getters/setters for string datarefs (same as for array datarefs) +- Added function for getting current Context Windows mode +- Added callback parameter for Context Window - designed to intercept various events related to internal windowing system +- Added ability to enable VR auto-handling for Context Window +- Added ability to select MSAA level during rendering to target +- Added alternative mode for Context Window resizing - only one resize spot on right bottom edge (only applies to windows without default X-Plane decoration) +- Added ability to separetely apply custom window decoration for base window rectangle - in the same way as for header decoration +- Added options to alter behavior of some drawing routines related to wide lines and convex polygons +- Added interface for managing environment variables for current process +- Added function to clear rectangular shape in current render target +- Added functional for setting various download timeouts +- Improved datarefs sub-system +- Improved function, allowing to use array index notation +- Improved auxiliary click system interface +- Improved activation widget interface (Commercial Version) + +---------------------------------------------------------- +SASL 3.4.2 (XP11.25+ support) +---------------------------------------------------------- + +- Added way to invert masking logic on call +- Fixed global key handlers - now there's additional argument which identifies the event + +---------------------------------------------------------- +SASL 3.4.1 (XP11.20+ support) +---------------------------------------------------------- + +- Improved custom datarefs export to DRE and to Datarefs Tree in Widget - now the export is correct + even if dataref is created after initial project loading +- Improved work with render targets - now rendering in texture is possible not only in callbacks +- Improved type casts messages for datarefs lookup - now they're mandatory DEBUG level messages +- Improved datarefs lookup and creation speed +- Improved texture minification filtering - using mipmaps +- Improved images loading - supporting more formats and specifications +- Fixed function presence +- Fixed resetting current logging level after project reboot +- Fixed broken sound system on some Linux distributions +- Fixed crash on project reboot when Functional Properties in use + +---------------------------------------------------------- +SASL 3.4.0 (XP11.20+ support) +---------------------------------------------------------- + +- Fixed a few issues with and options for +- Remade proportional resizing in +- Added ability to configure custom window header - option for +- Added ability to change parameters (movable, resizable, proportional) for on the fly +- now saves its previous position on modes changing (pop-out, free, etc) +- Fixed a bug with 3D panel clicks introduces in 3.3.0 version. + +---------------------------------------------------------- +SASL 3.3.3 (XP11.20+ support) +---------------------------------------------------------- + +- Fixed various issues with unnecessary re-activation requests (Commercial Version) +- Fixed function + +---------------------------------------------------------- +SASL 3.3.2 (XP11.20+ support) +---------------------------------------------------------- + +- Fixed cache for interpolators objects +- Fixed graphics artifacts in SASL Developer widget title + +---------------------------------------------------------- +SASL 3.3.1 (XP11.20+ support) +---------------------------------------------------------- + +- Fixed various issues with unnecessary re-activation requests (Commercial Version) +- Fixed activation dialog appearance on some multi-monitor setups (Commercial Version) +- Dump problematic path in case of function fails +- Fixed huge FPS drop in case of Context Windows usage in VR + +---------------------------------------------------------- +SASL 3.3.0 (XP11.20+ support) +---------------------------------------------------------- + +- Removed XP10 support +- Add support for XP11 features (multi-monitors, OS pop-out windows, VR support etc) + - Refer to the marks in the documentation +- Add support for using SVG format +- Updated warnings and errors dumping +- Updated SASL Developer Widget to support multi-monitors and OS pop-out mode +- Improved DRM functionality to avoid unnecessary activations requests (Commercial Version) + +---------------------------------------------------------- +SASL 3.2.7 +---------------------------------------------------------- + +- Fix various issues with unnecessary re-activation requests (Commercial Version) + +---------------------------------------------------------- +SASL 3.2.6 +---------------------------------------------------------- + +- Fix various issues with unnecessary re-activation requests (Commercial Version) + +---------------------------------------------------------- +SASL 3.2.5 +---------------------------------------------------------- + +- Fixed issue with huge project reboot time in case of DRE windows presence +- Fixed OpenAL issues on Mac OS with SASL 3.2.4 +- Improved DRM regarding unnecessary activations requests (Commercial Version) +- Fixed option for components on 3D panel +- Added function to set pixel accurate text rendering mode +- Added info about warnings and errors log entries count (since Reboot) into Developer Widget +- Add ability to use alpha texture as mask between and calls +- Fixed option for components +- Added new function for setting Lua stacktrace limit used in case of Warnings and Errors +- Fixed function absence +- Added default mouse wheel handler for popups (now they're not transparent for mouse wheel action) +- Fixed error logging in case of resources lookup fail +- Returned ability to specify for component as function +- Fixed some SASL virtual keys constants values +- Fixed hard crash in case of some graphics resources lookup fail during draw routines call + ---------------------------------------------------------- SASL 3.2.4 ---------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/api/api.lua b/src/base/B777-300ER/plugins/SASLFree/data/api/api.lua new file mode 100644 index 0000000..e915d01 --- /dev/null +++ b/src/base/B777-300ER/plugins/SASLFree/data/api/api.lua @@ -0,0 +1,109 @@ +------------------------------------------------------------------------------- +-- API +------------------------------------------------------------------------------- + +--- @class gl +--- @class al +--- @class net +--- @class options + +--- @class sasl +--- @field gl gl +--- @field al al +--- @field net net +--- @field options options + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- @class LogLevelID + +LOG_DEFAULT = nil +LOG_TRACE = nil +LOG_DEBUG = nil +LOG_INFO = nil +LOG_WARN = nil +LOG_ERROR = nil + +--- Writes data to the log file using info-level. +--- @vararg data +function logInfo(data, ...) end; +sasl.logInfo = logInfo; + +--- Writes data to the log file using warning-level. +--- @vararg data +function logWarning(data, ...) end; +sasl.logWarning = logInfo; + +--- Writes data to the log file using error-level. +--- @vararg data +function logError(data, ...) end; +sasl.logError = logInfo; + +--- Writes data to the log file using debug-level. +--- @vararg data +function logDebug(data, ...) end; +sasl.logDebug = logInfo; + +--- Writes data to the log file using debug-level. +--- @vararg data +function logTrace(data, ...) end; +sasl.logTrace = logInfo; + +--- Returns currently selected log level. +--- @return LogLevelID +function getLogLevel() end; +sasl.getLogLevel = getLogLevel; + +--- Sets current log level for logger. +--- @param level LogLevelID +function setLogLevel(level) end; +sasl.setLogLevel = setLogLevel; + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Returns value of system environment variable for current process. +--- @param name string +--- @return boolean, string +function getEnvVariable(name) end; +sasl.getEnvVariable = getEnvVariable; + +--- Sets value of system environment variable (creates new, if it doesn't exist) for current process. +--- @param name string +--- @param value string +--- @return boolean +function setEnvVariable(name, value) end; +sasl.setEnvVariable = setEnvVariable; + +--- Unsets environment variable for current process. +--- @param name string +--- @return boolean +function unsetEnvVariable(name) end; +sasl.unsetEnvVariable = unsetEnvVariable; + +--- Returns the identifier of OS. +--- @return string +function getOS() end; +sasl.getOS = getOS; + +--- Returns X-Plane version. +--- @return number +function getXPVersion() end; +sasl.getXPVersion = getXPVersion; + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- @class FileEntry +--- @field name string +--- @field type string + +--- Returns data about directories and files located in the specified path. +--- @param path string +--- @return FileEntry[] +function listFiles(path) end; +sasl.listFiles = listFiles; + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/base/B777-300ER/plugins/SASLFree/data/components/cursors.png b/src/base/B777-300ER/plugins/SASLFree/data/components/cursors.png index 1b0a84c..9d4c185 100755 Binary files a/src/base/B777-300ER/plugins/SASLFree/data/components/cursors.png and b/src/base/B777-300ER/plugins/SASLFree/data/components/cursors.png differ diff --git a/src/base/B777-300ER/plugins/SASLFree/data/components/interactive.lua b/src/base/B777-300ER/plugins/SASLFree/data/components/interactive.lua index eb9fef9..c1ade90 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/components/interactive.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/components/interactive.lua @@ -1,7 +1,6 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- INTERACTIVE ZONE ----------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Interactive zone +------------------------------------------------------------------------------- function draw() if globalShowInteractiveAreas then @@ -9,5 +8,5 @@ function draw() end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/components/mouseFocusedZone.lua b/src/base/B777-300ER/plugins/SASLFree/data/components/mouseFocusedZone.lua index f50a07e..51e239d 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/components/mouseFocusedZone.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/components/mouseFocusedZone.lua @@ -1,12 +1,11 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- MOUSE FOCUSED ZONE -------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Mouse focused zone +------------------------------------------------------------------------------- defineProperty("mouseHovered", false) components = { - interactive { + interactive { onMouseMove = function() return true end, @@ -21,5 +20,5 @@ components = { } } ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/components/popupCloseButton.lua b/src/base/B777-300ER/plugins/SASLFree/data/components/popupCloseButton.lua index 48d845c..44a18d5 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/components/popupCloseButton.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/components/popupCloseButton.lua @@ -1,20 +1,19 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- POPUP CLOSE BUTTON --------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Popup close button +------------------------------------------------------------------------------- defineProperty("panel") defineProperty("closeButtonFocused", false) function draw() drawAll(components) - + local isFocused = get(closeButtonFocused) local signColor = { 0.5, 0.5, 0.5, 1.0 } if isFocused then signColor = { 0.5, 0.9, 0.5, 1.0 } end - + sasl.gl.drawLine(2, 2, size[1] - 2, size[2] - 2, signColor) sasl.gl.drawLine(2, size[2] - 2, size[1] - 2, 2, signColor) end @@ -32,5 +31,5 @@ components = { } } ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/base/B777-300ER/plugins/SASLFree/data/components/popupResizeButton.lua b/src/base/B777-300ER/plugins/SASLFree/data/components/popupResizeButton.lua index eb8b7a8..ec829c6 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/components/popupResizeButton.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/components/popupResizeButton.lua @@ -1,19 +1,18 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- POPUP RESIZE BUTTON -------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Popup resize button +------------------------------------------------------------------------------- defineProperty("resizeButtonFocused", false) function draw() drawAll(components) - + local isFocused = get(resizeButtonFocused) local signColor = { 0.5, 0.5, 0.5, 1.0 } if isFocused then signColor = { 0.0, 0.9, 0.5, 1.0 } end - + sasl.gl.drawTriangle(0, 0, size[1], size[2], size[1], 0, signColor) end @@ -23,5 +22,5 @@ components = { } } ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/components/rectangle.lua b/src/base/B777-300ER/plugins/SASLFree/data/components/rectangle.lua index b756c3f..56aa73f 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/components/rectangle.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/components/rectangle.lua @@ -1,7 +1,6 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- INTERACTIVE ZONE ------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Rectangle +------------------------------------------------------------------------------- defineProperty("color", { 0.15, 0.15, 0.15, 1.0 }) @@ -10,6 +9,6 @@ function draw() sasl.gl.drawRectangle(0, 0, size[1], size[2], c) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initBasicHelpers.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initBasicHelpers.lua index eac4ac2..1807c0d 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initBasicHelpers.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initBasicHelpers.lua @@ -1,22 +1,31 @@ ---------------------------------------------------------------------------------------------------------------------------- --- BASIC HELPERS ----------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Basic helpers +------------------------------------------------------------------------------- --- Consider 0 as false -function toboolean(value) - if 0 == value then +private = {} + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Interprets 0 value as false. +--- @param v any +--- @return any +function toboolean(v) + if v == 0 then return false else - return value + return v end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Check if coord lay inside rectangle. Rectangle is array of --- { x, y, width, height } +--- Checks if 2D coordinates lays inside specified rectangle. +--- @param rect number[] +--- @param x number +--- @param y number +--- @return boolean function isInRect(rect, x, y) local x1 = rect[1] local y1 = rect[2] @@ -25,5 +34,5 @@ function isInRect(rect, x, y) return (x1 <= x) and (x2 > x) and (y1 <= y) and (y2 > y) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initContextWindows.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initContextWindows.lua new file mode 100644 index 0000000..ba0ff6d --- /dev/null +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initContextWindows.lua @@ -0,0 +1,505 @@ +------------------------------------------------------------------------------- +-- Context windows +------------------------------------------------------------------------------- + +local function contextWindowHeaderDrawDef(window, w, h) + local elColor = { 0.8, 0.8, 0.8, 1.0 } + sasl.gl.drawRectangle(0, 0, w, h, { 0.28, 0.28, 0.28, 1.0 }) + + sasl.gl.drawWideLine(7, 7, h - 7, h - 7, 2, elColor) + sasl.gl.drawWideLine(7, h - 7, h - 7, 7, 2, elColor) + sasl.gl.drawConvexPolygon({ h + 7, 7, h + 18, 7, h + 18, h - 7, h + 7, h - 7 }, false, 1, elColor) + sasl.gl.drawWidePolyLine({ h + 10, h - 7, h + 10, 10, h + 18, 10 }, 1, elColor) + + sasl.gl.drawWideLine(w - 7, 7, w - h + 7, h - 7, 2, elColor) + sasl.gl.drawWideLine(w - 7, h - 7, w - h + 7, 7, 2, elColor) + sasl.gl.drawConvexPolygon({ w - 2 * h + 7, 7, w - 2 * h + 18, 7, w - 2 * h + 18, h - 7, w - 2 * h + 7, h - 7 }, false, 1, elColor) + sasl.gl.drawWidePolyLine({ w - 2 * h + 10, h - 7, w - 2 * h + 10, 10, w - 2 * h + 18, 10 }, 1, elColor) +end + +local function contextWindowHeaderMDownDef(window, x, y, w, h, button) + if isInRect({ 0, 0, h, h }, x, y) or isInRect({ w - h, 0, h, h }, x, y) then + window:setIsVisible(false) + return true + end + if isInRect({ h, 0, h, h }, x, y) or isInRect({ w - 2 * h, 0, h, h }, x, y) then + window:setMode(SASL_CW_MODE_POPOUT) + return true + end + return false +end + +local function getContextWindowDecorationDef(window) + return { + headerHeight = 25, + draw = function(w, h) contextWindowHeaderDrawDef(window, w, h) end, + onMouseDown = function(x, y, w, h, button) return contextWindowHeaderMDownDef(window, x, y, w, h, button) end, + onMouseUp = function(x, y, w, h, button) return false end, + onMouseHold = function(x, y, w, h, button) return false end, + onMouseMove = function(x, y, w, h) return 1 end, + onMouseWheel = function(x, y, w, h, clicks) return false end, + main = {} + } +end + +local defaultWindowName = "cWindow" + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- @class ContextWindowDecorationCallbacks +--- @field draw fun(w:number, h:number) +--- @field onMouseDown fun(x:number, y:number, w:number, h:number):boolean +--- @field onMouseUp fun(x:number, y:number, w:number, h:number):boolean +--- @field onMouseHold fun(x:number, y:number, w:number, h:number):boolean +--- @field onMouseMove fun(x:number, y:number, w:number, h:number):number +--- @field onMouseWheel fun(x:number, y:number, w:number, h:number, clicks:number):boolean + +--- @class ContextWindowDecoration : ContextWindowDecorationCallbacks +--- @field headerHeight number +--- @field main ContextWindowDecorationCallbacks + +--- @class ContextWindowParams +--- @field name string +--- @field position number[] +--- @field minimumSize number[] +--- @field maximumSize number[] +--- @field visible boolean +--- @field proportional boolean +--- @field gravity number[] +--- @field noBackground boolean +--- @field layer CWLayerID +--- @field noDecore boolean +--- @field customDecore boolean +--- @field decoration ContextWindowDecoration +--- @field noResize boolean +--- @field resizeMode CWResizeModeID +--- @field noMove boolean +--- @field vrAuto boolean +--- @field fbo boolean +--- @field clip boolean +--- @field clipSize number[] +--- @field command string +--- @field description string +--- @field callback fun(id:number, event:CWEventID) +--- @field resizeCallback fun(c:Component, w:number, h:number, mode:CWModeID, proportional:boolean):number, number, number, number +--- @field components Component[] + +--- @class ContextWindow +--- @field id number +--- @field component Component +--- @field decoration ContextWindowDecoration +--- @field setSizeLimits fun(self:ContextWindow, minWidth:number, minHeight:number, maxWidth:number, maxHeight:number) +--- @field getSizeLimits fun(self:ContextWindow):number, number, number, number +--- @field setResizeMode fun(self:ContextWindow, mode:CWResizeModeID) +--- @field setIsVisible fun(self:ContextWindow, isVisible:boolean) +--- @field isVisible fun(self:ContextWindow):boolean +--- @field setTitle fun(self:ContextWindow, title:string) +--- @field setGravity fun(self:ContextWindow, left:number, top:number, right:number, bottom:number) +--- @field setPosition fun(self:ContextWindow, x:number, y:number, w:number, h:number) +--- @field getPosition fun(self:ContextWindow):number, number, number, number +--- @field setMode fun(self:ContextWindow, mode:CWModeID, monitor:number) +--- @field getMode fun(self:ContextWindow):CWModeID, monitor +--- @field isPoppedOut fun(self:ContextWindow):boolean +--- @field isInVR fun(self:ContextWindow):boolean +--- @field setVrAutoHandling fun(self:ContextWindow, auto:boolean) +--- @field setProportional fun(self:ContextWindow, isProportional:boolean) +--- @field setResizable fun(self:ContextWindow, isResizable:boolean) +--- @field setMovable fun(self:ContextWindow, isMovable:boolean) +--- @field setCallback fun(self:ContextWindow, callback:fun(id:number, event:CWEventID)) +--- @field destroy fun(self:ContextWindow) + +--- Creates modern 2D context window with attached components hierarchy. +--- @param tbl ContextWindowParams +--- @return ContextWindow +function contextWindow(tbl) + local window = {} + local cName = defaultWindowName + if tbl.name ~= nil then + cName = tbl.name + end + local c = private.createComponent(cName) + c.position = createProperty { 0, 0, 0, 0 } + + local cwDecoration = SASL_CW_DECORATED_XP + if get(tbl.noDecore) then + cwDecoration = SASL_CW_NON_DECORATED + elseif get(tbl.customDecore) then + cwDecoration = SASL_CW_DECORATED + end + + local layer = SASL_CW_LAYER_FLOATING_WINDOWS + if tbl.layer ~= nil then + layer = tbl.layer + end + + set(c.position, { 0, 0, tbl.position[3], tbl.position[4] }) + set(c.clip, tbl.clip) + set(c.clipSize, tbl.clipSize) + if tbl.visible ~= nil then + set(c.visible, tbl.visible) + else + set(c.visible, false) + end + c.size = { tbl.position[3], tbl.position[4] } + c.components = tbl.components + + startComponentsCreation(tbl) + if not get(tbl.noBackground) then + if not rectangle then + rectangle = loadComponent("rectangle") + end + + table.insert(c.components, 1, + rectangle { position = { 0, 0, c.size[1], c.size[2] } } ) + end + finishComponentsCreation() + + ------------------------------------------------------------------------------- + + function drawContextWindow(wId) + private.drawComponent(c) + end + + function onMouseDownContextWindow(wId, x, y, button) + private.eventCounter = 0 + return processMouseDown(c, x, y, button) + end + + function onMouseUpContextWindow(wId, x, y, button) + private.eventCounter = 0 + return processMouseUp(c, x, y, button) + end + + function onMouseHoldContextWindow(wId, x, y, button) + private.eventCounter = 0 + return processMouseHold(c, x, y, button) + end + + function onMouseWheelContextWindow(wId, x, y, wheelClicks) + private.eventCounter = 0 + return processMouseWheel(c, x, y, wheelClicks) + end + + function onMouseMoveContextWindow(wId, x, y) + private.eventCounter = 0 + private.setOnInterceptingWindow(false) + sasl.gl.setCursorLayer(wId) + + local resultCursor = 1 + processMouseMove(c, x, y) + if private.isOSCursorHidden() then + resultCursor = 2 + end + return resultCursor + end + + local resizeCallback = tbl.resizeCallback + function onContextWindowResize(wId, width, height, mode, proportional) + if resizeCallback then + return resizeCallback(c, width, height, mode, proportional) + else + local cP = get(c.position) + if proportional and + (mode == SASL_CW_MODE_POPOUT or + mode == SASL_CW_MODE_MONITOR_FULL or + cwDecoration == SASL_CW_DECORATED_XP) + then + local center = { width / 2, height / 2 } + local scale = math.min(width / cP[3], height / cP[4]) + + cP[3] = cP[3] * scale + cP[4] = cP[4] * scale + cP[1] = math.floor(center[1] - cP[3] / 2) + cP[2] = math.floor(center[2] - cP[4] / 2) + else + cP[3] = width + cP[4] = height + cP[1] = 0 + cP[2] = 0 + end + set(c.position, cP) + return cP[1], cP[2], cP[3], cP[4] + end + end + + function onContextWindowLayoutChange(wId, isInFront) + private.eventCounter = 1 + local currentFocusedComponentPath = private.getFocusedComponentPath() + local focusedNow = false + if currentFocusedComponentPath then + focusedNow = currentFocusedComponentPath[1] == c + if focusedNow and not isInFront then + private.clearFocusedComponentPaths() + end + end + if not focusedNow and isInFront then + private.setFocusedPath({ c }) + end + end + + ------------------------------------------------------------------------------- + + local p = tbl.position + window.id = sasl.windows.createContextWindow(cwDecoration, layer, p[1], p[2], p[3], p[4], + drawContextWindow, + onMouseDownContextWindow, + onMouseUpContextWindow, + onMouseHoldContextWindow, + onMouseMoveContextWindow, + onMouseWheelContextWindow, + onContextWindowResize, + onContextWindowLayoutChange) + + window.component = c + + ------------------------------------------------------------------------------- + + if cwDecoration == SASL_CW_DECORATED then + window.decoration = getContextWindowDecorationDef(window) + local decor = window.decoration + if tbl.decoration ~= nil then + for k, v in pairs(tbl.decoration) do + decor[k] = v + end + end + sasl.windows.setContextWindowDecoration(window.id, decor.headerHeight, + decor.draw, decor.onMouseDown, decor.onMouseUp, + decor.onMouseHold, decor.onMouseMove, decor.onMouseWheel, + decor.main.draw, decor.main.onMouseDown, decor.main.onMouseUp, + decor.main.onMouseHold, decor.main.onMouseMove, decor.main.onMouseWheel) + end + + ------------------------------------------------------------------------------- + + window.setSizeLimits = function(self, minWidth, minHeight, maxWidth, maxHeight) + sasl.windows.setContextWindowSizeLimits(self.id, minWidth, minHeight, maxWidth, maxHeight) + end + window.getSizeLimits = function(self) + local minW, minH, maxW, maxH = sasl.windows.getContextWindowSizeLimits(self.id) + return minW, minH, maxW, maxH + end + window.setResizeMode = function(self, mode) + sasl.windows.setContextWindowResizeMode(self.id, mode) + end + + local sLimits = { 100, 100, 2048, 2048 } + if get(tbl.minimumSize) then + sLimits[1] = tbl.minimumSize[1] + sLimits[2] = tbl.minimumSize[2] + end + if get(tbl.maximumSize) then + sLimits[3] = tbl.maximumSize[1] + sLimits[4] = tbl.maximumSize[2] + end + window:setSizeLimits(sLimits[1], sLimits[2], sLimits[3], sLimits[4]) + + local resizeMode = SASL_CW_RESIZE_ALL_BOUNDS + if tbl.resizeMode ~= nil then + resizeMode = tbl.resizeMode + end + window:setResizeMode(resizeMode) + + ------------------------------------------------------------------------------- + + window.setIsVisible = function(self, isVisible) + sasl.windows.setContextWindowVisible(self.id, isVisible) + set(self.component.visible, isVisible) + if not isVisible then + private.setPressedComponentPath(nil) + private.setCursor(nil) + end + end + window.isVisible = function(self) + return sasl.windows.getContextWindowVisible(self.id) + end + + if not get(c.visible) then + window:setIsVisible(false) + end + + ------------------------------------------------------------------------------- + + window.cmd = nil + if get(tbl.command) then + local command = sasl.createCommand(get(tbl.command), get(tbl.description)) + + function commandHandler(phase) + if phase == SASL_COMMAND_BEGIN then + window:setIsVisible(not window:isVisible()) + end + return 0 + end + window.cmd = command + + sasl.registerCommandHandler(window.cmd, 0, commandHandler) + end + + ------------------------------------------------------------------------------- + + window.setTitle = function(self, title) + sasl.windows.setContextWindowTitle(self.id, title) + end + if get(tbl.name) then + window:setTitle(get(tbl.name)) + end + + window.setGravity = function(self, left, top, right, bottom) + sasl.windows.setContextWindowGravity(self.id, left, top, right, bottom) + end + if get(tbl.gravity) then + local gr = get(tbl.gravity) + window:setGravity(gr[1], gr[2], gr[3], gr[4]) + end + + window.setPosition = function(self, x, y, width, height) + sasl.windows.setContextWindowPosition(self.id, x, y, width, height) + end + window.getPosition = function(self) + return sasl.windows.getContextWindowPosition(self.id) + end + + ------------------------------------------------------------------------------- + + window.setMode = function(self, mode, monitor) + private.setCursor(nil) + sasl.windows.setContextWindowMode(self.id, mode, monitor) + end + + window.getMode = function(self) + return sasl.windows.getContextWindowMode(self.id) + end + + window.isPoppedOut = function(self) + return sasl.windows.isContextWindowPoppedOut(self.id) + end + + window.isInVR = function(self) + return sasl.windows.isContextWindowInVR(self.id) + end + + local autoVr = false + window.setVrAutoHandling = function(self, auto) + sasl.windows.setContextWindowVrAutoHandling(self.id, auto) + end + if tbl.vrAuto ~= nil then + autoVr = tbl.vrAuto + end + window:setVrAutoHandling(autoVr) + + ------------------------------------------------------------------------------- + + local proportional = true + if tbl.proportional ~= nil then + proportional = tbl.proportional + end + window.setProportional = function(self, isProportional) + sasl.windows.setContextWindowProportional(self.id, isProportional) + end + window:setProportional(proportional) + + window.setResizable = function(self, isResizable) + sasl.windows.setContextWindowResizable(self.id, isResizable) + end + if tbl.noResize then + window:setResizable(false) + window:setSizeLimits(p[3], p[4], p[3], p[4]) + end + + window.setMovable = function(self, isMovable) + sasl.windows.setContextWindowMovable(self.id, isMovable) + end + if tbl.noMove then + window:setMovable(false) + end + + ------------------------------------------------------------------------------- + + window.setCallback = function(self, callback) + sasl.windows.setContextWindowCallback(self.id, callback) + end + if tbl.callback ~= nil then + window:setCallback(tbl.callback) + end + + ------------------------------------------------------------------------------- + + window.destroy = function(self) + sasl.windows.destroyContextWindow(self.id) + if self.cmd ~= nil then + sasl.unregisterCommandHandler(self.cmd, 0) + end + for k, v in ipairs(contextWindows.components) do + if v == c then + table.remove(contextWindows.components, k) + break + end + end + end + + ------------------------------------------------------------------------------- + + c.window = window + c.saveState = createProperty(false) + if get(tbl.saveState) then + set(c.saveState, true) + private.applyContextWindowState(c) + end + + contextWindows.component(c) + return window +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Saves context windows states in global state holder. +function private.saveContextWindowsState() + local cw = {} + for _, c in ipairs(contextWindows.components) do + local name = c.name + local sstate = get(c.saveState) + if sstate and name ~= defaultWindowName then + local modeId, modeMonitor = c.window:getMode() + local x, y, w, h = c.window:getPosition() + local vis = c.window:isVisible() + cw[name] = { + mode = { modeId, modeMonitor }, + position = { x, y, w, h }, + visible = vis + } + end + end + + if not #cw then + return + end + + private.savedState.contextWindows = cw +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Applies saved state for context window associated with component +function private.applyContextWindowState(c) + local name = c.name + if name ~= defaultWindowName then + local st = private.savedState.contextWindows[name] + if st then + local mode = st.mode + local p = st.position + local visible = st.visible + if mode and p and mode[1] ~= SASL_CW_MODE_VR then + c.window:setMode(mode[1], mode[2]) + c.window:setPosition(p[1], p[2], p[3], p[4]) + if visible ~= nil then + c.window:setIsVisible(visible) + end + end + end + end +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initDefaultEventHandlers.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initDefaultEventHandlers.lua index 460eb48..a284018 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initDefaultEventHandlers.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initDefaultEventHandlers.lua @@ -1,11 +1,17 @@ ---------------------------------------------------------------------------------------------------------------------------- --- DEFAULT MOUSE HANDLERS --------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Default mouse click handler -function defaultOnMouseHold(comp, x, y, button, parentX, parentY) - if (button == 1) and get(comp.movable) and (comp.dragging == 1) then +------------------------------------------------------------------------------- +-- Default events handlers +------------------------------------------------------------------------------- + +--- Default mouse click handler for component. +--- @param comp Component +--- @param x number +--- @param y number +--- @param button MouseButtonID +--- @param parentX number +--- @param parentY number +--- @return boolean +function private.defaultOnMouseHold(comp, x, y, button, parentX, parentY) + if button == 1 and get(comp.movable) and comp.dragging == 1 then local position = get(comp.position) comp.dragStartX = parentX comp.dragStartY = parentY @@ -17,14 +23,19 @@ function defaultOnMouseHold(comp, x, y, button, parentX, parentY) return false end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Default mouse down handler -function defaultOnMouseDown(comp, x, y, button, parentX, parentY) - if (button == 1) and get(comp.resizable) and - isInRect(comp.resizeRect, x, y) - then +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Default mouse down handler for component. +--- @param comp Component +--- @param x number +--- @param y number +--- @param button MouseButtonID +--- @param parentX number +--- @param parentY number +--- @return boolean +function private.defaultOnMouseDown(comp, x, y, button, parentX, parentY) + if button == 1 and get(comp.resizable) and isInRect(comp.resizeRect, x, y) then local pos = get(comp.position) comp.resizing = true comp.dragStartX = parentX @@ -36,23 +47,30 @@ function defaultOnMouseDown(comp, x, y, button, parentX, parentY) return true end - if (button == 1) and get(comp.movable) then + if button == 1 and get(comp.movable) then comp.dragging = 1 return true end return false end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Default mouse up handler -function defaultOnMouseUp(comp, x, y, button, parentX, parentY) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Default mouse up handler for component. +--- @param comp Component +--- @param x number +--- @param y number +--- @param button MouseButtonID +--- @param parentX number +--- @param parentY number +--- @return boolean +function private.defaultOnMouseUp(comp, x, y, button, parentX, parentY) if button == 1 and (get(comp.movable) or get(comp.resizable)) then if comp.dragging then comp.dragging = 0 end - if get(comp.resizable) and comp.resizing then + if get(comp.resizable) and comp.resizing then comp.resizing = false end return true @@ -60,20 +78,27 @@ function defaultOnMouseUp(comp, x, y, button, parentX, parentY) return false end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Default mouse move handler -function defaultOnMouseMove(comp, x, y, button, parentX, parentY) - if (rawget(comp, "resizing")) then +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Default mouse move handler for component. +--- @param comp Component +--- @param x number +--- @param y number +--- @param button MouseButtonID +--- @param parentX number +--- @param parentY number +--- @return boolean +function private.defaultOnMouseMove(comp, x, y, button, parentX, parentY) + if rawget(comp, "resizing") then local pos = get(comp.position) local newSizeX = comp.dragStartSizeX + (parentX - comp.dragStartX) local newSizeY = comp.dragStartSizeY - (parentY - comp.dragStartY) - - if 10 > newSizeX then + + if newSizeX < 10 then newSizeX = 10 end - if 10 > newSizeY then + if newSizeY < 10 then newSizeY = 10 end @@ -87,7 +112,7 @@ function defaultOnMouseMove(comp, x, y, button, parentX, parentY) newSizeX = propWidth end end - + pos[2] = comp.dragStartY - (newSizeY - comp.dragStartSizeY) pos[3] = newSizeX pos[4] = newSizeY @@ -95,7 +120,7 @@ function defaultOnMouseMove(comp, x, y, button, parentX, parentY) return true end - if (rawget(comp, "dragging") == 2) and get(comp.movable) then + if rawget(comp, "dragging") == 2 and get(comp.movable) then local position = get(comp.position) position[1] = comp.dragStartPosX + (parentX - comp.dragStartX) position[2] = comp.dragStartPosY + (parentY - comp.dragStartY) @@ -106,31 +131,51 @@ function defaultOnMouseMove(comp, x, y, button, parentX, parentY) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Default mouse wheel handler -function defaultOnMouseWheel(comp, x, y, button, parentX, parentY) - +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Default mouse wheel handler for component. +--- @param comp Component +--- @param x number +--- @param y number +--- @param button MouseButtonID +--- @param parentX number +--- @param parentY number +--- @param wheelClicks number +--- @return boolean +function private.defaultOnMouseWheel(comp, x, y, button, parentX, parentY, wheelClicks) + return false end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- DEFAULT KEY HANDLERS ------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Default key down handler -function defaultOnKeyDown(comp, char, key, shiftDown, ctrlDown, AltOptDown) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Default key down handler. +--- @param comp Component +--- @param char number +--- @param key number +--- @param shiftDown MouseButtonID +--- @param ctrlDown number +--- @param AltOptDown number +--- @return boolean +function private.defaultOnKeyDown(comp, char, key, shiftDown, ctrlDown, AltOptDown) return false end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Default key up handler -function defaultOnKeyUp(comp, char, key, shiftDown, ctrlDown, AltOptDown) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Default key up handler. +--- @param comp Component +--- @param char number +--- @param key number +--- @param shiftDown MouseButtonID +--- @param ctrlDown number +--- @param AltOptDown number +--- @return boolean +function private.defaultOnKeyUp(comp, char, key, shiftDown, ctrlDown, AltOptDown) return false end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initFilesystemHelpers.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initFilesystemHelpers.lua index 000c5d7..6fbce63 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initFilesystemHelpers.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initFilesystemHelpers.lua @@ -1,12 +1,13 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- FILESYSTEM HELPERS ---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Filesystem helpers +------------------------------------------------------------------------------- --- Return true if file exists +--- Checks if specified file exists. +--- @param fileName string +--- @return boolean function isFileExists(fileName) local f = io.open(fileName) - if nil == f then + if f == nil then return false else io.close(f) @@ -14,38 +15,42 @@ function isFileExists(fileName) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Remove extension from file name +--- Removes extension from path to file. +--- @param filePath string +--- @return string function extractFileName(filePath) for i = string.len(filePath), 1, -1 do if string.sub(filePath, i, i) == '.' then - return string.sub(filePath, 1, i-1) + return string.sub(filePath, 1, i - 1) end end return filePath end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Try to find file on search paths +--- Loads chunk of Lua code from specified file. +--- Will be searched according to the current list of search paths. +--- @param fileName string +--- @return function function openFile(fileName) local name = extractFileName(fileName) - for _, v in ipairs(searchPath) do + for _, v in ipairs(private.searchPath) do local fullName local subdir if 0 < string.len(v) then - fullName = v .. '/' .. fileName - subdir = v .. '/' .. name + fullName = v..'/'..fileName + subdir = v..'/'..name else fullName = fileName subdir = name end - -- Check if it is available at current path if isFileExists(fullName) then local f, errorMsg = loadfile(fullName) if f then @@ -55,7 +60,6 @@ function openFile(fileName) end end - -- Check subdirectory local subFullName = subdir .. '/' .. fileName if isFileExists(subFullName) then local f, errorMsg = loadfile(subFullName) @@ -70,24 +74,27 @@ function openFile(fileName) return nil end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Find specified resource file -function findResourceFile(fileName) - for _, v in ipairs(searchResourcesPath) do +--- Finds specified resource file. +--- Will be searched according to the current list of search resources paths. +--- @param fileName string +--- @return string +function findResourceFile(fileName) + for _, v in ipairs(private.searchResourcesPath) do local f = v .. '/' .. fileName if isFileExists(f) then return f end end - - if not isFileExists(fileName) then - return 0 + + if not isFileExists(fileName) then + return nil else return fileName end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initMain.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initMain.lua index 6edfb8b..1ce0f4b 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initMain.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initMain.lua @@ -1,28 +1,67 @@ ---------------------------------------------------------------------------------------------------------------------------- --- SETUP PATHS FOR ADDITIONAL PACKAGES AND 3-RD PARTY LIBRARIES ----------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Setup paths for additional packages and 3-rd party libraries +------------------------------------------------------------------------------- package.path = package.path .. ';' .. getProjectPath() .. '/3rd-modules/?.lua' package.path = package.path .. ';' .. getProjectPath() .. '/Custom Module/?.lua' -if (getOS() == "Windows") then - package.cpath = package.cpath .. ';' .. getProjectPath() .. '/3rd-Modules/?.dll' - package.cpath = package.cpath .. ';' .. getProjectPath() .. '/Custom Module/?.dll' -else - package.cpath = package.cpath .. ';' .. getProjectPath() .. '/3rd-Modules/?.so' - package.cpath = package.cpath .. ';' .. getProjectPath() .. '/Custom Module/?.so' -end +local __OS = sasl.getOS() +local __PackExt ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- COMPONENTS ------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +if __OS == "Windows" then + __PackExt = "dll" +elseif __OS == "Linux" then + __PackExt = "so" +else + __PackExt = "dylib" +end --- Create basic component -function createComponent(name, parent) - local data = { - components = { }, +package.cpath = package.cpath .. ';' .. getProjectPath() .. '/3rd-modules/?.' .. __PackExt +package.cpath = package.cpath .. ';' .. getProjectPath() .. '/Custom Module/?.' .. __PackExt + +------------------------------------------------------------------------------- +-- Components +------------------------------------------------------------------------------- + +--- @class Component +--- @field components Component[] +--- @field component fun(comp:Component):Component +--- @field defineProperty fun(name:string, dflt:any) +--- @field include fun(name:string) +--- @field fbo Property | boolean +--- @field fpsLimit Property | number +--- @field noRenderSignal Property | boolean +--- @field clip Property | boolean +--- @field clipSize Property | number[] +--- @field draw fun(self:Component) +--- @field drawObjects fun(self:Component) +--- @field draw3D fun(self:Component) +--- @field update fun(self:Component) +--- @field name string +--- @field visible Property | boolean +--- @field movable Property | boolean +--- @field resizable Property | boolean +--- @field resizeProportional Property | boolean +--- @field onMouseDown fun(self:Component, x:number, y:number, button:MouseButtonID, parentX:number, parentY:number):boolean +--- @field onMouseUp fun(self:Component, x:number, y:number, button:MouseButtonID, parentX:number, parentY:number):boolean +--- @field onMouseHold fun(self:Component, x:number, y:number, button:MouseButtonID, parentX:number, parentY:number):boolean +--- @field onMouseMove fun(self:Component, x:number, y:number, button:MouseButtonID, parentX:number, parentY:number):boolean +--- @field onMouseWheel fun(self:Component, x:number, y:number, button:MouseButtonID, parentX:number, parentY:number, wheelClicks:number):boolean +--- @field onKeyDown fun(self:Component, char:number, key:number, shiftDown:number, ctrlDown:number, AltOptDown:number):boolean +--- @field onKeyUp fun(self:Component, char:number, key:number, shiftDown:number, ctrlDown:number, AltOptDown:number):boolean +--- @field logInfo fun(...) +--- @field logWarning fun(...) +--- @field logDebug fun(...) +--- @field logError fun(...) +--- @field print fun(...) + +--- Creates basic component. +--- @param name string +--- @param parent Component +--- @return Component +function private.createComponent(name, parent) + local data = { + components = {}, fbo = createProperty(false), renderTarget = -1, fpsLimit = createProperty(-1), @@ -30,28 +69,28 @@ function createComponent(name, parent) noRenderSignal = createProperty(false), clip = createProperty(false), clipSize = createProperty { 0, 0, 0, 0 }, - draw = function (comp) drawAll(comp.components); end, - drawObjects = function (comp) drawAllObjects(comp.components); end, - draw3D = function (comp) drawAll3D(comp.components); end, - update = function (comp) updateAll(comp.components); end, + draw = function(comp) drawAll(comp.components) end, + drawObjects = function(comp) drawAllObjects(comp.components) end, + draw3D = function(comp) drawAll3D(comp.components) end, + update = function(comp) updateAll(comp.components) end, name = name, visible = createProperty(true), movable = createProperty(false), resizable = createProperty(false), focused = createProperty(false), resizeProportional = createProperty(true), - onMouseUp = defaultOnMouseUp, - onMouseDown = defaultOnMouseDown, - onMouseHold = defaultOnMouseHold, - onMouseMove = defaultOnMouseMove, - onMouseWheel = defaultOnMouseWheel, - onKeyDown = defaultOnKeyDown, - onKeyUp = defaultOnKeyUp, - logInfo = function(...) sasl.logInfo('"' .. name .. '"', ...); end, - logError = function(...) sasl.logError('"' .. name .. '"', ...); end, - logDebug = function(...) sasl.logDebug('"' .. name .. '"', ...); end, - logWarning = function(...) sasl.logWarning('"' .. name .. '"', ...); end, - print = function(...) sasl.print('"' .. name .. '"', ...); end, + onMouseDown = private.defaultOnMouseDown, + onMouseUp = private.defaultOnMouseUp, + onMouseHold = private.defaultOnMouseHold, + onMouseMove = private.defaultOnMouseMove, + onMouseWheel = private.defaultOnMouseWheel, + onKeyDown = private.defaultOnKeyDown, + onKeyUp = private.defaultOnKeyUp, + logInfo = function(...) sasl.logInfo('"'..name..'"', ...) end, + logError = function(...) sasl.logError('"'..name..'"', ...) end, + logDebug = function(...) sasl.logDebug('"'..name..'"', ...) end, + logWarning = function(...) sasl.logWarning('"'..name..'"', ...) end, + print = function(...) sasl.print('"'..name..'"', ...) end } data._C = data if parent then @@ -59,63 +98,63 @@ function createComponent(name, parent) if parent.position then local parentPosition = get(parent.position) data.size = { parentPosition[3], parentPosition[4] } - elseif parent.size then + elseif parent.size then data.size = parent.size end data.position = createProperty { 0, 0, data.size[1], data.size[2] } end - addComponentFunc(data) + private.addComponentFunc(data) return data end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Try to find key in local table first. --- Look in global table if key doesn't exists in local table. --- Try to load component from file if it doesn't exists in global table -function compIndex(table, key) +--- Index lookup function for components system. +--- @param table table +--- @param key any +function private.compIndex(table, key) local comp = table - while nil ~= comp do + while comp ~= nil do local v = rawget(comp, key) - if nil ~= v then - return v + if v ~= nil then + return v else comp = rawget(comp, '_P') end end v = _G[key] - if nil == v then + if v == nil then return loadComponent(key) else return v end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Create component function -function addComponentFunc(component) - component.component = function(name, tbl) - if not tbl then -- anonymous subcomponent - tbl = name - name = nil - end - table.insert(component.components, tbl) - return tbl +--- Creates function for specified component. +--- @param component Component +--- @return Component +function private.addComponentFunc(component) + component.component = function(comp) + table.insert(component.components, comp) + return comp end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Adds properties to component and setup component helper functions. +--- @param component Component +--- @param args table +function private.setupComponent(component, args) + private.mergeComponentTables(component, private.argumentsToProperties(args)) + setmetatable(component, { __index = private.compIndex }) --- Add properties to component -function setupComponent(component, args) - mergeTables(component, argumentsToProperties(args)) - setmetatable(component, { __index = compIndex }) - component.defineProperty = function(name, dflt) if not rawget(component, name) then component[name] = createProperty(dflt) @@ -125,91 +164,103 @@ function setupComponent(component, args) component.include = function(name) include(component, name) end - - addComponentFunc(component) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Components stack on creation -local creatingComponents = { } +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +--- Components creation stack. +local creatingComponents = {} --- Call it before creation of components +--- Starts creation of components using current stack level. +--- @param parent Component function startComponentsCreation(parent) table.insert(creatingComponents, parent) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Call it after creation of components +--- Finishes creation of components using current stack level. function finishComponentsCreation() table.remove(creatingComponents) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Load component from file and create constructor -function loadComponent(name, fileName, isRoot) - if not isRoot then - logInfo("loading", name) - end - - if not fileName then - fileName = name .. ".lua" - end +--- Loads component from constructor function. +--- @param name string +--- @param constructor function +--- @return function +function registerComponent(name, constructor) + return loadComponent(name, constructor, false) +end - local f, subdir = openFile(fileName) - if not f then - logError("can't load component", name) - return nil +--- Loads component from file or predefined function and creates constructor. +--- @param name string +--- @param source string | function +--- @param isRoot boolean +--- @return function +function loadComponent(name, source, isRoot) + local f, subdir, fileName + + if type(source) == "function" then + f = source + else + fileName = source + if not isRoot then + logInfo("loading", name) + end + + if not fileName then + fileName = name..".lua" + end + + f, subdir = openFile(fileName) + if not f then + logError("can't load component", name) + return nil + end end local constr = function(args) local parent = creatingComponents[#creatingComponents] - if parent and parent.name == "module" and parent.size then + if parent and parent.name == "module" and parent.size then parent.position = createProperty { 0, 0, parent.size[1], parent.size[2] } end - + if subdir then addSearchPath(subdir) end - local t = createComponent(name, parent) + local t = private.createComponent(name, parent) t.componentFileName = fileName - setupComponent(t, args) - if isProperty(t.position) then + private.setupComponent(t, args) + if isProperty(t.position) or type(t.position) == 'function' then local curPosition = get(t.position) t.size = { curPosition[3], curPosition[4] } elseif parent then t.size = { 0, 0 } - if isProperty(parent.position) then + if isProperty(parent.position) or type(parent.position) == 'function' then local parentPosition = get(parent.position) t.size = { parentPosition[3], parentPosition[4] } - elseif parent.size then + elseif parent.size then t.size = parent.size end t.position = createProperty { 0, 0, t.size[1], t.size[2] } end - + startComponentsCreation(t) setfenv(f, t) - f() + f(t) finishComponentsCreation() - + if get(t.fpsLimit) ~= -1 then set(t.fbo, true) end - + if toboolean(get(t.fbo)) then t.renderTarget = sasl.gl.createRenderTarget(t.size[1], t.size[2]) end - + if subdir then popSearchPath(subdir) end @@ -217,14 +268,15 @@ function loadComponent(name, fileName, isRoot) end _G[name] = constr - return constr end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Load script inside component environment +--- Loads script inside component environment. +--- @param component Component +--- @param name string function include(component, name) logInfo("including", name) @@ -235,7 +287,7 @@ function include(component, name) if subdir then addSearchPath(subdir) end - + setfenv(f, component) f() @@ -245,28 +297,54 @@ function include(component, name) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Global internal settings and states +------------------------------------------------------------------------------- --- Add component to popup layer -function popup(name, tbl) - return popups.component(name, tbl) -end +globalShowInteractiveAreas = false +private.savedState = nil ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- GLOBAL INTERNAL SETTINGS ------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +function private.initState() + private.savedState = {} + private.savedState.legacyPopups = {} + private.savedState.contextWindows = {} +end -globalShowInteractiveAreas = false +--- Saves current state. +function private.saveState() + private.initState() + private.savePopupsState() + private.saveContextWindowsState() + private.writeTableToFile(moduleDirectory.."/state.txt", private.savedState, "state") +end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- COMPONENTS HANDLERS FOR SIMULATOR EVENTS ------------------------------------------------------------ ---------------------------------------------------------------------------------------------------------------------------- +--- Loads current state. +function private.loadState() + private.initState() + local savedStateFile = loadfile(moduleDirectory.."/state.txt") + if savedStateFile ~= nil then + local temp = {} + setfenv(savedStateFile, temp) + savedStateFile() + private.savedState = temp["state"] + end +end --- Run handler of component -function runComponentHandler(component, name, mx, my, button, x, y, value) +------------------------------------------------------------------------------- +-- Common functional for mouse events handlers +------------------------------------------------------------------------------- + +--- Runs mouse event handler of component. +--- @param component Component +--- @param name string +--- @param mx number +--- @param my number +--- @param button number +--- @param x number +--- @param y number +--- @param value number +--- @return boolean +function private.runMouseEventComp(component, name, mx, my, button, x, y, value) local handler = rawget(component, name) if handler then return handler(component, mx, my, button, x, y, value) @@ -275,84 +353,63 @@ function runComponentHandler(component, name, mx, my, button, x, y, value) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Traverse components and finds best handler with specified name -function runHandler(component, name, x, y, button, path, value) - local position = get(component.position) - local size = component.size - if (not (position and size)) then - return false - end - local mx = (x - position[1]) * size[1] / position[3] - local my = (y - position[2]) * size[2] / position[4] - for i = #component.components, 1, -1 do - local v = component.components[i] - if toboolean(get(v.visible)) and isInRect(get(v.position), mx, my) then - local res = runHandler(v, name, mx, my, button, path, value) - if res then - if path then - table.insert(path, component) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Goes through components hierarchy and executes most appropriate event handler with specified name. +--- @param component Component +--- @param name string +--- @param x number +--- @param y number +--- @param button number +--- @param value number +--- @return boolean, Component[] +function private.runMouseEvent(component, name, x, y, button, value) + local function runMouseEvent(component, name, x, y, button, path, value) + local position = get(component.position) + local size = component.size + if not (position and size) then + return false + end + local mx = (x - position[1]) * size[1] / position[3] + local my = (y - position[2]) * size[2] / position[4] + for i = #component.components, 1, -1 do + local v = component.components[i] + if toboolean(get(v.visible)) and isInRect(get(v.position), mx, my) then + local res = runMouseEvent(v, name, mx, my, button, path, value) + if res then + if path then + table.insert(path, component) + end + return true end - return true end end - end - local res = runComponentHandler(component, name, mx, my, button, x, y, value) - if res then - if path then - table.insert(path, component) - end - end - return res -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Returns path to component under mouse -function getFocusedPath(component, x, y, path) - table.insert(path, component) - local position = get(component.position) - local size = component.size - if (not (position and size)) then - return - end - local mx = (x - position[1]) * size[1] / position[3] - local my = (y - position[2]) * size[2] / position[4] - for i = #component.components, 1, -1 do - local v = component.components[i] - if toboolean(get(v.visible)) and isInRect(get(v.position), mx, my) then - getFocusedPath(v, mx, my, path) + local res = private.runMouseEventComp(component, name, mx, my, button, x, y, value) + if res then + if path then + table.insert(path, component) + end end + return res end -end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Returns path to component under mouse -function getTopFocusedPath(layer, x, y) - local path = { } - if layer == 1 then - getFocusedPath(popups, x, y, path) - if #path > 1 then - return path - end - path = { } - end - if layer == 2 then - getFocusedPath(panel, x, y, path) - end - return path + local path = {} + return runMouseEvent(component, name, x, y, button, path, value), path end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Run handler of pressed component -function runPressedHandler(path, name, x, y, button, value) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Runs mouse event for specific component. +--- @param path Component[] +--- @param name string +--- @param x number +--- @param y number +--- @param button number +--- @param value number +--- @return boolean +function private.runMouseEventByPath(path, name, x, y, button, value) local mx = x local my = y local px = x @@ -366,50 +423,101 @@ function runPressedHandler(path, name, x, y, button, value) mx = (mx - position[1]) * c.size[1] / position[3] my = (my - position[2]) * c.size[2] / position[4] end - return runComponentHandler(path[1], name, mx, my, button, px, py, value) + return private.runMouseEventComp(path[1], name, mx, my, button, px, py, value) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Traverse components and finds best handler with specified name -function runTopHandler(layer, name, x, y, button, value) - local path = { } - if layer == 1 then - local res = runHandler(popups, name, x, y, button, path, value) - if res then - return true, path +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Returns path to component under mouse. +--- @param component Component +--- @param x number +--- @param y number +--- @return Component[] +function private.getMouseHoverPath(component, x, y) + local function getMouseHoverPath(component, x, y, path) + table.insert(path, component) + local position = get(component.position) + local size = component.size + if not (position and size) then + return + end + local mx = (x - position[1]) * size[1] / position[3] + local my = (y - position[2]) * size[2] / position[4] + for i = #component.components, 1, -1 do + local v = component.components[i] + if toboolean(get(v.visible)) and isInRect(get(v.position), mx, my) then + getMouseHoverPath(v, mx, my, path) + end end end - if layer == 2 then - return runHandler(panel, name, x, y, button, path, value), path - end + + local path = {} + getMouseHoverPath(component, x, y, path) + return path end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Auxiliary functional for cursors +------------------------------------------------------------------------------- + +--- @class Cursor +--- @field x number +--- @field y number +--- @field width number +--- @field height number +--- @field shape number + +--- Cursor state and position. +private.cursor = nil + +local function isCursorTable(c) + return c.x ~= nil and + c.y ~= nil and + c.width ~= nil and + c.height ~= nil and + c.shape ~= nil +end --- Returns value of cursor property for specified layer -function getTopCursorShape(layer, x, y) - if layer == 1 then - local cursor = getCursorShape(popups, x, y) - if cursor then - return cursor - end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Sets cursor. +--- @param cursor Cursor +function private.setCursor(cursor) + private.cursor = get(cursor) + local sh = private.cursor + if sh ~= nil and isCursorTable(sh) then + sasl.gl.setCursorShape(true, sh.shape, sh.x, sh.y, sh.width, sh.height) + else + sasl.gl.setCursorShape(false) end - if layer == 2 then - return getCursorShape(panel, x, y) +end + +--- Checks if OS cursor should be hidden for current cursor. +--- @return boolean +function private.isOSCursorHidden() + local sh = private.cursor + if sh ~= nil and isCursorTable(sh) then + if sh.hideOSCursor ~= nil and sh.hideOSCursor == true then + return true + end end + return false end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Returns value of cursor property -function getCursorShape(component, x, y) +--- Runs through components hierarchy and finds most appropriate cursor. +--- @param component Component +--- @param x number +--- @param y number +--- @return Cursor +function private.getComponentCursor(component, x, y) local position = get(component.position) local size = component.size - if (not (position and size)) then + if not (position and size) then return nil end local mx = (x - position[1]) * size[1] / position[3] @@ -417,7 +525,7 @@ function getCursorShape(component, x, y) for i = #component.components, 1, -1 do local v = component.components[i] if toboolean(get(v.visible)) and isInRect(get(v.position), mx, my) then - local res = getCursorShape(v, mx, my) + local res = private.getComponentCursor(v, mx, my) if res then return res end @@ -426,134 +534,212 @@ function getCursorShape(component, x, y) return rawget(component, "cursor") end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Auxiliary functional for interaction system +------------------------------------------------------------------------------- --- Set shape of cursor -function setCursor(x, y, shape, layer) - if layer ~= 2 then - cursor.x = x - cursor.y = y - end - cursor.shape = get(shape) - if cursor.shape ~= nil and cursor.shape.hideOSCursor ~= nil and cursor.shape.hideOSCursor == true then - return true - else - return false - end +private.eventCounter = 0 + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +local pressedButton = 0 + +function private.setPressedButton(button) + pressedButton = button end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +function private.getPressedButton() + return pressedButton +end --- Draw cursor shape -function drawCursor() - if cursor.shape and cursor.shape.shape then - sasl.gl.drawTexture(cursor.shape.shape, - cursor.x + cursor.shape.x, cursor.y + cursor.shape.y, - cursor.shape.width, cursor.shape.height, - { 1.0, 1.0, 1.0, 1.0 }) - end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +local pressedComponentPath = {} + +function private.setPressedComponentPath(path) + pressedComponentPath[private.eventCounter] = path end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +function private.getPressedComponentPath() + return pressedComponentPath[private.eventCounter] +end --- Pressed button number -local pressedButton = 0 +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +local enteredComponent = {} --- Path to component after mouse press -local pressedComponentPath = nil +function private.setEnteredComponent(c) + enteredComponent[private.eventCounter] = c +end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +function private.getEnteredComponent() + return enteredComponent[private.eventCounter] +end --- Currently entered component -local enteredComponent = nil +------------------------------------------------------------------------------- +-- Focusing +------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +local focusedComponentPath = {} --- Update pressed component path -function setPressedPath(path) - pressedComponentPath = path +function private.setFocusedComponentPath(path) + focusedComponentPath[private.eventCounter] = path end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +function private.getFocusedComponentPath() + return focusedComponentPath[private.eventCounter] +end --- Path to focused component -local focusedComponentPath = nil +function private.clearFocusedComponentPaths() + focusedComponentPath = {} +end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Update focused component path -function setFocusedPath(path) - if path and (0 == #path) then +--- Sets focused component path. +--- @param path Component[] +function private.setFocusedPath(path) + if path and #path == 0 then path = nil end - if focusedComponentPath then - for _, c in pairs(focusedComponentPath) do + local currentFocusedComponentPath = private.getFocusedComponentPath() + if currentFocusedComponentPath then + for _, c in ipairs(currentFocusedComponentPath) do set(c.focused, false) end end - focusedComponentPath = path - if focusedComponentPath then - for _, c in ipairs(focusedComponentPath) do + private.setFocusedComponentPath(path) + if path then + for _, c in ipairs(path) do set(c.focused, true) end end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Traverse visible focused components and call specified function -function traverseFocused(func, char, key, shiftDown, ctrlDown, AltOptDown) - if focusedComponentPath then +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Runs specified key event handler for currently visible focused component. +--- @param name string +--- @param char number +--- @param key number +--- @param shiftDown number +--- @param ctrlDown number +--- @param altOptDown number +--- @return boolean +function private.runKeyEventFocused(name, char, key, shiftDown, ctrlDown, altOptDown) + private.eventCounter = private.eventCounter + 1 + local handled = false + local currentFocusedComponentPath = private.getFocusedComponentPath() + if currentFocusedComponentPath then local maxVisible = 0 - for i = 1, #focusedComponentPath, 1 do - local c = focusedComponentPath[i] + for i = 1, #currentFocusedComponentPath, 1 do + local c = currentFocusedComponentPath[i] if toboolean(get(c.visible)) then maxVisible = i else - break; + break end end for i = maxVisible, 1, -1 do - local c = focusedComponentPath[i] - local res = c[func](c, char, key, shiftDown, ctrlDown, AltOptDown) + local c = currentFocusedComponentPath[i] + local res = c[name](c, char, key, shiftDown, ctrlDown, altOptDown) if res then - return true + handled = true end end end - return false + private.eventCounter = private.eventCounter - 1 + return handled +end + +--- Runs key down event handler for currently visible focused component. +--- @param char number +--- @param key number +--- @param shiftDown number +--- @param ctrlDown number +--- @param altOptDown number +--- @return boolean +function processKeyDownEvent(char, key, shiftDown, ctrlDown, altOptDown) + return private.runKeyEventFocused("onKeyDown", char, key, shiftDown, ctrlDown, altOptDown) +end + +--- Runs key up event handler for currently visible focused component. +--- @param char number +--- @param key number +--- @param shiftDown number +--- @param ctrlDown number +--- @param altOptDown number +--- @return boolean +function processKeyUpEvent(char, key, shiftDown, ctrlDown, altOptDown) + return private.runKeyEventFocused("onKeyUp", char, key, shiftDown, ctrlDown, altOptDown) +end + +------------------------------------------------------------------------------- +-- Functional for legacy intercepting window +------------------------------------------------------------------------------- + +local onInterceptingWindow = false + +--- Activates/deactivates cursor for legacy intercepting window. +--- @param isOn boolean +function private.setOnInterceptingWindow(isOn) + if isOn then + sasl.gl.setCursorLayer(0) + if onInterceptingWindow ~= isOn then + private.setCursor(nil) + end + end + onInterceptingWindow = isOn end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- SIMULATOR MOUSE CALLBACKS HANDLERS --------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- General mouse events handlers for components system +------------------------------------------------------------------------------- + +--- Finds and executes mouse button down event for components hierarchy. +--- @param component Component +--- @param x number +--- @param y number +--- @param button number +--- @return boolean +function processMouseDown(component, x, y, button) + private.eventCounter = private.eventCounter + 1 + private.setFocusedPath(private.getMouseHoverPath(component, x, y)) + private.setPressedButton(button) + local handled, path = private.runMouseEvent(component, "onMouseDown", x, y, button) + if handled then + private.setPressedComponentPath(path) + end + private.eventCounter = private.eventCounter - 1 + return handled +end --- Called when mouse button was pressed +--- Called when mouse button was pressed. function onMouseDown(x, y, button, layer) - setFocusedPath(getTopFocusedPath(layer, x, y)) - pressedButton = button - local handled, path = runTopHandler(layer, "onMouseDown", x, y, button, 0) + private.eventCounter = 1 + if layer == MB_LAYER_POPUP or button == MB_LEFT then + local path = private.getMouseHoverPath(layer == MB_LAYER_POPUP and popups or panel, x, y) + if layer == MB_LAYER_POPUP and #path == 1 then + path = {} + end + private.setFocusedPath(path) + end + private.setPressedButton(button) + local handled, path = private.runMouseEvent(layer == MB_LAYER_POPUP and popups or panel, "onMouseDown", x, y, button) if handled then - setPressedPath(path) - if layer == 1 then + private.setPressedComponentPath(path) + if layer == MB_LAYER_POPUP then local comp = path[1] - for i, v in pairs(popups.components) do + for i, v in ipairs(popups.components) do if v == comp then table.remove(popups.components, i) table.insert(popups.components, comp) - setPressedPath(nil) + private.setPressedComponentPath(nil) return handled end end @@ -562,171 +748,215 @@ function onMouseDown(x, y, button, layer) return handled end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called when mouse button was released -function onMouseUp(x, y, button, layer) - if pressedComponentPath then - local res = runPressedHandler(pressedComponentPath, "onMouseUp", - x, y, button, 0) - pressedButton = 0 - setPressedPath(nil) - return res +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Finds and executes mouse button up event for components hierarchy. +--- @param component Component +--- @param x number +--- @param y number +--- @param button number +--- @return boolean +function processMouseUp(component, x, y, button) + private.eventCounter = private.eventCounter + 1 + local pressedPath = private.getPressedComponentPath() + local handled + if pressedPath then + handled = private.runMouseEventByPath(pressedPath, "onMouseUp", x, y, button) + private.setPressedButton(0) + private.setPressedComponentPath(nil) else - return runTopHandler(layer, "onMouseUp", x, y, button, 0) + handled = private.runMouseEvent(component, "onMouseUp", x, y, button) end + private.eventCounter = private.eventCounter - 1 + return handled end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +--- Called when mouse button was released. +function onMouseUp(x, y, button, layer) + private.eventCounter = 0 + return processMouseUp(layer == MB_LAYER_POPUP and popups or panel, x, y, button) +end --- Called when mouse hold event was processed -function onMouseHold(x, y, button, layer) - if pressedComponentPath then - setCursor(x, y, cursor.shape, layer) - return runPressedHandler(pressedComponentPath, "onMouseHold", - x, y, button, 0) - else - pressedButton = button - local handled, path = runTopHandler(layer, "onMouseHold", x, y, button, 0) - if handled then - setPressedPath(path) - end - return handled +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Finds and executes mouse button hold event for components hierarchy. +--- @param component Component +--- @param x number +--- @param y number +--- @param button number +--- @return boolean +function processMouseHold(component, x, y, button) + private.eventCounter = private.eventCounter + 1 + private.setPressedButton(button) + local handled, path = private.runMouseEvent(component, "onMouseHold", x, y, button) + if handled then + private.setPressedComponentPath(path) end + private.eventCounter = private.eventCounter - 1 + return handled end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +--- Called when mouse hold event was processed. +function onMouseHold(x, y, button, layer) + private.eventCounter = 0 + return processMouseHold(layer == MB_LAYER_POPUP and popups or panel, x, y, button) +end --- Called when mouse wheel event was processed +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Finds and executes mouse wheel event for components hierarchy. +--- @param component Component +--- @param x number +--- @param y number +--- @param wheelClicks number +--- @return boolean +function processMouseWheel(component, x, y, wheelClicks) + private.eventCounter = private.eventCounter + 1 + local handled = private.runMouseEvent(component, "onMouseWheel", x, y, 4, wheelClicks) + private.eventCounter = private.eventCounter - 1 + return handled +end + +--- Called when mouse wheel event was processed. function onMouseWheel(x, y, wheelClicks, layer) - if pressedComponentPath then - local res = runPressedHandler(pressedComponentPath, "onMouseWheel", - x, y, 4, wheelClicks) - return res + private.eventCounter = 0 + return processMouseWheel(layer == MB_LAYER_POPUP and popups or panel, x, y, wheelClicks) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Finds and executes mouse move event for components hierarchy. +--- @param component Component +--- @param x number +--- @param y number +function processMouseMove(component, x, y) + private.eventCounter = private.eventCounter + 1 + local cursor = private.getComponentCursor(component, x, y) + private.setCursor(cursor) + + local res, path = private.runMouseEvent(component, "onMouseMove", x, y, private.getPressedButton()) + local currentEnteredComponent = private.getEnteredComponent() + if res == true then + if currentEnteredComponent ~= path[1] then + if currentEnteredComponent ~= nil then + leaveHandler = rawget(currentEnteredComponent, "onMouseLeave") + if leaveHandler ~= nil then + leaveHandler() + end + end + private.setEnteredComponent(path[1]) + enterHandler = rawget(private.getEnteredComponent(), "onMouseEnter") + if enterHandler ~= nil then + enterHandler() + end + end else - return runTopHandler(layer, "onMouseWheel", x, y, 4, wheelClicks) + if currentEnteredComponent ~= nil then + leaveHandler = rawget(currentEnteredComponent, "onMouseLeave") + if leaveHandler ~= nil then + leaveHandler() + end + end + private.setEnteredComponent(nil) end + private.eventCounter = private.eventCounter - 1 end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called when mouse motion event was processed +--- Called when mouse motion event was processed. function onMouseMove(x, y, layer) - local resultCursorID = 0 - local res - if pressedComponentPath then - resultCursorID = 1 - else - if layer == 1 and #popups.components > 0 then + private.eventCounter = 1 + if layer == MB_LAYER_POPUP then + private.setOnInterceptingWindow(true) + end + local resultCursor = 0 + local pressedPath = private.getPressedComponentPath() + if not pressedPath then + if layer == MB_LAYER_POPUP and #popups.components > 0 then local size = popups.size local position = get(popups.position) local mx = (x - position[1]) * size[1] / position[3] local my = (y - position[2]) * size[2] / position[4] for i = #popups.components, 1, -1 do local v = popups.components[i] - if toboolean(get(v.visible)) and - isInRect(get(v.position), mx, my) - then - resultCursorID = 1 + if toboolean(get(v.visible)) and isInRect(get(v.position), mx, my) then + resultCursor = 1 break end end end - end - if pressedComponentPath then - local hideOSCursorMode = setCursor(x, y, cursor.shape, layer) - if hideOSCursorMode then - resultCursorID = 2 + if layer == MB_LAYER_PANEL and x < 0 and y < 0 then + private.setCursor(nil) + return resultCursor end - res = runPressedHandler(pressedComponentPath, "onMouseMove", - x, y, pressedButton, 0) else - local cursor = getTopCursorShape(layer, x, y) - local hideOSCursorMode = setCursor(x, y, cursor, layer) - if hideOSCursorMode then - resultCursorID = 2 - end - local path - res, path = runTopHandler(layer, "onMouseMove", x, y, pressedButton, 0) - if res == true then - if enteredComponent ~= path[1] then - if enteredComponent ~= nil then - leaveHandler = rawget(enteredComponent, "onMouseLeave") - if leaveHandler ~= nil then - leaveHandler() - end - end - enteredComponent = path[1] - enterHandler = rawget(enteredComponent, "onMouseEnter") - if enterHandler ~= nil then - enterHandler() - end - end - else - if enteredComponent ~= nil then - leaveHandler = rawget(enteredComponent, "onMouseLeave") - if leaveHandler ~= nil then - leaveHandler() - end - end - enteredComponent = nil - end + resultCursor = 1 end - if not res then - resultCursorID = 0 + if layer == MB_LAYER_POPUP and resultCursor == 0 then + return resultCursor end - return resultCursorID + private.eventCounter = 0 + processMouseMove(layer == MB_LAYER_POPUP and popups or panel, x, y) + if private.isOSCursorHidden() then + resultCursor = 2 + end + return resultCursor end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- SIMULATOR KEY CALLBACKS HANDLERS ------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- General key events handlers for components system +------------------------------------------------------------------------------- --- Called when button pressed -function onKeyDown(char, key, shiftDown, ctrlDown, AltOptDown) - return traverseFocused('onKeyDown', char, key, shiftDown, ctrlDown, AltOptDown) +--- Called when button pressed. +function onKeyDown(char, key, shiftDown, ctrlDown, altOptDown) + private.eventCounter = 0 + return processKeyDownEvent(char, key, shiftDown, ctrlDown, altOptDown) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Called when button released -function onKeyUp(char, key, shiftDown, ctrlDown, AltOptDown) - return traverseFocused('onKeyUp', char, key, shiftDown, ctrlDown, AltOptDown) +--- Called when button released. +function onKeyUp(char, key, shiftDown, ctrlDown, altOptDown) + private.eventCounter = 0 + return processKeyUpEvent(char, key, shiftDown, ctrlDown, altOptDown) end ---------------------------------------------------------------------------------------------------------------------------- --- GLOBAL DATA ------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- List of paths to search module components -searchPath = { ".", "" } +------------------------------------------------------------------------------- +-- Global project data and corresponding helpers +------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +--- List of paths to search module components. +private.searchPath = { ".", "" } --- List of paths to search module resources (images, fonts, shaders, sounds, objects) -searchResourcesPath = { ".", "" } +--- List of paths to search module resources (images, fonts, shaders, sounds, objects). +private.searchResourcesPath = { ".", "" } ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Add path to search path +--- Adds path to search paths lists. +--- @param path string function addSearchPath(path) - table.insert(searchPath, 1, path) - table.insert(searchResourcesPath, 1, path) + table.insert(private.searchPath, 1, path) + table.insert(private.searchResourcesPath, 1, path) +end + +--- Adds path to search resources paths list. +--- @param path string +function addSearchResourcesPath(path) + table.insert(private.searchResourcesPath, 1, path) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Remove search path +--- Removes path from search paths lists. +--- @overload fun() +--- @param path string function popSearchPath(path) local remover = function(path, list) for k, v in ipairs(list) do @@ -737,92 +967,63 @@ function popSearchPath(path) end end if path then - remover(path, searchPath) - remover(path, searchResourcesPath) + remover(path, private.searchPath) + remover(path, private.searchResourcesPath) return end - table.remove(searchPath, 1) - table.remove(searchResourcesPath, 1) + table.remove(private.searchPath, 1) + table.remove(private.searchResourcesPath, 1) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Add path to images search path -function addSearchResourcesPath(path) - table.insert(searchResourcesPath, 1, path) +--- Removes path from search resources paths list. +--- @overload fun() +--- @param path string +function popSearchResourcesPath(path) + if path then + for k, v in ipairs(private.searchResourcesPath) do + if v == path then + table.remove(private.searchResourcesPath, k) + return + end + end + return + end + table.remove(private.searchResourcesPath, 1) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Saved popups positions -popupsPositions = nil - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Cursor state and position -cursor = { - x = 0, - y = 0, - shape = nil -} +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- MANAGING MAIN ENTITIES ---------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Resizes panel +--- Resizes panel main component. function resizePanel(width, height) set(panel.position, { 0, 0, width, height }) - panel.size[1] = width - panel.size[2] = height + panel.size[1] = width + panel.size[2] = height end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Resizes popups +--- Resizes legacy popups main component. function resizePopup(width, height) set(popups.position, { 0, 0, width, height }) popups.size[1] = width popups.size[2] = height end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Loading module +------------------------------------------------------------------------------- --- Move panel to top of screen -function movePanelToTop(panel) - for i, v in pairs(popups.components) do - if v == panel then - table.remove(popups.components, i) - table.insert(popups.components, panel) - return - end - end -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- MODULE LOADER --------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Loads module from main module file +--- Loads module from main module file. function loadModule(fileName, panelWidth, panelHeight, popupWidth, popupHeight) - popups = createComponent("popups") + popups = private.createComponent("popups") popups.position = createProperty { 0, 0, popupWidth, popupHeight } - popups.size = { popupWidth, popupHeight } - local savedPopupsFile = loadfile(moduleDirectory .. '/popupsPositions.txt') - if savedPopupsFile ~= nil then - local temp = {} - setfenv(savedPopupsFile, temp) - savedPopupsFile() - popupsPositions = temp['positions'] - end - + popups.size = { popupWidth, popupHeight } + + contextWindows = private.createComponent("contextWindows") + private.loadState() + local c = loadComponent("module", fileName, isRoot) if not c then logError("Error loading main component", fileName) @@ -832,97 +1033,5 @@ function loadModule(fileName, panelWidth, panelHeight, popupWidth, popupHeight) return panel end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- COMMON CALLERS -------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Call callback function -function callCallback(name, component) - local handler = rawget(component, name) - if handler then - handler() - end - for i = #component.components, 1, -1 do - callCallback(name, component.components[i]) - end -end - --- Call callback for both panel and popups -function callCallbackForAll(name) - callCallback(name, popups) - callCallback(name, panel) -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- COMMON SIMULATOR CALLBACK HANDLERS -------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called whenever the user's plane is positioned at a new airport -function onAirportLoaded() - callCallbackForAll("onAirportLoaded") -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called whenever new scenery is loaded -function onSceneryLoaded() - callCallbackForAll("onSceneryLoaded") -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called whenever the user adjusts the number of X-Plane aircraft models -function onAirplaneCountChanged() - callCallbackForAll("onAirplaneCountChanged") -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called when user aircraft is loaded -function onPlaneLoaded() - callCallbackForAll("onPlaneLoaded") -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called when user aircraft is unloaded -function onPlaneUnloaded() - callCallbackForAll("onPlaneUnloaded") -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called whenever user plane is crashed. Returns 1 if SASL system is need to be reloaded, 0 otherwise -function onPlaneCrash() - local planeCrashHandler = rawget(panel, 'onPlaneCrash') - needReload = 1 - if planeCrashHandler then - needReload = planeCrashHandler() - end - if needReload == 0 then - for i = #panel.components, 1, -1 do - callCallback('onPlaneCrash', panel.components[i]) - end - callCallback('onPlaneCrash', popups) - end - return needReload -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Called when module about to unload -function doneModules() - callCallbackForAll("onModuleDone") - savePopupsPositions() -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initMathHelpers.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initMathHelpers.lua new file mode 100644 index 0000000..28aced8 --- /dev/null +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initMathHelpers.lua @@ -0,0 +1,129 @@ +------------------------------------------------------------------------------- +-- Interpolation helpers +------------------------------------------------------------------------------- + +--- Creates stepwise linear N-dimensional interpolator using specified grid parameters. +--- @return number +function newInterpolator(...) + local arg = { ... } + local input = {} + local value = {} + + if #arg == 1 then + input = { arg[1][1] } + value = arg[1][2] + return sasl.newCPPInterpolator(input, value) + end + + local N = #arg - 1 + local matrix = arg[N + 1] + local size = 1 + + if N == 0 then + logError("Number of input arguments into an interpolator must be greater than zero") + return nil + end + + for i = 1, N do + input[i] = arg[i] + size = size * #arg[i] + end + + value = private.extractArrayData(matrix) + if #value ~= size then + logError("Size dimensions mismatch for interpolator object") + return nil + end + + return sasl.newCPPInterpolator(input, value) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Deletes interpolator object. +--- @param handle number +function deleteInterpolator(handle) + sasl.deleteCPPInterpolator(handle) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Interpolates N-dimensional point. +--- @overload fun(x:table | number, interp:number):number +--- @param x table | number +--- @param interp number +--- @param flag boolean +--- @return number +function interpolate(x, interp, flag) + if type(x) == "number" then + x = { x } + end + if flag == nil then + flag = false + end + return sasl.interpolateCPP(interp, x, flag) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- @class Interpolator +--- @field interpolate fun(x:table | number, interp:number, flag:boolean):number +--- @field interp number + +--- Creates Interpolator object. +--- @return Interpolator +function selfInterpolator(...) + local r = {} + r.interp = newInterpolator(...) + r.interpolate = function(x, flag) + return interpolate(x, r.interp, flag) + end + return r +end + +------------------------------------------------------------------------------- +-- Stereographic projection +------------------------------------------------------------------------------- + +--- @class StereographicProjection +--- @field setProjectionCenter fun(self:StereographicProjection, lat:number, lon:number) +--- @field setScale fun(self:StereographicProjection, nmRange:number, cartesianRange:number) +--- @field LLtoXY fun(self:StereographicProjection, lat:number, lon:number):number, number +--- @field XYtoLL fun(self:StereographicProjection, x:number, y:number):number, number + +--- Creates stereographic projection object +--- @param prCLatitude number +--- @param prCLongitude number +--- @param nmRange number +--- @param cartesianRange number +--- @return StereographicProjection +function newStereographicProjection(prCLatitude, prCLongitude, nmRange, cartesianRange) + local r = {} + r.setProjectionCenter = function(self, lat, lon) + self.prCLat = lat + self.prCLon = lon + end + r.setScale = function(self, nmRange, cartesianRange) + if nmRange <= 0 or cartesianRange <= 0 then + logError("Incorrect scale values for stereographic projection") + end + self.nmR = nmRange + self.cR = cartesianRange + end + r.LLtoXY = function(self, lat, lon) + return sasl.stereographicLLtoXY(self.prCLat, self.prCLon, self.nmR, self.cR, lat, lon) + end + r.XYtoLL = function(self, x, y) + return sasl.stereographicXYtoLL(self.prCLat, self.prCLon, self.nmR, self.cR, x, y) + end + + r:setProjectionCenter(prCLatitude, prCLongitude) + r:setScale(nmRange, cartesianRange) + return r +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initProcessing.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initProcessing.lua index a0dec71..d959cf4 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initProcessing.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initProcessing.lua @@ -1,85 +1,54 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- UPDATE AND DRAW PROCESSORS ------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Draw +------------------------------------------------------------------------------- --- Draw all modules panel components -function drawPanelStage() - drawComponent(panel) -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Draw all modules popups components -function drawPopupsStage() - drawComponent(popups) - - if cursor.shape then - drawCursor() +--- Draws (2D) all components. +--- @param components Component[] +function drawAll(components) + for _, v in ipairs(components) do + private.drawComponent(v) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Draw all 3D stuff -function draw3DStage() - drawComponent3D(panel) -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Draw all objects -function drawObjectsStage() - drawObjects(panel) -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Update all modules components -function update() - updateComponent(panel) - updateComponent(popups) -end - --- Update component -function updateComponent(v) - if v and v.update then - v:update() +--- Draws 3D from components. +--- @param components Component[] +function drawAll3D(components) + for _, v in ipairs(components) do + private.drawComponent3D(v) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Update all components from table -function updateAll(table) - for _, v in pairs(table) do - updateComponent(v) +--- Draws objects from components. +--- @param components Component[] +function drawAllObjects(components) + for _, v in ipairs(components) do + private.drawObjects(v) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Simulator framerate dataref +local simFRP = globalPropertyf("sim/operation/misc/frame_rate_period") --- Draw to components render target -function renderToTarget(v) - setRenderTarget(v.renderTarget, 1) +--- Draws component to its 2D render target. +--- @param v Component +function private.drawComponentToTarget(v) + setRenderTarget(v.renderTarget, true) v:draw() restoreRenderTarget() end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Simulator framerate -local simFRP = globalPropertyf("sim/operation/misc/frame_rate_period") - --- Draw component -function drawComponent(v) +--- Draws component in 2D. +--- @param v Component +function private.drawComponent(v) if v and toboolean(get(v.visible)) then sasl.gl.saveGraphicsContext() local renderTargetExist = toboolean(get(v.fbo)) @@ -89,13 +58,13 @@ function drawComponent(v) local currentFPS = 1.0 / get(simFRP) local limit = get(v.fpsLimit) if limit == -1 or limit >= currentFPS then - renderToTarget(v) + private.drawComponentToTarget(v) v.frames = 0 - else + else if v.frames > currentFPS / limit then - renderToTarget(v) + private.drawComponentToTarget(v) v.frames = 0 - else + else v.frames = v.frames + 1 end end @@ -108,11 +77,11 @@ function drawComponent(v) local pos = get(v.position) sasl.gl.setComponentTransform(pos[1], pos[2], pos[3], pos[4], v.size[1], v.size[2]) local clip = toboolean(get(v.clip)) - local cs = get(v.clipSize) and get(v.clipSize) or {pos[1], pos[2], pos[3], pos[4]} + local cs = get(v.clipSize) and get(v.clipSize) or { pos[1], pos[2], pos[3], pos[4] } local clipSize = cs[3] > 0 and cs[4] > 0 - if clip then - if clipSize then - sasl.gl.setClipArea(cs[1], cs[2], cs[3], cs[4]) + if clip then + if clipSize then + sasl.gl.setClipArea(cs[1], cs[2], cs[3], cs[4]) else sasl.gl.setClipArea(0, 0, v.size[1], v.size[2]) end @@ -121,56 +90,190 @@ function drawComponent(v) if clip then sasl.gl.resetClipArea() end - end + end sasl.gl.restoreGraphicsContext() end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Draw component 3D stuff -function drawComponent3D(v) +--- Draws 3D from component. +--- @param v Component +function private.drawComponent3D(v) v:draw3D() end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Draw component 3D stuff -function drawObjects(v) +--- Draws objects from components. +--- @param v Component +function private.drawObjects(v) v:drawObjects() end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Update +------------------------------------------------------------------------------- --- Draw all components from table -function drawAll(table) - for _, v in pairs(table) do - drawComponent(v) +--- Updates all components. +--- @param components Component[] +function updateAll(components) + for _, v in ipairs(components) do + private.updateComponent(v) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Draw all 3D stuff from components -function drawAll3D(table) - for _, v in pairs(table) do - drawComponent3D(v) +--- Updates component. +--- @param v Component +function private.updateComponent(v) + if v and v.update then + v:update() end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Utilities +------------------------------------------------------------------------------- --- Draw all 3D stuff from components -function drawAllObjects(table) - for _, v in pairs(table) do - drawObjects(v) +--- Calls callback function for component recursively. +--- @param name string +--- @param component Component +function private.callCallback(name, component) + local handler = rawget(component, name) + if handler then + handler() end + for i = #component.components, 1, -1 do + private.callCallback(name, component.components[i]) + end +end + +--- Calls callback for all components layers. +--- @param name string +function private.callCallbackForAllLayers(name) + private.callCallback(name, popups) + private.callCallback(name, panel) + private.callCallback(name, contextWindows) +end + +------------------------------------------------------------------------------- +-- Other +------------------------------------------------------------------------------- + +--- Draws 3D panel components. +function drawPanelStage() + private.drawComponent(panel) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Draws old-style popups components. +function drawPopupsStage() + private.drawComponent(popups) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Draws 3D. +function draw3DStage() + private.drawComponent3D(panel) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Draws objects. +function drawObjectsStage() + private.drawObjects(panel) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Updates components. +function update() + private.updateComponent(panel) + private.updateComponent(popups) + private.updateComponent(contextWindows) +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Called whenever the user's plane is positioned at a new airport. +function onAirportLoaded() + private.callCallbackForAllLayers("onAirportLoaded") +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Called whenever new scenery is loaded. +function onSceneryLoaded() + private.callCallbackForAllLayers("onSceneryLoaded") +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Called whenever the user adjusts the number of X-Plane aircraft models. +function onAirplaneCountChanged() + private.callCallbackForAllLayers("onAirplaneCountChanged") +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Called when user aircraft is loaded. +function onPlaneLoaded() + private.callCallbackForAllLayers("onPlaneLoaded") +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Called when user aircraft is unloaded. +function onPlaneUnloaded() + private.callCallbackForAllLayers("onPlaneUnloaded") +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Called whenever user plane is crashed. +function onPlaneCrash() + local planeCrashHandler = rawget(panel, 'onPlaneCrash') + needReload = 1 + if planeCrashHandler then + needReload = planeCrashHandler() + end + if needReload == 0 then + for i = #panel.components, 1, -1 do + private.callCallback('onPlaneCrash', panel.components[i]) + end + private.callCallback('onPlaneCrash', popups) + private.callCallback('onPlaneCrash', contextWindows) + end + return needReload +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Called on module shutdown. +function shutdownModules() + private.callCallbackForAllLayers("onModuleShutdown") +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Called when module is unloading. +function doneModules() + private.callCallbackForAllLayers("onModuleDone") + private.saveState() end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initProjectTree.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initProjectTree.lua index 63bb86f..4faddab 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initProjectTree.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initProjectTree.lua @@ -1,28 +1,40 @@ ---------------------------------------------------------------------------------------------------------------------------- --- PROJECT TREE ------------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Project tree +------------------------------------------------------------------------------- --- Initiates current project state tree +--- Initiates current project state tree. function initiateStateTree() - _G["stateTree"] = {} - initStateTree(_G["panel"], _G["stateTree"]) + _G["stateTree"] = {} + private.initStateTree(_G["panel"], _G["stateTree"]) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Initiates current project state tree recursive -function initStateTree(inTable, inStateTree) - local cache={} +--- Exports project tree. +--- @param seekFunctions boolean +function exportProjectTreePanel(seekFunctions) + if _G["panel"] then + private.exportProjectTree(_G["panel"], _G["stateTree"], seekFunctions) + end +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Initiates current project state tree recursive. +--- @param inTable table +--- @param inStateTree table +function private.initStateTree(inTable, inStateTree) + local cache = {} local function subInitStateTree(inTable, inStateTree) if (cache[tostring(inTable)]) then -- Do nothing else cache[tostring(inTable)] = true - if (type(inTable)=="table") then + if type(inTable) == "table" then for pos, val in pairs(inTable) do - if (type(val)=="table" and pos ~= "_P" and pos ~= "_C") then + if type(val) == "table" and pos ~= "_P" and pos ~= "_C" then inStateTree["open"] = 0 inStateTree[pos] = {} subInitStateTree(val, inStateTree[pos]) @@ -31,48 +43,39 @@ function initStateTree(inTable, inStateTree) end end end - if (type(inTable) == "table") then - subInitStateTree(inTable, inStateTree) - end + subInitStateTree(inTable, inStateTree) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Exports project tree -function exportProjectTreePanel(seekFunctions) - if (_G["panel"]) then - exportProjectTree(_G["panel"], _G["stateTree"], seekFunctions) - end -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Exports project tree recursive -function exportProjectTree(inTable, inStateTree, seekFunctions) +--- Exports project tree recursive. +--- @param inTable table +--- @param inStateTree table +--- @param seekFunctions boolean +function private.exportProjectTree(inTable, inStateTree, seekFunctions) local seekF = seekFunctions - local exportCache={} + local exportCache = {} local function subExportProjectTree(inTable, inStateTree, seekF) if (exportCache[tostring(inTable)]) then -- Do nothing else exportCache[tostring(inTable)] = true - if (type(inTable) == "table") then + if type(inTable) == "table" then for pos, val in pairs(inTable) do - if (type(val) == "table" and pos ~= "_P" and pos ~= "_C") then - if (type(inStateTree) == "table" and inStateTree["open"] == 1) then - local isComponent = rawget(val, "_C") ~= nil - sasl.projectTreeBeginCommand(tostring("["..pos.."]"), isComponent) + if type(val) == "table" and pos ~= "_P" and pos ~= "_C" then + if type(inStateTree) == "table" and inStateTree["open"] == 1 then + local isComponent = rawget(val, "_C") ~= nil + sasl.projectTreeBeginCommand("["..tostring(pos).."]", isComponent) subExportProjectTree(val, inStateTree[pos], seekF) sasl.projectTreeEndCommand() else - sasl.projectTreeCreateCommand(tostring("["..pos.."]"), TYPE_STRING, '', true) + sasl.projectTreeCreateCommand("["..tostring(pos).."]", TYPE_STRING, '', true) end - elseif (type(val) == "string") then - sasl.projectTreeCreateCommand(tostring("["..pos.."]"), TYPE_STRING, val, false) - elseif (pos ~= "_P" and pos ~= "_C" and pos ~= "__property") then - if (type(val) ~= "function" or seekFunctions == 1) then + elseif type(val) == "string" then + sasl.projectTreeCreateCommand("["..tostring(pos).."]", TYPE_STRING, val, false) + elseif pos ~= "_P" and pos ~= "_C" and pos ~= "__p" then + if type(val) ~= "function" or seekFunctions == 1 then local typeIdentifier local currentType = type(val) if (currentType == "number") then @@ -84,17 +87,15 @@ function exportProjectTree(inTable, inStateTree, seekFunctions) else typeIdentifier = TYPE_STRING end - sasl.projectTreeCreateCommand(tostring("["..pos.."]"), typeIdentifier, tostring(val), false) + sasl.projectTreeCreateCommand("["..tostring(pos).."]", typeIdentifier, tostring(val), false) end end - end + end end end end - if (type(inTable) == "table") then - subExportProjectTree(inTable, inStateTree) - end + subExportProjectTree(inTable, inStateTree) end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initProperties.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initProperties.lua index 91307cb..5c1403b 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initProperties.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initProperties.lua @@ -1,64 +1,36 @@ ---------------------------------------------------------------------------------------------------------------------------- --- PROPERTIES --------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Properties +------------------------------------------------------------------------------- --- Returns true if argument is property -function isProperty(value) - return ("table" == type(value)) and (1 == value.__property) -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Returns value of property --- Traverse recursive properties -function get(property, doNotCall, offset, numValues) - if isProperty(property) then - if property.get then - return property:get(doNotCall, offset, numValues) - else - if isProperty(property.value) then - return get(property.value, doNotCall, offset, numValues) - else - return property.value - end - end - else - if (not doNotCall) and ("function" == type(property)) then - return property() - else - return property - end +local function floorArray(tbl) + for i = 1, #tbl do + tbl[i] = math.floor(tbl[i]) end + return tbl end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Set value of property -function set(property, value, offset, numValues) - if isProperty(property) then - if property.set then - property:set(value, offset, numValues) - else - if isProperty(property.value) then - set(property.value, value, offset, numValues) - else - property.value = value - end - end - end +local function propTypeToString(propType) + local str = 'unknown' + if propType == TYPE_INT then str = 'integer' + elseif propType == TYPE_FLOAT then str = 'float' + elseif propType == TYPE_DOUBLE then str = 'double' + elseif propType == TYPE_STRING then str = 'string' + elseif propType == TYPE_INT_ARRAY then str = 'int array' + elseif propType == TYPE_FLOAT_ARRAY then str = 'float array' + end + return str end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Convert values from table to properties -function argumentsToProperties(arguments) +--- Convert values from table to properties. +--- @param arguments table +--- @return table +function private.argumentsToProperties(arguments) local res = {} for k, v in pairs(arguments) do - if "function" == type(v) then + if type(v) == "function" then res[k] = v else if isProperty(v) then @@ -71,694 +43,772 @@ function argumentsToProperties(arguments) return res end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- @class Property +--- @field v any --- Create new property table +--- @class GlobalProperty +--- @field name string +--- @field get fun(self:GlobalProperty, offset:number, numValues:number):any +--- @field set fun(self:GlobalProperty, value:any, offset:number, numValues:number) +--- @field size fun():number +--- @field free fun() + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new property with initial value. +--- @param value any +--- @return Property function createProperty(value) if isProperty(value) then return value end + return { __p = 1, v = value } +end - local prop = { __property = 1 } - if "function" == type(value) then - prop.get = value +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Checks if value is a property table. +--- @param value any +--- @return boolean +function isProperty(value) + return type(value) == "table" and value.__p +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Returns value of property, traversing recursively. +--- @param property Property | GlobalProperty | function +--- @param offset number +--- @param numValues number +--- @overload fun(property:Property | GlobalProperty | function):any +--- @overload fun(property:Property | GlobalProperty | function, offset:number):any +--- @return any +function get(property, offset, numValues) + if isProperty(property) then + if property.get then + return property:get(offset, numValues) + else + if isProperty(property.v) then + return get(property.v, offset, numValues) + else + return property.v + end + end else - prop.value = value + if type(property) == "function" then + return property() + else + return property + end end - return prop end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- PROPERTIES CREATORS ------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Returns property (with automatically retrieved type) +--- Sets value of property, traversing recursively. +--- @param property Property | GlobalProperty +--- @param value any +--- @param offset number +--- @param numValues number +--- @overload fun(property:Property | GlobalProperty, value:any) +--- @overload fun(property:Property | GlobalProperty, value:any, offset:number):any +function set(property, value, offset, numValues) + if isProperty(property) then + if property.set then + property:set(value, offset, numValues) + else + if isProperty(property.v) then + set(property.v, value, offset, numValues) + else + property.v = value + end + end + end +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Returns global sim property (dataref), retrieving type automatically. +--- @param name string +--- @return GlobalProperty function globalProperty(name) - local types = sasl.fetchDataRef(name) - if not types then - return nil + local ref, t = sasl.findDataRef(name, true) + local index = nil + if not ref then + local sname, sindex = string.match(name, '(.+)%[(%d+)%]$') + if sname and sindex then + ref, t = sasl.findDataRef(sname, true) + index = tonumber(sindex) + end + if not ref then + sasl.findDataRef(name) + return nil + end end - - local ref = sasl.findDataRef(name, types[1]) - local get = function(doNotCall) return sasl.getDataRef(ref); end - local set = function(self, value) sasl.setDataRef(ref, value); end - + + local get, set + local size = function() return sasl.getDataRefSize(ref) end + if t == TYPE_INT_ARRAY or t == TYPE_FLOAT_ARRAY or t == TYPE_STRING then + if index then + get = function(self) return sasl.getDataRef(ref, index + 1, nil) end + set = function(self, value) sasl.setDataRef(ref, value, index + 1, nil) end + size = function() return 1 end + else + get = function(self, offset, numValues) return sasl.getDataRef(ref, offset, numValues) end + set = function(self, value, offset, numValues) sasl.setDataRef(ref, value, offset, numValues) end + end + else + get = function(self) return sasl.getDataRef(ref) end + set = function(self, value) sasl.setDataRef(ref, value) end + end + return { - __property = 1; + __p = 1; name = name; - get = get; + get = get; set = set; - free = function() sasl.freeDataRef(ref); end; + size = size; + free = function() sasl.freeDataRef(ref) end; } end --- Returns double property -function globalPropertyd(name, suppressCastWarns) - if suppressCastWarns == nil then suppressCastWarns = false end - - local types = sasl.fetchDataRef(name) - if not types then +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Returns global sim property (dataref) of type double. +--- @param name string +--- @return GlobalProperty +function globalPropertyd(name) + local ref, t = sasl.findDataRef(name) + if not ref then return nil end - local get, set - local ref = sasl.findDataRef(name, types[1]) - - if types[1] == TYPE_FLOAT or types[1] == TYPE_DOUBLE or types[1] == TYPE_INT then - get = function(doNotCall) return sasl.getDataRef(ref); end - set = function(self, value) sasl.setDataRef(ref, value); end - elseif types[1] == TYPE_STRING then - get = function(doNotCall) return 0 end - set = function(self, value) sasl.setDataRef(ref, tostring(value)); end - if not suppressCastWarns then - logWarning('"'..name..'": '.."Casting "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_DOUBLE)) - end + + if t == TYPE_FLOAT or t == TYPE_DOUBLE or t == TYPE_INT then + get = function(self) return sasl.getDataRef(ref) end + set = function(self, value) sasl.setDataRef(ref, value) end + elseif t == TYPE_STRING then + get = function(self) return 0 end + set = function(self, value) sasl.setDataRef(ref, tostring(value), nil, nil) end + logDebug('"'..name..'": '.."Casting string to double") else - get = function(doNotCall) return 0; end - logWarning('"'..name..'": '.."Can't cast "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_DOUBLE)) - end - + logWarning('"'..name..'": '.."Can't cast "..propTypeToString(t).." to double") + return nil + end + return { - __property = 1; + __p = 1; name = name; - get = get; + get = get; set = set; - free = function() sasl.freeDataRef(ref); end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new double property and set default value -function createGlobalPropertyd(name, default, isNotPublished, isShared) - if isNotPublished == nil then isNotPublished = false end - if isShared == nil then isShared = false end - - local ref = sasl.createDataRef(name, TYPE_DOUBLE, isNotPublished, isShared) - if default ~= nil then sasl.setDataRef(ref, default) else sasl.setDataRef(ref, 0) end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new sim property (dataref) of type double. +--- @param name string +--- @param default number +--- @param isNotPublished boolean +--- @param isShared boolean +--- @param isReadOnly boolean +--- @overload fun(name:string):GlobalProperty +--- @overload fun(name:string, default:number):GlobalProperty +--- @overload fun(name:string, default:number, isNotPublished:boolean):GlobalProperty +--- @overload fun(name:string, default:number, isNotPublished:boolean, isShared:boolean):GlobalProperty +--- @return GlobalProperty +function createGlobalPropertyd(name, default, isNotPublished, isShared, isReadOnly) + local ref = sasl.createDataRef(name, TYPE_DOUBLE, isNotPublished or false, isShared or false, isReadOnly or false) + if default ~= nil then sasl.setDataRef(ref, default) elseif isShared then sasl.setDataRef(ref, 0) end return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall) return sasl.getDataRef(ref); end; - set = function(self, value) sasl.setDataRef(ref, value); end; - free = function() sasl.freeDataRef(ref); end; + get = function(self) return sasl.getDataRef(ref) end; + set = function(self, value) sasl.setDataRef(ref, value) end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Create new functional double property +--- Creates new functional sim property (dataref) of type double. +--- @param name string +--- @param getter fun():number +--- @param setter fun(v:number) +--- @param isNotPublished boolean +--- @overload fun(name:string, getter:function, setter:function) +--- @return GlobalProperty function createFunctionalPropertyd(name, getter, setter, isNotPublished) - if isNotPublished == nil then isNotPublished = false end - - local ref = sasl.createFunctionalDataRef(name, TYPE_DOUBLE, getter, setter, isNotPublished) + local ref = sasl.createFunctionalDataRef(name, TYPE_DOUBLE, getter, setter, isNotPublished or false) return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall) return sasl.getDataRef(ref); end; - set = function(self, value) sasl.setDataRef(ref, value); end; - free = function() sasl.freeDataRef(ref); end; + get = function(self) return sasl.getDataRef(ref) end; + set = function(self, value) sasl.setDataRef(ref, value) end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Returns float property -function globalPropertyf(name, suppressCastWarns) - if suppressCastWarns == nil then suppressCastWarns = false end - - local types = sasl.fetchDataRef(name) - if not types then +--- Returns global sim property (dataref) of type float. +--- @param name string +--- @return GlobalProperty +function globalPropertyf(name) + local ref, t = sasl.findDataRef(name) + if not ref then return nil end - local get, set - local ref = sasl.findDataRef(name, types[1]) - - if types[1] == TYPE_FLOAT or types[1] == TYPE_DOUBLE or types[1] == TYPE_INT then - get = function(doNotCall) return sasl.getDataRef(ref); end - set = function(self, value) sasl.setDataRef(ref, value); end - elseif types[1] == TYPE_STRING then - get = function(doNotCall) return 0 end - set = function(self, value) sasl.setDataRef(ref, tostring(value)); end - if not suppressCastWarns then - logWarning('"'..name..'": '.."Casting "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_FLOAT)) - end + + if t == TYPE_FLOAT or t == TYPE_DOUBLE or t == TYPE_INT then + get = function(self) return sasl.getDataRef(ref) end + set = function(self, value) sasl.setDataRef(ref, value) end + elseif t == TYPE_STRING then + get = function(self) return 0 end + set = function(self, value) sasl.setDataRef(ref, tostring(value), nil, nil) end + logDebug('"'..name..'": '.."Casting string to float") else - get = function(doNotCall) return 0; end - logWarning('"'..name..'": '.."Can't cast "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_FLOAT)) - end - + logWarning('"'..name..'": '.."Can't cast "..propTypeToString(t).." to float") + return nil + end + return { - __property = 1; + __p = 1; name = name; - get = get; + get = get; set = set; - free = function() sasl.freeDataRef(ref); end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new float property and set default value -function createGlobalPropertyf(name, default, isNotPublished, isShared) - if isNotPublished == nil then isNotPublished = false end - if isShared == nil then isShared = false end - - local ref = sasl.createDataRef(name, TYPE_FLOAT, isNotPublished, isShared) - if default ~= nil then sasl.setDataRef(ref, default) else sasl.setDataRef(ref, 0) end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new sim property (dataref) of type float. +--- @param name string +--- @param default number +--- @param isNotPublished boolean +--- @param isShared boolean +--- @param isReadOnly boolean +--- @overload fun(name:string):GlobalProperty +--- @overload fun(name:string, default:number):GlobalProperty +--- @overload fun(name:string, default:number, isNotPublished:boolean):GlobalProperty +--- @overload fun(name:string, default:number, isNotPublished:boolean, isShared:boolean):GlobalProperty +--- @return GlobalProperty +function createGlobalPropertyf(name, default, isNotPublished, isShared, isReadOnly) + local ref = sasl.createDataRef(name, TYPE_FLOAT, isNotPublished or false, isShared or false, isReadOnly or false) + if default ~= nil then sasl.setDataRef(ref, default) elseif isShared then sasl.setDataRef(ref, 0) end return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall) return sasl.getDataRef(ref); end; - set = function(self, value) sasl.setDataRef(ref, value); end; - free = function() sasl.freeDataRef(ref); end; + get = function(self) return sasl.getDataRef(ref) end; + set = function(self, value) sasl.setDataRef(ref, value) end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Create new functional float property +--- Creates new functional sim property (dataref) of type float. +--- @param name string +--- @param getter fun():number +--- @param setter fun(v:number) +--- @param isNotPublished boolean +--- @overload fun(name:string, getter:function, setter:function) +--- @return GlobalProperty function createFunctionalPropertyf(name, getter, setter, isNotPublished) - if isNotPublished == nil then isNotPublished = false end - - local ref = sasl.createFunctionalDataRef(name, TYPE_FLOAT, getter, setter, isNotPublished) + local ref = sasl.createFunctionalDataRef(name, TYPE_FLOAT, getter, setter, isNotPublished or false) return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall) return sasl.getDataRef(ref); end; - set = function(self, value) sasl.setDataRef(ref, value); end; - free = function() sasl.freeDataRef(ref); end; + get = function(self) return sasl.getDataRef(ref) end; + set = function(self, value) sasl.setDataRef(ref, value) end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Returns int property -function globalPropertyi(name, suppressCastWarns) - if suppressCastWarns == nil then suppressCastWarns = false end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- - local types = sasl.fetchDataRef(name) - if not types then +--- Returns global sim property (dataref) of type int. +--- @param name string +--- @return GlobalProperty +function globalPropertyi(name) + local ref, t = sasl.findDataRef(name) + if not ref then return nil end - local get, set - local ref = sasl.findDataRef(name, types[1]) - - if types[1] == TYPE_INT then - get = function(doNotCall) return sasl.getDataRef(ref); end - set = function(self, value) sasl.setDataRef(ref, value); end - elseif types[1] == TYPE_FLOAT or types[1] == TYPE_DOUBLE then - get = function(doNotCall) return math.floor(sasl.getDataRef(ref)); end - set = function(self, value) sasl.setDataRef(ref, math.floor(value)); end - if not suppressCastWarns then - logWarning('"'..name..'": '.."Casting "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_INT)) - end - elseif types[1] == TYPE_STRING then - get = function(doNotCall) return 0 end - set = function(self, value) sasl.setDataRef(ref, tostring(value)); end - if not suppressCastWarns then - logWarning('"'..name..'": '.."Casting "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_INT)) - end + + if t == TYPE_INT then + get = function(self) return sasl.getDataRef(ref) end + set = function(self, value) sasl.setDataRef(ref, value) end + elseif t == TYPE_FLOAT or t == TYPE_DOUBLE then + get = function(self) return math.floor(sasl.getDataRef(ref)) end + set = function(self, value) sasl.setDataRef(ref, math.floor(value)) end + logDebug('"'..name..'": '.."Casting "..propTypeToString(t).." to int") + elseif t == TYPE_STRING then + get = function(self) return 0 end + set = function(self, value) sasl.setDataRef(ref, tostring(value), nil, nil) end + logDebug('"'..name..'": '.."Casting string to int") else - get = function(doNotCall) return 0; end - logWarning('"'..name..'": '.."Can't cast "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_INT)) - end - + logWarning('"'..name..'": '.."Can't cast "..propTypeToString(t).." to int") + return nil + end + return { - __property = 1; + __p = 1; name = name; - get = get; + get = get; set = set; - free = function() sasl.freeDataRef(ref); end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new int property and set default value -function createGlobalPropertyi(name, default, isNotPublished, isShared) - if isNotPublished == nil then isNotPublished = false end - if isShared == nil then isShared = false end - - local ref = sasl.createDataRef(name, TYPE_INT, isNotPublished, isShared) - if default ~= nil then sasl.setDataRef(ref, default) else sasl.setDataRef(ref, 0) end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new sim property (dataref) of type int. +--- @param name string +--- @param default number +--- @param isNotPublished boolean +--- @param isShared boolean +--- @param isReadOnly boolean +--- @overload fun(name:string):GlobalProperty +--- @overload fun(name:string, default:number):GlobalProperty +--- @overload fun(name:string, default:number, isNotPublished:boolean):GlobalProperty +--- @overload fun(name:string, default:number, isNotPublished:boolean, isShared:boolean):GlobalProperty +--- @return GlobalProperty +function createGlobalPropertyi(name, default, isNotPublished, isShared, isReadOnly) + local ref = sasl.createDataRef(name, TYPE_INT, isNotPublished or false, isShared or false, isReadOnly or false) + if default ~= nil then sasl.setDataRef(ref, default) elseif isShared then sasl.setDataRef(ref, 0) end return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall) return sasl.getDataRef(ref); end; - set = function(self, value) sasl.setDataRef(ref, value); end; - free = function() sasl.freeDataRef(ref); end; + get = function(self) return sasl.getDataRef(ref) end; + set = function(self, value) sasl.setDataRef(ref, value) end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new functional int property -function createFunctionalPropertyi(name, getter, setter, isNotPublished) - if isNotPublished == nil then isNotPublished = false end - - local ref = sasl.createFunctionalDataRef(name, TYPE_INT, getter, setter, isNotPublished) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new functional sim property (dataref) of type int. +--- @param name string +--- @param getter fun():number +--- @param setter fun(v:number) +--- @param isNotPublished boolean +--- @overload fun(name:string, getter:function, setter:function) +--- @return GlobalProperty +function createFunctionalPropertyi(name, getter, setter, isNotPublished) + local ref = sasl.createFunctionalDataRef(name, TYPE_INT, getter, setter, isNotPublished or false) return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall) return sasl.getDataRef(ref); end; - set = function(self, value) sasl.setDataRef(ref, value); end; - free = function() sasl.freeDataRef(ref); end; + get = function(self) return sasl.getDataRef(ref) end; + set = function(self, value) sasl.setDataRef(ref, value) end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Returns string property -function globalPropertys(name, suppressCastWarns) - if suppressCastWarns == nil then suppressCastWarns = false end - - local types = sasl.fetchDataRef(name) - if not types then +--- Returns global sim property (dataref) of type string. +--- @param name string +--- @return GlobalProperty +function globalPropertys(name) + local ref, t = sasl.findDataRef(name) + if not ref then return nil end - local get, set - local ref = sasl.findDataRef(name, types[1]) - - if types[1] == TYPE_STRING then - get = function(doNotCall) return sasl.getDataRef(ref); end - set = function(self, value) sasl.setDataRef(ref, value); end - elseif types[1] == TYPE_FLOAT or types[1] == TYPE_INT or types[1] == TYPE_DOUBLE then - get = function(doNotCall) return tostring(sasl.getDataRef(ref)); end - set = function(self, value) sasl.setDataRef(ref, 0); end - if not suppressCastWarns then - logWarning('"'..name..'": '.."Casting "..propTypeToString(types[1]).." to " ..propTypeToString(TYPE_STRING)) - end + + if t == TYPE_STRING then + get = function(self, offset, numValues) return sasl.getDataRef(ref, offset, numValues) end + set = function(self, value, offset, numValues) sasl.setDataRef(ref, value, offset, numValues) end + elseif t == TYPE_FLOAT or t == TYPE_INT or t == TYPE_DOUBLE then + get = function(self) return tostring(sasl.getDataRef(ref, nil, nil)) end + set = function(self, value) end + logDebug('"'..name..'": '.."Casting "..propTypeToString(t).." to string. Partial and aren't available") else - get = function(doNotCall) return 0; end - logWarning('"'..name..'": '.."Can't cast "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_STRING)) - end - + logWarning('"'..name..'": '.."Can't cast "..propTypeToString(t).." to string") + return nil + end + return { - __property = 1; + __p = 1; name = name; - get = get; + get = get; set = set; - size = function() return sasl.getDataRefSize(ref); end; - free = function() sasl.freeDataRef(ref); end; + size = function() return sasl.getDataRefSize(ref) end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new string property and set default value -function createGlobalPropertys(name, default, isNotPublished, isShared) - if isNotPublished == nil then isNotPublished = false end - if isShared == nil then isShared = false end - - local ref = sasl.createDataRef(name, TYPE_STRING, isNotPublished, isShared) - if default ~= nil then sasl.setDataRef(ref, default) else sasl.setDataRef(ref, '') end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new sim property (dataref) of type string. +--- @param name string +--- @param default string +--- @param isNotPublished boolean +--- @param isShared boolean +--- @param isReadOnly boolean +--- @overload fun(name:string):GlobalProperty +--- @overload fun(name:string, default:string):GlobalProperty +--- @overload fun(name:string, default:string, isNotPublished:boolean):GlobalProperty +--- @overload fun(name:string, default:string, isNotPublished:boolean, isShared:boolean):GlobalProperty +--- @return GlobalProperty +function createGlobalPropertys(name, default, isNotPublished, isShared, isReadOnly) + local ref = sasl.createDataRef(name, TYPE_STRING, isNotPublished or false, isShared or false, isReadOnly or false) + if default ~= nil then + sasl.setDataRef(ref, default, nil, nil) + elseif isShared then + sasl.setDataRef(ref, '', nil, nil) + end return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall) return sasl.getDataRef(ref); end; - set = function(self, value) sasl.setDataRef(ref, value); end; - size = function() return sasl.getDataRefSize(ref); end; - free = function() sasl.freeDataRef(ref); end; + get = function(self, offset, numValues) return sasl.getDataRef(ref, offset, numValues) end; + set = function(self, value, offset, numValues) sasl.setDataRef(ref, value, offset, numValues) end; + size = function() return sasl.getDataRefSize(ref) end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new functional string property -function createFunctionalPropertys(name, getter, setter, isNotPublished) - if isNotPublished == nil then isNotPublished = false end - - local ref = sasl.createFunctionalDataRef(name, TYPE_STRING, getter, setter, isNotPublished) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new functional sim property (dataref) of type string. +--- @param name string +--- @param getter fun(offset:number, numValues:number):string +--- @param setter fun(v:string, offset:number) +--- @param isNotPublished boolean +--- @param sizeGetter fun():number +--- @overload fun(name:string, getter:function, setter:function) +--- @overload fun(name:string, getter:function, setter:function, isNotPublished:boolean) +--- @return GlobalProperty +function createFunctionalPropertys(name, getter, setter, isNotPublished, sizeGetter) + local ref = sasl.createFunctionalDataRef(name, TYPE_STRING, getter, setter, isNotPublished or false, sizeGetter or 0) return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall) return sasl.getDataRef(ref); end; - set = function(self, value) sasl.setDataRef(ref, value); end; + get = function(self, offset, numValues) return sasl.getDataRef(ref, offset, numValues) end; + set = function(self, value, offset, numValues) sasl.setDataRef(ref, value, offset, numValues) end; size = function() return sasl.getDataRefSize(ref); end; free = function() sasl.freeDataRef(ref); end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Returns int array property -function globalPropertyia(name, suppressCastWarns) - if suppressCastWarns == nil then suppressCastWarns = false end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- - local types = sasl.fetchDataRef(name) - if not types then +--- Returns global sim property (dataref) of type int array. +--- @param name string +--- @return GlobalProperty +function globalPropertyia(name) + local ref, t = sasl.findDataRef(name) + if not ref then return nil end - local get, set - local ref = sasl.findDataRef(name, types[1]) - - if types[1] == TYPE_INT_ARRAY then - get = function(doNotCall, offset, numValues) - if offset == nil and numValues == nil then - return sasl.getDataRef(ref) - else - return sasl.getDataRef(ref, offset, numValues) - end + + if t == TYPE_INT_ARRAY then + get = function(self, offset, numValues) + return sasl.getDataRef(ref, offset, numValues) end - set = function(self, value, offset, numValues) - if offset == nil and numValues == nil then - sasl.setDataRef(ref, value) - else - sasl.setDataRef(ref, value, offset, numValues) - end + set = function(self, value, offset, numValues) + sasl.setDataRef(ref, value, offset, numValues) + end + elseif t == TYPE_FLOAT_ARRAY then + get = function(self, offset, numValues) + return floorArray(sasl.getDataRef(ref, offset, numValues)) end - elseif types[1] == TYPE_FLOAT_ARRAY then - get = function(doNotCall, offset, numValues) - if offset == nil and numValues == nil then - return math.tablefloor(sasl.getDataRef(ref)) - else - return math.tablefloor(sasl.getDataRef(ref, offset, numValues)) - end - end set = function(self, value, offset, numValues) - if offset == nil and numValues == nil then - sasl.setDataRef(ref, math.tablefloor(value)) - else - sasl.setDataRef(ref, math.tablefloor(value), offset, numValues) - end - end - if not suppressCastWarns then - logWarning('"'..name..'": '.."Casting "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_INT_ARRAY)) + sasl.setDataRef(ref, floorArray(value), offset, numValues) end + logDebug('"'..name..'": '.."Casting float array to int array") else - get = function(doNotCall) return 0; end - logWarning('"'..name..'": '.."Can't cast "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_INT_ARRAY)) - end - + logWarning('"'..name..'": '.."Can't cast "..propTypeToString(t).." to int array") + return nil + end + return { - __property = 1; + __p = 1; name = name; - get = get; + get = get; set = set; - size = function() return sasl.getDataRefSize(ref); end; - free = function() sasl.freeDataRef(ref); end; + size = function() return sasl.getDataRefSize(ref) end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Returns int array element property -function globalPropertyiae(name, index, suppressCastWarns) - if suppressCastWarns == nil then suppressCastWarns = false end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- - local types = sasl.fetchDataRef(name) - if not types then +--- Returns global sim property (dataref) bound to int array element. +--- @param name string +--- @param index number +--- @return GlobalProperty +function globalPropertyiae(name, index) + local ref, t = sasl.findDataRef(name) + if not ref then return nil end - local get, set - local ref = sasl.findDataRef(name, types[1]) - - if types[1] == TYPE_INT_ARRAY then - get = function(doNotCall) return sasl.getDataRef(ref, index, nil) end + if t == TYPE_INT_ARRAY then + get = function(self) return sasl.getDataRef(ref, index, nil) end set = function(self, value) sasl.setDataRef(ref, value, index, nil) end - elseif types[1] == TYPE_FLOAT_ARRAY then - get = function(doNotCall) return math.floor(sasl.getDataRef(ref, index, nil)) end + elseif t == TYPE_FLOAT_ARRAY then + get = function(self) return math.floor(sasl.getDataRef(ref, index, nil)) end set = function(self, value) sasl.setDataRef(ref, math.floor(value), index, nil) end - if not suppressCastWarns then - logWarning('"'..name..'": '.."Casting "..propTypeToString(types[1]).." element to "..propTypeToString(TYPE_INT_ARRAY).." element") - end + logDebug('"'..name..'": '.."Casting float array element to int array element") else - get = function(doNotCall) return 0; end - logWarning('"'..name..'": '.."Can't cast "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_INT_ARRAY).." element") - end - + logWarning('"'..name..'": '.."Can't cast "..propTypeToString(t).." to int array element") + return nil + end + return { - __property = 1; + __p = 1; name = name; - get = get; + get = get; set = set; - size = function() return 1; end; - free = function() sasl.freeDataRef(ref); end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new int array property -function createGlobalPropertyia(name, default, isNotPublished, isShared) - if isNotPublished == nil then isNotPublished = false end - if isShared == nil then isShared = false end - - local ref = sasl.createDataRef(name, TYPE_INT_ARRAY, isNotPublished, isShared) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new sim property (dataref) of type int array. +--- @param name string +--- @param default table | number +--- @param isNotPublished boolean +--- @param isShared boolean +--- @param isReadOnly boolean +--- @overload fun(name:string):GlobalProperty +--- @overload fun(name:string, default:table | number):GlobalProperty +--- @overload fun(name:string, default:table | number, isNotPublished:boolean):GlobalProperty +--- @overload fun(name:string, default:table | number, isNotPublished:boolean, isShared:boolean):GlobalProperty +--- @return GlobalProperty +function createGlobalPropertyia(name, default, isNotPublished, isShared, isReadOnly) + local ref = sasl.createDataRef(name, TYPE_INT_ARRAY, isNotPublished or false, isShared or false, isReadOnly or false) if default ~= nil then if type(default) == 'number' and default > 0 then - initializer = {} + local initializer = {} for i = 1, default do initializer[i] = 0 end - sasl.setDataRef(ref, initializer) + sasl.setDataRef(ref, initializer, nil, nil) else - sasl.setDataRef(ref, default) + sasl.setDataRef(ref, default, nil, nil) end end - + return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall, offset, numValues) - if offset == nil and numValues == nil then - return sasl.getDataRef(ref) - else - return sasl.getDataRef(ref, offset, numValues) - end - end; + get = function(self, offset, numValues) + return sasl.getDataRef(ref, offset, numValues) + end; set = function(self, value, offset, numValues) - if offset == nil and numValues == nil then - sasl.setDataRef(ref, value) - else - sasl.setDataRef(ref, value, offset, numValues) - end + sasl.setDataRef(ref, value, offset, numValues) end; - size = function() return sasl.getDataRefSize(ref); end; - free = function() sasl.freeDataRef(ref); end; + size = function() return sasl.getDataRefSize(ref) end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new functional int array property -function createFunctionalPropertyia(name, getter, setter, isNotPublished) - if isNotPublished == nil then isNotPublished = false end - - local ref = sasl.createFunctionalDataRef(name, TYPE_INT_ARRAY, getter, setter, isNotPublished) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new functional sim property (dataref) of type int array. +--- @param name string +--- @param getter fun(offset:number, numValues:number):table +--- @param setter fun(v:table, offset:number) +--- @param isNotPublished boolean +--- @param sizeGetter fun():number +--- @overload fun(name:string, getter:function, setter:function) +--- @overload fun(name:string, getter:function, setter:function, isNotPublished:boolean) +--- @return GlobalProperty +function createFunctionalPropertyia(name, getter, setter, isNotPublished, sizeGetter) + local ref = sasl.createFunctionalDataRef(name, TYPE_INT_ARRAY, getter, setter, isNotPublished or false, sizeGetter or 0) return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall, offset, numValues) - if offset == nil and numValues == nil then - return sasl.getDataRef(ref) - else - return sasl.getDataRef(ref, offset, numValues) - end - end; + get = function(self, offset, numValues) + return sasl.getDataRef(ref, offset, numValues) + end; set = function(self, value, offset, numValues) - if offset == nil and numValues == nil then - sasl.setDataRef(ref, value) - else - sasl.setDataRef(ref, value, offset, numValues) - end + sasl.setDataRef(ref, value, offset, numValues) end; - size = function() return sasl.getDataRefSize(ref); end; - free = function() sasl.freeDataRef(ref); end; + size = function() return sasl.getDataRefSize(ref) end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Returns float array property -function globalPropertyfa(name, suppressCastWarns) - if suppressCastWarns == nil then suppressCastWarns = false end - - local types = sasl.fetchDataRef(name) - if not types then +--- Returns global sim property (dataref) of type float array. +--- @param name string +--- @return GlobalProperty +function globalPropertyfa(name) + local ref, t = sasl.findDataRef(name) + if not ref then return nil end - local get, set - local ref = sasl.findDataRef(name, types[1]) - - if types[1] == TYPE_FLOAT_ARRAY or types[1] == TYPE_INT_ARRAY then - get = function(doNotCall, offset, numValues) - if offset == nil and numValues == nil then - return sasl.getDataRef(ref) - else - return sasl.getDataRef(ref, offset, numValues) - end + + if t == TYPE_FLOAT_ARRAY or t == TYPE_INT_ARRAY then + get = function(self, offset, numValues) + return sasl.getDataRef(ref, offset, numValues) end - set = function(self, value, offset, numValues) - if offset == nil and numValues == nil then - sasl.setDataRef(ref, value) - else - sasl.setDataRef(ref, value, offset, numValues) - end + set = function(self, value, offset, numValues) + sasl.setDataRef(ref, value, offset, numValues) end else - get = function(doNotCall) return 0; end - logWarning('"'..name..'": '.."Can't cast "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_FLOAT_ARRAY)) - end - + logWarning('"'..name..'": '.."Can't cast "..propTypeToString(t).." to float array") + return nil + end + return { - __property = 1; + __p = 1; name = name; - size = size; - get = get; + get = get; set = set; - size = function() return sasl.getDataRefSize(ref); end; - free = function() sasl.freeDataRef(ref); end; + size = function() return sasl.getDataRefSize(ref) end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Returns float array element property -function globalPropertyfae(name, index, suppressCastWarns) - if suppressCastWarns == nil then suppressCastWarns = false end - - local types = sasl.fetchDataRef(name) - if not types then +--- Returns global sim property (dataref) bound to float array element. +--- @param name string +--- @param index number +--- @return GlobalProperty +function globalPropertyfae(name, index) + local ref, t = sasl.findDataRef(name) + if not ref then return nil end - local get, set - local ref = sasl.findDataRef(name, types[1]) - - if types[1] == TYPE_FLOAT_ARRAY or types[1] == TYPE_INT_ARRAY then - get = function(doNotCall) return sasl.getDataRef(ref, index, nil) end - set = function(self, value) sasl.setDataRef(ref, value, index, nil) end + + if t == TYPE_FLOAT_ARRAY or t == TYPE_INT_ARRAY then + get = function(self) return sasl.getDataRef(ref, index, nil) end + set = function(self, value) sasl.setDataRef(ref, value, index, nil) end else - get = function(doNotCall) return 0; end - logWarning('"'..name..'": '.."Can't cast "..propTypeToString(types[1]).." to "..propTypeToString(TYPE_FLOAT_ARRAY).." element") + logWarning('"'..name..'": '.."Can't cast "..propTypeToString(t).." to float array element") end - + return { - __property = 1; + __p = 1; name = name; - size = size; - get = get; + get = get; set = set; - size = function() return 1; end; - free = function() sasl.freeDataRef(ref); end; + size = function() return 1 end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new float array property -function createGlobalPropertyfa(name, default, isNotPublished, isShared) - if isNotPublished == nil then isNotPublished = false end - if isShared == nil then isShared = false end - - local ref = sasl.createDataRef(name, TYPE_FLOAT_ARRAY, isNotPublished, isShared) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new sim property (dataref) of type float array. +--- @param name string +--- @param default table | number +--- @param isNotPublished boolean +--- @param isShared boolean +--- @param isReadOnly boolean +--- @overload fun(name:string):GlobalProperty +--- @overload fun(name:string, default:table | number):GlobalProperty +--- @overload fun(name:string, default:table | number, isNotPublished:boolean):GlobalProperty +--- @overload fun(name:string, default:table | number, isNotPublished:boolean, isShared:boolean):GlobalProperty +--- @return GlobalProperty +function createGlobalPropertyfa(name, default, isNotPublished, isShared, isReadOnly) + local ref = sasl.createDataRef(name, TYPE_FLOAT_ARRAY, isNotPublished or false, isShared or false, isReadOnly or false) if default ~= nil then if type(default) == 'number' and default > 0 then - initializer = {} + local initializer = {} for i = 1, default do initializer[i] = 0 end - sasl.setDataRef(ref, initializer) + sasl.setDataRef(ref, initializer, nil, nil) else - sasl.setDataRef(ref, default) + sasl.setDataRef(ref, default, nil, nil) end end - + return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall, offset, numValues) - if offset == nil and numValues == nil then - return sasl.getDataRef(ref) - else - return sasl.getDataRef(ref, offset, numValues) - end - end; + get = function(self, offset, numValues) + return sasl.getDataRef(ref, offset, numValues) + end; set = function(self, value, offset, numValues) - if offset == nil and numValues == nil then - sasl.setDataRef(ref, value) - else - sasl.setDataRef(ref, value, offset, numValues) - end + sasl.setDataRef(ref, value, offset, numValues) end; - size = function() return sasl.getDataRefSize(ref); end; - free = function() sasl.freeDataRef(ref); end; + size = function() return sasl.getDataRefSize(ref) end; + free = function() sasl.freeDataRef(ref) end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create new functional float array property -function createFunctionalPropertyfa(name, getter, setter, isNotPublished) - if isNotPublished == nil then isNotPublished = false end - - local ref = sasl.createFunctionalDataRef(name, TYPE_FLOAT_ARRAY, getter, setter, isNotPublished) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Creates new functional sim property (dataref) of type float array. +--- @param name string +--- @param getter fun(offset:number, numValues:number):table +--- @param setter fun(v:table, offset:number) +--- @param isNotPublished boolean +--- @param sizeGetter fun():number +--- @overload fun(name:string, getter:function, setter:function) +--- @overload fun(name:string, getter:function, setter:function, isNotPublished:boolean) +--- @return GlobalProperty +function createFunctionalPropertyfa(name, getter, setter, isNotPublished, sizeGetter) + local ref = sasl.createFunctionalDataRef(name, TYPE_FLOAT_ARRAY, getter, setter, isNotPublished or false, sizeGetter or 0) return { - __property = 1; + __p = 1; name = name; - get = function(doNotCall, offset, numValues) - if offset == nil and numValues == nil then - return sasl.getDataRef(ref) - else - return sasl.getDataRef(ref, offset, numValues) - end - end; + get = function(self, offset, numValues) + return sasl.getDataRef(ref, offset, numValues) + end; set = function(self, value, offset, numValues) - if offset == nil and numValues == nil then - sasl.setDataRef(ref, value) - else - sasl.setDataRef(ref, value, offset, numValues) - end + sasl.setDataRef(ref, value, offset, numValues) end; size = function() return sasl.getDataRefSize(ref); end; free = function() sasl.freeDataRef(ref); end; } end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Properties types-to-string converter -function propTypeToString(propType) - local str = 'none' - if propType == TYPE_INT then str = 'integer' - elseif propType == TYPE_FLOAT then str = 'float' - elseif propType == TYPE_DOUBLE then str = 'double' - elseif propType == TYPE_STRING then str = 'string' - elseif propType == TYPE_INT_ARRAY then str = 'integer array' - elseif propType == TYPE_FLOAT_ARRAY then str = 'float array' - end - return str -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initResourcesLoaders.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initResourcesLoaders.lua index 899f1a2..44d24ed 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initResourcesLoaders.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initResourcesLoaders.lua @@ -1,107 +1,146 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- MODULES IMAGES LOADER ---------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Special trace logger for resource loading errors -function logResourceErrorStacktrace(...) - logError(...) - local currentLevel = 1 - while true do - local errorInfo = debug.getinfo(currentLevel, "Sl") - if not errorInfo or errorInfo.what == "C" then break end - logError(string.format("Resource loading stack trace [%s]:%d", errorInfo.short_src, errorInfo.currentline)) - currentLevel = currentLevel + 1 - end -end - --- Load texture image. --- Loads image and sets texture coords. It can be called in forms of: --- loadImage(fileName) -- sets texture coords to entire texture --- loadImage(fileName, width, height) -- sets texture coords to show --- center part of image. width and height sets size of image part --- loadImage(fileName, x, y, width, height) - loads specified part of image -function loadImage(fileName, x, y, width, height) +------------------------------------------------------------------------------- +-- Resources loaders +------------------------------------------------------------------------------- + +--- Loads texture from image. +--- @param fileName string +--- @param x number +--- @param y number +--- @param width number +--- @param height number +--- @overload fun(fileName:string):number +--- @overload fun(fileName:string, x:number, y:number):number +--- @return number, number, number +function loadImage(fileName, x, y, width, height) local f = findResourceFile(fileName) - if f == 0 then - logResourceErrorStacktrace("Can't find texture", fileName) + if f == nil then + logError("Can't find texture", fileName) return nil end local s if height ~= nil then s = sasl.gl.getGLTexture(f, x, y, width, height) elseif y ~= nil then s = sasl.gl.getGLTexture(f, x, y) - else s = sasl.gl.getGLTexture(f) end - + else s = sasl.gl.getGLTexture(f) end + + if not s then + logError("Can't load texture", fileName) + return nil + end + local w, h = sasl.gl.getTextureSize(s) + return s, w, h +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Loads SVG texture from image. +--- @param fileName string +--- @param rasterWidth number +--- @param rasterHeight number +--- @param x number +--- @param y number +--- @param width number +--- @param height number +--- @overload fun(fileName:string, rasterWidth:number, rasterHeight:number):number +--- @overload fun(fileName:string, rasterWidth:number, rasterHeight:number, x:number, y:number):number +--- @return number, number, number +function loadVectorImage(fileName, rasterWidth, rasterHeight, x, y, width, height) + local f = findResourceFile(fileName) + if f == nil then + logError("Can't find vector texture", fileName) + return nil + end + + local s + if height ~= nil then s = sasl.gl.getGLVectorTexture(f, rasterWidth, rasterHeight, x, y, width, height) + elseif y ~= nil then s = sasl.gl.getGLVectorTexture(f, rasterWidth, rasterHeight, x, y) + else s = sasl.gl.getGLVectorTexture(f, rasterWidth, rasterHeight) end + if not s then - logResourceErrorStacktrace("Can't load texture", fileName) + logError("Can't load vector texture", fileName) return nil end - local h, w = sasl.gl.getTextureSize(s) - return s, h, w + local w, h = sasl.gl.getTextureSize(s) + return s, w, h end sasl.gl.loadImage = loadImage +sasl.gl.loadVectorImage = loadVectorImage + +sasl.gl.unloadImage = unloadTexture +unloadImage = unloadTexture +sasl.gl.loadImageFromMemory = loadTextureFromMemory +loadImageFromMemory = loadTextureFromMemory ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- MODULES FONTS LOADERS ---------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Load bitmap font +--- Loads old-style bitmap font from file. +--- @param fileName string +--- @return number function loadBitmapFont(fileName) - return loadFontImpl(fileName, sasl.gl.getGLBitmapFont) + return private.loadFontImpl(fileName, sasl.gl.getGLBitmapFont) end sasl.gl.loadBitmapFont = loadBitmapFont ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Load font +--- Loads font from file (TTF, TTC, OTF, etc). +--- @param fileName string +--- @return number function loadFont(fileName) - return loadFontImpl(fileName, sasl.gl.getGLFont) + return private.loadFontImpl(fileName, sasl.gl.getGLFont) end sasl.gl.loadFont = loadFont ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Load font common implementation -function loadFontImpl(fileName, loadingFunction) +--- Loads font using specified. +--- @param fileName string +--- @param loadingFunction fun(fileName:string):number +--- @return number +function private.loadFontImpl(fileName, loadingFunction) local f = findResourceFile(fileName) - if f == 0 then - logResourceErrorStacktrace("Can't find font", fileName) + if f == nil then + logError("Can't find font", fileName) return nil end local font = loadingFunction(f) if not font then - logResourceErrorStacktrace("Can't load font", fileName) + logError("Can't load font", fileName) end return font end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- MODULES SOUNDS LOADERS ------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Load sample from file +--- Load sound sample from file. +--- @param fileName string +--- @param needToCreateTimer boolean +--- @param needReversed boolean +--- @overload fun(fileName:string):number +--- @overload fun(fileName:string, needToCreateTimer:boolean):number +--- @return number function loadSample(fileName, needToCreateTimer, needReversed) if needToCreateTimer == nil then needToCreateTimer = false end if needReversed == nil then needReversed = false end - + local f = findResourceFile(fileName) - if f == 0 then - logResourceErrorStacktrace("Can't find sound", fileName) + if f == nil then + logError("Can't find sound", fileName) return nil end local s = sasl.al.loadSampleFromFile(f, needToCreateTimer, needReversed) if s == nil then - logResourceErrorStacktrace("Can't load sound", fileName) + logError("Can't load sound", fileName) return nil end return s @@ -109,62 +148,69 @@ end sasl.al.loadSample = loadSample ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- MODULES OBJECTS LOADER --------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Load object from file +--- Loads XP object from file. +--- @param fileName string +--- @return number function loadObject(fileName) local f = findResourceFile(fileName) - if f == 0 then - logResourceErrorStacktrace("Can't find object", fileName) + if f == nil then + logError("Can't find object", fileName) return nil end local o = sasl.loadObjectFromFile(f) if o == nil then - logResourceErrorStacktrace("Can't load object", fileName) + logError("Can't load object", fileName) end return o end sasl.loadObject = loadObject --- Load object from file asynchronously +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Loads XP object from file asynchronously. +--- @param fileName string +--- @param callback fun(id:number) +--- @return number function loadObjectAsync(fileName, callback) local f = findResourceFile(fileName) - if f == 0 then - logResourceErrorStacktrace("Can't find object", fileName) + if f == nil then + logError("Can't find object", fileName) return nil end local o = sasl.loadObjectAsyncFromFile(f, callback) if o == nil then - logResourceErrorStacktrace("Can't load object", fileName) + logError("Can't load object", fileName) end return o end sasl.loadObjectAsync = loadObjectAsync ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- MODULES SHADERS LOADER -------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Load shader source from file +--- Loads shader source from file. +--- @param shaderID number +--- @param fileName string +--- @param shType ShaderTypeID function loadShader(shaderID, fileName, shType) local f = findResourceFile(fileName) - if f == 0 then - logResourceErrorStacktrace("Can't find shader source", fileName) + if f == nil then + logError("Can't find shader source", fileName) return nil end - + sasl.gl.addShader(shaderID, f, shType) end - sasl.gl.loadShader = loadShader ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initSubpanelCreator.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initSubpanelCreator.lua index 3455fbb..cdaf586 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initSubpanelCreator.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initSubpanelCreator.lua @@ -1,53 +1,77 @@ ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- SUBPANEL CREATOR ----------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Create movable resizable subpanel hidden by default +------------------------------------------------------------------------------- +-- Subpanel +------------------------------------------------------------------------------- + +--- @class SubpanelParams +--- @field name string +--- @field position number[] +--- @field savePosition boolean +--- @field visible boolean +--- @field noBackground boolean +--- @field noClose boolean +--- @field noResize boolean +--- @field noMove boolean +--- @field vrAuto boolean +--- @field fbo boolean +--- @field clip boolean +--- @field clipSize number[] +--- @field command string +--- @field description string +--- @field pinnedToXWindow boolean[] +--- @field propotionalToXWindow boolean[] +--- @field components Component[] + +--- [DEPRECATED] Creates simple 2D floating panel (popup) with attached components hierarchy. +--- @param tbl SubpanelParams +--- @return Component function subpanel(tbl) local name = tbl.name if name == nil then - name = 'subpanel' + name = "subpanel" end - local c = createComponent(name, popups) + local c = private.createComponent(name, popups) c.position = createProperty { 0, 0, 0, 0 } set(c.position, tbl.position) set(c.clip, tbl.clip) set(c.clipSize, tbl.clipSize) set(c.fbo, tbl.fbo) c.size = { tbl.position[3], tbl.position[4] } - c.onMouseHold = function (comp, x, y, button, parentX, parentY) - defaultOnMouseHold(comp, x, y, button, parentX, parentY) + c.onMouseHold = function(comp, x, y, button, parentX, parentY) + private.defaultOnMouseHold(comp, x, y, button, parentX, parentY) + return true + end + c.onMouseDown = function(comp, x, y, button, parentX, parentY) + private.defaultOnMouseDown(comp, x, y, button, parentX, parentY) return true end - c.onMouseDown = function (comp, x, y, button, parentX, parentY) - defaultOnMouseDown(comp, x, y, button, parentX, parentY) + c.onMouseMove = function(comp, x, y, button, parentX, parentY) + private.defaultOnMouseMove(comp, x, y, button, parentX, parentY) return true end - c.onMouseMove = function (comp, x, y, button, parentX, parentY) - defaultOnMouseMove(comp, x, y, button, parentX, parentY) + c.onMouseWheel = function(comp, x, y, button, parentX, parentY, wheelClicks) + private.defaultOnMouseWheel(comp, x, y, button, parentX, parentY, wheelClicks) return true end - + if tbl.visible then set(c.visible, tbl.visible) else set(c.visible, false) end - + set(c.movable, true) if get(tbl.noMove) then set(c.movable, false) end - - c.savePosition = createProperty(false) + + c.savePosition = createProperty(false) if get(tbl.savePosition) then set(c.savePosition, true) end - + c.pinnedToXWindow = createProperty { false, true } c.proportionalToXWindow = createProperty(false) - + if tbl.pinnedToXWindow then set(c.pinnedToXWindow, tbl.pinnedToXWindow) end @@ -57,9 +81,9 @@ function subpanel(tbl) startComponentsCreation(tbl) if not get(tbl.noBackground) then if not rectangle then - rectangle = loadComponent('rectangle') + rectangle = loadComponent("rectangle") end - + table.insert(c.components, 1, rectangle { position = { 0, 0, c.size[1], c.size[2] } } ) end @@ -70,16 +94,16 @@ function subpanel(tbl) local btnHeight = c.size[2] / pos[4] * 16 if not popupCloseButton then - popupCloseButton = loadComponent('popupCloseButton') + popupCloseButton = loadComponent("popupCloseButton") end - - local closeButton = popupCloseButton { - position = { c.size[1] - btnWidth, c.size[2] - btnHeight, + + local closeButton = popupCloseButton { + position = { c.size[1] - btnWidth, c.size[2] - btnHeight, btnWidth, btnHeight }, panel = c } - closeButton.size = { btnWidth, btnHeight } - c.component('closeButton', closeButton) + closeButton.size = { btnWidth, btnHeight } + c.component(closeButton) end if not get(tbl.noResize) and not get(c.proportionalToXWindow) then @@ -87,63 +111,75 @@ function subpanel(tbl) local pos = get(c.position) c.resizeWidth = c.size[1] / pos[3] * 10 c.resizeHeight = c.size[2] / pos[4] * 10 - + if not rectangle then - rectangle = loadComponent('rectangle') + rectangle = loadComponent("rectangle") end if not popupResizeButton then - popupResizeButton = loadComponent('popupResizeButton') + popupResizeButton = loadComponent("popupResizeButton") end - - c.resizeRect = { c.size[1] - c.resizeWidth, 0, + + c.resizeRect = { c.size[1] - c.resizeWidth, 0, c.resizeWidth, c.resizeHeight }; - + local resizeButton = popupResizeButton { position = c.resizeRect } resizeButton.size = { c.resizeWidth, c.resizeHeight } - c.component('resizeButton', resizeButton) + c.component(resizeButton) end finishComponentsCreation() if get(tbl.command) then - -- Register panel popup command local command = sasl.createCommand(get(tbl.command), get(tbl.description)) - -- Show or hide panel on command received function commandHandler(phase) if phase == SASL_COMMAND_BEGIN then set(c.visible, not toboolean(get(c.visible))) if toboolean(get(c.visible)) then - movePanelToTop(c) + private.movePopupToTop(c) end end return 0 end - -- Register created command handler sasl.registerCommandHandler(command, 0, commandHandler) end - - if popupsPositions and get(c.savePosition) and (name ~= 'subpanel') then - local pos = popupsPositions[name] + + if get(c.savePosition) and name ~= "subpanel" then + local pos = private.savedState.legacyPopups[name] if pos then set(c.position, pos) end end - popup(c) + popups.component(c) return c end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Moves 2D floating panel to the top of hierarchy +--- @param p Component +function private.movePopupToTop(p) + for i, v in ipairs(popups.components) do + if v == p then + table.remove(popups.components, i) + table.insert(popups.components, p) + return + end + end +end --- Save positions of popup components -function savePopupsPositions() - local positions = { } - for _k, c in pairs(popups.components) do - if get(c.savePosition) and (get(c.name) ~= 'subpanel') then +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Saves current positions of 2D floating panels in global state holder. +function private.savePopupsState() + local positions = {} + for _, c in ipairs(popups.components) do + if get(c.savePosition) and get(c.name) ~= "subpanel" then positions[get(c.name)] = get(c.position) end end @@ -152,33 +188,31 @@ function savePopupsPositions() return end - local fileName = moduleDirectory .. '/popupsPositions.txt' - local f = io.open(fileName, 'w+') - if f ~= nil then - savePositionsToFile(f, positions, 'positions') - f:close() - else - logWarning("Can't open file '" .. fileName .. "' for writing") - end + private.savedState.legacyPopups = positions end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +--- Adapts positions and dimensions of 2D floating panel on 2D context resize. +--- @param diffX number +--- @param diffY number +--- @param ratioX number +--- @param ratioY number function adaptPopupsPositions(diffX, diffY, ratioX, ratioY) for i = 1, #popups.components do local pinOption = get(popups.components[i].pinnedToXWindow) - local proportionalOption = get(popups.components[i].proportionalToXWindow) + local proportionalOption = get(popups.components[i].proportionalToXWindow) local currentPosition = get(popups.components[i].position) - + local oldSize = { currentPosition[3], currentPosition[4] } if proportionalOption then if ratioX ~= 1 then currentPosition[3] = math.floor(currentPosition[3] * ratioX) - currentPosition[4] = math.floor(currentPosition[3] / (oldSize[1] / oldSize[2])) + currentPosition[4] = math.floor(currentPosition[3] / (oldSize[1] / oldSize[2])) else currentPosition[4] = math.floor(currentPosition[4] * ratioY) - currentPosition[3] = math.floor(currentPosition[4] / (oldSize[1] / oldSize[2])) + currentPosition[3] = math.floor(currentPosition[4] / (oldSize[1] / oldSize[2])) end end if pinOption[1] then @@ -193,10 +227,10 @@ function adaptPopupsPositions(diffX, diffY, ratioX, ratioY) currentPosition[2] = currentPosition[2] - (currentPosition[4] - oldSize[2]) end end - + set(popups.components[i].position, currentPosition) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/src/base/B777-300ER/plugins/SASLFree/data/init/initTableHelpers.lua b/src/base/B777-300ER/plugins/SASLFree/data/init/initTableHelpers.lua index 16d41e8..4ffe7ca 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/init/initTableHelpers.lua +++ b/src/base/B777-300ER/plugins/SASLFree/data/init/initTableHelpers.lua @@ -1,83 +1,44 @@ ---------------------------------------------------------------------------------------------------------------------------- --- TABLE HELPERS ----------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- Table helpers +------------------------------------------------------------------------------- --- Load stands from cache -function loadTableFromFile(fileName, name) - local chunk = loadfile(fileName) - if nil ~= chunk then - local t = { } - setfenv(chunk, t) - chunk() - return t[name] - else - logError('file not exists', fileName) - return nil - end -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Save table to file -function saveTableToFile(f, table, name) - if name then - f:write(name .. ' = ') - end - f:write('{\n') - - for k, v in pairs(table) do - f:write('["' .. k .. '"] = ') - if ('number' == type(v)) or ('boolean' == type(v)) then - f:write(tostring(v) .. ';\n') - elseif ('string' == type(v)) then - f:write('"' .. v .. '";\n') - elseif ('table' == type(v)) then - saveTableToFile(f, v) +local function transpose(x) + local r = {} + for i = 1, #x[1] do + r[i] = {} + for j = 1, #x do + r[i][j] = x[j][i] end end - - f:write('};\n') + return r end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Save positions to file -function savePositionsToFile(f, table, name) - if name then - f:write(name .. ' = ') +local function mergeTablesSimple(t1, t2) + local t = {} + for k, v in ipairs(t1) do + table.insert(t, v) end - f:write('{\n') - - for k, v in pairs(table) do - f:write('["' .. k .. '"] = { ') - for i = 1, 4 do - f:write(v[i]) - if 4 ~= i then - f:write(', ') - else - f:write(' ') - end - end - f:write('};\n') + for k, v in ipairs(t2) do + table.insert(t, v) end - - f:write('};\n') + return t end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- --- Deep copies values from source table to destination table -function mergeTables(dest, src) +--- Merges two tables to setup a component. +--- @param dest table +--- @param src table +function private.mergeComponentTables(dest, src) for k, v in pairs(src) do - if "table" == type(v) then + if type(v) == "table" then if not dest[k] then dest[k] = v + elseif isProperty(dest[k]) and isProperty(v) then + dest[k] = v else - mergeTables(dest[k], v) + private.mergeComponentTables(dest[k], v) end else dest[k] = v @@ -85,84 +46,72 @@ function mergeTables(dest, src) end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Simple merge of two tables -function table.merge(t1, t2) - t={} - for k,v in ipairs(t1) do - table.insert(t, v) - end - for k,v in ipairs(t2) do - table.insert(t, v) - end - return t -end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Make deep copy of table -function cloneTable(table) - local newTable = {} - for k, v in pairs(table) do - if "table" == type(v) then - newTable[k] = cloneTable(v) - else - newTable[k] = v +--- Extracts data from N-dimensional table to simple array-like table. +--- @param arr table +function private.extractArrayData(arr) + if type(arr[1]) ~= "table" then + return arr + else + if type(arr[1][1]) ~= "table" then + arr = transpose(arr) end - end - return newTable -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- --- Table floor -function math.tablefloor(tbl) - for i=1,#tbl do - tbl[i] = math.floor(tbl[i]) - end - return tbl -end - ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Transposing function -local function transpose(x) - local r = {} - - for i=1,#x[1] do - r[i] = {} - for j=1,#x do - r[i][j] = x[j][i] + local res = {} + for i = 1, #arr do + res = mergeTablesSimple(res, private.extractArrayData(arr[i])) end + return res end - - return r end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- - --- Extracts N-dimensinal table into one table -function extractArrayData(arr) - if assert(type(arr[1])) ~= 'table' then - return arr - else - if assert(type(arr[1][1])) ~= 'table' then - arr = transpose(arr) - end - - local res={} - for i=1, #arr do - res = table.merge(res, extractArrayData(arr[i])) +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +--- Writes table to file in valid Lua syntax. +--- @param fileName string +--- @param t table +--- @param tname string +function private.writeTableToFile(fileName, t, tname) + local f = io.open(fileName, "w+") + if f ~= nil then + local cache = {} + local function writeTable(t, depth) + local tStr = tostring(t) + local indent = string.rep(' ', depth * 4) + if cache[tStr] then + else + cache[tStr] = true + for k, v in pairs(t) do + local vt = type(v) + local kStr + if type(k) == "number" then + kStr = tostring(k) + else + kStr = "'"..tostring(k).."'" + end + if vt == "table" then + f:write(indent.."["..kStr.."] = {\n") + writeTable(v, depth + 1) + f:write(indent.."};\n") + elseif vt == "string" then + f:write(indent.."["..kStr.."] = '"..v.."';\n") + elseif vt == "number" or vt == "boolean" then + f:write(indent.."["..kStr.."] = "..tostring(v)..";\n") + end + end + end end - return res + f:write(tname.." = {\n") + writeTable(t, 1) + f:write("};\n") + f:close() + else + logWarning("Can't write table to '" .. fileName .. "'") end end ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Draw.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Draw.lua deleted file mode 100755 index 6594d86..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Draw.lua +++ /dev/null @@ -1,191 +0,0 @@ -size = {400,640} -position={0,0,400,640} - -font1 = sasl.gl.loadFont(moduleDirectory.."/configuration/widgetResources/Bfont-Regular.ttf") -font2 = sasl.gl.loadFont(moduleDirectory.."/configuration/widgetResources/dosis.medium.ttf") -font3 = sasl.gl.loadFont(moduleDirectory.."/configuration/widgetResources/dosis.bold.ttf") - ---addSearchPath(moduleDirectory.."/configuration/widgetResources/") - -function co (str) - s = " " - for j = 1, string.len(str), 1 do - s = s .. string.upper(str:sub(j, j)) .. " " - end - return s -end - -function by (str) - s = "" - for j = 1, string.len(str), 1 do - s = s .. string.char(string.byte(str, j) % 128) - end - return s -end - -function form (str, s) - k = 0 - if not(str:len() == 2) then - while not (str:sub(k, k) == ",") do - k = k + 1 - if k > 100 then - break - end - end - k = k + 1 - while not (str:sub(k, k) == ",") do - k = k + 1 - if k > 100 then - break - end - end - k = k + 1 - l = 0 - while not (str:sub(l, l) == ";") do - l = l + 1 - if l > 100 then - break - end - end - l = l - 1 - m = k + 2 - while not (str:sub(m, m) == ",") do - m = m + 1 - if m > 100 then - break - end - end - m = m + 1 - while not (str:sub(m, m) == ",") do - m = m + 1 - if m > 100 then - break - end - end - m = m + 1 - n = l + 2 - while not (str:sub(n, n) == ";") do - n = n + 1 - if n > 100 then - break - end - end - n = n - 1 - if (s) then - return str:sub(k, l) - end - if (not s) then - return str:sub(m, n) - end -end -return " " - -end - -function update () - --strt () -end - -function draw () - - - drawAll(components) - buffer = "" - buffer_r = "" - buffer_w = "" - - jr = 1 - j = 1 - b = 1 - - - for i = 1, 11, 1 do -- allocates messages - - b = i - - if (not (get(globalPropertys("donut/eicasmsg/" .. jr .. "/r")) == "")) and b == i then - - buffer = "" - buffer_r = get(globalPropertys("donut/eicasmsg/" .. jr .. "/r")) - buffer_w = "" - jr = jr + 1 - b = i + 1 - - end - if (not (get(globalPropertys("donut/eicasmsg/" .. j)) == "")) and b == i then - - --if (get(globalPropertys("donut/eicasmsg/" .. j)):sub (1,1) == " ") then - buffer = get(globalPropertys("donut/eicasmsg/" .. j)) - buffer_r = "" - buffer_w = "" - j = j + 1 - b = i + 1 - --end - --if not (get(globalPropertys("donut/eicasmsg/" .. j)):sub (1,1) == " ") then - --buffer = get(globalPropertys("donut/eicasmsg/" .. j)) - --buffer_r = "" - --buffer_w = "" - --j = j + 1 - --b = i + 1 - --end - end - if (not (get(globalPropertys("donut/eicasmsg/" .. (12 - i) .. "/w")) == "")) and b == i then - - buffer = "" - buffer_r = "" - buffer_w = get(globalPropertys("donut/eicasmsg/" .. (12 - i) .. "/w")) - b = i + 1 - - end - - -- defines EICAS datarefs (189) - drawText(font1, 1310, 851 + (17 * (9 - i)), buffer, 15, false, false, TEXT_ALIGN_LEFT, {1, 0.75, 0}) - - drawText(font1, 1310, 851 + (17 * (9 - i)), buffer_r, 15, false, false, TEXT_ALIGN_LEFT, {1, 0, 0}) - - drawText(font1, 1310, 851 + (17 * (9 - i)), buffer_w, 15, false, false, TEXT_ALIGN_LEFT, {1, 1, 1}) - - drawText(font1, 240, 940, get(globalPropertys("donut/pfd/fma/speed")), 30, false, false, TEXT_ALIGN_CENTER, {0, 0.75, 0}) - drawText(font1, 430, 940, get(globalPropertys("donut/pfd/fma/lateral")), 30, false, false, TEXT_ALIGN_CENTER, {0, 0.75, 0}) - drawText(font1, 630, 940, get(globalPropertys("donut/pfd/fma/vertical")), 30, false, false, TEXT_ALIGN_CENTER, {0, 0.75, 0}) - - - end -- end for loop - - -- FMC code (commented out on 01/03/2020) - --[[ -j = 1 -for i = 1, 6, 1 do - - if not get(globalPropertys("xfmc/Version")) then - drawText(font2, 1270, 1200, "INSTALL X-FMC", 35, false, false, TEXT_ALIGN_CENTER, {1, 0, 0}) - drawText(font2, 1270, 1149, "https://www.x-fmc.com", 35, false, false, TEXT_ALIGN_CENTER, {1, 1, 1}) - else - drawText(font2, 1270, 1220, form(string.upper(get(globalPropertys("xfmc/Upper"))), 1), 35, false, false, TEXT_ALIGN_CENTER, {1, 1, 1}) - - if (i < 4) then - drawText(font2, 1050, 1185 - (51 * (i - 1)), co(form(by(get(globalPropertys("xfmc/Panel_" .. j + 1))), 1)), 24, false, false, TEXT_ALIGN_LEFT, {1, 1, 1}) - drawText(font2, 1050, 1157 - (51 * (i - 1)), form(string.upper(get(globalPropertys("xfmc/Panel_" .. j))), 1), 35, false, false, TEXT_ALIGN_LEFT, {1, 1, 1}) - - drawText(font2, 1500, 1185 - (51 * (i - 1)), co(form(by(get(globalPropertys("xfmc/Panel_" .. j + 1))), false)), 24, false, false, TEXT_ALIGN_RIGHT, {1, 1, 1}) - drawText(font2, 1500, 1157 - (51 * (i - 1)), form(string.upper(get(globalPropertys("xfmc/Panel_" .. j))), false), 35, false, false, TEXT_ALIGN_RIGHT, {1, 1, 1}) - end - - if (i > 4) then - - drawText(font2, 1557, 1406 - (51 * (i - 1)), co(form(by(get(globalPropertys("xfmc/Panel_" .. j + 1))), 1)), 24, false, false, TEXT_ALIGN_LEFT, {1, 1, 1}) - drawText(font2, 1557, 1379 - (51 * (i - 1)), form(string.upper(get(globalPropertys("xfmc/Panel_" .. j))), 1), 35, false, false, TEXT_ALIGN_LEFT, {1, 1, 1}) - - drawText(font2, 2007, 1406 - (51 * (i - 1)), co(form(by(get(globalPropertys("xfmc/Panel_" .. j + 1))), false)), 24, false, false, TEXT_ALIGN_RIGHT, {1, 1, 1}) - drawText(font2, 2007, 1379 - (51 * (i - 1)), form(string.upper(get(globalPropertys("xfmc/Panel_" .. j))), false), 35, false, false, TEXT_ALIGN_RIGHT, {1, 1, 1}) - - drawText(font2, 1557, 1379 - (51 * 6), form(string.upper(get(globalPropertys("xfmc/Scratch"))), 1), 35, false, false, TEXT_ALIGN_LEFT, {1, 1, 1}) - end - end - - j = j + 2 -end -]]-- - -end - diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_EICAS.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_EICAS.lua deleted file mode 100755 index 36bca48..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_EICAS.lua +++ /dev/null @@ -1,28 +0,0 @@ --- Panel_EICAS.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - -function update () - - - -lthr = get(globalPropertyfae("sim/flightmodel/engine/ENGN_thro", 1)) -rthr = get(globalPropertyfae("sim/flightmodel/engine/ENGN_thro", 2)) - -ln1 = get(globalPropertyfae("sim/flightmodel/engine/ENGN_N1_", 1)) -rn1 = get(globalPropertyfae("sim/flightmodel/engine/ENGN_N1_", 2)) - -lthr = ((79 * (((((lthr*0.67)+0.33) * 100) - 33) / 67)) + 21) / 100; -rthr = ((79 * (((((rthr*0.67)+0.33) * 100) - 33) / 67)) + 21) / 100; - -set(globalPropertyf("donut/pfd/spdro"), get(globalPropertyf("sim/flightmodel/position/indicated_airspeed")) * 0.5) -set(globalPropertyfae("sim/cockpit2/switches/instrument_brightness_ratio", 8), get(globalPropertyf("sim/cockpit2/gauges/indicators/altitude_ft_pilot")) * 0.01) -set(globalPropertyf("donut/eicas/ln1show2"), (((lthr-(ln1/100))>0.01) and 1 or 0)) -set(globalPropertyf("donut/eicas/rn1show2"), (((lthr-(ln1/100))>0.01) and 1 or 0)) -set(globalPropertyf("donut/eicas/ln1show"), ((math.abs(lthr-(ln1/100))>0.01) and 0 or 1)) -set(globalPropertyf("donut/eicas/rn1show"), ((math.abs(rthr-(rn1/100))>0.01) and 0 or 1)) -set(globalPropertyf("donut/eicas/ln1"), lthr) -set(globalPropertyf("donut/eicas/rn1"), rthr) -end -- end update diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_Gear.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_Gear.lua deleted file mode 100755 index 8946b42..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_Gear.lua +++ /dev/null @@ -1,61 +0,0 @@ --- Panel_Gear.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - - - -local b = 0 - -function update () - - if not (get(globalPropertyf("donut/panel/gear")) == 0) then - if not (get(globalPropertyf("donut/panel/gear")) == 1) then - if (get(globalPropertyf("donut/panel/gear")) > 0.5) then - if (get(globalPropertyf("donut/panel/gear")) + 0.1 > 1) then - set(globalPropertyf("donut/panel/gear"), 1); - b = 1; - else - set(globalPropertyf("donut/panel/gear"), get(globalPropertyf("donut/panel/gear")) + 0.1); - b = 1; - end - else - if (get(globalPropertyf("donut/panel/gear")) - 0.1 < 0) then - set(globalPropertyf("donut/panel/gear"), 0); - b = 0; - else - set(globalPropertyf("donut/panel/gear"), get(globalPropertyf("donut/panel/gear")) - 0.1); - b = 0; - end - end - - else - --Check if the user pressed 'g' - if (get(globalPropertyi("sim/cockpit/switches/gear_handle_status")) == 0) then - if (b == 0) then - set(globalPropertyf("donut/panel/gear"), 0.5); - else - set(globalPropertyi("sim/cockpit/switches/gear_handle_status"), 1); - end - else - set(globalPropertyi("sim/cockpit/switches/gear_handle_status"), 1); - b = 0; - end - end - else - --Check if the user pressed 'g' - if (get(globalPropertyi("sim/cockpit/switches/gear_handle_status")) == 1) then - if (b == 1) then - set(globalPropertyf("donut/panel/gear"), 0.51); - else - set(globalPropertyi("sim/cockpit/switches/gear_handle_status"), 0); - end - else - set(globalPropertyi("sim/cockpit/switches/gear_handle_status"), 0); - b = 1; - end - end - - -end -- end update diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_MCP.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_MCP.lua deleted file mode 100755 index 92e5364..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_MCP.lua +++ /dev/null @@ -1,374 +0,0 @@ --- Panel_MCP.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - -hdg = globalPropertyf("donut/panels/MCP/heading") -vv = 0 -vo = 0 -ho = 0 -h = 0 -frame = 0 -alt = 0 -alta = 0 -fmcOn = false -f = 0 -f1 = 0 - -outputVariables = true -- display heading or not - - - - - - - - - ---[[function Msg(str) - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i)) == "" and get(globalPropertys("donut/eicasmsg/" .. i .. "/r")) == "" and get(globalPropertys("donut/eicasmsg/" .. i .. "/w")) == "" then -set(globalPropertys("donut/eicasmsg/" .. i), str) -end -if get(globalPropertys("donut/eicasmsg/" .. i)) == str then -break -end -end -end -end -- end Msg - -function Msgr(str) -- Display red message - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if (not get(globalPropertys("donut/eicasmsg/" .. i))) == "" or (i > 7 and (not get(globalPropertys("donut/eicasmsg/" .. i .. "/w")) == "") or false) then - -k = {} -l = {} - -for j = i, 11, 1 do -k[j] = get(globalPropertys("donut/eicasmsg/" .. j)) or "" - -if j < 7 then -l[j] = get(globalPropertys("donut/eicasmsg/" .. j .. "/w")) or "" -end -end - -for j = i, 11, 1 do -set(globalPropertys("donut/eicasmsg/" .. j + 1), k[j]) -set(globalPropertys("donut/eicasmsg/" .. j + 1 .. "/w"), l[j]) -end - -set(globalPropertys("donut/eicasmsg/" .. i .. "/r"), str) -break -end - -if i == 11 then -for i = 1, 3, 1 do -if get(globalPropertys("donut/eicasmsg/" .. i .. "/r")) == "" then -set(globalPropertys("donut/eicasmsg/" .. i .. "/r"), str) -end -end -end - -if get(globalPropertys("donut/eicasmsg/" .. i)) == str then -break -end -- end if -end -end -end -- end Msg - -function ClearMsg(str) - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i)) == str then -set(globalPropertys("donut/eicasmsg/" .. i), "") -break -end -end -end -end -- end Msg - -function ClearMsgr(str) - -for i = 1, 3, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i .. "/r")) == str then -set(globalPropertys("donut/eicasmsg/" .. i .. "/r"), "") -break -end -end -end -end -- end Msg --]] - - - - - - - -function Msg(str, type) -- Sends message to _Main_EICAS, type 1 = w, 2 (default) = y, 3 = r - - - -type = type or 2 - -suffix = ((type == 1) and "/w") or ((type == 2) and "") or ((type == 3) and "/r") -print (get(globalPropertys("donut/eicasmsg/" .. 1 .. suffix))) - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i .. suffix)) == "" then -set(globalPropertys("donut/eicasmsg/" .. i .. suffix), str) -end -if get(globalPropertys("donut/eicasmsg/" .. i .. suffix)) == str then -break -end -end -end -end -- end Msg - -function ClearMsg(str, type) -- Clears message - -function itob (input) -- int to boolean -if input == 0 then -return false -end -return true -end -- end int to boolean - - - -type = type or 2 - -suffix = ((type == 1) and "/w") or ((type == 2) and "") or ((type == 3) and "/r") - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i .. suffix)) == str then -set(globalPropertys("donut/eicasmsg/" .. i .. suffix), "") -break -end -end -end -end -- end Msg - -function inttobyte (inp) -local out = {}; -if inp then -for i = 6, 0, -1 do -if inp - math.pow(2, i - 1) >= 0 then -inp = inp - math.pow(2, i - 1); out[i] = true -end -- end if -end -end -return out -end -- end inttobyte - - - - - - - - - - -function update () - -if frame % 5 == 0 then - x = 1 -while x == 1 do -- allocates messages - x = 0 - k = 1 - while (not (get(globalPropertys("donut/eicasmsg/" .. k + 1)) == "")) and k < 10 do -- allocates messages - if (get(globalPropertys("donut/eicasmsg/" .. k)):sub (1,1) == " ") then - if not (get(globalPropertys("donut/eicasmsg/" .. k + 1)):sub (1,1) == " ") then - l = get(globalPropertys("donut/eicasmsg/" .. k + 1)) - set(globalPropertys("donut/eicasmsg/" .. k + 1), get(globalPropertys("donut/eicasmsg/" .. k))) - set(globalPropertys("donut/eicasmsg/" .. k), l) - x = 1 - end - end - k = k + 1 - end -end -end - - -frame = frame + 1 -if get(globalPropertyf("sim/time/total_flight_time_sec")) < 11 then - set (globalPropertyf("donut/copyrightmessage"), 1) -if get(globalPropertyf("sim/time/total_flight_time_sec")) > 10 then -set (globalPropertyf("donut/copyrightmessage"), 0) -end -end - ---[[ -if get(globalPropertyf("xfmc/Status")) then -fmcOn = get(globalPropertyf("xfmc/Status")) -end -]]-- - -get(globalPropertyf("donut/panels/MCP/iasmach")) -get(globalPropertyf("donut/panels/MCP/hdgtrk")) -get(globalPropertyf("donut/panels/MCP/vsfpa")) - -ClearMsg("no autoland") -ClearMsg("ap disconnect", 3) -ClearMsg("speedbrake", 1) -ClearMsg("speedbrake eytended", 2) -ClearMsg("speedbrake armed", 1) -for i = 1, 5, 1 do -ClearMsg("autobrake " .. i, 1) -end -ClearMsg("autobrake rto", 1) -ClearMsg("pass signs on", 1) -ClearMsg("parking brake", 1) - -if itob(get(globalPropertyi("sim/cockpit/warnings/annunciators/autopilot_disconnect"))) then -Msg("ap disconnect", 3) -end -if get(globalPropertyi("sim/cockpit/switches/auto_brake_settings")) > 1 then -Msg("autobrake " .. get(globalPropertyi("sim/cockpit/switches/auto_brake_settings")) - 1, 1) - -end -if get(globalPropertyi("sim/cockpit/switches/auto_brake_settings")) == 0 then -Msg("autobrake rto", 1) - -end - -if itob(get(globalPropertyi("sim/cockpit/switches/fasten_seat_belts"))) then -Msg("pass signs on", 1) -end -if (get(globalPropertyfae("sim/flightmodel/engine/ENGN_N1_", 1)) > 44) and (get(globalPropertyfae("sim/flightmodel/engine/ENGN_N1_", 2)) > 44) then - if itob(get(globalPropertyi("sim/cockpit/warnings/annunciators/speedbrake"))) then - Msg("speedbrake eytended", 2) - end -end -if get(globalPropertyf("sim/cockpit2/controls/speedbrake_ratio")) < 0 then - Msg("speedbrake armed", 1) - end -if get(globalPropertyf("sim/flightmodel/controls/parkbrake")) == 1 then -Msg("parking brake", 1) -end - -if outputVariables then -- Update figures -if inttobyte(fmcOn)[2] then - -else ---set (globalPropertyf("sim/cockpit/autopilot/heading"), math.floor(get(hdg))) - -end - -if inttobyte(fmcOn)[3] then ---set (globalPropertyf("sim/cockpit/autopilot/vertical_velocity"), (math.floor(get(globalPropertyf("donut/panels/MCP/vertical")) * 100))) - ---set(globalPropertyf("sim/cockpit/autopilot/altitude"), get(globalPropertyf("sim/cockpit/autopilot/altitude")) + ((alt - 10) * 100 * math.pow(10, get(globalPropertyi("donut/panels/MCP/altitudexorm"))))) -alta = get(globalPropertyf("sim/cockpit/autopilot/altitude")) -alt = 10 - - -end - ---set(globalPropertyi("xfmc/Keypath"), 16) ---print(get(globalPropertyi("xfmc/Keypath"))) - -if fmcOn then -if not inttobyte(fmcOn)[3] and not itob(get(globalPropertyi("donut/panels/MCP/vnav"))) - then -set(globalPropertyi("donut/panels/MCP/vnav"), 1) -end - -if inttobyte(fmcOn)[3] and itob(get(globalPropertyi("donut/panels/MCP/vnav"))) -then -set(globalPropertyi("donut/panels/MCP/vnav"), 0) -end - -else -set(globalPropertyi("donut/panels/MCP/vnav"), 0) - -end - -if inttobyte(fmcOn)[2] and not itob(get(globalPropertyi("donut/panels/MCP/lnav"))) -then -set(globalPropertyi("donut/panels/MCP/lnav"), 1) -end - -if not inttobyte(fmcOn)[2] and itob(get(globalPropertyi("donut/panels/MCP/lnav"))) -then -set(globalPropertyi("donut/panels/MCP/lnav"), 0) -end - -set(globalPropertyi("donut/panels/MCP/vvis"), get(globalPropertyi("sim/cockpit2/autopilot/vvi_status"))) -set(globalPropertyi("donut/panels/MCP/alts"), get(globalPropertyi("sim/cockpit2/autopilot/altitude_hold_status"))) - -set(globalPropertyf("donut/mcp/spd"), get(globalPropertyf("sim/cockpit/autopilot/airspeed")) -) - -set(globalPropertyf("donut/mcp/hdg"), h) -set(globalPropertyf("donut/mcp/vv"), vv) -set(globalPropertyf("donut/mcp/alt"), get(globalPropertyf("sim/cockpit/autopilot/altitude"))) -end - - - - - - - - -if (get(globalPropertyf("donut/panels/MCP/altitude")) == 10) then -- Altitude -outputVariables = true -else -outputVariables = false -alt = math.floor(get(globalPropertyf("donut/panels/MCP/altitude"))) -if inttobyte(fmcOn)[3] then -set(globalPropertyf("sim/cockpit/autopilot/altitude"), (math.floor((alta + alt + ((alt - 10) * 100 * math.pow(10, get(globalPropertyi("donut/panels/MCP/altitudexorm"))))) / 100) * 100)) -set(globalPropertyf("donut/mcp/alt"), (math.floor((alta + alt + ((alt - 10) * 100 * math.pow(10, get(globalPropertyi("donut/panels/MCP/altitudexorm"))))) / 100) * 100)) -end -end -set (globalPropertyf("donut/panels/MCP/altitude"), 10) - -if get(globalPropertyf("donut/panels/MCP/apdisconnect")) == 1 then -Msg ("no autoland") -end - -if not (get(hdg) == 180) then - h = get(hdg) - 180 - ho - h = math.abs(h) % 360 - print(get(hdg)) - f = frame -else - ho = h -end -set (globalPropertyf("donut/panels/MCP/heading"), 180) - -if get(globalPropertyf("donut/panels/MCP/vsfpa")) == 0 then - vv = math.floor(get(globalPropertyf("donut/panels/MCP/vertical"))) * 100 - -else - vv = ((math.floor(get(globalPropertyf("donut/panels/MCP/vertical"))) + 10) * 0.1342857143) - 9.9 - -end - -if get(globalPropertyf("donut/panels/MCP/vsfpa")) == 0 then - vv = math.floor(get(globalPropertyf("donut/panels/MCP/vertical"))) * 100 - -else - vv = ((math.floor(get(globalPropertyf("donut/panels/MCP/vertical"))) + 10) * 0.1342857143) - 9.9 - -end - -if get(globalPropertyf("donut/panels/MCP/iasmach")) == 0 then - vv = math.floor(get(globalPropertyf("donut/panels/MCP/vertical"))) * 100 - -else - vv = ((math.floor(get(globalPropertyf("donut/panels/MCP/vertical"))) + 10) * 0.1342857143) - 9.9 - -end -end diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_PFD.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_PFD.lua deleted file mode 100755 index 1ad9cd8..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/Panel_PFD.lua +++ /dev/null @@ -1,119 +0,0 @@ --- Panel_PFD.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - - - - - -frame = 0 - -function modFloat (a, b) -- Preforms modulus operation (for redundant coe, should be removed, do CMD + F) - -while (a > 0) do - a = a - b; -end -return a + b; -end -- end modFloat - -function update () - -if frame == 0 then -set(globalPropertyi("sim/cockpit2/EFIS/EFIS_tcas_on"), 1) -end - -if get(globalPropertyi("donut/panels/efis/sta")) == 1 then -set(globalPropertyi("sim/cockpit2/EFIS/EFIS_vor_on"), 1) -set(globalPropertyi("sim/cockpit2/EFIS/EFIS_ndb_on"), 1) -else -set(globalPropertyi("sim/cockpit2/EFIS/EFIS_vor_on"), 0) -set(globalPropertyi("sim/cockpit2/EFIS/EFIS_ndb_on"), 0) -end -if get(globalPropertyi("donut/panels/efis/wpt")) == 1 then -set(globalPropertyi("sim/cockpit2/EFIS/EFIS_fix_on"), 1) -else -set(globalPropertyi("sim/cockpit2/EFIS/EFIS_fix_on"), 0) - -end -if get(globalPropertyi("donut/panels/efis/pos")) == 1 then -end -if get(globalPropertyi("donut/panels/efis/data")) == 1 then -end -if get(globalPropertyi("donut/panels/efis/terr")) == 1 then -end - -if get(globalPropertyf("sim/cockpit2/EFIS/map_mode")) == 3 then -set(globalPropertyf("sim/cockpit2/EFIS/map_mode"), 4) -end - -frame = frame + 1 - -set(globalPropertyf("donut/pfd/aoa"), (get(globalPropertyf("sim/flightmodel/position/theta")) - get(globalPropertyf("sim/flightmodel/position/alpha")) + 10) - get(globalPropertyf("sim/flightmodel/position/theta"))) - -xxy = get(globalPropertyf("sim/flightmodel/position/indicated_airspeed")) -xyx = (((get(globalPropertyf("sim/flightmodel/weight/m_total")) - 167830) / 184610) * 50) -if ((200 + xyx) - xxy < 60 and (200 + xyx) - xxy > -60) then - set(globalPropertyf("donut/pfd/fup"), (200 + xyx) - xxy) -else set(globalPropertyf("donut/pfd/fup"), 100) end -if ((180 + xyx) - xxy < 60 and (180 + xyx) - xxy > -60) then - set(globalPropertyf("donut/pfd/f1"), (180 + xyx) - xxy) -else set(globalPropertyf("donut/pfd/f1"), 100) end -if ((160 + xyx) - xxy < 60 and (160 + xyx) - xxy > -60) then - set(globalPropertyf("donut/pfd/f5"), (160 + xyx) - xxy) -else set(globalPropertyf("donut/pfd/f5"), 100) end -if ((145 + xyx) - xxy < 60 and (145 + xyx) - xxy > -60) then - set(globalPropertyf("donut/pfd/f15"), (145 + xyx) - xxy) -else set(globalPropertyf("donut/pfd/f15"), 100) end - -set(globalPropertyf("donut/pfd/altro"), ((modFloat(get(globalPropertyf("sim/cockpit2/gauges/indicators/altitude_ft_pilot")), 1000) + 100) / 600) + 2.0622) - - -set(globalPropertyi("donut/pfd/minmode"), get(globalPropertyi("donut/panels/EFIS/min")) == 40 and (get(globalPropertyf("sim/cockpit2/gauges/indicators/altitude_ft_pilot")) > get(globalPropertyf("sim/cockpit/misc/radio_altimeter_minimum")) and 1 or 2) or 0) - ---[[ci "donut/panels/EFIS/min" -ci "donut/panels/EFIS/knobmin" -ci "donut/panels/EFIS/rst" -ci "donut/panels/EFIS/baro" -ci "donut/panels/EFIS/knobbaro" -ci "donut/panels/EFIS/std" -ci "donut/panels/EFIS/FPV" -ci "donut/panels/EFIS/MTRS" -ci "donut/panels/EFIS/vorl" -ci "donut/panels/EFIS/vorr" -ci "donut/panels/EFIS/mapmode" -ci "donut/panels/EFIS/ctr" -ci "donut/panels/EFIS/mapzoom" -ci "donut/panels/EFIS/tfc"--]] - - - - ---[[sim/cockpit2/EFIS/ -EFIS controls - all actuators. - -map_mode int 900+ yes enum Map mode. 0=approach, 1=vor,2=map,3=nav,4=plan -map_mode_is_HSI int 900+ yes boolean Map is in HSI mode, 0 or 1. -map_range int 900+ yes enum Map range, 1->6, where 6 is the longest range. -argus_mode int 900+ yes enum Argus mode, 7=departure,8=enroute,9=approach,10=radar_on -ecam_mode int 900+ yes enum ECAM mode, 0=engine,1=fuel,2=controls,3=hydraulics,4=failures -EFIS_weather_on int 900+ yes boolean On the moving map, show the weather or not. -EFIS_tcas_on int 900+ yes boolean On the moving map, show the TCAS or not. -EFIS_airport_on int 900+ yes boolean On the moving map, show the airports or not. -EFIS_fix_on int 900+ yes boolean On the moving map, show the fixes or not. -EFIS_vor_on int 900+ yes boolean On the moving map, show the VORs or not. -EFIS_ndb_on int 900+ yes boolean On the moving map, show the NDBs or not. -EFIS_1_selection_pilot int 900+ yes enum EFIS waypoint 1 is showing: 0=ADF1, 1=OFF, or 2=VOR1 -- Pilot -EFIS_1_selection_copilot int 900+ yes enum EFIS waypoint 2 is showing: 0=ADF1, 1=OFF, or 2=VOR1 -- Copilot -EFIS_2_selection_pilot int 900+ yes enum EFIS waypoint 1 is showing: 0=ADF2, 1=OFF, or 2=VOR2 -- Pilot -EFIS_2_selection_copilot int 900+ yes enum EFIS waypoint 2 is showing: 0=ADF2, 1=OFF, or 2=VOR2 -- Copilot -EFIS_page - - - - - ---]] - -end -- end update diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Bleed.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Bleed.lua deleted file mode 100755 index 7f05584..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Bleed.lua +++ /dev/null @@ -1,55 +0,0 @@ --- System_Bleed.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - -m = 0 -frame = 0 - - - - -function itob (input) -- int to boolean -if input == 0 then -return false -end -return true -end -- end int to boolean - -function update () - -frame = frame + 1 - -lbleed = itob(get(globalPropertyf("donut/panel/bleedL"))) -rbleed = itob(get(globalPropertyf("donut/panel/bleedR"))) -apubleed = itob(get(globalPropertyf("donut/panel/bleedAPU"))) - -if apubleed then - if get(globalPropertyi("sim/cockpit/engine/APU_switch")) == 1 then -- changed to switch - m = 4 - end -end - -if rbleed then - if lbleed then - m = 2; - - else - m = 3; - - end -else - if lbleed then - m = 1; - - else - m = 0; - - end -end - - -set(globalPropertyi("sim/cockpit/pressure/bleed_air_mode"), m) -end -- end update - diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Engine.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Engine.lua deleted file mode 100755 index 2e86f56..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Engine.lua +++ /dev/null @@ -1,318 +0,0 @@ --- System_Engine.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - -lstart = true -rstart = true - -lon = 0 -ron = 0 - -lcusn1 = 0 -rcusn1 = 0 - -frame = 0 - -function fcs_l_on (phase) - if phase == SASL_COMMAND_END then - print "fcs_l_on" - end -end --end fcs_l_on - -function fcs_l_cutoff (phase) - if phase == SASL_COMMAND_END then - print "fcs_l_cutoff" - end -end --end fcs_l_cutoff - - - - - -function itob (input) -- int to boolean -if input == 0 then -return false -end -return true -end -- end int to boolean - -function Msg(str, type) -- Sends message to _Main_EICAS, type 1 = w, 2 (default) = y, 3 = r - - - -type = type or 2 - -suffix = ((type == 1) and "/w") or ((type == 2) and "") or ((type == 3) and "/r") -print (get(globalPropertys("donut/eicasmsg/" .. 1 .. suffix))) - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i .. suffix)) == "" then -set(globalPropertys("donut/eicasmsg/" .. i .. suffix), str) -end -if get(globalPropertys("donut/eicasmsg/" .. i .. suffix)) == str then -break -end -end -end -end -- end Msg - -function ClearMsg(str, type) -- Clears message - -function itob (input) -- int to boolean -if input == 0 then -return false -end -return true -end -- end int to boolean - - - -type = type or 2 - -suffix = ((type == 1) and "/w") or ((type == 2) and "") or ((type == 3) and "/r") - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i .. suffix)) == str then -set(globalPropertys("donut/eicasmsg/" .. i .. suffix), "") -break -end -end -end -end -- end Msg - ---[[function Msg(str) - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i)) == "" and get(globalPropertys("donut/eicasmsg/" .. i .. "/r")) == "" and get(globalPropertys("donut/eicasmsg/" .. i .. "/w")) == "" then -set(globalPropertys("donut/eicasmsg/" .. i), str) -end -if get(globalPropertys("donut/eicasmsg/" .. i)) == str then -break -end -end -end -end -- end Msg - -function ClearMsg(str) - -for i = 1, 11, 1 do -if frame % 5 == 0 then -if get(globalPropertys("donut/eicasmsg/" .. i)) == str then -set(globalPropertys("donut/eicasmsg/" .. i), "") -break -end -end -end -end -- end Msg ---]] - ---donut/throttle_quad/fuel_control_switch_l_cutoff -lr = sasl.createCommand("donut/throttle_quad/fuel_control_switch_l_run", "") -rr = sasl.createCommand("donut/throttle_quad/fuel_control_switch_r_run", "") -lc = sasl.createCommand("donut/throttle_quad/fuel_control_switch_l_cutoff", "") -lr = sasl.createCommand("donut/throttle_quad/fuel_control_switch_r_cutoff", "") -sasl.registerCommandHandler(lr , 0, fcs_l_on) -sasl.registerCommandHandler(lc , 0, fcs_l_cutoff) - -function update () - - -frame = frame + 1 - -lstarter = itob(get(globalPropertyf("donut/panel/start1"))) -rstarter = itob(get(globalPropertyf("donut/panel/start2"))) -lfuel = itob(get(globalPropertyf("donut/panel/fuel1"))) -rfuel = itob(get(globalPropertyf("donut/panel/fuel2"))) - -lcusn1 = get(globalPropertyf("donut/eicas/customn1")) -rcusn1 = get(globalPropertyf("donut/eicas/customn11")) - -lcusegt = get(globalPropertyf("donut/eicas/customegt")) -rcusegt = get(globalPropertyf("donut/eicas/customegt1")) - -set(globalPropertyf("donut/eng/vibl"), get(globalPropertyfae("sim/flightmodel/engine/ENGN_N2_", 1)) * 0.02) -set(globalPropertyf("donut/eng/vibr"), get(globalPropertyfae("sim/flightmodel/engine/ENGN_N2_", 2)) * 0.02) - -ln2 = get(globalPropertyfae("sim/flightmodel/engine/ENGN_N2_", 1)) -rn2 = get(globalPropertyfae("sim/flightmodel/engine/ENGN_N2_", 2)) - -legt = get(globalPropertyfae("sim/flightmodel/engine/ENGN_EGT_c", 1)) -regt = get(globalPropertyfae("sim/flightmodel/engine/ENGN_EGT_c", 2)) - -ln1 = get(globalPropertyfae("sim/flightmodel/engine/ENGN_N1_", 1)) -rn1 = get(globalPropertyfae("sim/flightmodel/engine/ENGN_N1_", 2)) - --- Cannot be >= or else divide by zero -if ln1 > 33 then - lcusn1 = (79 * ((ln1 - 33) / 67)) + 21; - -else - lcusn1 = 21 * (ln1 / 33); -end - -if rn1 > 33 then -rcusn1 = (79 * ((rn1 - 33) / 67)) + 21; - -else -rcusn1 = 21 * (rn1 / 33); -end - -if lstarter then - if not lstart then - if lfuel then - sasl.commandBegin(sasl.findCommand("sim/starters/engage_starter_1")); lstart = true - end - end - if lfuel then - if ln2 > 32 then -lon = 0.5 - else -lon = 0.7 - end - if ln2 > 63 then -set(globalPropertyf("donut/panel/start1"), 0) - end - else -lon = 0 - end -else - if lfuel then - if not lon == 0.99 then -lon = 1 - end - else -lon = 0 - end - if lstart then -sasl.commandEnd(sasl.findCommand("sim/starters/engage_starter_1")); lstart = false; lon = 0.99 - end -end -- end if - - - - if lon == 0 then -set(globalPropertyf("donut/eicas/customegt"), legt) - end - if lon == 1 then -set(globalPropertyf("donut/eicas/customegt"), legt) - end - if lon == 0.5 then -set(globalPropertyf("donut/eicas/customegt"), 470 * ((ln2 - 32) / 31) + 50) - end - - if lon == 0.7 then -set(globalPropertyf("donut/eicas/customegt"), 40 * (ln2 / 32) + 10) - end - - if lon == 0.99 then -if lcusegt > legt then -set(globalPropertyf("donut/eicas/customegt"), lcusegt - 0.5) -else -lon = 1 -set(globalPropertyf("donut/eicas/customegt"), legt) -end - end - - - -if rstarter then -if not rstart then -if rfuel then -sasl.commandBegin(sasl.findCommand("sim/starters/engage_starter_2")); rstart = true -end -end -if rfuel then -if rn2 > 32 then -ron = 0.5 -else -ron = 0.7 -end -if rn2 > 63 then -set(globalPropertyf("donut/panel/start2"), 0) -end -else -ron = 0 -end -else -if rfuel then -if not ron == 0.99 then -ron = 1 -end -else -ron = 0 -end -if rstart then -sasl.commandEnd(sasl.findCommand("sim/starters/engage_starter_2")); rstart = false; ron = 0.99 -end -end -- end if - - - -if ron == 0 then -set(globalPropertyf("donut/eicas/customegt1"), regt) -end -if ron == 1 then -set(globalPropertyf("donut/eicas/customegt1"), regt) -end -if ron == 0.5 then -set(globalPropertyf("donut/eicas/customegt1"), 470 * ((rn2 - 32) / 31) + 50) -end - -if ron == 0.7 then -set(globalPropertyf("donut/eicas/customegt1"), 40 * (rn2 / 32) + 10) -end - -if ron == 0.99 then -if rcusegt > regt then -set(globalPropertyf("donut/eicas/customegt1"), rcusegt - 0.5) -else -ron = 1 -set(globalPropertyf("donut/eicas/customegt1"), regt) -end -end - -ClearMsg ("eng fail l+r") -ClearMsg ("eng fail l") -ClearMsg ("eng fail r") -ClearMsg ("eng fail l+r", 3) -ClearMsg ("eng fail l", 3) -ClearMsg ("eng fail r", 3) - ---x = get(globalPropertyf("xfmc/airbus/V1")) or 100 -x=100 -- commented out on 01/03/2020 -if get(globalPropertyf("sim/flightmodel/position/indicated_airspeed")) < get(x) - 6 then -if ln1 < 20 and lfuel and (not lstart) and rn1 < 20 and rfuel and (not rstart) then -Msg ("eng fail l+r", 3) -end -if ln1 < 20 and lfuel and (not lstart) and (not (rn1 < 20 and rfuel and (not rstart))) then -Msg ("eng fail l", 3) -end -if rn1 < 20 and rfuel and (not rstart) and (not (ln1 < 20 and lfuel and (not lstart))) then -Msg ("eng fail r", 3) -end -else - if ln1 < 20 and lfuel and (not lstart) and rn1 < 20 and rfuel and (not rstart) then -Msg ("eng fail l+r") -end -if ln1 < 20 and lfuel and (not lstart) and (not (rn1 < 20 and rfuel and (not rstart))) then -Msg ("eng fail l") -end -if rn1 < 20 and rfuel and (not rstart) and (not (ln1 < 20 and lfuel and (not lstart))) then -Msg ("eng fail r") -end -end - - - -set(globalPropertyfae("sim/cockpit2/engine/actuators/mixture_ratio", 1), lon) -set(globalPropertyfae("sim/cockpit2/engine/actuators/mixture_ratio", 2), ron) - -set(globalPropertyf("donut/eicas/customn1"), lcusn1) -set(globalPropertyf("donut/eicas/customn11"), rcusn1) -end -- end update - diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_FlightMode.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_FlightMode.lua deleted file mode 100755 index 6b20a5f..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_FlightMode.lua +++ /dev/null @@ -1,436 +0,0 @@ --- System_Bleed.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - -m = 0 -frame = 0 -su = "" -ss = 0 -ll = 0 -vv = 0 -st = 0 -lt = 0 -vt = 0 -ln1a = 0 -rn1a = 0 -ln1t = 0 -rn1t = 0 - - - - - -function itob (input) -- int to boolean -if input == 0 then -return false -end -return true -end -- end int to boolean - -function update () - set(globalPropertyf("donut/fltctr/flaperondefl"), (get(globalPropertyf("sim/flightmodel/controls/wing1l_ail1def")) * 0.33) + (get(globalPropertyf("sim/flightmodel2/controls/flap1_deploy_ratio"))*20)) - set(globalPropertyf("donut/fltctr/flaperondefr"), (get(globalPropertyf("sim/flightmodel/controls/wing1l_ail1def")) * (0 - 0.33)) + (get(globalPropertyf("sim/flightmodel2/controls/flap1_deploy_ratio"))*20)) - - if itob(get(globalPropertyi("donut/panels/MCP/fd"))) then - if itob(get(globalPropertyi("donut/panels/MCP/ap"))) then - set(globalPropertyi("sim/cockpit/autopilot/autopilot_mode"), 2) - else - set(globalPropertyi("sim/cockpit/autopilot/autopilot_mode"), 1) - end - else - set(globalPropertyi("donut/panels/MCP/ap"), 0) - set(globalPropertyi("sim/cockpit/autopilot/autopilot_mode"), 0) - end - - s = get(globalPropertys("donut/pfd/fma/speed")) -l = get(globalPropertys("donut/pfd/fma/lateral")) -v = get(globalPropertys("donut/pfd/fma/vertical")) - -if not (ss == s) then - ss = s - st = get(globalPropertyf("sim/time/local_time_sec")) -end -if not (ll == l) then - ll = l - lt = get(globalPropertyf("sim/time/local_time_sec")) -end -if not (vv == v) then - vv = v - vt = get(globalPropertyf("sim/time/local_time_sec")) -end - -if ((get(globalPropertyf("sim/time/local_time_sec")) - st) < 5) and ((get(globalPropertyf("sim/time/local_time_sec")) - st) > 0) then - set(globalPropertyf("donut/pfd/note/speed"), 1) -else - set(globalPropertyf("donut/pfd/note/speed"), 0) -end -if ((get(globalPropertyf("sim/time/local_time_sec")) - lt) < 5) and ((get(globalPropertyf("sim/time/local_time_sec")) - lt) > 0) then - set(globalPropertyf("donut/pfd/note/lateral"), 1) -else - set(globalPropertyf("donut/pfd/note/lateral"), 0) -end -if ((get(globalPropertyf("sim/time/local_time_sec")) - vt) < 5) and ((get(globalPropertyf("sim/time/local_time_sec")) - vt) > 0) then - set(globalPropertyf("donut/pfd/note/vertical"), 1) -else - set(globalPropertyf("donut/pfd/note/vertical"), 0) -end - -frame = frame + 1 - - - - - - -if not (su == "f") then - if get(globalPropertyf("donut/panels/MCP/at")) == 1 then - if get(globalPropertyf("sim/flightmodel/misc/h_ind")) < 400 then - - if not ((s == "l spd") or (s == "r spd") or (s == "spd")) then - if get(globalPropertyf("sim/flightmodel/position/indicated_airspeed")) > 80 then - set(globalPropertys("donut/pfd/fma/speed"), su .. "hold") - ln1t = 2 - else - set(globalPropertys("donut/pfd/fma/speed"), su .. "thr ref") - ln1t = 1 - rn1t = 1 - end - else - if get(globalPropertyf("sim/cockpit2/gauges/indicators/radio_altimeter_height_ft_pilot")) < 26 then - set(globalPropertys("donut/pfd/fma/speed"), su .. "idle") - ln1t = 0 - rn1t = 0 - else - set(globalPropertys("donut/pfd/fma/speed"), su .. "spd") - if ln1t == 2 then - ln1t = 1 - rn1t = 1 - end - end - end - - else - - if v == "vnav spd" then - set(globalPropertys("donut/pfd/fma/speed"), su .. "thr ref") - ln1t = 0.8 - rn1t = 0.8 - else if v == "flch spd" then - if get(globalPropertyf("sim/cockpit/autopilot/vertical_velocity")) > 0 then - set(globalPropertys("donut/pfd/fma/speed"), su .. "thr ref") - ln1t = 0.8 - rn1t = 0.8 - else - if (get(globalPropertyf("donut/eicas/ln1")) == 0) and (get(globalPropertyf("donut/eicas/rn1")) == 0) then - set(globalPropertys("donut/pfd/fma/speed"), su .. "hold") - ln1t = 2 - else - set(globalPropertys("donut/pfd/fma/speed"), su .. "idle") - if ln1t == 2 then - ln1t = 1 - rn1n1t = 1 - end - end - end - else - set(globalPropertys("donut/pfd/fma/speed"), su .. "spd") - if ln1t == 2 then - ln1t = 1 - rn1t = 1 - end - end - end - end - else - set(globalPropertys("donut/pfd/fma/speed"), "") - ln1t = 2 - end -else - set(globalPropertys("donut/pfd/fma/speed"), "") - ln1t = 2 -end - - - - - - - - - - - -if (get(globalPropertyf("sim/time/sim_speed")) > 0) then - if ((s == "l spd") or (s == "r spd") or (s == "spd")) then - if (get(globalPropertyf("sim/cockpit/autopilot/airspeed")) - get(globalPropertyf("sim/flightmodel/position/indicated_airspeed"))) > 5 then - if (get(globalPropertyf("sim/cockpit2/gauges/indicators/airspeed_acceleration_kts_sec_pilot")) - 3) / (-5) < 1 then - ln1t = (get(globalPropertyf("sim/cockpit2/gauges/indicators/airspeed_acceleration_kts_sec_pilot")) - 3) / (-5) - rn1t = (get(globalPropertyf("sim/cockpit2/gauges/indicators/airspeed_acceleration_kts_sec_pilot")) - 3) / (-5) - else - ln1t = 0.9 - rn1t = 0.9 - end - print(ln1t) - else - - if (get(globalPropertyf("sim/flightmodel/position/indicated_airspeed")) - get(globalPropertyf("sim/cockpit/autopilot/airspeed"))) > 5 then - - print(get(globalPropertyf("sim/flightmodel/position/indicated_airspeed")) - get(globalPropertyf("sim/cockpit/autopilot/airspeed"))) - if ln1t > 0 then - ln1t = ln1t - 0.02 - rn1t = rn1t - 0.02 - print(ln1t) - end - end - end - end - - if (frame % 2 == 0) then - if itob(get(globalPropertyf("donut/panels/MCP/lautothrottle"))) then - if (ln1t < 2) then - if get(globalPropertyf("donut/eicas/ln1")) < ln1t then - sasl.commandOnce(sasl.findCommand("sim/engines/throttle_up_1")) - end - if get(globalPropertyf("donut/eicas/ln1")) > ln1t then - sasl.commandOnce(sasl.findCommand("sim/engines/throttle_down_1")) - end - end - if not itob(get(globalPropertyf("donut/panels/MCP/rautothrottle"))) then - su = "l " - end - ln1a = get(globalPropertyf("donut/eicas/ln1")) - end - - if itob(get(globalPropertyf("donut/panels/MCP/rautothrottle"))) then - if (ln1t < 2) then - if get(globalPropertyf("donut/eicas/rn1")) < rn1t then - sasl.commandOnce(sasl.findCommand("sim/engines/throttle_up_2")) - end - - if get(globalPropertyf("donut/eicas/rn1")) > rn1t then - sasl.commandOnce(sasl.findCommand("sim/engines/throttle_down_2")) - end - end - if not itob(get(globalPropertyf("donut/panels/MCP/lautothrottle"))) then - su = "r " - else - su = "" - end - rn1a = get(globalPropertyf("donut/eicas/ln1")) - else - if not itob(get(globalPropertyf("donut/panels/MCP/lautothrottle"))) then - su = "f" - set(globalPropertyf("donut/panels/MCP/at"), 0) - end - end - else - if not (ln1a == get(globalPropertyf("donut/eicas/ln1"))) then - --sasl.commandOnce(sasl.findCommand("sim/autopilot/autothrottle_off")) - --ln1t = 2 - end - - if not (rn1a == get(globalPropertyf("donut/eicas/rn1"))) then - --sasl.commandOnce(sasl.findCommand("sim/autopilot/autothrottle_off")) - --ln1t = 2 - end - end -end - - - - -x = 0 -if get(globalPropertyf("sim/cockpit/autopilot/autopilot_mode")) > 0 then - if get(globalPropertyf("sim/cockpit2/gauges/indicators/radio_altimeter_height_ft_pilot")) < 50 then - set(globalPropertys("donut/pfd/fma/lateral"), "to ga") - else - - if (get(globalPropertyf("donut/panels/MCP/headinghld")) == 1) then - if (get(globalPropertyf("donut/panels/MCP/hdgtrk")) == 0) and (l == "trk hold") then - set(globalPropertys("donut/pfd/fma/lateral"), "hdg hold") - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading_sync")) - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading")) - l = "hdg hold" - else - if (not (get(globalPropertyf("donut/panels/MCP/hdgtrk")) == 0)) and (l == "hdg hold") then - set(globalPropertys("donut/pfd/fma/lateral"), "trk hold") - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading_sync")) - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading")) - l = "trk hold" - end - end - if (not (l == "hdg hold")) and (not (l == "trk hold")) then - set(globalPropertyf("donut/panels/MCP/headingsel"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/heading_mode"), 15) - set(globalPropertyf("sim/cockpit2/autopilot/nav_status"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/approach_status"), 0) - - if get(globalPropertyf("donut/panels/MCP/hdgtrk")) == 0 then - set(globalPropertys("donut/pfd/fma/lateral"), "hdg hold") - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading_sync")) - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading")) - l = "hdg hold" - else - set(globalPropertys("donut/pfd/fma/lateral"), "trk hold") - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading_sync")) - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading")) - l = "trk hold" - end - end - x = 1 - end - - if (get(globalPropertyf("donut/panels/MCP/headingsel")) == 1) then - if (get(globalPropertyf("donut/panels/MCP/hdgtrk")) == 0) and (l == "trk sel") then - set(globalPropertys("donut/pfd/fma/lateral"), "hdg sel") - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading")) - l = "hdg sel" - else - if (not (get(globalPropertyf("donut/panels/MCP/hdgtrk")) == 0)) and (l == "hdg sel") then - set(globalPropertys("donut/pfd/fma/lateral"), "trk sel") - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading")) - l = "trk sel" - end - end - if (not (l == "hdg sel")) and (not (l == "trk sel")) then - set(globalPropertyf("donut/panels/MCP/headinghld"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/heading_mode"), 15) - set(globalPropertyf("sim/cockpit2/autopilot/nav_status"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/approach_status"), 0) - - if get(globalPropertyf("donut/panels/MCP/hdgtrk")) == 0 then - set(globalPropertys("donut/pfd/fma/lateral"), "hdg sel") - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading")) - l = "hdg sel" - else - set(globalPropertys("donut/pfd/fma/lateral"), "trk sel") - sasl.commandOnce(sasl.findCommand("sim/autopilot/heading")) - l = "trk sel" - end - end - x = 1 - end - - if (get(globalPropertyf("sim/cockpit2/autopilot/nav_status")) == 2) then - if not (l == "loc") then - set(globalPropertyf("donut/panels/MCP/headinghld"), 0) - set(globalPropertyf("donut/panels/MCP/headingsel"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/heading_mode"), 15) - set(globalPropertyf("sim/cockpit2/autopilot/approach_status"), 0) - - set(globalPropertys("donut/pfd/fma/lateral"), "loc") - l = "loc" - end - x = 1 - end - if x == 0 then - set(globalPropertys("donut/pfd/fma/lateral"), "att") - l = "att" - end - - end - if (get(globalPropertyf("sim/flightmodel/misc/h_ind")) < 400) or ((get(globalPropertyf("sim/cockpit2/gauges/indicators/radio_altimeter_height_ft_pilot")) < 50) and ((s == "l spd") or (s == "r spd") or (s == "spd"))) then - if (get(globalPropertyf("sim/flightmodel/misc/h_ind")) < 400) then - set(globalPropertys("donut/pfd/fma/vertical"), "to ga") - else - set(globalPropertys("donut/pfd/fma/vertical"), "flare") - end - else - x = 0 - - if (get(globalPropertyf("donut/panels/MCP/flch")) == 1) then - if not (v == "flch spd") then - set(globalPropertyf("donut/panels/MCP/alts"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/altitude_mode"), 3) - set(globalPropertyf("donut/panels/MCP/vvis"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/approach_status"), 0) - set(globalPropertyf("donut/panels/MCP/vnav"), 0) - - - - set(globalPropertyf("sim/cockpit2/autopilot/vertical_velocity"), (get(globalPropertyf("sim/flightmodel/misc/h_ind")) - get(globalPropertyf("sim/cockpit/autopilot/altitude"))) / 2) - sasl.commandOnce(sasl.findCommand("sim/autopilot/vertical_speed")) - set(globalPropertys("donut/pfd/fma/vertical"), "flch spd") - end - x = 1 - end - - if (get(globalPropertyf("sim/cockpit2/autopilot/altitude_mode")) == 6) then - if not (v == "alt") then - set(globalPropertyf("donut/panels/MCP/alts"), 1) - set(globalPropertyf("donut/panels/MCP/flch"), 0) - set(globalPropertyf("donut/panels/MCP/vvis"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/approach_status"), 0) - set(globalPropertyf("donut/panels/MCP/vnav"), 0) - - set(globalPropertys("donut/pfd/fma/vertical"), "alt") - v = "alt" - end - x = 1 - end - - if (get(globalPropertyf("sim/cockpit2/autopilot/altitude_mode")) == 4) and (get(globalPropertyf("donut/panels/MCP/flch")) == 0) then - print(v) - if (get(globalPropertyf("donut/panels/MCP/vsfpa")) == 0) and (v == "fpa") then - set(globalPropertys("donut/pfd/fma/vertical"), "v s") - v = "v s" - else - if (not (get(globalPropertyf("donut/panels/MCP/vsfpa")) == 0) and (v == "v s")) then - set(globalPropertys("donut/pfd/fma/vertical"), "fpa") - v = "fpa" - end - end - if (not (v == "v s")) and (not (v == "fpa")) then - set(globalPropertyf("donut/panels/MCP/alts"), 0) - set(globalPropertyf("donut/panels/MCP/flch"), 0) - set(globalPropertyf("donut/panels/MCP/vvis"), 1) - set(globalPropertyf("sim/cockpit2/autopilot/approach_status"), 0) - set(globalPropertyf("donut/panels/MCP/vnav"), 0) - - if get(globalPropertyf("donut/panels/MCP/vsfpa")) == 0 then - set(globalPropertys("donut/pfd/fma/vertical"), "v s") - v = "v s" - else - set(globalPropertys("donut/pfd/fma/vertical"), "fpa") - v = "fpa" - end - end - x = 1 - end - - if (get(globalPropertyf("sim/cockpit2/autopilot/approach_status")) == 2) then - if not (v == "g s") then - set(globalPropertyf("donut/panels/MCP/alts"), 0) - set(globalPropertyf("sim/cockpit2/autopilot/altitude_mode"), 3) - set(globalPropertyf("donut/panels/MCP/flch"), 0) - set(globalPropertyf("donut/panels/MCP/vvis"), 0) - set(globalPropertyf("donut/panels/MCP/vnav"), 0) - - set(globalPropertys("donut/pfd/fma/vertical"), "g s") - v = "g s" - end - x = 1 - end - if x == 0 then - set(globalPropertys("donut/pfd/fma/vertical"), "") - v = "" - end - end -else - set(globalPropertys("donut/pfd/fma/lateral"), "") - set(globalPropertys("donut/pfd/fma/vertical"), "") -end - -if get(globalPropertyf("sim/cockpit2/gauges/indicators/radio_altimeter_height_ft_pilot")) > 10 then - if get(globalPropertyf("sim/cockpit2/gauges/indicators/radio_altimeter_height_ft_pilot")) < 11 then - x = get(globalPropertyf("xfmc/airbus/V2")) or 110 - set(globalPropertyf("sim/cockpit/autopilot/airspeed"), get(x) + 15) - sasl.commandOnce(sasl.findCommand("sim/autopilot/level_change")) - end -end - - -end -- end update - diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Fuel.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Fuel.lua deleted file mode 100755 index ea0b03b..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Fuel.lua +++ /dev/null @@ -1,64 +0,0 @@ --- System_Fuel.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - - - - -function itob (input) -- int to boolean -if input == 0 then -return false -end -return true -end -- end int to boolean - -function update () - -fwdcrossfeed = itob(get(globalPropertyf("donut/panels/overhead/fuel/fwdcrossfeed"))) -aftcrossfeed = itob(get(globalPropertyf("donut/panels/overhead/fuel/aftcrossfeed"))) - -set(globalPropertyf("donut/fuel/qtyl"), get(globalPropertyfae("sim/cockpit2/fuel/fuel_quantity", 2)) * 2.221 / 1000) -set(globalPropertyf("donut/fuel/qtyc"), get(globalPropertyfae("sim/cockpit2/fuel/fuel_quantity", 1)) * 2.221 / 1000) -set(globalPropertyf("donut/fuel/qtyr"), get(globalPropertyfae("sim/cockpit2/fuel/fuel_quantity", 3)) * 2.221 / 1000) - --- c "donut/fuel/qtyl" ---c "donut/fuel/qtyc" ---c "donut/fuel/qtyr" - -lfwdpump = itob(get(globalPropertyf("donut/panels/overhead/fuel/lfwdpump"))) -laftpump = itob(get(globalPropertyf("donut/panels/overhead/fuel/laftpump"))) - -rfwdpump = itob(get(globalPropertyf("donut/panels/overhead/fuel/rfwdpump"))) -raftpump = itob(get(globalPropertyf("donut/panels/overhead/fuel/raftpump"))) - -lcentrepump = itob(get(globalPropertyf("donut/panels/overhead/fuel/lcentrepump"))) -rcentrepump = itob(get(globalPropertyf("donut/panels/overhead/fuel/rcentrepump"))) - -fwdcrossfeed = aftcrossfeed or fwdcrossfeed -- is any of the buttons on? -lfwdpump = laftpump or lfwdpump -rfwdpump = raftpump or rfwdpump -lcentrepump = rcentrepump or lcentrepump - -select = 4 - - -if fwdcrossfeed then -tanklQty = get(globalPropertyfae("sim/cockpit2/fuel/fuel_quantity", 2)) -tankrQty = get(globalPropertyfae("sim/cockpit2/fuel/fuel_quantity", 3)) - -if math.abs((tanklQty - tankrQty)) < 100 then -select = 4 -else -select = ((tanklQty > tankrQty) and 3) or 1 -end -- end if - -end -- end if - -set(globalPropertyi("sim/cockpit/engine/fuel_tank_selector"), select) -set(globalPropertyiae("sim/cockpit2/fuel/fuel_tank_pump_on", 1), lcentrepump and 1 or 0) -set(globalPropertyiae("sim/cockpit2/fuel/fuel_tank_pump_on", 2), lfwdpump and 1 or 0) -set(globalPropertyiae("sim/cockpit2/fuel/fuel_tank_pump_on", 3), rfwdpump and 1 or 0) -end -- end update - diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Radio.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Radio.lua deleted file mode 100755 index b02abe3..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/System_Radio.lua +++ /dev/null @@ -1,147 +0,0 @@ --- System_Radio.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - - - -radio1_mode = 1 -hfsens1_mode = false -acp1_mode = 0 - -timer = {} -radios = {} -radioa = {} -for i = 1, 6, 1 do -radioa[i] = 110 -radios[i] = 110 -timer[i] = 0 -end -hfsens = 75 -com1 = 0 -com2 = 0 -frame = 0 - - - -function itob (input) -- int to boolean -if input == 0 then -return false -end -return true -end -- end int to boolean - -function update () - -if itob(get(globalPropertyi("donut/panels/pedestal/panel1/radio/toggle"))) then -if not hfsens1_mode then -set(globalPropertyf("donut/radio1a"), radioa[radio1_mode]) --For HF sensitivity, use a value less than one for A not S radio -set(globalPropertyf("donut/radio1s"), radios[radio1_mode]) -else -set(globalPropertyf("donut/radio1a"), hfsens / 1000) --For HF sensitivity, use a value less than one for A not S radio -set(globalPropertyf("donut/radio1s"), 0) -end - -if not com1 == get(globalPropertyi("sim/cockpit/radios/com1_freq_hz")) then -radioa[1] = get(globalPropertyi("sim/cockpit/radios/com1_freq_hz") / 100) -end -if not com2 == get(globalPropertyi("sim/cockpit/radios/com2_freq_hz")) then -radioa[3] = get(globalPropertyi("sim/cockpit/radios/com2_freq_hz") / 100) -end - - - -com1 = get(globalPropertyi("sim/cockpit/radios/com1_freq_hz")) -com2 = get(globalPropertyi("sim/cockpit/radios/com2_freq_hz")) -set(globalPropertyf("sim/cockpit/radios/com1_freq_hz"), math.floor(radioa[1] * 100)) -set(globalPropertyf("sim/cockpit/radios/com1_freq_hz"), math.floor(radioa[3] * 100)) - -set(globalPropertyf("sim/cockpit/radios/com1_freq_hz"), radioa[3]) - -else -set(globalPropertyf("donut/radio1a"), 0) --For HF sensitivity, use a value less than one for A not S radio -set(globalPropertyf("donut/radio1s"), 0) - -end - -set(globalPropertyf("donut/radio2a"), 1) -set(globalPropertyf("donut/radio2s"), 1) -set(globalPropertyf("donut/radio3a"), 1) -set(globalPropertyf("donut/radio3s"), 1) -set(globalPropertyf("donut/transponder"), 1) - -radios[radio1_mode] = math.floor(get(globalPropertyf("donut/panels/pedestal/panel1/radioIn"))) + (math.floor(get(globalPropertyf("donut/panels/pedestal/panel1/radioOut")) / 1000 + 108)) -if not get(globalPropertyf("donut/panels/pedestal/panel1/hfsens")) == hfsens then -hfsens1_mode = true -if frame % 5 == 0 then -timer[1] = get(globalPropertyf("sim/time/zulu_time_sec")) -end -end - -if frame % 5 == 0 then -if get(globalPropertyf("sim/time/zulu_time_sec")) > timer[1] + 3 then -hfsens1_mode = false -end -end - -hfsens = get(globalPropertyf("donut/panels/pedestal/panel1/hfsens")) - -get(globalPropertyi("donut/panels/pedestal/panel1/radio/dual")) - -if itob(get(globalPropertyi("donut/panels/pedestal/panel1/radio/standby"))) then -radioa[radio1_mode] = radios[radio1_mode] -set(globalPropertyf("donut/panels/pedestal/panel1/radioIn"), radios[radio1_mode] - math.floor(radios[radio1_mode])) -set(globalPropertyf("donut/panels/pedestal/panel1/radioOut"), radios[radio1_mode]) -end - -if itob(get(globalPropertyi("donut/panels/pedestal/panel1/radio/lvhf"))) then -radio1_mode = 1 - -set(globalPropertyf("donut/panels/pedestal/panel1/radioIn"), radios[radio1_mode] - math.floor(radios[radio1_mode])) -set(globalPropertyf("donut/panels/pedestal/panel1/radioOut"), radios[radio1_mode]) -end -if itob(get(globalPropertyi("donut/panels/pedestal/panel1/radio/cvhf"))) then -radio1_mode = 2 - -set(globalPropertyf("donut/panels/pedestal/panel1/radioIn"), radios[radio1_mode] - math.floor(radios[radio1_mode])) -set(globalPropertyf("donut/panels/pedestal/panel1/radioOut"), radios[radio1_mode]) -end -if itob(get(globalPropertyi("donut/panels/pedestal/panel1/radio/rvhf"))) then -radio1_mode = 3 - -set(globalPropertyf("donut/panels/pedestal/panel1/radioIn"), radios[radio1_mode] - math.floor(radios[radio1_mode])) -set(globalPropertyf("donut/panels/pedestal/panel1/radioOut"), radios[radio1_mode]) -end -if itob(get(globalPropertyi("donut/panels/pedestal/panel1/radio/lhf"))) then -radio1_mode = 4 - -set(globalPropertyf("donut/panels/pedestal/panel1/radioIn"), radios[radio1_mode] - math.floor(radios[radio1_mode])) -set(globalPropertyf("donut/panels/pedestal/panel1/radioOut"), radios[radio1_mode]) -end -if itob(get(globalPropertyi("donut/panels/pedestal/panel1/radio/rhf"))) then -radio1_mode = 5 - -set(globalPropertyf("donut/panels/pedestal/panel1/radioIn"), radios[radio1_mode] - math.floor(radios[radio1_mode])) -set(globalPropertyf("donut/panels/pedestal/panel1/radioOut"), radios[radio1_mode]) -end -if itob(get(globalPropertyi("donut/panels/pedestal/panel1/radio/am"))) then -radio1_mode = 6 - -set(globalPropertyf("donut/panels/pedestal/panel1/radioIn"), radios[radio1_mode] - math.floor(radios[radio1_mode])) -set(globalPropertyf("donut/panels/pedestal/panel1/radioOut"), radios[radio1_mode]) -end - -set(globalPropertyi("donut/panels/pedestal/panel1/radio/lvhf"), 0) -set(globalPropertyi("donut/panels/pedestal/panel1/radio/cvhf"), 0) -set(globalPropertyi("donut/panels/pedestal/panel1/radio/rvhf"), 0) -set(globalPropertyi("donut/panels/pedestal/panel1/radio/lhf"), 0) -set(globalPropertyi("donut/panels/pedestal/panel1/radio/rhf"), 0) -set(globalPropertyi("donut/panels/pedestal/panel1/radio/am"), 0) - -frame = frame + 1 - - - -end -- end update - diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Data.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Data.lua deleted file mode 100755 index 3a24bb0..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Data.lua +++ /dev/null @@ -1,356 +0,0 @@ --- _Main_Datarefs.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - -local y = 0 -local a = 0 -local coldDark = {} -local frame = 0 -local alphabet = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o"} - -function d (name, default, onColdDark) -- creates dataref - default = default or 1.0 - coldDark[a] = onColdDark - - defineProperty("x" .. a, createGlobalPropertyf(name, default, false, true)) - a = a + 1 - -end -- end c - -function di(name, default, onColdDark) -- creates dataref as int - default = default or 1.0 - coldDark[a] = onColdDark - - defineProperty("x" .. a, createGlobalPropertyi(name, default, false, true)) - a = a + 1 - -end -- end ci - -function da(name, length) -- creates an array for similar variables - for i = 0, length, 1 do - d (name .. i, 0) - - - end -- end for -end -- end ca - -function ds(name) -- creates string dataref - defineProperty("x" .. a, createGlobalPropertys(name, "", false, true)) - a = a + 1 - -end -- end cs - -for i = 1, 12, 1 do -- defines EICAS datarefs (189) - - ds ("donut/eicasmsg/" .. i) - ds ("donut/eicasmsg/" .. i .. "/r") - ds ("donut/eicasmsg/" .. i .. "/w") - - - - -end -- end for loop - - - -if get(globalPropertyf("sim/time/total_flight_time_sec")) > 1 then -createGlobalPropertyf("donut/a", 1, false, true) -else -createGlobalPropertyf("donut/a", 0, false, true) -end - -function update () - - if frame < 10 then - - set(globalPropertyf("sim/flightmodel/misc/cgz_ref_to_default"), 0.736332) - set(globalPropertyi("sim/cockpit/engine/APU_switch"), 0) - - for i = 1, table.getn(coldDark), 1 do - set("x" .. i, coldDark[i]) - end - frame = 1 - end -- end if - - if get(globalPropertyi("sim/time/sim_speed")) > 0 and get(globalPropertyf("sim/time/total_flight_time_sec")) > 1 and get(globalPropertyf("sim/time/total_flight_time_sec")) < 1.05 and y == 0 then - y = 1 - --sasl.reloadPlugins() - --sasl.commandOnce(sasl.findCommand("sasl/reload/AE")) - end - -end -- end update - -d ("donut/a", 0) -d "donut/m" - -d "donut/engine/aero" - - -di ("donut/copyrightmessage", 0) -d "donut/custom/alt" - -d "donut/eicas/white" --How many white are displayed on eicas -d "donut/eicas/customegt" --Custom EGT for startup -d "donut/eicas/customegt1" --Custom EGT for startup -d "donut/eicas/customn1" --Custom N1 for startup -d "donut/eicas/customn11" --Custom N1 for startup -d "donut/eicas/ln1" -d "donut/eicas/rn1" -d "donut/eicas/ln1show" -d "donut/eicas/rn1show" -d "donut/eicas/ln1show2" -d "donut/eicas/rn1show2" - -d "donut/fuel/qtyl" -d "donut/fuel/qtyc" -d "donut/fuel/qtyr" -d "donut/eng/vibl" -d "donut/eng/vibr" -di ("donut/eng/oql", 25) -di ("donut/eng/oqr", 25) -di ("donut/eng/egtstrtl", 700) -di ("donut/eng/egtstrtr", 700) - -d "donut/panel/cross" --Fuel crossfeed button out -d "donut/panel/fuel1" --Fuel switch 1 -d "donut/panel/fuel2" --Fuel switch 2 -d "donut/panel/throttle_column/fuel_control_switch_l_pos" -d "donut/panel/throttle_column/fuel_control_switch_r_pos" -d "donut/panel/gear" --Gear Lever - - - -d "donut/panels/MCP/speed" -d "donut/panels/MCP/heading" -d "donut/panels/MCP/vertical" -di "donut/panels/MCP/altitudexorm" -d "donut/panels/MCP/altitude" -di "donut/panels/MCP/lautothrottle" -di "donut/panels/MCP/rautothrottle" -di "donut/panels/MCP/headingsel" -di "donut/panels/MCP/headinghld" -di "donut/panels/MCP/lnav" -di "donut/panels/MCP/vnav" -di "donut/panels/MCP/clbcon" -di "donut/panels/MCP/flchs" -di "donut/panels/MCP/vvis" -di "donut/panels/MCP/alts" -di ("donut/panels/MCP/at", 0) -di ("donut/panels/MCP/flch", 0) - -di "donut/panels/MCP/fd" -di ("donut/panels/MCP/ap", 0) - - -di ("donut/panels/MCP/iasmach", 0) -di ("donut/panels/MCP/hdgtrk", 0) -di ("donut/panels/MCP/vsfpa", 0) -di ("donut/panels/MCP/apdisconnect", 0) - - - -di "donut/panels/EFIS/min" -di ("donut/panels/EFIS/knobmin", 40) -di ("donut/panels/EFIS/rst", 0) -di "donut/panels/EFIS/baro" -di ("donut/panels/EFIS/knobbaro", 50) -di ("donut/panels/EFIS/std", 0) -di ("donut/panels/EFIS/FPV", 0) -di ("donut/panels/EFIS/MTRS", 0) -di "donut/panels/EFIS/vorl" -di "donut/panels/EFIS/vorr" -di "donut/panels/EFIS/mapmode" -di "donut/panels/EFIS/ctr" -di "donut/panels/EFIS/mapzoom" -di "donut/panels/EFIS/tfc" - - - -da ("donut/panels/pedestal/panel1/mic/mic", 10) -- -da ("donut/panels/pedestal/panel1/mic/recieve", 12) -- -da ("donut/panels/pedestal/panel1/mic/push", 12) -- -da ("donut/panels/pedestal/panel1/mic/turn", 12) -- - -da ("donut/panels/pedestal/panel2/mic/mic", 10) -- -da ("donut/panels/pedestal/panel2/mic/recieve", 12) -- -da ("donut/panels/pedestal/panel2/mic/push", 12) -- -da ("donut/panels/pedestal/panel2/mic/turn", 12) -- - - - -d "donut/panels/overhead/computer/adiru" -d "donut/panels/overhead/computer/thrustasymcomp" -d "donut/panels/overhead/computer/primaryflightcomputers" - -d "donut/panels/overhead/electrical/ifepassseats" -d "donut/panels/overhead/electrical/cabinutility" -d "donut/panels/overhead/electrical/lbustie" -d "donut/panels/overhead/electrical/rbustie" -d ("donut/panels/overhead/electrical/ldrivedisc", 0) -d ("donut/panels/overhead/electrical/rdrivedisc", 0) -d ("donut/panel/ExtpwrPRI", 0) --primary external power -d ("donut/panel/ExtpwrSEC", 0) --secondary external power -d "donut/panel/ExtpwrPRIavail" --primary external power avail? -d "donut/panel/ExtpwrSECavail" --secondary external power avail? -d "donut/panels/overhead/electrical/lbackupgen" -d "donut/panels/overhead/electrical/rbackupgen" - -di "donut/panels/overhead/lwiper/lwiper" - -d "donut/panels/overhead/abvhyd/emerlights" -d "donut/panels/overhead/abvhyd/servintph" -d "donut/panels/overhead/abvhyd/lsidewindowheat" -d "donut/panels/overhead/abvhyd/lfwdwindowheat" -d "donut/panels/overhead/abvhyd/rfwdwindowheat" -d "donut/panels/overhead/abvhyd/rsidewindowheat" - -d "donut/panels/overhead/hyd/ramairturbine" -d "donut/panel/hydLPRI" --primary hydraulics -d "donut/panel/hydC1PRI" --primary hydraulics -d "donut/panel/hydC2PRI" --primary hydraulics -d "donut/panel/hydRPRI" --primary hydraulics -di "donut/panel/hydLDEM" --demand hydraulics -di "donut/panel/hydC1DEM" --demand hydraulics -di "donut/panel/hydC2DEM" --demand hydraulics -di "donut/panel/hydRDEM" --demand hydraulics - -d "donut/panels/overhead/lights/ovhd" -d "donut/panels/overhead/lights/cb" -d "donut/panels/overhead/lights/dome" -d "donut/panels/overhead/lights/storm" -d "donut/panels/overhead/lights/masterbright" -d "donut/panels/overhead/lights/glareshieldpnl" -d "donut/panels/overhead/lights/flood" -d "donut/panels/overhead/lights/llanding" -d "donut/panels/overhead/lights/nlanding" -d "donut/panels/overhead/lights/rlanding" - -d "donut/fltctr/flaperondefl" -d "donut/fltctr/flaperondefr" - -d "donut/panels/overhead/engine/fwdarm" -d "donut/panels/overhead/engine/aftarm" -d "donut/panels/overhead/engine/disch" -d "donut/panels/overhead/engine/fireovhttest" -d "donut/panels/overhead/engine/autostart" -di ("donut/panel/start1", 0) --Starter 1 -di ("donut/panel/start2", 0) --Starter 2 - -d "donut/panels/overhead/fuel/lnozzle" -d "donut/panels/overhead/fuel/rnozzle" -d "donut/panels/overhead/fuel/arm" -d "donut/panels/overhead/fuel/lfwdpump" -d "donut/panels/overhead/fuel/laftpump" -d ("donut/panels/overhead/fuel/fwdcrossfeed", 0) -d ("donut/panels/overhead/fuel/aftcrossfeed", 0) -d "donut/panels/overhead/fuel/rfwdpump" -d "donut/panels/overhead/fuel/raftpump" -d "donut/panels/overhead/fuel/lcentrepump" -d "donut/panels/overhead/fuel/rcentrepump" - -d "donut/panels/overhead/antiice/icewing" -d "donut/panels/overhead/antiice/icelengine" -d "donut/panels/overhead/antiice/icerengine" -d "donut/panels/overhead/antiice/beacon" -d "donut/panels/overhead/antiice/nav" -d "donut/panels/overhead/antiice/logo" -d "donut/panels/overhead/antiice/wing" -d "donut/panels/overhead/antiice/indlts" -d "donut/panels/overhead/antiice/lrunwayturnoff" -d "donut/panels/overhead/antiice/rrunwayturnoff" -d "donut/panels/overhead/antiice/taxi" -d "donut/panels/overhead/antiice/strobe" - -d "donut/panels/overhead/airconditioning/equipcooling" -d "donut/panels/overhead/airconditioning/upper" -d "donut/panels/overhead/airconditioning/lower" -d "donut/panels/overhead/airconditioning/fltdecktemp" -d "donut/panels/overhead/airconditioning/cabintemp" -d "donut/panels/overhead/airconditioning/aircondreset" -d "donut/panels/overhead/airconditioning/lpack" -d "donut/panels/overhead/airconditioning/ltrimair" -d "donut/panels/overhead/airconditioning/rtrimair" -d "donut/panels/overhead/airconditioning/rpack" - -d "donut/panels/overhead/bleedair/lisln" -d "donut/panels/overhead/bleedair/cisln" -d "donut/panels/overhead/bleedair/risln" -d "donut/panel/bleedL" --Bleed air -d "donut/panel/bleedR" --Bleed air -d "donut/panel/bleedAPU" --Bleed air -d "donut/panels/overhead/bleedair/fwdoutflowvalve" -d "donut/panels/overhead/bleedair/aftoutflowvalve" -d "donut/panels/overhead/bleedair/ldgalt" -d "donut/panels/overhead/bleedair/fwdmanual" -d "donut/panels/overhead/bleedair/aftmanual" - -di "donut/panels/overhead/rwiper/rwiper" - - - -d "donut/pfd/aoa" --angle of attack -d "donut/pfd/fup" --flaps up bug -d "donut/pfd/f1" --flaps 1 -d "donut/pfd/f5" --flaps 5 -d "donut/pfd/f15" --flaps 15 -d "donut/pfd/v1" --v1 bug -d "donut/pfd/vr" --vr -d "donut/pfd/vrf" --vrf -d "donut/pfd/v2" --v2 -d "donut/pfd/apprfl" --FMd approach flaps -d "donut/pfd/apprsp" --FMd approach speed -d "donut/pfd/altro" --for altitude rolling tickmarks (altitude / 10) -d "donut/pfd/spdro" --for speed rolling indicator - -ds "donut/pfd/fma/speed" -ds "donut/pfd/fma/lateral" -ds "donut/pfd/fma/vertical" -ds "donut/pfd/eicas/trm" --odd choice of path, the thrust reference mode - -d "donut/mcp/spd" -d "donut/mcp/hdg" -d "donut/mcp/vv" -d "donut/mcp/alt" - -d "donut/radio1a" --For HF sensitivity, use a value less than one for A not S radio -d "donut/radio1s" -d "donut/radio2a" -d "donut/radio2s" -d "donut/radio3a" -d "donut/radio3s" -d "donut/transponder" - -d "donut/panels/pedestal/panel1/radioIn" -di "donut/panels/pedestal/panel1/radioOut" -d ("donut/panels/pedestal/panel1/hfsens", 75) - -di "donut/panels/pedestal/panel1/radio/dual" -di "donut/panels/pedestal/panel1/radio/standby" -di "donut/panels/pedestal/panel1/radio/lvhf" -di "donut/panels/pedestal/panel1/radio/cvhf" -di "donut/panels/pedestal/panel1/radio/rvhf" -di "donut/panels/pedestal/panel1/radio/lhf" -di "donut/panels/pedestal/panel1/radio/toggle" -di "donut/panels/pedestal/panel1/radio/rhf" -di "donut/panels/pedestal/panel1/radio/am" - - -di "donut/pfd/note/mode" -di "donut/pfd/note/spd" -di "donut/pfd/note/alt" -di "donut/pfd/note/vspd" -di "donut/pfd/note/radioalt" -di "donut/pfd/note/speed" -di "donut/pfd/note/lateral" -di "donut/pfd/note/vertical" - -di "donut/pfd/minmode" -d "donut/pfd/barodisplay" - -di "donut/panels/efis/sta" -di "donut/panels/efis/wpt" -di "donut/panels/efis/pos" -di "donut/panels/efis/data" -di "donut/panels/efis/terr" diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Datarefs.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Datarefs.lua deleted file mode 100644 index 58c7f81..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Datarefs.lua +++ /dev/null @@ -1,6 +0,0 @@ --- _Main_Datarefs.lua -- --- Chai112 Boeing 777-300ER 1-06-018 - --- Script Version 1.0.0 --- Aircraft Version 0.40.0 - diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Sound.lua b/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Sound.lua deleted file mode 100755 index a7b5c12..0000000 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/Custom Module/_Main_Sound.lua +++ /dev/null @@ -1,190 +0,0 @@ --- reverse_thrust.lua -- --- Steve Wilson 8-10-2013 - --- 0.1 Initial Release - -volume_ratio = 0.7 -- set this value to taste or to match your X-Plane engines volume setting. -number_of_engines = 8 -- this can stay at 8, but for efficiency (frames count!) adjust to the correct value - -- for your aircraft - - --- **************** NOTE **************** --- This script uses the stock X-Plane afterburner sound with a bit of a tweak. If using a different sound, then modify the sound file name and path as well as --- other sound functions accordingly. --- **************** NOTE **************** - --- first we must find the sound since we don't know for sure what directory the aircraft folder is stored in --- normally it's something like X-Plane/aircraft/aircraft_name --- or X-Plane/aircraft/aircraft_type/aircraft_name --- but we don't know, so we have to hunt a bit... - --- we start searching buried two folders deeper than the X-Plane/aircraft folder, one folder deeper than normal - -asound_file = moduleDirectory.."/configuration/widgetResources/eng_max.wav" -bsound_file = moduleDirectory.."/configuration/widgetResources/eng_mid.wav" -csound_file = moduleDirectory.."/configuration/widgetResources/eng_idle.wav" -nsound_file = moduleDirectory.."/configuration/widgetResources/eng_n2.wav" - --- if the user has their aircraft folder in a really arcane location, this ain't gonna produce any sound. Sorry! - --- sound resources and array initialization - -s_Reverse = {} -- sound sample -al = 0 -bl = 0 -cl = 0 -ar = 0 -br = 0 -cr = 0 -n1 = {} -- engine n1 value read from dataref -n2 = {} -- engine n1 value read from dataref -rev = {} -- reverser deployment ratio -rev_gain = {} -- loudness of reverser - -for i = 1,2 do - al = loadSample(asound_file) - bl = loadSample(bsound_file) - cl = loadSample(csound_file) - nl = loadSample(nsound_file) - ar = loadSample(asound_file) - br = loadSample(bsound_file) - cr = loadSample(csound_file) - nr = loadSample(nsound_file) - - --setSamplePitch(s_Reverse[i],500) -- lower the pitch of the afterburner sound. Deeper rumble. - setSampleEnv (al, SOUND_EVERYWHERE) -- just like X-Plane, use the same sound inside and out -- initalize at zero volume since we build the sound as the reverser deploys - setSampleEnv (bl, SOUND_EVERYWHERE) -- just like X-Plane, use the same sound inside and out - setSampleEnv (cl, SOUND_EVERYWHERE) -- just like X-Plane, use the same sound inside and out - setSampleEnv (nl, SOUND_EVERYWHERE) - setSampleEnv (ar, SOUND_EVERYWHERE) -- just like X-Plane, use the same sound inside and out -- initalize at zero volume since we build the sound as the reverser deploys - setSampleEnv (br, SOUND_EVERYWHERE) -- just like X-Plane, use the same sound inside and out - setSampleEnv (cr, SOUND_EVERYWHERE) - setSampleEnv (nr, SOUND_EVERYWHERE) - n1[i] = 0 - rev[i] = 0 - rev_gain[i] = 0 -end - ----- input datarefs array values would be cleaner, but this is a limitation of SASL -defineProperty("x", createGlobalPropertyf("donut/m", 1.0)) - -defineProperty("n1val_1", globalPropertyfae("sim/flightmodel/engine/ENGN_N1_", 1)) -defineProperty("n1val_2", globalPropertyfae("sim/flightmodel/engine/ENGN_N1_", 2)) - -defineProperty("n2val_1", globalPropertyfae("sim/flightmodel/engine/ENGN_N2_", 1)) -defineProperty("n2val_2", globalPropertyfae("sim/flightmodel/engine/ENGN_N2_", 2)) - - - -function update () - --- read datarefs for this frame - - set(x, 7.0) - - n1[1] = get (n1val_1) - n1[2] = get (n1val_2) - - n2[1] = get (n2val_1) - n2[2] = get (n2val_2) - - rev[1] = 1 - rev[2] = 1 - - reverse() -- make some noise - -end -- function update - -function reverse() - - for i = 1, 2 do - - rev_gain[i] = .01 * n1[i] * rev[i] * 1000 * volume_ratio -- as the reverser deploys, N1 is increasing. - -- both factors affect played volume as a ratio of max volume and - -- the configured volume ratio - - --if isSamplePlaying(s_Reverse[i]) then -- if the sample is playing, set it to the current gain value - setSampleGain(bl,((math.deg(math.sin (((n1[1]-30)*0.0729) + 4.7175))*2)+111) * 20*get(globalPropertyf("sim/operation/sound/engine_volume_ratio"))) - setSampleGain(al,1200 - (((math.deg(math.sin (((n1[1] - 33) * 0.01 * 1)/(0.05 * 3.145))) + (3.145)) + 1) * 10 - 1100) + 200) - setSampleGain(nl,(n2[1] - 50) * get(globalPropertyf("sim/operation/sound/engine_volume_ratio")) * 20) - if n1[1] > 50 then - setSampleGain(al,(2500 - ((math.deg(math.sin (((n1[1]-20)*0.0729) + 4.7175))*2)+111) * 20+1000)*0.1*get(globalPropertyf("sim/operation/sound/engine_volume_ratio"))) - else - setSampleGain(al,0) - --setSampleGain(al, (1 - math.deg(math.sin (((n1[1] - 21) * 0.01 * get(globalPropertyf("sim/operation/sound/engine_volume_ratio")))/0.05) + (3.145 * 1.5))) * 100) - end - if n1[1] < 70 then - setSampleGain(cl, (2500 - ((math.deg(math.sin (((n1[1]-20)*0.0629) + 4.7175))*2)+111) * 20+1000)*0.001*n1[1]*get(globalPropertyf("sim/operation/sound/engine_volume_ratio"))) - else - setSampleGain(cl,0) - end - setSamplePitch(nl,n2[1] * 10-10) - setSamplePitch(al,n1[1] * 4 + 600) - setSamplePitch(bl,n1[1] * 15) - - setSampleGain(br,((math.deg(math.sin (((n1[2]-30)*0.0729) + 4.7175))*2)+111) * 20*get(globalPropertyf("sim/operation/sound/engine_volume_ratio"))) - setSampleGain(ar,1200 - (((math.deg(math.sin (((n1[2] - 33) * 0.01 * 1)/(0.05 * 3.145))) + (3.145)) + 1) * 10 - 1100) + 200) - if n1[2] > 50 then - setSampleGain(ar,(2500 - ((math.deg(math.sin (((n1[2]-20)*0.0729) + 4.7175))*2)+111) * 20+1000)*0.1*get(globalPropertyf("sim/operation/sound/engine_volume_ratio"))) - else - setSampleGain(ar,0) - --setSampleGain(ar, (1 - math.deg(math.sin (((n1[2] - 21) * 0.01 * get(globarPropertyf("sim/operation/sound/engine_volume_ratio")))/0.05) + (3.145 * 1.5))) * 100) - end - if n1[2] < 70 then - setSampleGain(cr, (2500 - ((math.deg(math.sin (((n1[2]-20)*0.0629) + 4.7175))*2)+111) * 20+1000)*0.001*n1[2]*get(globalPropertyf("sim/operation/sound/engine_volume_ratio"))) - else - setSampleGain(cr,0) - end - setSamplePitch(ar,n1[2] * 4 + 600) - setSamplePitch(br,n1[2] * 15) - --end - - -- if rev_gain[i] > 0 then --This is test code, good to enable if you don't hear anything. - -- logInfo ("Should be playing sound here.") - -- end - - if rev_gain[i] > 0 then -- if the gain value is greater than zero, we should be playing sound. correct as needed - if (get(globalPropertyf("sim/time/sim_speed")) > 0) and (get(globalPropertyi("sim/operation/sound/sound_on")) > 0) then - if not isSamplePlaying(al) then - playSample(al, 1) - end - if not isSamplePlaying(bl) then - playSample(bl, 1) - end - if not isSamplePlaying(cl) then - playSample(cl, 1) - end - if not isSamplePlaying(nl) then - playSample(nl, 1) - end - if not isSamplePlaying(ar) then - playSample(ar, 1) - end - if not isSamplePlaying(br) then - playSample(br, 1) - end - if not isSamplePlaying(cr) then - playSample(cr, 1) - end - end - end - if (get(globalPropertyf("sim/time/sim_speed")) == 0) then -- once the reverser is completely retracted, it zeroes out the gain and we can stop - stopSample (al) -- playing sound - stopSample (bl) - stopSample (cl) - stopSample (nl) - stopSample (ar) -- playing sound - stopSample (br) - stopSample (cr) - end - if rev_gain[i] == 0 then - end - end - -end - --- That about does it. See the readme if you have any questions. Thanks to Dan Klaue and Dozer for their fine examples that helped --- me get this far. Cheers! - Steve Wilson, August 2013 - - - diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/configurationExample.ini b/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/configurationExample.ini index 52e1885..e68fe0b 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/configurationExample.ini +++ b/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/configurationExample.ini @@ -1,25 +1,21 @@ -####################### SASL PROJECT CONFIGURATION ######################## +#################### SASL PROJECT CONFIGURATION #################### -# This file is used to configure SASL project. +# This file is SASL project configuration -##################################################################### -##################################################################### -##################################################################### +############################################################## -# This section is used for common project setup +# This section will be used for general project setup [project] id=0 - name=AE + name=Example type=0 startDisabled=0 widget=1 -##################################################################### -##################################################################### -##################################################################### +############################################################## -# This section is used for scenery project setup, if [project].type is equal to 1 (scenery project) +# This section will be used for scenery project setup, if [project].type is equal to 1 (scenery project) [sceneryProject] centerLatitude=0.0000000 @@ -27,11 +23,9 @@ maxElevation=0.0 radius=0.0 -##################################################################### -##################################################################### -##################################################################### +############################################################## -# This section is used to configure SASL widget +# This section will be used to configure SASL Developer widget, if [project].widget is equal to 1 (enabled) [widget] font=SourceCodePro.ttf @@ -57,6 +51,4 @@ logErrorColorB=0.0 logErrorColorA=1.0 -##################################################################### -##################################################################### -##################################################################### \ No newline at end of file +############################################################## \ No newline at end of file diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_idle.wav b/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_idle.wav deleted file mode 100755 index cef3e5a..0000000 Binary files a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_idle.wav and /dev/null differ diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav b/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav deleted file mode 100755 index 8c00584..0000000 Binary files a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav and /dev/null differ diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_mid.wav b/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_mid.wav deleted file mode 100755 index b0ec6b6..0000000 Binary files a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_mid.wav and /dev/null differ diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_n2.wav b/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_n2.wav deleted file mode 100755 index f94f699..0000000 Binary files a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/widgetResources/eng_n2.wav and /dev/null differ diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/wprefs.ini b/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/wprefs.ini index 8cb378f..f9a57c0 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/wprefs.ini +++ b/src/base/B777-300ER/plugins/SASLFree/data/modules/configuration/wprefs.ini @@ -1,20 +1,17 @@ [widget] -originX=381 -originY=-18 -telemetryWidth=600 -telemetryHeight=450 +fontSize=12 +originX=-19 +originY=100 +width=1277 +height=509 +originXOs=0 +originYOs=0 +widthOs=0 +heightOs=0 +selectedTab=1 +popout=false +show=false telemetryEnabled=false -consoleWidth=1147 -consoleHeight=543 -projectTreeWidth=800 -projectTreeHeight=800 projectTreeActive=false projectTreeShowStandardComponents=false projectTreeShowFunctions=false -datarefsWidth=800 -datarefsHeight=800 -commandsWidth=800 -commandsHeight=800 -aboutWidth=600 -aboutHeight=450 -syncTabsSize=false diff --git a/src/base/B777-300ER/plugins/SASLFree/data/modules/state.txt b/src/base/B777-300ER/plugins/SASLFree/data/modules/state.txt new file mode 100644 index 0000000..472b8d8 --- /dev/null +++ b/src/base/B777-300ER/plugins/SASLFree/data/modules/state.txt @@ -0,0 +1,6 @@ +state = { + ['contextWindows'] = { + }; + ['legacyPopups'] = { + }; +}; diff --git a/src/base/B777-300ER/plugins/SASLFree/data/output/SASLLog.txt b/src/base/B777-300ER/plugins/SASLFree/data/output/SASLLog.txt index ef77fd2..8dd58e6 100755 --- a/src/base/B777-300ER/plugins/SASLFree/data/output/SASLLog.txt +++ b/src/base/B777-300ER/plugins/SASLFree/data/output/SASLLog.txt @@ -1,17 +1,24 @@ [AE INFO]: Initializing... -[AE INFO]: Path to module: /Volumes/KINGSTON/X-Plane 10/Aircraft/Heavy Metal/B777-300ER/plugins/SASLFree/data/modules/main.lua +[AE INFO]: Path to module: D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/main.lua [AE INFO]: Loading module... [AE INFO]: [LUA]: loading module [AE INFO]: [LUA]: loading _Main_Data [AE WARN]: [STACK]:| createDataRef : DataRefsHandler::luaCreateDataRef: already exists -[AE WARN]: [STACK]:| ...B777-300ER/plugins/SASLFree/data/init/initProperties.lua:234 in function -[AE WARN]: [STACK]:| ...ugins/SASLFree/data/modules/Custom Module/_Main_Data.lua:15 in function -[AE WARN]: [STACK]:| ...ugins/SASLFree/data/modules/Custom Module/_Main_Data.lua:94 in function -[AE WARN]: [STACK]:| ...Metal/B777-300ER/plugins/SASLFree/data/init/initMain.lua:202 in function <_Main_Data> -[AE WARN]: [STACK]:| ... Metal/B777-300ER/plugins/SASLFree/data/modules/main.lua:10 in function +[AE WARN]: [STACK]:| ...b777-300er/plugins/SASLFree/data/init/initProperties.lua:317 in function +[AE WARN]: [STACK]:| ...ugins/SASLFree/data/modules/Custom Module/_Main_Data.lua:17 in function +[AE WARN]: [STACK]:| ...ugins/SASLFree/data/modules/Custom Module/_Main_Data.lua:85 in function +[AE WARN]: [STACK]:| ...ai112/b777-300er/plugins/SASLFree/data/init/initMain.lua:253 in function <_Main_Data> +[AE WARN]: [STACK]:| ...hai112/b777-300er/plugins/SASLFree/data/modules/main.lua:10 in function [AE WARN]: [STACK]:| ... [AE INFO]: [LUA]: loading Draw [AE INFO]: [LUA]: loading _Main_Sound +[AE WARN]: [STACK]:| createDataRef : DataRefsHandler::luaCreateDataRef: already exists +[AE WARN]: [STACK]:| ...b777-300er/plugins/SASLFree/data/init/initProperties.lua:317 in function +[AE WARN]: [STACK]:| ...gins/SASLFree/data/modules/Custom Module/_Main_Sound.lua:69 in function +[AE WARN]: [STACK]:| ...ai112/b777-300er/plugins/SASLFree/data/init/initMain.lua:253 in function <_Main_Sound> +[AE WARN]: [STACK]:| ...hai112/b777-300er/plugins/SASLFree/data/modules/main.lua:14 in function +[AE WARN]: [STACK]:| ...ai112/b777-300er/plugins/SASLFree/data/init/initMain.lua:253 in function +[AE WARN]: [STACK]:| ... [AE INFO]: [LUA]: loading Panel_EICAS [AE INFO]: [LUA]: loading Panel_MCP [AE INFO]: [LUA]: loading Panel_PFD @@ -21,8 +28,469 @@ [AE INFO]: [LUA]: loading System_Radio [AE INFO]: [LUA]: loading System_Bleed [AE INFO]: [LUA]: loading System_FlightMode -[AE INFO]: Loading cursors... [AE INFO]: Module loaded +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav [AE INFO]: [LUA]: "Panel_MCP" 1 +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" +[AE INFO]: [LUA]: "_Main_Sound" D:\Documents/programs/X-Plane 11/Aircraft/Chai112/b777-300er/plugins/SASLFree/data/modules/configuration/widgetResources/eng_max.wav +[AE INFO]: [LUA]: "System_Engine" [AE INFO]: Disabling... [AE INFO]: SASL plugin stopped... diff --git a/src/base/B777-300ER/plugins/SASLFree/functions.txt b/src/base/B777-300ER/plugins/SASLFree/functions.txt new file mode 100644 index 0000000..b57f3b3 --- /dev/null +++ b/src/base/B777-300ER/plugins/SASLFree/functions.txt @@ -0,0 +1,359 @@ +getCamera +setCamera +startCameraControl +stopCameraControl +getCurrentCameraStatus +registerCameraController +unregisterCameraController +setAuxiliaryClickSystem +getClipboardText +setClipboardText +findCommand +commandBegin +commandEnd +commandOnce +createCommand +registerCommandHandler +unregisterCommandHandler +fetchDataRef +findDataRef +createDataRef +createFunctionalDataRef +freeDataRef +getDataRef +getDataRefSize +setDataRef +setComponentTransform +setTranslateTransform +setScaleTransform +setRotateTransform +saveGraphicsContext +restoreGraphicsContext +setLinePattern +drawFrame +importTexture +drawTexture +drawRotatedTexture +drawRotatedTextureCenter +drawTexturePart +drawRotatedTexturePart +drawRotatedTexturePartCenter +drawTextureCoords +drawTextureWithRotatedCoords +drawRectangle +drawTriangle +drawLine +drawLinePattern +drawBezierLineQ +drawBezierLineC +drawBezierLineQAdaptive +drawBezierLineCAdaptive +drawBitmapText +drawText +measureText +measureBitmapText +drawCircle +drawArc +getGLBitmapFont +unloadBitmapFont +getGLFont +unloadFont +setFontOutlineThickness +setFontOutlineColor +getGLTexture +getTextureSize +setTextureWrapping +loadTextureFromMemory +unloadTexture +recreateTexture +setRenderTarget +restoreRenderTarget +createRenderTarget +getTargetTextureData +createTextureDataStorage +deleteTextureDataStorage +getTextureDataPointer +getRawTextureData +setRawTextureData +setBlendFunction +setBlendFunctionSeparate +setBlendEquation +setBlendEquationSeparate +setBlendColor +resetBlending +setClipArea +resetClipArea +drawMaskStart +drawUnderMask +drawMaskEnd +createShaderProgram +deleteShaderProgram +linkShaderProgram +addShader +setShaderUniform +useShaderProgram +stopShaderProgram +saveGraphicsContext3D +restoreGraphicsContext3D +setTranslateTransform3D +setScaleTransform3D +setRotateTransformX3D +setRotateTransformY3D +setRotateTransformZ3D +setRotateTransform3D +drawLine3D +drawTriangle3D +drawCircle3D +drawAngle3D +drawStandingCone3D +drawBillboard3D +sendMessageToPlugin +registerMessageHandler +unregisterMessageHandler +getMyPluginID +getMyPluginPath +getXPlanePath +getAircraftPath +getAircraft +getProjectPath +countPlugins +getNthPlugin +findPluginByPath +findPluginBySignature +getPluginInfo +isPluginEnabled +enablePlugin +disablePlugin +reloadPlugins +newCPPInterpolator +deleteCPPInterpolator +interpolateCPP +registerGlobalKeyHandler +unregisterGlobalKeyHandler +appendMenuSeparator +clearAllMenuItems +appendMenuItem +removeMenuItem +setMenuItemName +setMenuItemState +getMenuItemState +enableMenuItem +createMenu +destroyMenu +messageWindow +getFirstNavAid +getNextNavAid +findFirstNavAidOfType +findLastNavAidOfType +findNavAid +getNavAidInfo +countFMSEntries +getDisplayedFMSEntry +getDestinationFMSEntry +setDisplayedFMSEntry +setDestinationFMSEntry +getFMSEntryInfo +setFMSEntryInfo +setFMSEntryLatLon +clearFMSEntry +getGPSDestinationType +getGPSDestination +projectTreeBeginCommand +projectTreeEndCommand +projectTreeCreateCommand +projectTreeClearCommand +reloadScenery +worldToLocal +localToWorld +modelToLocal +localToModel +probeTerrain +loadObjectFromFile +unloadObject +drawObject +loadSampleFromFile +unloadSample +playSample +stopSample +setSampleGain +setSamplePitch +rewindSample +isSamplePlaying +getSamplePlayingRemaining +setMasterGain +setSampleEnv +getSampleEnv +setSamplePosition +getSamplePosition +setSampleDirection +getSampleDirection +setSampleMaxDistance +setSampleRolloff +setSampleRefDistance +setSampleCone +getSampleCone +setSampleRelative +getSampleRelative +getContextsState +createTimer +deleteTimer +startTimer +pauseTimer +resumeTimer +stopTimer +getElapsedSeconds +getElapsedMicroseconds +getCurrentCycle +setLogLevel +getLogLevel +print +logInfo +logTrace +logWarning +logDebug +logError +listFiles +getOS +getXPVersion +startDebug +finishDebug +destroyRenderTarget +getTextureSourceSize +getProjectName +drawPolyLine +drawPolyLinePattern +drawWideLine +drawConvexPolygon +drawWidePolyLine +drawRotatedBitmapText +drawRotatedText +pauseSample +setSampleMinimumGain +setSampleMaximumGain +getSampleDuration +setSampleOffset +getSampleOffset +setSampleVelocity +getSampleVelocity +loadObjectAsyncFromFile +drawWideBezierLineQ +drawWideBezierLineC +drawWideBezierLineQAdaptive +drawWideBezierLineCAdaptive +setRenderingMode2D +isNonLitStage +isLitStage +isPanelBeforeStage +isPanelAfterStage +setPanelRenderingMode +downloadFileSync +downloadFileContentsSync +getMagneticVariation +degMagneticToDegTrue +degTrueToDegMagnetic +appendMenuItemWithCommand +registerHotKey +unregisterHotKey +setHotKeyCombination +createInstance +destroyInstance +setInstancePosition +setAircraftPanelRendering +set3DRendering +setInteractivity +setLuaErrorsHandling +setLuaStackTraceLimit +setRenderTextPixelAligned +createContextWindow +destroyContextWindow +setContextWindowSizeLimits +setContextWindowPosition +getContextWindowPosition +setContextWindowTitle +setContextWindowGravity +getContextWindowVisible +setContextWindowVisible +getContextWindowSizeLimits +getMonitorsIDsGlobal +getMonitorsIDsOS +getMonitorBoundsGlobal +setContextWindowMode +getMonitorBoundsOS +isContextWindowPoppedOut +isContextWindowInVR +getScreenBoundsGlobal +getGLVectorTexture +setContextWindowMovable +setContextWindowResizable +setContextWindowProportional +setContextWindowDecoration +applyCommandsNameCheck +applyDataRefsNameCheck +setDownloadTimeout +setFontRenderMode +setCursorShape +setCursorLayer +getContextWindowMode +setContextWindowCallback +setContextWindowVrAutoHandling +clearRenderTarget +setContextWindowResizeMode +setPolygonExtrudeMode +setWideLineExtrudeMode +getEnvVariable +setEnvVariable +unsetEnvVariable +drawTextI +drawRotatedTextI +measureTextI +setFontSize +setFontBold +setFontItalic +saveFontState +restoreFontState +setCSWheelInteractionDelay +setCSPassWheelEventFlag +setCSDClickInterval +setCSMode +setCSShowCursor +setCSCursorScale +getCSClickDown +getCSClickUp +getCSClickHold +getCSDoubleClick +getCSWheelClicks +getCSDragDirection +getCSDragValue +getCSCursorOnInterface +getCSMouseXPos +getCSMouseYPos +getCSDClickInterval +getCSMode +getCSShowCursor +getCSWheelInteractionDelay +measureTextGlyphs +measureTextGlyphsI +measureBitmapTextGlyphs +setFontBckMode +setFontBckColor +setFontBckPadding +setFontGlyphSpacingFactor +createTexture +drawArcLine +setInternalLineWidth +setInternalLineStipple +setFontUnicode +createPerformanceTimer +resetTimer +stereographicLLtoXY +stereographicXYtoLL +getContextWindowResizing +getContextWindowDragging +getContextWindowPositionInternal +getCSMouseIsOnPanel +getCSPanelMousePos +saveInternalLineState +restoreInternalLineState +setFontDirection +downloadFileAsync +downloadFileContentsAsync diff --git a/src/base/B777-300ER/plugins/SASLFree/version.txt b/src/base/B777-300ER/plugins/SASLFree/version.txt index 3e73945..15aea1e 100755 --- a/src/base/B777-300ER/plugins/SASLFree/version.txt +++ b/src/base/B777-300ER/plugins/SASLFree/version.txt @@ -1,6 +1,6 @@ -SASL -Scriptable Aviation Simulation Library (Free Edition) -Version: 3.2.4+3d8a967 +Scriptable Aviation Simulation Library +Lua scripting environment for X-Plane add-ons (Free Edition) +Version: 3.9.0+890d171 -1-sim.com -Copyright FlightFactor 2018 + +© 2012-2020 FlightFactor, © 2015-2020 StepToSky diff --git a/src/external/code/_Main_Sound.lua b/src/external/code/_Main_Sound.lua index a7b5c12..c744295 100755 --- a/src/external/code/_Main_Sound.lua +++ b/src/external/code/_Main_Sound.lua @@ -77,6 +77,7 @@ defineProperty("n2val_2", globalPropertyfae("sim/flightmodel/engine/ENGN_N2_", 2 function update () + print(asound_file); -- read datarefs for this frame @@ -146,25 +147,25 @@ function reverse() if rev_gain[i] > 0 then -- if the gain value is greater than zero, we should be playing sound. correct as needed if (get(globalPropertyf("sim/time/sim_speed")) > 0) and (get(globalPropertyi("sim/operation/sound/sound_on")) > 0) then if not isSamplePlaying(al) then - playSample(al, 1) + playSample(al) end if not isSamplePlaying(bl) then - playSample(bl, 1) + playSample(bl) end if not isSamplePlaying(cl) then - playSample(cl, 1) - end + playSample(cl) + end if not isSamplePlaying(nl) then - playSample(nl, 1) + playSample(nl) end if not isSamplePlaying(ar) then - playSample(ar, 1) + playSample(ar) end if not isSamplePlaying(br) then - playSample(br, 1) + playSample(br) end if not isSamplePlaying(cr) then - playSample(cr, 1) + playSample(cr) end end end diff --git a/src/template/Chai112's B773ER/.DS_Store b/src/template/Chai112's B773ER/.DS_Store new file mode 100644 index 0000000..172f74a Binary files /dev/null and b/src/template/Chai112's B773ER/.DS_Store differ diff --git a/src/template/Chai112's B773ER/Documentation & License/.DS_Store b/src/template/Chai112's B773ER/Documentation & License/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/src/template/Chai112's B773ER/Documentation & License/.DS_Store differ diff --git a/src/template/Chai112's B773ER/Documentation & License/Full Manual & Documentation.pdf b/src/template/Chai112's B773ER/Documentation & License/Full Manual & Documentation.pdf new file mode 100644 index 0000000..3b2d9c1 Binary files /dev/null and b/src/template/Chai112's B773ER/Documentation & License/Full Manual & Documentation.pdf differ diff --git a/src/template/Chai112's B773ER/Documentation & License/License.txt b/src/template/Chai112's B773ER/Documentation & License/License.txt new file mode 100644 index 0000000..be02f85 --- /dev/null +++ b/src/template/Chai112's B773ER/Documentation & License/License.txt @@ -0,0 +1,637 @@ + +Creating Digital Simulations of Aircraft +Copyright (C) 2019 Chai + +This program is under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Below is the GNU General Public License . + + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS diff --git a/src/template/Chai112's B773ER/Documentation & License/Readme.txt b/src/template/Chai112's B773ER/Documentation & License/Readme.txt new file mode 100644 index 0000000..7f73be3 --- /dev/null +++ b/src/template/Chai112's B773ER/Documentation & License/Readme.txt @@ -0,0 +1,125 @@ +================== CREDITS & AUTHOR ================== + +Boeing 777-300 Extended Range +by Chai112 +https://forums.x-plane.org/index.php?/profile/520176-chai112/ + +Now with engines! +v0.42.0 +Please read the license included in the file for copyright information. + I have created this product simply for entertainment purposes; the product has been distributed freely from X-Plane.com by Chai112. + +================== NOTES FROM THE AUTHOR ================== + +Hello! Thank you for choosing to download this product! As you may know, this product is in it’s early development phase and every single piece of feedback I can get would be amazing! :) + +This is a Boeing 777-300ER, the most largest aircraft of it’s kind. It’s a wide-body aircraft capable of crossing the Atlantic with over 350 people on board. + +My goal is to bring this into X-Plane as a freeware product. So basically, in a couple of years, you could be able to fly a Boeing 777-300ER inside of the X-plane which is fully realistic. Even though the published aircraft may pretty plain, I am currently researching and planning the cockpit thoroughly. + +================== INSTALLATION ================== + +1. First, locate your X-plane 10/11 home folder. It should contain the ‘Aircraft’ folder. + +2. Open it and locate the ‘Heavy Metal’ folder, if you’ve changed it or it’s not there, just make a new folder or select another folder - it doesn’t matter. + +3. Locate the B777-300ER folder that this text file is in. Right next of the ‘Information’ folder should be the Boeing 777-300ER folder, open it and make sure it’s filled with cluttered files and one saying ‘liveries’. + +4. Drag that folder into the ‘Heavy Metal’ folder or whatever you’ve chosen. + +5. Start up X-plane and you should see the aircraft in the selection menu. + +================== CHANGELOG ================== + +I’ve made many improvements to the exterior of the aircraft! +Here they are! + +NEW IN THIS UPDATE find the latest changelog on Github https://github.com/Chai112/Chai112-s-Boeing-777-300ER + +v0.41.0 + + + FMA logic + + Custom coded EICAS messages + + Sound engine + + Custom autothrottle + + 3D FMC with xFMC support + + Eng page for MFD + * Improved flight dynamics + * Remodelled engine + * Texture revise + * Code revise + +v0.40.0 +August 12, 2018 + + * Rewrote logic for different SDK + * Remapped EFIS, MCP and Overhead + * Redid normal maps and specularity for more accurate lighting + * Redid EFIS, MCP, Forward, Pedestal + * Redid bottom of aircraft + * Redid PFD + +v0.37.0 +December, 2018 + + + Added EICAS Messages + + Added Individual Hydraulic Pumps, Fuel Crossfeed Valves and other buttons + + Added PFD flap markers (UP, 1, 5, 15) + + Added Fuel Control Switches (and Engine Start Switch, and FADEC Switch) + * Remapped Overhead & Glareshield + * Exterior Shading above the wing + * Changed engine startup procedure to be more realistic + * Changed and animated gear lever + * Changed N1 and EGT so that it is more realistic during startup and running (idle) + * Changed bleed air system so that they are manipulated by buttons + +v0.36.0 +September 3, 2017 + + + Added EICAS Messages Compatibility + + Added Commanded N1 to EICAS + + Added Welcome Message + + Textured & Baked Cockpit Interior + + Textured & Baked Pedestal + * Rebuilt EICAS & PFD to have HD textures + +v0.35.0 +June 30, 2017 + + + Added 3D Cockpit + + Added Ram Air Turbine + + Added Emirates livery (Fly Emirates!) + * Changes to wing models & animation + * Changes to spoiler deployment sequence & models + * Changes to landing gear deflections + +v0.30.0 +January 10, 2017 + + + Added Gears + + Added Engines + * Improved Doors + + Added Airstairs + + Added Ground Power Unit + + Added Galley Service + + Added Cargo loaders + * Improved Textures (more rough stains) + + Added British Airways livery (To promote BA; fly BA! Please don’t sue me. + + Added a Glass windshield. + * Fixed slider issue + * Fixed cruising speed issue (adding more thrust) + * Adjusted engine fuel consumption + +v0.20.0 +November 25, 2016 + + + Added Wings + + Added Spoilers + + Added Slats + + Added Flaps + * Improved fuselage texture + +v0.10.0 +October 21, 2016 + + + Basically, the whole aircraft diff --git a/src/template/Chai112's B773ER/INSTALL THESE PLUGINS.txt b/src/template/Chai112's B773ER/INSTALL THESE PLUGINS.txt new file mode 100644 index 0000000..1cfb8c9 --- /dev/null +++ b/src/template/Chai112's B773ER/INSTALL THESE PLUGINS.txt @@ -0,0 +1,64 @@ +PLEASE INSTALL THESE PLUGINS FOR A MORE BETTER EXPERIENCE OF THE AIRCRAFT. THE TOP ONES BEING MOST RECOMMENDED. + + + +=========================================================================== + X-FMC FLIGHT MANAGEMENT COMPUTER + + + https://www.x-fmc.com << HIGHLY, HIGHLY RECOMMENDED + + + +This is vital for a VAST IMPROVEMENT TO XPLANE’S FMC. It provides so much more realistic features such as flight planning, SIDs and STARs arrivals, etc. etc. It is useful for all your other Boeing aircrafts. +=========================================================================== + + + + + + + + XChecklist + +https://forums.x-plane.org/index.php?/files/file/20785-xchecklist-linwinmac3264/ + + + +The aircraft is compatible with XChecklist so that you can start the plane without having to switch back and from a .png file. Useful if you want to try fly the plane in a more realistic manner. + + + + + + HeadShake + +https://www.simcoders.com/headshake/features-and-download + + + +Not only is this plugin great for this aircraft, it can be used with every type of aircraft; from a GA plane to a fighter. It moves the camera around in a realistic manner when affected by G-forces, touchdowns, turbulence and many other factors. + + + + + + Passenger FX + +http://forums.x-plane.org/index.php?/files/file/38625-passengersfx-adding-realistic-passengers-to-your-aircraft/ + + + +With many cabin noises & announcements, it adds a whole new level of realism. + + + + + + X-RAAS: Runway Awareness and Advisory System + +https://forums.x-plane.org/index.php?/files/file/36360-x-raas-runway-awareness-and-advisory-system/ + + + +Gives indications for runway length, position, etc. The Boeing 777 is equipped with this system to help navigate unfamiliar airports. diff --git a/src/template/Chai112's B773ER/Installation Procedure.txt b/src/template/Chai112's B773ER/Installation Procedure.txt new file mode 100644 index 0000000..333dbd5 --- /dev/null +++ b/src/template/Chai112's B773ER/Installation Procedure.txt @@ -0,0 +1,15 @@ +Hello, Thank you for downloading +你好, 谢谢你的下载 +Hola, Gracias por descargar +Bonjour, Merci pour le téléchargement +Hallo, Dankeschön für das Herunterladen +Ciao, Grazie per aver scaricato +Olá, Obrigado pelo download +Здравствуйте, Спасибо за скачивание + + + +X-Plane 10 > Aircraft > Heavy Metal > B777-300ER +X-Plane 11 > Aircraft > Heavy Metal > B777-300ER + +===Please download=== https://www.x-fmc.com