-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed ELECTRONIC_COMPASS_CALIBRATION exception
- Loading branch information
Showing
12 changed files
with
301 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...-multiplatform/src/commonTest/resources/state/state_x_electronic_compass_calibration.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"fingerprint": "FIG_0001", | ||
"state": { | ||
"_apiVersion": 2, | ||
"_batteryInsert": true, | ||
"batteryLevel": 0.33, | ||
"_batteryState": "disconnect", | ||
"_cameraError": ["ELECTRONIC_COMPASS_CALIBRATION"], | ||
"_captureStatus": "idle", | ||
"_capturedPictures": 0, | ||
"_currentMicrophone": "Internal", | ||
"_currentStorage": "IN", | ||
"_function": "normal", | ||
"_latestFileUrl": "http://192.168.1.1/files/100RICOH/R0010015.JPG", | ||
"_mySettingChanged": false, | ||
"_pluginRunning": false, | ||
"_pluginWebServer": true, | ||
"_recordableTime": 0, | ||
"_recordedTime": 0, | ||
"_storageID": "90014a68423861503e030277e0c2b500", | ||
"storageUri": "http://192.168.1.1/files/" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
kotlin-multiplatform/src/commonTest/resources/state/state_x_unknown_camera_error.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"fingerprint": "FIG_0001", | ||
"state": { | ||
"_apiVersion": 2, | ||
"_batteryInsert": true, | ||
"batteryLevel": 0.33, | ||
"_batteryState": "disconnect", | ||
"_cameraError": ["error_unknown"], | ||
"_captureStatus": "idle", | ||
"_capturedPictures": 0, | ||
"_currentMicrophone": "Internal", | ||
"_currentStorage": "IN", | ||
"_function": "normal", | ||
"_latestFileUrl": "http://192.168.1.1/files/100RICOH/R0010015.JPG", | ||
"_mySettingChanged": false, | ||
"_pluginRunning": false, | ||
"_pluginWebServer": true, | ||
"_recordableTime": 0, | ||
"_recordedTime": 0, | ||
"_storageID": "90014a68423861503e030277e0c2b500", | ||
"storageUri": "http://192.168.1.1/files/" | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
react-native/src/__tests__/theta-repository/theta-state/theta-state-camera-error.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { CameraErrorEnum } from '../../../theta-repository'; | ||
|
||
describe('CameraErrorEnum', () => { | ||
const data: [CameraErrorEnum, string][] = [ | ||
[CameraErrorEnum.UNKNOWN, 'UNKNOWN'], | ||
[CameraErrorEnum.NO_MEMORY, 'NO_MEMORY'], | ||
[CameraErrorEnum.FILE_NUMBER_OVER, 'FILE_NUMBER_OVER'], | ||
[CameraErrorEnum.NO_DATE_SETTING, 'NO_DATE_SETTING'], | ||
[CameraErrorEnum.READ_ERROR, 'READ_ERROR'], | ||
[CameraErrorEnum.NOT_SUPPORTED_MEDIA_TYPE, 'NOT_SUPPORTED_MEDIA_TYPE'], | ||
[CameraErrorEnum.NOT_SUPPORTED_FILE_SYSTEM, 'NOT_SUPPORTED_FILE_SYSTEM'], | ||
[CameraErrorEnum.MEDIA_NOT_READY, 'MEDIA_NOT_READY'], | ||
[CameraErrorEnum.NOT_ENOUGH_BATTERY, 'NOT_ENOUGH_BATTERY'], | ||
[CameraErrorEnum.INVALID_FILE, 'INVALID_FILE'], | ||
[CameraErrorEnum.PLUGIN_BOOT_ERROR, 'PLUGIN_BOOT_ERROR'], | ||
[CameraErrorEnum.IN_PROGRESS_ERROR, 'IN_PROGRESS_ERROR'], | ||
[CameraErrorEnum.CANNOT_RECORDING, 'CANNOT_RECORDING'], | ||
[CameraErrorEnum.CANNOT_RECORD_LOWBAT, 'CANNOT_RECORD_LOWBAT'], | ||
[CameraErrorEnum.CAPTURE_HW_FAILED, 'CAPTURE_HW_FAILED'], | ||
[CameraErrorEnum.CAPTURE_SW_FAILED, 'CAPTURE_SW_FAILED'], | ||
[CameraErrorEnum.INTERNAL_MEM_ACCESS_FAIL, 'INTERNAL_MEM_ACCESS_FAIL'], | ||
[CameraErrorEnum.UNEXPECTED_ERROR, 'UNEXPECTED_ERROR'], | ||
[CameraErrorEnum.BATTERY_CHARGE_FAIL, 'BATTERY_CHARGE_FAIL'], | ||
[CameraErrorEnum.HIGH_TEMPERATURE_WARNING, 'HIGH_TEMPERATURE_WARNING'], | ||
[CameraErrorEnum.HIGH_TEMPERATURE, 'HIGH_TEMPERATURE'], | ||
[CameraErrorEnum.BATTERY_HIGH_TEMPERATURE, 'BATTERY_HIGH_TEMPERATURE'], | ||
[CameraErrorEnum.COMPASS_CALIBRATION, 'COMPASS_CALIBRATION'], | ||
]; | ||
|
||
test('length', () => { | ||
expect(data.length).toBe(Object.keys(CameraErrorEnum).length); | ||
}); | ||
|
||
test('data', () => { | ||
data.forEach((item) => { | ||
expect(item[0]).toBe(item[1]); | ||
}); | ||
}); | ||
}); |
56 changes: 56 additions & 0 deletions
56
react-native/src/theta-repository/theta-state/camera-error.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** Camera error constants */ | ||
export const CameraErrorEnum = { | ||
/** Undefined value */ | ||
UNKNOWN: 'UNKNOWN', | ||
/** Insufficient memory */ | ||
NO_MEMORY: 'NO_MEMORY', | ||
/** Maximum file number exceeded */ | ||
FILE_NUMBER_OVER: 'FILE_NUMBER_OVER', | ||
/** Camera clock not set */ | ||
NO_DATE_SETTING: 'NO_DATE_SETTING', | ||
/** Includes when the card is removed */ | ||
READ_ERROR: 'READ_ERROR', | ||
/** Unsupported media (SDHC, etc.) */ | ||
NOT_SUPPORTED_MEDIA_TYPE: 'NOT_SUPPORTED_MEDIA_TYPE', | ||
/** FAT32, etc. */ | ||
NOT_SUPPORTED_FILE_SYSTEM: 'NOT_SUPPORTED_FILE_SYSTEM', | ||
/** Error warning while mounting */ | ||
MEDIA_NOT_READY: 'MEDIA_NOT_READY', | ||
/** Battery level warning (firmware update) */ | ||
NOT_ENOUGH_BATTERY: 'NOT_ENOUGH_BATTERY', | ||
/** Firmware file mismatch warning */ | ||
INVALID_FILE: 'INVALID_FILE', | ||
/** Plugin start warning (IoT technical standards compliance) */ | ||
PLUGIN_BOOT_ERROR: 'PLUGIN_BOOT_ERROR', | ||
/** | ||
* When performing continuous shooting by operating the camera while executing <Delete object>, | ||
* <Transfer firmware file>, <Install plugin> or <Uninstall plugin> with the WebAPI or MTP. | ||
*/ | ||
IN_PROGRESS_ERROR: 'IN_PROGRESS_ERROR', | ||
/** Battery inserted + WLAN ON + Video mode + 4K 60fps / 5.7K 10fps / 5.7K 15fps / 5.7K 30fps / 8K 10fps */ | ||
CANNOT_RECORDING: 'CANNOT_RECORDING', | ||
/** Battery inserted AND Specified battery level or lower + WLAN ON + Video mode + 4K 30fps */ | ||
CANNOT_RECORD_LOWBAT: 'CANNOT_RECORD_LOWBAT', | ||
/** Shooting hardware failure */ | ||
CAPTURE_HW_FAILED: 'CAPTURE_HW_FAILED', | ||
/** Software error */ | ||
CAPTURE_SW_FAILED: 'CAPTURE_SW_FAILED', | ||
/** Internal memory access error */ | ||
INTERNAL_MEM_ACCESS_FAIL: 'INTERNAL_MEM_ACCESS_FAIL', | ||
/** Undefined error */ | ||
UNEXPECTED_ERROR: 'UNEXPECTED_ERROR', | ||
/** Charging error */ | ||
BATTERY_CHARGE_FAIL: 'BATTERY_CHARGE_FAIL', | ||
/** (Board) temperature warning */ | ||
HIGH_TEMPERATURE_WARNING: 'HIGH_TEMPERATURE_WARNING', | ||
/** (Board) temperature error */ | ||
HIGH_TEMPERATURE: 'HIGH_TEMPERATURE', | ||
/** Battery temperature error */ | ||
BATTERY_HIGH_TEMPERATURE: 'BATTERY_HIGH_TEMPERATURE', | ||
/** Electronic compass error */ | ||
COMPASS_CALIBRATION: 'COMPASS_CALIBRATION', | ||
} as const; | ||
|
||
/** type definition of CameraErrorEnum */ | ||
export type CameraErrorEnum = | ||
(typeof CameraErrorEnum)[keyof typeof CameraErrorEnum]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './camera-error'; | ||
export * from './theta-state'; |
Oops, something went wrong.