mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-19 18:07:58 +00:00
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import stripAnsi from 'strip-ansi'
|
||||
import { SerialPortStream } from '@serialport/stream'
|
||||
import { LogService, NotificationsService, Profile } from 'tabby-core'
|
||||
import { LogService, NotificationsService } from 'tabby-core'
|
||||
import { Subject, Observable } from 'rxjs'
|
||||
import { Injector, NgZone } from '@angular/core'
|
||||
import { BaseSession, LoginScriptsOptions, SessionMiddleware, StreamProcessingOptions, TerminalStreamProcessor } from 'tabby-terminal'
|
||||
import { BaseSession, BaseTerminalProfile, LoginScriptsOptions, SessionMiddleware, StreamProcessingOptions, TerminalStreamProcessor } from 'tabby-terminal'
|
||||
import { SerialService } from './services/serial.service'
|
||||
|
||||
export interface SerialProfile extends Profile {
|
||||
export interface SerialProfile extends BaseTerminalProfile {
|
||||
options: SerialProfileOptions
|
||||
}
|
||||
|
||||
|
@@ -14,8 +14,7 @@ import { SerialSession, BAUD_RATES, SerialProfile } from '../api'
|
||||
styles: [require('./serialTab.component.scss'), ...BaseTerminalTabComponent.styles],
|
||||
animations: BaseTerminalTabComponent.animations,
|
||||
})
|
||||
export class SerialTabComponent extends BaseTerminalTabComponent {
|
||||
profile?: SerialProfile
|
||||
export class SerialTabComponent extends BaseTerminalTabComponent<SerialProfile> {
|
||||
session: SerialSession|null = null
|
||||
serialPort: any
|
||||
Platform = Platform
|
||||
@@ -56,16 +55,11 @@ export class SerialTabComponent extends BaseTerminalTabComponent {
|
||||
super.ngOnInit()
|
||||
|
||||
setImmediate(() => {
|
||||
this.setTitle(this.profile!.name)
|
||||
this.setTitle(this.profile.name)
|
||||
})
|
||||
}
|
||||
|
||||
async initializeSession () {
|
||||
if (!this.profile) {
|
||||
this.logger.error('No serial profile info supplied')
|
||||
return
|
||||
}
|
||||
|
||||
const session = new SerialSession(this.injector, this.profile)
|
||||
this.setSession(session)
|
||||
|
||||
@@ -121,6 +115,6 @@ export class SerialTabComponent extends BaseTerminalTabComponent {
|
||||
})),
|
||||
)
|
||||
this.serialPort.update({ baudRate: rate })
|
||||
this.profile!.options.baudrate = rate
|
||||
this.profile.options.baudrate = rate
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user