Skip to content

Commit

Permalink
Merge pull request #16 from lnls-sirius/dev
Browse files Browse the repository at this point in the history
Change monitor window labels
  • Loading branch information
RafaelLyra8 authored May 8, 2023
2 parents 0cc0853 + 6595964 commit c1fbafc
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- 80:80
frontend:
container_name: 'rad-det'
image: 'ghcr.io/lnls-sirius/rad-det-frontend:1.1.3'
image: 'ghcr.io/lnls-sirius/rad-det-frontend:1.1.4'
build:
context: ./front_end
ports:
Expand Down
3 changes: 1 addition & 2 deletions front_end/src/components/ArchRadChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ class ArchRadChart extends Component<RadArchChartInterface>{
limits={this.getLimits()}
optimization={
(this.props.pv_mon[0] == "dose_rate") ? 1000 : -1}
interval={
(this.props.pv_mon[0] == "dose_rate") ? 4 : 1}/>
interval={1}/>
);
}
}
Expand Down
44 changes: 39 additions & 5 deletions front_end/src/components/BarChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,46 @@ class BarChart extends Component<BarChartInterface, BarChartState>{
return options;
}

location_text(det_data: DictStr, name: string): string {
const location_code: string = det_data["default_location"];
const axis: string = location_code.slice(2, 4);
let det_label: string = "SI-";

if(location_code.includes('cs')){
if(name == "Thermo 10"){
det_label += 'Chicane 18'
}else if(name == 'Berthold'){
det_label += "COR_SRV" + axis;
}else{
det_label += "RACK" + axis;
}
}
if(location_code.includes('ha')){
det_label += "HALL" + axis;
}
if(location_code.includes('bo')){
det_label += "BOOSTER" + axis;
}
if(location_code.includes('ro')){
det_label += "ROOF" + axis;
}
det_label += '-'
det_label += det_data["probe"].toUpperCase()
det_label += name[0].toUpperCase()
return det_label
}

generate_labels(pv_list: string[]): string[] {
let labels: string[] = [];
pv_list.map((pvname: string, idx: number) => {
labels[idx] = simplifyLabel(pvname)
const simple_name: string = simplifyLabel(pvname);
const det_data: DictStr = this.props.pvs_data[simple_name];
if (det_data !== undefined){
labels[idx] = this.location_text(
det_data, simple_name);
}else{
labels[idx] = simple_name;
}
})
return labels
}
Expand All @@ -138,11 +174,9 @@ class BarChart extends Component<BarChartInterface, BarChartState>{
modifyOptions={this.handleOptions}
label={this.state.labels}/>
<S.LegendWrapper>
{
this.state.color_axis.map((color: string) => {
{this.state.color_axis.map((color: string) => {
return <Square value={color}/>
})
}
})}
</S.LegendWrapper>
</S.ChartWrapper>
)
Expand Down
2 changes: 1 addition & 1 deletion front_end/src/components/ModelPg/InfoBase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const InfoBase: React.FC<BaseInfoInterface> = (props) => {
const array_location: string[] = spl_arr_coma[0].split("-");
let sector_det: string = array_location[1]
if(array_location.length == 1){
sector_det = "01"
sector_det = "01";
}
setSector(sector_det);

Expand Down
4 changes: 2 additions & 2 deletions front_end/src/components/Navigation/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Nav = styled(Link)`

const Icon = styled(FontAwesomeIcon)`
width: 2.5em;
height: 2.5em;
height: 1.5em;
padding: 0.2em;
color: ${colors.properties.border};
border-radius: ${properties.border_radius.light};
Expand All @@ -17,7 +17,7 @@ const Icon = styled(FontAwesomeIcon)`

const ControlWrapper = styled.nav`
position: absolute;
top: 0.75em;
top: 0.25em;
right: 3em;
`

Expand Down
2 changes: 1 addition & 1 deletion front_end/src/pages/monitor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as S from './styled';
/**
*
* The monitor page shows a bar chart of the current integrated dose and a line chart of the
* dose rate of the last 4 hours of all the radiation detectors.
* dose rate of the last hour of all the radiation detectors.
*
* @param props
* - pvs_data: Contains the radiation detectors configuration data
Expand Down

0 comments on commit c1fbafc

Please sign in to comment.