Compare commits
5 Commits
usb_releas
...
dev-server
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92feb5d353 | ||
|
|
f4387871fb | ||
|
|
0e2d1daaf6 | ||
|
|
83354e37d9 | ||
|
|
bd8df47262 |
@@ -21,7 +21,7 @@ android {
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 130
|
||||
versionName "2.1.130"
|
||||
versionName "2.1.130 -usb"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ android {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
|
||||
@@ -42,6 +42,9 @@ class UsbTerminalFragment : Fragment() {
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
||||
): View {
|
||||
binding = FragmentUsbTerminalBinding.inflate(inflater, container, false)
|
||||
binding.clearQueueButton.setOnClickListener {
|
||||
clearQueue()
|
||||
}
|
||||
sharedPreferences = requireContext().getSharedPreferences("HEMOCUBE", Context.MODE_PRIVATE)
|
||||
return binding.root
|
||||
}
|
||||
@@ -75,9 +78,7 @@ class UsbTerminalFragment : Fragment() {
|
||||
binding.etCommands.text.clear()
|
||||
}
|
||||
}
|
||||
binding.button.setOnClickListener{
|
||||
|
||||
}
|
||||
|
||||
listenToHemoCube()
|
||||
callCommand("I")
|
||||
@@ -94,9 +95,7 @@ class UsbTerminalFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun addToQueue(commands: List<String>) {
|
||||
commandQueue.clear()
|
||||
currentCommand = null
|
||||
|
||||
// Append new commands to the queue instead of replacing it
|
||||
commandQueue.addAll(commands)
|
||||
|
||||
// Track commands in the activity
|
||||
@@ -106,8 +105,14 @@ class UsbTerminalFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
appendFormattedMessage("\nNew priority commands: ${commands.joinToString(" ")}")
|
||||
processNextCommand()
|
||||
appendFormattedMessage("\nAdded commands to queue: ${commands.joinToString(" ")}")
|
||||
processNextCommand() // Start processing if not already in progress
|
||||
}
|
||||
|
||||
fun clearQueue() {
|
||||
commandQueue.clear()
|
||||
currentCommand = null
|
||||
appendFormattedMessage("\nCommand queue cleared")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
android:padding="16dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:id="@+id/clearQueueButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Clar All Commands" />
|
||||
|
||||
Reference in New Issue
Block a user