Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React blockly chat assistant persona #457

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1746 commits
Select commit Hold shift + click to select a range
a785f34
made changes(images) in readme file
Eashika2504 Dec 12, 2023
e4c3a94
made changes in readme file(reduced sizes of images and gifs, changed…
Eashika2504 Dec 13, 2023
3247b10
reduced file size and udpated readme
Dec 13, 2023
b717748
solved merge conflict and made changes(images) in readme file
Eashika2504 Dec 13, 2023
149b64d
update the changes
Dec 13, 2023
29547a2
added space between images
Dec 13, 2023
5d16008
updated readme for firebase services
Dec 14, 2023
1bfa2a0
updated readme file added images, gifs and documentation
Eashika2504 Dec 14, 2023
ac3032c
added reset blockly code functionality and updated run robot UI
Dec 16, 2023
e207cbe
fixed back logic for blockly fragment on stop car
Dec 18, 2023
582fdda
on the click of stop car button text changed to Back and then onclic…
Eashika2504 Dec 18, 2023
c897c5a
updated blockly fragment UI with landscape orientation
Dec 18, 2023
d4789cf
added comments and remove extra logs
Dec 18, 2023
69d49a6
change status to initial when triggered reset function
Dec 18, 2023
41a38f4
added the reset functionality
Eashika2504 Dec 20, 2023
d0a98d9
set the UI(reset button) in landscape orientation
Eashika2504 Dec 21, 2023
26ede19
added fragment type in socket connection
Dec 22, 2023
2d4ed64
set the UI in landscape and fixed the reset functionality as well
Eashika2504 Dec 22, 2023
d6157ae
updates fragment type for each fragment containing vehicle control
Dec 22, 2023
8f72cc7
added socket message for every fragment
Dec 28, 2023
bb57ebc
added disclaimer for openbot in readme.md
Jan 1, 2024
3545b6f
updated readme.md
Jan 1, 2024
4af43ba
handle sso if redirected from dashboard
Jan 6, 2024
61815a6
handled single sign on functionality while redirected from dashboard
Jan 8, 2024
651aadd
deleted extra fonts
Jan 8, 2024
90d37f9
handled ace-build editor error on playground script
Jan 9, 2024
45f5ee3
implemented user usuage analytics for playground
Jan 9, 2024
e5d169e
added restriction over projects
Jan 10, 2024
b82d1be
stored user information on the monthly basis
Jan 11, 2024
1d927e7
removed unused variables
Jan 11, 2024
0319566
handled date of birth setting in profile
Jan 12, 2024
17af751
added server duration when server successfully connected
Jan 16, 2024
d65e848
fixed user usage of connecting server and optimise code
Jan 18, 2024
96fdaa5
added expiration popup and restrict user on sending key to server
Jan 18, 2024
88e9d47
handled free expiration trial on authentication
Jan 18, 2024
7dbdcde
fixed server duration updating on closing window
Jan 18, 2024
76f4cc2
increase free time for connection
Jan 19, 2024
46658f6
fix dob issue in profile
Jan 19, 2024
d30d626
added subscription popup for restricting user
Jan 19, 2024
8387dee
optimise code and fixes theme
Jan 22, 2024
f5ba15b
optimise and refractore code
Jan 22, 2024
d27a8f7
added firestore data queries for user usage
Jan 23, 2024
224b2e8
structured firestore data while updating server duration
Jan 23, 2024
b0334d4
fixed firetore data for projects and models
Jan 24, 2024
e4c23ac
added server details in firebase
Jan 25, 2024
ec3ac4d
fixed database structure for blockly projects
Jan 25, 2024
b98acd7
fixed database structure
Jan 29, 2024
b8cdc64
added status in database for web server
Jan 29, 2024
e2e7d42
fixed server duration data in firebase firestore
Jan 29, 2024
63d3b20
added user restriction on compile code
Jan 31, 2024
7bb447c
add restriction for models
Jan 31, 2024
316197f
fixed loader styling
Feb 1, 2024
9a72a7a
fixed state hook for compilation
Feb 1, 2024
58d12c2
fixed url link for downloading drive file
Feb 2, 2024
894ee3f
added key api from google service
Feb 2, 2024
6c291b6
fixed scanner fragment potential risk issue
Feb 2, 2024
92a4782
fixed merge conflict
Feb 5, 2024
7958ef0
Merge branch 'ios-dev-setup' into ios-blockly-updates
Feb 5, 2024
b9b941c
added text to speech block in playground
Feb 6, 2024
5954279
remove restriction for current deployment
Feb 6, 2024
84c2fe6
changed initial sound text description
Feb 6, 2024
19037f2
added text to speech functionality for blockly
Feb 6, 2024
ec122e0
remove stroke in workspace
Feb 6, 2024
5435a6f
added blocks for showing sensors and variable on robot screen
Feb 8, 2024
c5fca0c
fix audio uterance and display data for sensors functionality
Feb 8, 2024
5fe458a
fixed bug On downloading model from the app will display the model on…
Eashika2504 Feb 8, 2024
a8f4f5e
fixed model update config function
Feb 9, 2024
2cfe168
changed function name for display string block
Feb 9, 2024
8b41c0e
added extra block functionality for display string
Feb 9, 2024
aacf707
added text to speech feature in blockly
Feb 9, 2024
897950e
added blockly function for display block on robot screen
Feb 9, 2024
2127002
added sensor reading for wheel odometery
Feb 9, 2024
d0b6682
remove default value displayed for sensor block
Feb 10, 2024
4d427b9
updated code for user usage
Feb 21, 2024
fba7058
updated firestore server schema
Feb 21, 2024
9a72e0a
updated date object to timestamp on sending server details
Feb 21, 2024
dda64ce
extended free time
Feb 21, 2024
c0e1f0e
Update Date and update file name in android
Surajitinker Mar 11, 2024
a8fb361
Update model management from android and playground
Surajitinker Mar 15, 2024
4defbd5
Update model management from playground
Surajitinker Mar 15, 2024
81a7244
Update ReadME file in android-blockly-v2 file.
Surajitinker Mar 18, 2024
15dc450
Update Send msg from controller
Surajitinker Mar 21, 2024
4652879
merge
May 2, 2024
b58fac2
Merge branch 'ios-dev-setup' of https://github.com/3dwesupport/OpenBo…
May 2, 2024
a21c00b
Merge branch 'ios-dev-setup' of https://github.com/3dwesupport/OpenBo…
May 2, 2024
b944eee
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
May 2, 2024
825587a
Merge branch 'ios-dev-setup' of https://github.com/3dwesupport/OpenBo…
May 2, 2024
f79e2bc
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
May 2, 2024
fcab277
Merge branch 'ios-blockly-updates' of https://github.com/3dwesupport/…
May 2, 2024
71b5825
Merge branch 'android-blockly-v2' of https://github.com/3dwesupport/O…
May 3, 2024
cb2d29a
Fixed project file is displayed in android
Surajitinker May 3, 2024
047484c
added .env module for authentication
May 23, 2024
3ecae13
added readme.md for google authentication
May 23, 2024
9ec80f6
updated readme.md
May 23, 2024
a09b8e1
merge
May 24, 2024
d88d669
remove websocket unused file
May 24, 2024
db81df6
removed env file for google services
May 30, 2024
e3cdcfe
updated readme.md
May 31, 2024
7ae1ac2
updated readme.md and compressed gifs
May 31, 2024
86ee77d
updated readme.md
May 31, 2024
c3bcdef
updated readme.md
May 31, 2024
a19d3fd
updated styling for documentation image
May 31, 2024
9228cef
updated styling
May 31, 2024
d651511
updated readme.md
Jun 2, 2024
f3279e1
Update README.md
thias15 Jun 5, 2024
2c78060
Fixed README url's for playground
Jun 6, 2024
a8273aa
updated links in README.md
Jun 6, 2024
ee084b2
updated bundle ID for google-services
Jun 7, 2024
f1ae572
updated README.md
Jun 7, 2024
ddbc287
remove unused server links
Jun 7, 2024
ac962e9
updated link for opening web client
Jun 7, 2024
56f3a15
Rename Readme.md to README.md
thias15 Jun 13, 2024
c70b578
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 13, 2024
9c3ef30
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 13, 2024
3aa0570
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 13, 2024
be3c95a
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 13, 2024
2dcbe76
added server for integrating openAI into blockly
isha382 Jun 17, 2024
6e4f968
Update README.md
thias15 Jun 18, 2024
b1460ef
added Json for AI blocks
isha382 Jun 18, 2024
1e37b9a
Added category json for all the blocks available
isha382 Jun 18, 2024
9a1ebae
rename server directory and remove extra files
Jun 19, 2024
fe83415
updated port
Jun 19, 2024
c57d317
added request parser
Jun 19, 2024
1a2acd5
Added the UI design of chat assistant
isha382 Jun 19, 2024
bde4ab1
Delete ios/OpenBot/OpenBot/Controllers/WebView/Readme.md
thias15 Jun 19, 2024
027670c
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 20, 2024
af90e25
removed extra files
Jun 20, 2024
c369014
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 20, 2024
8e5ff40
Added the functionality to get the response from the chatbot asked by…
isha382 Jun 20, 2024
5b3f51b
deleted extra images
Jun 21, 2024
bd40920
deleted unuse images
Jun 21, 2024
ac47f5f
Merge branch 'android-blockly-v2-updates' of https://github.com/3dwes…
Jun 21, 2024
2ab5487
deleted extra image
Jun 21, 2024
b8e9908
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 21, 2024
2d3308f
Merge branch 'android-blockly-v2-updates' of https://github.com/3dwes…
Jun 21, 2024
f709c7d
remove extra dependency
Jun 21, 2024
083d765
Added the function for handling user message and assistant response
isha382 Jun 21, 2024
6efef52
Integrated frontend and the backend API
isha382 Jun 21, 2024
6d1bf7c
removed copied font files
Jun 24, 2024
297d315
removed unused json
Jun 24, 2024
43b9f8b
deleted unused image and optimise code
Jun 24, 2024
723e62d
removed redundant files
Jun 24, 2024
c2a0b33
remove extra image
Jun 24, 2024
2455910
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 24, 2024
43b947a
removed Podfile.lock
Jun 24, 2024
d3b4f6b
updated google-services information
Jun 24, 2024
422ff66
added modes folder
Jun 24, 2024
a5bd883
Added the functionality to restructure the server response in a struc…
isha382 Jun 24, 2024
f3f3be2
Merge branch 'android-blockly-v2-updates' of https://github.com/3dwes…
Jun 25, 2024
7f86c0f
modified the send button togggling based on the input in message
isha382 Jun 25, 2024
ac1538f
Merge branches 'web-server-v2' and 'master' of https://github.com/3dw…
Jun 25, 2024
0f60c49
sync local variables across all fragment controls
Jun 25, 2024
70c54a2
Merge branch 'ios-blockly-updates' of https://github.com/3dwesupport/…
Jun 25, 2024
0ea13c0
playground assistant ui modifications and backend response formatting…
isha382 Jun 25, 2024
8914527
Merge branch 'react-blockly' of https://github.com/3dwesupport/OpenBo…
Jun 25, 2024
bea6ac4
changed web-server icon color and remove extra image
Jun 26, 2024
021fcaa
updated README.md
Jun 26, 2024
04c514e
removed extra modes file
Jun 26, 2024
bbae2fd
Added autoscrolling property for the chat assistant
isha382 Jun 26, 2024
2568628
removed unused user saved data
Jun 27, 2024
38a67ef
rename websocket file and remove duplicate dependency
Jun 27, 2024
a7f9789
Added dark theme functionality for the chat assistant
isha382 Jun 27, 2024
5632bcb
Added custom block message from Ai at first instance and added timest…
isha382 Jun 27, 2024
a7720e6
added system prompt for creating blockly XML
Jun 27, 2024
d478f56
Added the open bot image on the assistant and modified css of the use…
isha382 Jun 27, 2024
9ea6d42
added .gitignore
Jun 27, 2024
04814b8
Segregated ChatBottomBar as a separate component
isha382 Jun 27, 2024
a737928
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jun 28, 2024
e778e6b
Merge branch 'react-blockly' of https://github.com/3dwesupport/OpenBo…
Jun 28, 2024
440f12e
Merge branch 'ios-blockly-updates' of https://github.com/3dwesupport/…
Jun 28, 2024
1611925
handled out of context prompt
Jun 28, 2024
ce79513
updated system prompt
Jun 28, 2024
f548f37
removed extra logs
Jun 28, 2024
f31b990
Added the functionality to generate block image from the prompt at th…
isha382 Jun 28, 2024
ecd66e9
remove extra dependency
Jul 1, 2024
4fc09f7
worked on conversion of svg to png
isha382 Jul 1, 2024
aa3817e
added system prompt to choose specific field name from JSON
Jul 2, 2024
c08b527
updated ui and indentation of response
isha382 Jul 2, 2024
4b96500
Added chat response as typewriter
isha382 Jul 3, 2024
8babb08
Added chat pause functionality
isha382 Jul 5, 2024
40de88e
added block field name in system prompt
Jul 5, 2024
48248d8
Added auto scrolling for the new conversation
isha382 Jul 5, 2024
2d00300
Added auto scrolling for the assistant response
isha382 Jul 5, 2024
00dcbf9
Added auto scrolling on clicking pause
isha382 Jul 5, 2024
2575ac0
added video in chat UI
Jul 6, 2024
e4719ce
removed svg to png
isha382 Jul 6, 2024
dce40e3
update code to abort api response
isha382 Jul 8, 2024
b2cd7bc
Added auto scrolling with maincontainer
isha382 Jul 8, 2024
ef8f565
modified to hide xml from response
isha382 Jul 8, 2024
2e9197b
added AI overview in system prompt
Jul 8, 2024
ade3007
fixed bug in variable detection block
Jul 8, 2024
ba2a866
changed done in ui header
isha382 Jul 9, 2024
ad45989
added custom blocks context in the system prompt for openAI
Jul 9, 2024
1e9b22d
fixed openAI explanation
Jul 9, 2024
bb6ea16
added custom style colours to markdown message
isha382 Jul 9, 2024
62089eb
added necessary note
Jul 9, 2024
c067bbf
addded structure for the generative response
Jul 10, 2024
afd1e30
added prompt for suggesting blocks to user
Jul 10, 2024
4d2d27d
refactored code
Jul 10, 2024
d9268d9
spacing modification and scroll height null solved
isha382 Jul 10, 2024
1318718
moved xml genration to the end of response
Jul 10, 2024
eb1bef7
fix prompt for forever block
Jul 10, 2024
3150470
Added show/hide xml in response
isha382 Jul 10, 2024
4ca7907
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
Jul 11, 2024
96f64c8
Merge branch 'web-server-v2' of https://github.com/3dwesupport/OpenBo…
Jul 11, 2024
33096de
Added editing a related existing block
isha382 Jul 15, 2024
632dd70
changed name of variableDetection
isha382 Jul 16, 2024
730aaf2
modified prompt
isha382 Jul 16, 2024
163daa2
Added changed ai assistant button and closing functionality chat ass…
isha382 Jul 17, 2024
ee37d17
modified prompt for documentation link
isha382 Jul 18, 2024
1e81b47
Fixed loader scrolling issue
isha382 Jul 18, 2024
8c4b4b0
Refactored code
isha382 Jul 18, 2024
51edf0c
drawer toggling on click chatIcon
isha382 Jul 19, 2024
9775d20
Changed the gpt model
isha382 Aug 7, 2024
b9502e0
Merge pull request #20 from 3dwesupport/react-blockly-chat-assistant
isha382 Aug 7, 2024
e5023df
integrate dynamic server domain
isha382 Aug 7, 2024
16ebefd
Merge pull request #23 from 3dwesupport/react-blockly-chat-assistant
isha382 Aug 7, 2024
107b160
added cors origin options
isha382 Aug 7, 2024
0735bf2
Merge pull request #24 from 3dwesupport/react-blockly-chat-assistant
isha382 Aug 7, 2024
dcc42bc
integrated docker file
isha382 Aug 8, 2024
22e4e88
Merge pull request #25 from 3dwesupport/react-blockly-chat-assistant
isha382 Aug 8, 2024
f5bc149
added optimized prompt
isha382 Aug 22, 2024
ec1821e
Merge pull request #26 from 3dwesupport/react-blockly-chat-assistant
isha382 Aug 22, 2024
046292b
integrated open ai api on frontend
isha382 Aug 29, 2024
e4f906d
Merge pull request #27 from 3dwesupport/react-blockly-chat-assistant
isha382 Aug 29, 2024
923db77
made prompts more generic
isha382 Sep 3, 2024
b05d2ce
Merge pull request #29 from 3dwesupport/react-blockly-chat-assistant
isha382 Sep 3, 2024
c22c208
integrated streaming in chat completion api
isha382 Sep 13, 2024
b1ea358
integration of structured output in chat completion
isha382 Sep 18, 2024
77eb479
removed logs
isha382 Sep 23, 2024
3d51d64
Merge pull request #30 from 3dwesupport/react-blockly-minorfix-chat
isha382 Sep 23, 2024
3ca5965
Merge branch 'react-blockly' of https://github.com/3dwesupport/OpenBo…
isha382 Sep 23, 2024
a56868a
handled formatting of final response
isha382 Sep 24, 2024
63d9135
fixed parsed message and loader ui
isha382 Sep 25, 2024
8d79279
formating of response on clicking pause icon
isha382 Sep 26, 2024
d0e6d28
modified function for handling response formatting
isha382 Sep 30, 2024
46766bb
modified keywords
isha382 Oct 1, 2024
f086ab0
changed keyword and added description
isha382 Oct 3, 2024
75497f1
modified handler function to hide xml
isha382 Oct 4, 2024
a57ce1f
dynamic formatting while streaming
isha382 Oct 14, 2024
3eb6110
modified formatting of response
isha382 Oct 15, 2024
f955479
removed response formatting on clicking pause
isha382 Oct 15, 2024
1ffe1ed
fixed codeBuffer loader
isha382 Oct 15, 2024
ccf782b
Added different persona chaaracters
isha382 Oct 22, 2024
8832cfe
Added key to each persona
isha382 Oct 22, 2024
c9d8475
modified persona characteristic
isha382 Oct 23, 2024
b215b42
persona frontend and backend implemetation
isha382 Oct 25, 2024
7598cd4
added functionality to show selection effect of persona
isha382 Oct 25, 2024
e16e7bb
implementation of persona selection message
isha382 Oct 25, 2024
711db7e
implemented typing effect for persona message
isha382 Oct 28, 2024
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
Binary file modified docs/images/firebase_google_signin.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/firebase_product_services.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,3 @@ class AutopilotFragment: CameraController {
protocol autopilotDelegate: AnyObject {
func didPerformAction()
}

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DataCollectionController: CameraController {
let newBackButton = UIBarButtonItem(image: backNavigationIcon, title: Strings.dataCollection, target: self, action: #selector(DataCollectionController.back(sender:)), titleColor: Colors.navigationColor ?? .white)
navigationItem.leftBarButtonItem = newBackButton
}

if let value = preferencesManager.getSensorData(sensor: "isVehicleLogSelected"){
dataLogger.isVehicleLogSelected = value as! Bool;
}
Expand All @@ -75,7 +75,7 @@ class DataCollectionController: CameraController {
if let value = preferencesManager.getSensorData(sensor: "isAccelerationLogSelected"){
dataLogger.isAccelerationLogSelected = value as! Bool;
}

DeviceCurrentOrientation.shared.findDeviceOrientation()
NotificationCenter.default.addObserver(self, selector: #selector(switchCamera), name: .switchCamera, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(openBluetoothSettings), name: .ble, object: nil)
Expand Down Expand Up @@ -509,4 +509,3 @@ class DataCollectionController: CameraController {

}


Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,3 @@ extension UIBarButtonItem {
}



Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class ObjectTrackingFragment: CameraController {
gameController.sendControlFromPhoneController(control: Control(left: Float(Double(leftSpeed ?? "0.0") ?? 0.0), right: Float(Double(rightSpeed ?? "0.0") ?? 0.0)))
}
}

/// update screen command data coming from application
@objc func updateLightsCommandFromControllerApp(_ notification: Notification) {
if gameController.selectedControlMode == ControlMode.GAMEPAD {
Expand Down Expand Up @@ -438,4 +438,4 @@ class ObjectTrackingFragment: CameraController {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -821,4 +821,3 @@ extension UserDefaults {




Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,4 @@ class scannerFragment: CameraController,autopilotDelegate {
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ class openCodeWebView: UIViewController, WKUIDelegate, WKNavigationDelegate {
present(alertController, animated: true, completion: nil)
}

}
}
2 changes: 1 addition & 1 deletion ios/OpenBot/OpenBot/Controllers/runRobot/RunRobot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1054,4 +1054,4 @@ class runRobot: CameraController, ARSCNViewDelegate, UITextFieldDelegate {
isMultipleAi = false
isDetection = false
}
}
}
50 changes: 25 additions & 25 deletions ios/OpenBot/OpenBot/Data/SharedPreferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,104 +38,104 @@ public class SharedPreferencesManager {
public func setControlMode(value:String){
userDefaults.set(value, forKey: control_mode)
}

public func getControlMode() -> String? {
return userDefaults.string(forKey: control_mode);
}

public func setDriveMode(value:String){
userDefaults.set(value, forKey: drive_mode);
}

public func getDriveMode() -> String? {
return userDefaults.string(forKey: drive_mode);
}

public func setSpeedMode(value:Float){
userDefaults.set(value, forKey: speed_mode);
}

public func getSpeedMode() -> Float? {
return userDefaults.float(forKey: speed_mode);
}

public func updateSensorData(value:Bool,sensor:String){
userDefaults.set(value, forKey: sensor);
}

public func getSensorData(sensor:String) -> Any? {
return userDefaults.value(forKey: sensor)
}

public func setObjectTrackModel(value:String){
userDefaults.set(value, forKey: object_tracking_model);
}

public func getObjectTrackModel() -> String? {
return userDefaults.string(forKey: object_tracking_model)
}

public func setObjectTrackingObject(value:String){
userDefaults.set(value, forKey: object_type)
}

public func getObjectTrackingObject() -> String? {
return userDefaults.string(forKey: object_type);
}

public func setObjectTrackConfidence(value:Int){
userDefaults.set(value, forKey: confidence);
}

public func getObjectTrackConfidence() -> Any? {
return userDefaults.value(forKey: confidence);
}

public func setDevice(value:String){
userDefaults.set(value, forKey: device);
}

public func getDevice() -> String? {
return userDefaults.string(forKey: device);
}

public func setThreads(value:String){
userDefaults.set(value, forKey: threads);
}

public func getThreads() -> String? {
return userDefaults.string(forKey: threads);
}

public func setAutopilotModel(value:String){
userDefaults.set(value, forKey: autopilot_model);
}

public func getAutopilotModel() -> String? {
return userDefaults.string(forKey: autopilot_model);
}

public func setCameraSwitch(value:String){
userDefaults.set(value, forKey: camera_switch);
}

public func getCameraSwitch() -> String?{
userDefaults.string(forKey: camera_switch);
}

public func setDynamicSpeed(value:Bool){
userDefaults.set(value, forKey: dynamic_speed);
}

public func getDynamicSpeed() -> Any?{
userDefaults.value(forKey: dynamic_speed);
}

public func setBlocklyCode(value:String){
userDefaults.set(value, forKey: blocklyCode);
}

public func getBlocklyCode() -> String?{
userDefaults.string(forKey: blocklyCode);
}
}
}
2 changes: 1 addition & 1 deletion ios/OpenBot/OpenBot/Data/SignalingMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ struct CandidateEvent: Codable {

struct OpenBotSignal : Codable {
var openbot : Int
}
}
2 changes: 1 addition & 1 deletion ios/OpenBot/OpenBot/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@
<key>kTCCServiceMediaLibrary</key>
<string>Allow Audio Player for sound mode</string>
</dict>
</plist>
</plist>
11 changes: 5 additions & 6 deletions ios/OpenBot/OpenBot/JsEvaluator/JsEvaluator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class jsEvaluator {
runOpenBotThreadClass = nil
bluetooth.sendDataFromJs(payloadData: "c" + String(0) + "," + String(0) + "\n");
}

/**
function defined for all the methods of openBot blockly
*/
Expand Down Expand Up @@ -272,11 +272,11 @@ class jsEvaluator {
let onLostFrames: @convention(block) (String, Int, String) -> Void = { (object, frames, task) in
self.runOpenBotThreadClass?.onLostFrames(object: object, frames: frames, task: task);
}

let displaySensorData: @convention(block) (String) -> Void = { (inputString) in
self.runOpenBotThreadClass?.displaySensorData(inputString: inputString);
}

let displayString: @convention(block) (String) -> Void = { (inputString) in
self.runOpenBotThreadClass?.displayString(inputString: inputString);
}
Expand Down Expand Up @@ -1079,14 +1079,14 @@ class jsEvaluator {
}
taskStorage.addAttribute(classType: object, task: task, frames: frames, type: "unDetect");
}

func displaySensorData(inputString: String){
if isCancelled {
return
}
NotificationCenter.default.post(name: .displayItems, object: inputString);
}

func displayString(inputString: String){
if isCancelled {
return
Expand All @@ -1095,4 +1095,3 @@ class jsEvaluator {
}
}
}

3 changes: 1 addition & 2 deletions ios/OpenBot/OpenBot/Utils/AudioPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,10 @@ class AudioPlayer : AVPlayer, AVSpeechSynthesizerDelegate {
speechSynthesizer.speak(utterance)
}
}

func playInputString(input:String){
if(input != ""){
playString(input: input)
}
}
}

2 changes: 1 addition & 1 deletion ios/OpenBot/OpenBot/Utils/extensions/Notifications.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ extension Notification.Name {
static let server = Notification.Name("server");
static let saveAs = Notification.Name("saveAs");
static let displayItems = Notification.Name("displayItems");
}
}
Loading
Loading