diff --git a/eda-frontend/src/components/Project/CreateProject.js b/eda-frontend/src/components/Project/CreateProject.js
index c12c992a8..f7d8382fa 100644
--- a/eda-frontend/src/components/Project/CreateProject.js
+++ b/eda-frontend/src/components/Project/CreateProject.js
@@ -1,5 +1,5 @@
/* eslint-disable camelcase */
-import React, { useState, useEffect } from 'react'
+import React, { useState, useEffect, useRef } from 'react'
import {
Button,
Toolbar,
@@ -21,9 +21,10 @@ import {
DialogActions,
DialogContent,
DialogContentText,
- DialogTitle
+ DialogTitle,
}
from '@material-ui/core'
+import { Multiselect } from 'multiselect-react-dropdown'
import CloseIcon from '@material-ui/icons/Close'
import PostAddIcon from '@material-ui/icons/PostAdd'
import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp'
@@ -34,6 +35,7 @@ import { useDispatch, useSelector } from 'react-redux'
import { changeStatus, createProject, deleteProject, getStatus } from '../../redux/actions'
import api from '../../utils/Api'
import ProjectTimeline from './ProjectTimeline'
+import ProjectSimulationParameters from './ProjectSimulationParameters'
const useStyles = makeStyles((theme) => ({
appBar: {
@@ -49,7 +51,7 @@ const useStyles = makeStyles((theme) => ({
},
paper: {
padding: theme.spacing(2),
- textAlign: 'center',
+ textAlign: 'left',
color: '#fff'
},
formControl: {
@@ -62,11 +64,11 @@ const useStyles = makeStyles((theme) => ({
}
}))
-const Transition = React.forwardRef(function Transition (props, ref) {
+const Transition = React.forwardRef(function Transition(props, ref) {
return
})
-function CreateProject () {
+function CreateProject() {
const [open, setOpen] = useState(false)
const classes = useStyles()
const dispatch = useDispatch()
@@ -90,9 +92,38 @@ function CreateProject () {
const [fields, setFields] = useState([{ name: 'Procedure', text: '' }, { name: 'Observation', text: '' }, { name: 'Conclusion', text: '' }])
const [changed, setChanged] = useState(0)
const [deleteDialogue, setDeleteDialogue] = useState(false)
+ const [dcSweepcontrolLine, setDcSweepControlLine] = useState({
+ parameter: '',
+ sweepType: 'Linear',
+ start: '',
+ stop: '',
+ step: '',
+ parameter2: '',
+ start2: '',
+ stop2: '',
+ step2: ''
+ })
+ const [transientAnalysisControlLine, setTransientAnalysisControlLine] = useState({
+ start: '',
+ stop: '',
+ step: '',
+ skipInitial: false
+ })
+ const [acAnalysisControlLine, setAcAnalysisControlLine] = useState({
+ input: 'dec',
+ start: '',
+ stop: '',
+ pointsBydecade: ''
+ })
+
+ const [tfAnalysisControlLine, setTfAnalysisControlLine] = useState({
+ outputNodes: false,
+ outputVoltageSource: '',
+ inputVoltageSource: ''
+ })
+ const [selectedSimulation, setSelectedSimulation] = useState('')
useEffect(() => {
- console.log(project.details?.project_id)
if (open && project.details?.project_id) {
dispatch(getStatus(project.details?.project_id))
setStatus(project.details?.status_name)
@@ -100,6 +131,18 @@ function CreateProject () {
if (project.details) {
setDetails({ title: project.details.title, description: project.details.description, active_version: project.details.active_version, active_branch: project.details.active_branch })
setFields(project.details.fields)
+ if (project.details.dc_sweep) {
+ setDcSweepControlLine(project.details.dc_sweep)
+ }
+ if (project.details.transient_analysis) {
+ setTransientAnalysisControlLine(project.details.transient_analysis)
+ }
+ if (project.details.tf_analysis) {
+ setTfAnalysisControlLine(project.details.tf_analysis)
+ }
+ if (project.details.ac_analysis) {
+ setAcAnalysisControlLine(project.details.ac_analysis)
+ }
}
if (!project.details) {
setDetails({
@@ -224,21 +267,20 @@ function CreateProject () {
setOpen(!open)
}
const createPub = () => {
- dispatch(createProject(save_id, [details, fields]))
+ dispatch(createProject(save_id, [details, fields, '', dcSweepcontrolLine, transientAnalysisControlLine, acAnalysisControlLine, tfAnalysisControlLine]))
}
const clickChange = () => {
- console.log(changed)
if (changed === 1) {
- dispatch(createProject(save_id, [details, fields, '']))
+ dispatch(createProject(save_id, [details, fields, '', dcSweepcontrolLine, transientAnalysisControlLine, acAnalysisControlLine, tfAnalysisControlLine]))
} else if (changed === 2) {
if (status !== project.details.status_name) {
dispatch(changeStatus(project.details.project_id, status, ''))
}
} else if (changed === 3) {
if (status !== project.details.status_name) {
- dispatch(createProject(save_id, [details, fields, status]))
+ dispatch(createProject(save_id, [details, fields, status, dcSweepcontrolLine, transientAnalysisControlLine, acAnalysisControlLine, tfAnalysisControlLine]))
} else {
- dispatch(createProject(save_id, [details, fields, '']))
+ dispatch(createProject(save_id, [details, fields, '', dcSweepcontrolLine, transientAnalysisControlLine, acAnalysisControlLine, tfAnalysisControlLine]))
}
}
setChanged(0)
@@ -291,6 +333,9 @@ function CreateProject () {
setDeleteDialogue(!deleteDialogue)
setOpen(false)
}
+ useEffect(() => {
+ console.log(selectedSimulation)
+ }, [selectedSimulation])
return (
{(window.location.href.split('?id=')[1] && auth.user?.username === owner) &&
@@ -340,26 +385,28 @@ function CreateProject () {
alignItems="flex-start"
>
+
{project.details &&
Status of the project: {project.details.status_name}
Active Version: {activeName} of variation {project.details.active_branch} saved on {activeSaveDate} at {activeSaveTime} hours
{project.details.history && project.details.history.slice(0).reverse()[0]?.reviewer_notes && Reviewer Notes: {project.details.history.slice(0).reverse()[0]?.reviewer_notes}
}
}
+ Project Details
{versions != null &&
- ((project.details && project.details.can_edit) || !project.details) &&
- Select the version you want to use for your project.
-
- }
+ ((project.details && project.details.can_edit) || !project.details) &&
+ Select the version you want to use for your project.
+
+ }
{fields && fields.map((item, index) =>
- (
- <>
-
- {((project.details && project.details.can_edit) || !project.details) &&
+ (
+ <>
+
+ {((project.details && project.details.can_edit) || !project.details) &&
<>
onRemove(index)}>
@@ -409,37 +456,65 @@ function CreateProject () {
}
>}
-
-
- >
- ))}
+
+
+ >
+ ))}
{((project.states && project.details) || !project.details) && }
+ Simulation Parameters
+
+
+ Select simulation mode parameters to enter:
+
+
+
+
{project.details && <>{
project.states &&
@@ -453,9 +528,9 @@ function CreateProject () {
value={status}
>
{project.states.map((item, index) =>
- (
-
- ))}
+ (
+
+ ))}
@@ -488,19 +563,19 @@ function CreateProject () {
-
-
-
- History of this Project
- {(project.details?.history && project.details?.history[0])
- ? <>
-
- >
- : No history of this project.
- }
-
-
- >}
+
+
+
+ History of this Project
+ {(project.details?.history && project.details?.history[0])
+ ? <>
+
+ >
+ : No history of this project.
+ }
+
+
+ >}
{!project.details &&