Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 108 additions & 27 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@ name: Build
on:
pull_request:
branches: ["flutter"]
paths-ignore:
- '**.md'
- 'docs/**'
- '**.png'
- '**.jpg'
- '**.jpeg'
- '**.gif'
- '**.svg'
- '**.webp'
- '**.txt'
- '**.arb'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -25,138 +15,229 @@ env:
IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4)

jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
is_code: ${{ steps.check.outputs.is_code }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- id: check
run: |
# Diff the actual commit SHAs.
# grep -vE removes your media/doc extensions. grep -v removes the docs folder.
# If anything is left over, it's code. If the output is empty, it's just docs.
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -vE '\.(md|png|jpg|jpeg|gif|svg|webp|txt|arb)$' | grep -v '^docs/'; then
echo "is_code=true" >> $GITHUB_OUTPUT
else
echo "is_code=false" >> $GITHUB_OUTPUT
fi

common:
name: Common Build
needs: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: Common Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/common

- name: Save PR number
if: needs.changes.outputs.is_code == 'true'
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR

- uses: actions/upload-artifact@v7
if: needs.changes.outputs.is_code == 'true'
with:
name: pr
path: pr/

- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

android:
name: Android Flutter Build
needs: common
needs: [changes, common]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: Android Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/android

- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

ios:
name: iOS Flutter Build
needs: common
runs-on: macos-latest
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }}
steps:
- name: Set up Xcode
if: needs.changes.outputs.is_code == 'true'
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: '16.4.0'

- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: iOS Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/ios

- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

screenshots-android:
name: Screenshots (Android)
needs: changes
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: Android Screenshot Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/screenshot-android
with:
ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }}
ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }}

- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

screenshots-iphone:
name: Screenshots (iPhone)
runs-on: macos-latest
needs: changes
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }}
timeout-minutes: 30
steps:
- name: Set up Xcode
if: needs.changes.outputs.is_code == 'true'
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: '16.4.0'

- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: iPhone Screenshot Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/screenshot-iphone
with:
IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }}


- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

screenshots-ipad:
name: Screenshots (iPad)
runs-on: macos-latest
needs: changes
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }}
timeout-minutes: 30
steps:
- name: Set up Xcode
if: needs.changes.outputs.is_code == 'true'
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: '16.4.0'

- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: iPad Screenshot Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/screenshot-ipad
with:
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}


- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

windows:
name: Windows Flutter Build
needs: common
runs-on: windows-latest
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'windows-latest' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: Windows Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/windows


- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

linux:
name: Linux Flutter Build
needs: common
needs: [changes, common]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: Linux Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/linux

- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

linux-arm64:
name: Linux ARM64 Flutter Build
needs: common
runs-on: ubuntu-24.04-arm
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: Linux ARM64 Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/linux-arm64

- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."

macos:
name: macOS Flutter Build
needs: common
runs-on: macos-latest
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }}
steps:
- name: Set up Xcode
if: needs.changes.outputs.is_code == 'true'
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: '16.4.0'

- uses: actions/checkout@v6
if: needs.changes.outputs.is_code == 'true'

- name: macOS Workflow
uses: ./.github/actions/macos
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/macos

- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@ Despite any reason, follow the steps given below to squash all commits into one

`$ git push -f origin <branch-name>`

//////////


### Branch Policy

We have the following branches
Expand Down
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.12.2" apply false
id "org.jetbrains.kotlin.android" version "2.3.20" apply false
id "org.jetbrains.kotlin.android" version "2.3.21" apply false
}

include ":app"
8 changes: 4 additions & 4 deletions docs/Lux meter.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to use Lux meter

## Table of Content
## Table of Contents
1. Introduction
2. Layout
3. Features
Expand All @@ -9,7 +9,7 @@
4. How to Use

## Introduction
Pocket Science Lab contains a lux meter which can measure real time ambient light intensity. This lux meter can use either the `built-in ambient light sensor` in your android device, `BH-1750` or `TSL-2561` lux sensors. The PSLab android application communicates with the Pocket Science Lab using `I2C` bus to read the two externally connected sensors. This document will help a user on available functionalities and how to use Pocket Science Lab with PSLab android application.
Pocket Science Lab contains a lux meter which can measure real time ambient light intensity. This lux meter can use either the `built-in ambient light sensor` in your android device, `BH-1750` or `TSL-2561` lux sensors. The PSLab android application communicates with the Pocket Science Lab using `I2C` bus to read the two externally connected sensors. This document will help a user on available functionalities and how to use Pocket Science Lab with PSLab application.

## Layout

Expand Down Expand Up @@ -47,7 +47,7 @@ Configure view is used to control the lux meter by changing variuos parameters.
4. Update period
- The time delay between two successive sensor readings can be changed by this parameter. The range is from `100ms` to `1000ms`.

## How to Use
## How to Use it

The default sensor for the lux meter is the built-in sensor. If the android device contains the ambient light sensor, immediatly the data can be observed throught the data view.
When using a I2C connected lux sensor, the pin configuration for the sensor is as follows.
Expand All @@ -63,4 +63,4 @@ SDA | SDA

The pin configuration for the TSL-2561 is also as same as above.

Change the parameters `update period`, `high limit` and `gain range` and observe the differences.
Change the parameters `update period`, `high limit` and `gain range` and observe the differences.
2 changes: 1 addition & 1 deletion lib/communication/science_lab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ScienceLab {
if (isDeviceFound()) {
try {
await mCommunicationHandler.open();
mPacketHandler = PacketHandler(500, mCommunicationHandler);
mPacketHandler = PacketHandler(1500, mCommunicationHandler);
} catch (e) {
logger.e(e);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/providers/settings_config_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SettingsConfigProvider extends ChangeNotifier {
await prefs.setString('settings_config', json.encode(_config.toJson()));
logger.d("Saved SettingsConfig: ${_config.toJson()}");
} catch (e) {
logger.e("Error saving SettingsConfig to prefs: $e");
logger.e("EError saving SettingsConfig to prefs: $e");
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/providers/wave_generator_state_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum WaveConst {

enum WaveData {
freqMin(10),
dutyMin(0),
dutyMin(10),
phaseMin(0),
freqMax(5000),
phaseMax(360),
Expand Down
2 changes: 1 addition & 1 deletion lib/view/barometer_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _BarometerScreenState extends State<BarometerScreen> {
_i2c = I2C(_scienceLab!.mPacketHandler);
}
} catch (e) {
logger.e('Error initializing ScienceLab: $e');
logger.e('Error initializing _____ScienceLab_____: $e');
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/view/gyroscope_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _GyroscopeScreenState extends State<GyroscopeScreen> {
),
const InstrumentImage(
imagePath: imagePath,
height: 200.0,
height: 210.0,
),
InstrumentIntroText(
text: appLocalizations.gyroscopeDesc,
Expand Down
Loading