实现基本信息的变更
This commit is contained in:
@@ -2,15 +2,11 @@ import { app, BrowserWindow } from 'electron'
|
||||
import {join} from "path";
|
||||
import './load-serialport'
|
||||
|
||||
|
||||
|
||||
function createWindow(page: String) {
|
||||
|
||||
const win = new BrowserWindow({
|
||||
fullscreen: true,
|
||||
frame: false,
|
||||
webPreferences: {
|
||||
// webSecurity: false,
|
||||
nodeIntegration: true,
|
||||
preload: join(__dirname, 'preload.js')
|
||||
}
|
||||
@@ -23,29 +19,13 @@ function createWindow(page: String) {
|
||||
win.loadFile(`dist/render/${page}.html`)
|
||||
win.webContents.openDevTools()
|
||||
}
|
||||
|
||||
// if (process.env.NODE_ENV === 'development') {
|
||||
// win.loadURL(`http://localhost:3000/?page=${page}`)
|
||||
// win.webContents.openDevTools()
|
||||
// } else {
|
||||
// win.loadFile(`dist/render/index.html?page=${page}`)
|
||||
// // win.loadURL(`file://${__dirname}/dist/render/index.html?page=${page}`);
|
||||
// win.webContents.openDevTools()
|
||||
// }
|
||||
}
|
||||
|
||||
function launch() {
|
||||
|
||||
createWindow('satellite-data-monitor-platform')
|
||||
createWindow('satellite-info-monitor-platform')
|
||||
createWindow('satellite-signal-monitor-platform')
|
||||
createWindow('satellite-state-monitor-platform')
|
||||
|
||||
|
||||
// createWindow('DataMonitorPage')
|
||||
// createWindow('InfoMonitorPage')
|
||||
// createWindow('SignalMonitorPage')
|
||||
// createWindow('StateMonitorPage')
|
||||
// createWindow('satellite-info-monitor-platform')
|
||||
// createWindow('satellite-signal-monitor-platform')
|
||||
// createWindow('satellite-state-monitor-platform')
|
||||
}
|
||||
|
||||
app.whenReady().then(launch)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
const { ipcMain } = require('electron')
|
||||
const SerialPort = require('serialport')
|
||||
// const Readline = require('@serialport/parser-readline')
|
||||
const InterByteTimeout = require('@serialport/parser-inter-byte-timeout')
|
||||
const config = require('./config')
|
||||
|
||||
@@ -42,7 +41,6 @@ SerialPort.list().then((ports, err) => {
|
||||
const { path, baudRate } = getSerialPortConstructorArguments(ports)
|
||||
const serialPort = new SerialPort(path, { baudRate })
|
||||
|
||||
// const parser = serialPort.pipe(new Readline({ delimiter: '\r\n' }))
|
||||
const parser = serialPort.pipe(new InterByteTimeout({interval: 30}))
|
||||
|
||||
NMEAHandler.on('handled' , (nmeaObj) => {
|
||||
|
||||
Reference in New Issue
Block a user